Grabber::getVideoDataDimension Method |
||||||||||||||
Returns the actual dimension of the image data which is passed to the display. This may be different from the video format of the currently active video capture device, if you have used setDeviceFrameFilters or setDisplayFrameFilters to insert frame filters in the image stream behind the device or in front of the display. If IFrameFilter objects are used by the FrameHandlerSink, the dimension of the MemBufferCollection may be different from the video data dimension as well. | ||||||||||||||
Syntax: | bool getVideoDataDimension( SIZE& dim ) const; |
|||||||||||||
|
||||||||||||||
Return value: | true, if the operation was successful. If an error occurred, call getLastError to obtain extended error information. |
|||||||||||||
Remarks: | You can only retrieve this information, when the image stream has been setup by a call to either prepareLive or startLive. |
|||||||||||||
Information: | Introduced in version 3.0 | |||||||||||||
Sample: | The following example uses the ROI filter from stdfilters.ftf to resize the video format of the live display. Grabber grabber; grabber.showDevicePage(); // Create an instance of the ROI filter, and let the user change the ROI smart_com<IFrameFilter> pROIFilter = FilterLoader::createFilter( "ROI" ); pROIFilter->callDialog( 0 ); // Set the filter, and call prepareLive. grabber.setDisplayFrameFilters( pROIFilter.get() ); grabber.prepareLive( true ); // After prepareLive has been called, getVideoDataDimension returns the size of the // live display. SIZE dim; if( grabber.getVideoDataDimension( dim ) ) { std::cout << "Display video format: " << dim.cx << "x" << dim.cy << std::endl; } else { std::cerr << "Unable to determine display video format" << std::endl; } After prepareLive has been called, getVideoDataDimension returns the size of the live display video format. |
|||||||||||||
See also: | Grabber, Grabber::prepareLive, Grabber::startLive |