IC Imaging Control C++

Grabber::getVideoDataDimension Method

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;
Parameter Description
dim

Size of the image data.

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

<< Grabber

Get in touch with us


About The Imaging Source

Established in 1990, The Imaging Source is one of the leading manufacturers of industrial cameras, frame grabbers and video converters for production automation, quality assurance, logistics, medicine, science and security.

Our comprehensive range of cameras with USB 3.1, USB 3.0, USB 2.0, GigE interfaces and other innovative machine vision products are renowned for their high quality and ability to meet the performance requirements of demanding applications.

Automated Imaging Association ISO 9001:2015 certified

Contact us