Grabber::setDeviceFrameFilters Method

Inserts a list of frame filters in the device path of the image stream. If an overlay is present in the device path, the filter list is inserted in front it. This means that the filter list is located between the device and the overlay.
Syntax:
bool setDeviceFrameFilters( IFrameFilter* pFilter );
bool setDeviceFrameFilters( const tFrameFilterList& filterList );

Parameter Description
pFilter

Pointer to an IFrameFilter object. If this parameter is used, a filter list is generated and the IFrameFilter object is inserted.

filterList

A tFrameFilterList containing pointers to IFrameFilter objects.

Return value:

true, if the operation was successful. If an error occurred, call getLastError to obtain extended error information.

Remarks:

The life time of filter instances has to be checked by the caller of this method. Therefore, the caller remains responsible for the filter objects that are referenced by the plain pointers in the filter list. If you want to use filters here that have been loaded from a module, you have to call the get method of the smart_com pointer that holds the filter instance in order to obtain a plain pointer. Filters that have been inserted in the device path must not be destroyed unless they have been removed by calling setDeviceFrameFilters using a Null pointer as a parameter.

Information:

Introduced in version 3.0

Sample:

The following code fragment shows how to create two frame filter instances and set them as a filter chain.

m_pROIFilter = FilterLoader::createFilter( "ROI" );
m_pRotFlipFilter = FilterLoader::createFilter( "Rotate Flip" );
// Set filter parameters.
tFrameFilterList filterList;
// Use .get to extract a plain pointer from the smart pointer.
filterList.push_back( m_pROIFilter.get() );
filterList.push_back( m_pRotFlipFilter.get() );
m_Grabber.setDeviceFrameFilters( filterList );

Please note the use of smart_com.get() to extract a plain pointer out of the smart pointers.

See also: Grabber, IFrameFilter, Grabber::getDeviceFrameFilters, Grabber::setDisplayFrameFilters

<< Grabber