FilterLoader::createFilter Method

Creates a frame filter instance.
Syntax:
static smart_com<IFrameFilter> createFilter( const FilterInfo& fi );
static smart_com<IFrameFilter> createFilter( const std::string& filter_name,
                                             const std::string& module = std::string() );
static smart_com<IFrameFilter> createFilter( const std::wstring& filter_name,
                                         const std::wstring& module = std::wstring() );

Parameter Description
fi

FilterInfo structure, describing the filter to create. FilterLoader::getAvailableFrameFilters returns a list of FilterInfo structures, which you can pass to this method.

filter_name

Name of the frame filter to create.

module

Path to the module in which the frame filter to be created is implemented.

Return value:

This method returns a smart_com to an IFrameFilter interface of the created frame filter. The pointer is 0, when the filter could not be created.

Remarks:

When a combination of filter_name and module is passed to this method, it will look in the list of available frame filters for a filter matching the specified values.

When the module parameter is omitted, the filter loader create an instance of the first frame filter implementation it finds with a matching name.

Example:

The following code creates an instance of the Rotate Flip filter in stdfilters.ftf and sets it as device frame filter:

smart_com<IFrameFilter> pRotFlipFilter = FilterLoader::createFilter( "Rotate Flip" );
grabber.setDeviceFrameFilters( pRotFlipFilter.get() );

See also: FilterLoader, FilterLoader::getAvailableFrameFilters

<< FilterLoader