📄 videoio_8h-source.html
字号:
00174 <span class="preprocessor">#ifndef _PVIDEOIO</span>00175 <span class="preprocessor"></span><span class="preprocessor">#define _PVIDEOIO</span>00176 <span class="preprocessor"></span>00177 <span class="preprocessor">#ifdef P_USE_PRAGMA</span>00178 <span class="preprocessor"></span><span class="preprocessor">#pragma interface</span>00179 <span class="preprocessor"></span><span class="preprocessor">#endif</span>00180 <span class="preprocessor"></span>00181 <span class="preprocessor">#if defined(_WIN32)</span>00182 <span class="preprocessor"></span><a class="code" href="plugin_8h.html#a6">PWLIB_STATIC_LOAD_PLUGIN</a>(PVideoInputDevice_VideoForWindows);00183 <a class="code" href="plugin_8h.html#a6">PWLIB_STATIC_LOAD_PLUGIN</a>(PVideoInputDevice_FakeVideo);00184 00185 <a class="code" href="plugin_8h.html#a6">PWLIB_STATIC_LOAD_PLUGIN</a>(PVideoOutputDevice_NULLOutput);00186 <span class="preprocessor">#endif</span>00187 <span class="preprocessor"></span>00188 <span class="keyword">class </span><a class="code" href="classPColourConverter.html">PColourConverter</a>;00189 <a name="l00220"></a><a class="code" href="classPVideoDevice.html">00220</a> <span class="keyword">class </span><a class="code" href="classPVideoDevice.html">PVideoDevice</a> : <span class="keyword">public</span> <a class="code" href="classPObject.html">PObject</a>00221 {00222 <a class="code" href="object_8h.html#a27">PCLASSINFO</a>(<a class="code" href="classPVideoDevice.html">PVideoDevice</a>, <a class="code" href="classPObject.html">PObject</a>);00223 00224 <span class="keyword">protected</span>:00227 <a class="code" href="classPVideoDevice.html#b0">PVideoDevice</a>();00228 00229 00230 <span class="keyword">public</span>:00233 <span class="keyword">virtual</span> <a class="code" href="classPVideoDevice.html#a0">~PVideoDevice</a>();00234 <a name="l00235"></a><a class="code" href="classPVideoDevice.html#s15">00235</a> <span class="keyword">enum</span> <a class="code" href="classPVideoDevice.html#s15">VideoFormat</a> {00236 <a class="code" href="classPVideoDevice.html#s15s0">PAL</a>,00237 <a class="code" href="classPVideoDevice.html#s15s1">NTSC</a>,00238 <a class="code" href="classPVideoDevice.html#s15s2">SECAM</a>,00239 <a class="code" href="classPVideoDevice.html#s15s3">Auto</a>,00240 <a class="code" href="classPVideoDevice.html#s15s4">NumVideoFormats</a>00241 };00242 <a name="l00243"></a><a class="code" href="classPVideoDevice.html#s16">00243</a> <span class="keyword">enum</span> <a class="code" href="classPVideoDevice.html#s16">StandardSizes</a> {00244 <a class="code" href="classPVideoDevice.html#s16s5">CIF16Width</a> = 1408,00245 <a class="code" href="classPVideoDevice.html#s16s6">CIF16Height</a> = 1152,00246 <a class="code" href="classPVideoDevice.html#s16s7">CIF4Width</a> = 704,00247 <a class="code" href="classPVideoDevice.html#s16s8">CIF4Height</a> = 576,00248 <a class="code" href="classPVideoDevice.html#s16s9">CIFWidth</a> = 352,00249 <a class="code" href="classPVideoDevice.html#s16s10">CIFHeight</a> = 288,00250 <a class="code" href="classPVideoDevice.html#s16s11">QCIFWidth</a> = 176,00251 <a class="code" href="classPVideoDevice.html#s16s12">QCIFHeight</a> = 144,00252 <a class="code" href="classPVideoDevice.html#s16s13">SQCIFWidth</a> = 144,00253 <a class="code" href="classPVideoDevice.html#s16s14">SQCIFHeight</a> = 96,00254 };00255 <a name="l00256"></a><a class="code" href="structPVideoDevice_1_1OpenArgs.html">00256</a> <span class="keyword">struct </span><a class="code" href="structPVideoDevice_1_1OpenArgs.html">OpenArgs</a> {<a name="l00257"></a><a class="code" href="structPVideoDevice_1_1OpenArgs.html#a0">00257</a> <a class="code" href="structPVideoDevice_1_1OpenArgs.html#a0">OpenArgs</a>()00258 : <a class="code" href="structPVideoDevice_1_1OpenArgs.html#m0">deviceName</a>("#1"),00259 <a class="code" href="structPVideoDevice_1_1OpenArgs.html#m1">videoFormat</a>(Auto),00260 <a class="code" href="structPVideoDevice_1_1OpenArgs.html#m2">channelNumber</a>(0),00261 <a class="code" href="structPVideoDevice_1_1OpenArgs.html#m3">colourFormat</a>("YUV420P"),00262 <a class="code" href="structPVideoDevice_1_1OpenArgs.html#m4">convertFormat</a>(TRUE),00263 <a class="code" href="structPVideoDevice_1_1OpenArgs.html#m5">rate</a>(0),00264 <a class="code" href="structPVideoDevice_1_1OpenArgs.html#m6">width</a>(CIFWidth),00265 <a class="code" href="structPVideoDevice_1_1OpenArgs.html#m7">height</a>(CIFHeight),00266 <a class="code" href="structPVideoDevice_1_1OpenArgs.html#m8">convertSize</a>(TRUE),00267 <a class="code" href="structPVideoDevice_1_1OpenArgs.html#m9">scaleSize</a>(FALSE),00268 <a class="code" href="structPVideoDevice_1_1OpenArgs.html#m10">flip</a>(FALSE),00269 <a class="code" href="structPVideoDevice_1_1OpenArgs.html#m11">brightness</a>(-1),00270 <a class="code" href="structPVideoDevice_1_1OpenArgs.html#m12">whiteness</a>(-1),00271 <a class="code" href="structPVideoDevice_1_1OpenArgs.html#m13">contrast</a>(-1),00272 <a class="code" href="structPVideoDevice_1_1OpenArgs.html#m14">colour</a>(-1),00273 <a class="code" href="structPVideoDevice_1_1OpenArgs.html#m15">hue</a>(-1)00274 { }<a name="l00275"></a><a class="code" href="structPVideoDevice_1_1OpenArgs.html#m0">00275</a> <a class="code" href="classPString.html">PString</a> <a class="code" href="structPVideoDevice_1_1OpenArgs.html#m0">deviceName</a>;<a name="l00276"></a><a class="code" href="structPVideoDevice_1_1OpenArgs.html#m1">00276</a> VideoFormat <a class="code" href="structPVideoDevice_1_1OpenArgs.html#m1">videoFormat</a>;<a name="l00277"></a><a class="code" href="structPVideoDevice_1_1OpenArgs.html#m2">00277</a> <span class="keywordtype">int</span> <a class="code" href="structPVideoDevice_1_1OpenArgs.html#m2">channelNumber</a>;<a name="l00278"></a><a class="code" href="structPVideoDevice_1_1OpenArgs.html#m3">00278</a> <a class="code" href="classPString.html">PString</a> <a class="code" href="structPVideoDevice_1_1OpenArgs.html#m3">colourFormat</a>;<a name="l00279"></a><a class="code" href="structPVideoDevice_1_1OpenArgs.html#m4">00279</a> BOOL <a class="code" href="structPVideoDevice_1_1OpenArgs.html#m4">convertFormat</a>;<a name="l00280"></a><a class="code" href="structPVideoDevice_1_1OpenArgs.html#m5">00280</a> <span class="keywordtype">unsigned</span> <a class="code" href="structPVideoDevice_1_1OpenArgs.html#m5">rate</a>;<a name="l00281"></a><a class="code" href="structPVideoDevice_1_1OpenArgs.html#m6">00281</a> <span class="keywordtype">unsigned</span> <a class="code" href="structPVideoDevice_1_1OpenArgs.html#m6">width</a>;<a name="l00282"></a><a class="code" href="structPVideoDevice_1_1OpenArgs.html#m7">00282</a> <span class="keywordtype">unsigned</span> <a class="code" href="structPVideoDevice_1_1OpenArgs.html#m7">height</a>;<a name="l00283"></a><a class="code" href="structPVideoDevice_1_1OpenArgs.html#m8">00283</a> BOOL <a class="code" href="structPVideoDevice_1_1OpenArgs.html#m8">convertSize</a>;<a name="l00284"></a><a class="code" href="structPVideoDevice_1_1OpenArgs.html#m9">00284</a> BOOL <a class="code" href="structPVideoDevice_1_1OpenArgs.html#m9">scaleSize</a>;<a name="l00285"></a><a class="code" href="structPVideoDevice_1_1OpenArgs.html#m10">00285</a> BOOL <a class="code" href="structPVideoDevice_1_1OpenArgs.html#m10">flip</a>;<a name="l00286"></a><a class="code" href="structPVideoDevice_1_1OpenArgs.html#m11">00286</a> <span class="keywordtype">int</span> <a class="code" href="structPVideoDevice_1_1OpenArgs.html#m11">brightness</a>;<a name="l00287"></a><a class="code" href="structPVideoDevice_1_1OpenArgs.html#m12">00287</a> <span class="keywordtype">int</span> <a class="code" href="structPVideoDevice_1_1OpenArgs.html#m12">whiteness</a>;<a name="l00288"></a><a class="code" href="structPVideoDevice_1_1OpenArgs.html#m13">00288</a> <span class="keywordtype">int</span> <a class="code" href="structPVideoDevice_1_1OpenArgs.html#m13">contrast</a>;<a name="l00289"></a><a class="code" href="structPVideoDevice_1_1OpenArgs.html#m14">00289</a> <span class="keywordtype">int</span> <a class="code" href="structPVideoDevice_1_1OpenArgs.html#m14">colour</a>;<a name="l00290"></a><a class="code" href="structPVideoDevice_1_1OpenArgs.html#m15">00290</a> <span class="keywordtype">int</span> <a class="code" href="structPVideoDevice_1_1OpenArgs.html#m15">hue</a>;00291 };00292 00295 <span class="keyword">virtual</span> BOOL <a class="code" href="classPVideoDevice.html#a1">OpenFull</a>(00296 <span class="keyword">const</span> OpenArgs & args, 00297 BOOL startImmediate = TRUE 00298 );00299 00302 <span class="keyword">virtual</span> BOOL <a class="code" href="classPVideoDevice.html#a2">Open</a>(00303 <span class="keyword">const</span> <a class="code" href="classPString.html">PString</a> & <a class="code" href="classPVideoDevice.html#n0">deviceName</a>, 00304 BOOL startImmediate = TRUE 00305 ) = 0;00306 00309 <span class="keyword">virtual</span> BOOL <a class="code" href="classPVideoDevice.html#a3">IsOpen</a>() = 0;00310 00313 <span class="keyword">virtual</span> BOOL <a class="code" href="classPVideoDevice.html#a4">Close</a>() = 0;00314 00317 <span class="keyword">virtual</span> BOOL <a class="code" href="classPVideoDevice.html#a5">Start</a>() = 0;00318 00321 <span class="keyword">virtual</span> BOOL <a class="code" href="classPVideoDevice.html#a6">Stop</a>() = 0;00322 00323 <a name="l00326"></a><a class="code" href="classPVideoDevice.html#a7">00326</a> <span class="keyword">const</span> <a class="code" href="classPString.html">PString</a> & <a class="code" href="classPVideoDevice.html#a7">GetDeviceName</a>()<span class="keyword"> const</span>00327 <span class="keyword"> </span>{ <span class="keywordflow">return</span> <a class="code" href="classPVideoDevice.html#n0">deviceName</a>; }00328 00331 <span class="keyword">virtual</span> <a class="code" href="classPStringList.html">PStringList</a> <a class="code" href="classPVideoDevice.html#a8">GetDeviceNames</a>() <span class="keyword">const</span> = 0;00332 00333 <span class="preprocessor">#if PTRACING</span>00334 <span class="preprocessor"></span> <span class="keyword">friend</span> ostream & <a class="code" href="classPObject.html#z201_2">operator<<</a>(ostream &, <a class="code" href="classPVideoDevice.html#s15">VideoFormat</a>);00335 <span class="preprocessor">#endif</span>00336 <span class="preprocessor"></span>00342 <span class="keyword">virtual</span> BOOL <a class="code" href="classPVideoDevice.html#a9">SetVideoFormat</a>(00343 <a class="code" href="classPVideoDevice.html#s15">VideoFormat</a> <a class="code" href="classPVideoDevice.html#n2">videoFormat</a> 00344 );00345 00350 <span class="keyword">virtual</span> <a class="code" href="classPVideoDevice.html#s15">VideoFormat</a> <a class="code" href="classPVideoDevice.html#a10">GetVideoFormat</a>() <span class="keyword">const</span>;00351 00356 <span class="keyword">virtual</span> <span class="keywordtype">int</span> <a class="code" href="classPVideoDevice.html#a11">GetNumChannels</a>();00357 00365 <span class="keyword">virtual</span> BOOL <a class="code" href="classPVideoDevice.html#a12">SetChannel</a>(00366 <span class="keywordtype">int</span> <a class="code" href="classPVideoDevice.html#n3">channelNumber</a> 00367 );00368 00373 <span class="keyword">virtual</span> <span class="keywordtype">int</span> <a class="code" href="classPVideoDevice.html#a13">GetChannel</a>() <span class="keyword">const</span>;00374 00381 <span class="keyword">virtual</span> BOOL <a class="code" href="classPVideoDevice.html#a14">SetColourFormatConverter</a>(00382 <span class="keyword">const</span> <a class="code" href="classPString.html">PString</a> & <a class="code" href="classPVideoDevice.html#n4">colourFormat</a> <span class="comment">// New colour format for device.</span>00383 );00384 00395 <span class="keyword">virtual</span> BOOL <a class="code" href="classPVideoDevice.html#a15">SetColourFormat</a>(00396 <span class="keyword">const</span> <a class="code" href="classPString.html">PString</a> & <a class="code" href="classPVideoDevice.html#n4">colourFormat</a> <span class="comment">// New colour format for device.</span>00397 );00398 00403 <span class="keyword">const</span> <a class="code" href="classPString.html">PString</a> & <a class="code" href="classPVideoDevice.html#a16">GetColourFormat</a>() <span class="keyword">const</span>;00404 00410 <span class="keyword">virtual</span> BOOL <a class="code" href="classPVideoDevice.html#a17">SetFrameRate</a>(00411 <span class="keywordtype">unsigned</span> rate 00412 );00413 00418 <span class="keyword">virtual</span> <span class="keywordtype">unsigned</span> <a class="code" href="classPVideoDevice.html#a18">GetFrameRate</a>() <span class="keyword">const</span>;00419 00425 <span class="keyword">virtual</span> BOOL <a class="code" href="classPVideoDevice.html#a19">GetFrameSizeLimits</a>(00426 <span class="keywordtype">unsigned</span> & minWidth, 00427 <span class="keywordtype">unsigned</span> & minHeight, 00428 <span class="keywordtype">unsigned</span> & maxWidth, 00429 <span class="keywordtype">unsigned</span> & maxHeight 00430 ) ;00431 00432 00438 <span class="keyword">virtual</span> BOOL <a class="code" href="classPVideoDevice.html#a20">SetFrameSizeConverter</a>(00439 <span class="keywordtype">unsigned</span> width, 00440 <span class="keywordtype">unsigned</span> height, 00441 BOOL bScaleNotCrop 00442 );00443 00452 <span class="keyword">virtual</span> BOOL <a class="code" href="classPVideoDevice.html#a21">SetFrameSize</a>(00453 <span class="keywordtype">unsigned</span> width, 00454 <span class="keywordtype">unsigned</span> height 00455 );00456 00462 <span class="keyword">virtual</span> BOOL <a class="code" href="classPVideoDevice.html#a22">GetFrameSize</a>(00463 <span class="keywordtype">unsigned</span> & width,00464 <span class="keywordtype">unsigned</span> & height00465 );00466 00471 <span class="keyword">virtual</span> <span class="keywordtype">unsigned</span> <a class="code" href="classPVideoDevice.html#a23">GetFrameWidth</a>() <span class="keyword">const</span>;00472 00477 <span class="keyword">virtual</span> <span class="keywordtype">unsigned</span> <a class="code" href="classPVideoDevice.html#a24">GetFrameHeight</a>() <span class="keyword">const</span>;00478 00484 <span class="keyword">virtual</span> PINDEX <a class="code" href="classPVideoDevice.html#a25">GetMaxFrameBytes</a>() = 0;00485 00488 <span class="keyword">static</span> <span class="keywordtype">unsigned</span> <a class="code" href="classPVideoDevice.html#d0">CalculateFrameBytes</a>( 00489 <span class="keywordtype">unsigned</span> width,00490 <span class="keywordtype">unsigned</span> height,00491 <span class="keyword">const</span> <a class="code" href="classPString.html">PString</a> & <a class="code" href="classPVideoDevice.html#n4">colourFormat</a>00492 );00493 00494 <a name="l00497"></a><a class="code" href="classPVideoDevice.html#a26">00497</a> <span class="keywordtype">int</span> <a class="code" href="classPVideoDevice.html#a26">GetLastError</a>()<span class="keyword"> const </span>{ <span class="keywordflow">return</span> <a class="code" href="classPVideoDevice.html#n1">lastError</a>; }
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -