IFrameFilter::setParameter Method

Sets a frame filter parameter.
Syntax:
tFilterError setParameter( const std::string& name, const _variant_t& value );
tFilterError setParameter( const std::string& name, const std::string& value );
tFilterError setParameter( const std::string& name, int value );
tFilterError setParameter( const std::string& name, long value );
tFilterError setParameter( const std::string& name, float value );
tFilterError setParameter( const std::string& name, bool value );
tFilterError setParameter( const std::wstring& name, const _variant_t& value );
tFilterError setParameter( const std::wstring& name, const std::wstring& value );
tFilterError setParameter( const std::wstring& name, int value );
tFilterError setParameter( const std::wstring& name, long value );
tFilterError setParameter( const std::wstring& name, float value );
tFilterError setParameter( const std::wstring& name, bool value );

Parameter Description
name

The name of the parameter to be set.

value

The new value of the parameter.

Return Value:

A member of the tFilterError enumeration:

Value Description
eNO_ERROR The parameter was set successfully.
ePARAM_NOT_FOUND The filter does not have a parameter with the specified name. To obtain a list with the valid parameters, use getAvailableParameters.
eINCOMPATIBLE_PARAM_VALUE The type of the value does not match the data type of the parameter. To obtain a list with the valid parameters and its types, use getAvailableParameters.
eINVALID_PARAM_VALUE The value was not accepted, e.g. because it is out of range.
eINVALID_FILTER_STATE The filter could not accept the parameter, because it is in a state that prevents the parameter from being changed, e.g. in live mode.

Remarks:

All calls to setParameter have to be inside a beginParamTransfer /endParamTransfer block. Especially when setting multiple parameters, like X/Y-coordinates, this is important to ensure parameter consistency.

Example:

The following example shows how to set the parameters of a frame filter. Assume a frame filter was loaded and set with the following code:

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

The parameters are set using beginParamTransfer, setParameter and endParamTransfer:

pRotFlipFilter->beginParamTransfer();
if( eNO_ERROR != pRotFlipFilter->setParameter( "Rotation Angle", 90 ) )
{
    std::cerr << "Error setting parameter 'Rotation Angle'" << std::endl;
}
if( eNO_ERROR != pRotFlipFilter->setParameter( "Flip H", false ) )
{
    std::cerr << "Error setting parameter 'Flip H'" << std::endl;
}
if( eNO_ERROR != pRotFlipFilter->setParameter( "Flip V", true ) )
{
    std::cerr << "Error setting parameter 'Flip V'" << std::endl;
}
pRotFlipFilter->endParamTransfer();

See also: IFrameFilter, IFrameFilter::getParameter, IFrameFilter::getAvailableParameters, IFrameFilter::beginParamTransfer, IFrameFilter::endParamTransfer

<< IFrameFilter