IFrameFilter::getParameter Method

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

Parameter Description
name

The name of the parameter to be read.

value

This parameter receives the current value of the parameter.

Return Value:

A member of the tFilterError enumeration.

Value Description
eNO_ERROR The parameter was read 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_FILTER_STATE The filter could return a value for the parameter, because it is in a state that prevents the parameter from being read, e.g. not in live mode.

Remarks:

All calls to getParameter have to be inside a beginParamTransfer /endParamTransfer block. Especially when reading multiple parameters, such as X/Y-coordinates, this is important to ensure parameter consistency.

To save all parameters of a frame filter, use IFrameFilter::getSettings.

Example:

The following example shows how to get 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 read using beginParamTransfer, getParameter and endParamTransfer:

pRotFlipFilter->beginParamTransfer();
long rot = 0;
if( eNO_ERROR != pRotFlipFilter->getParameter( "Rotation Angle", rot ) )
{
    std::cerr << "Error getting parameter 'rotation'" << std::endl;
}
else
{
    std::cout << "Rotation Angle = " << rot << std::endl;
}
bool flipH = false;
if( eNO_ERROR != pRotFlipFilter->setParameter( "Flip H", flipH ) )
{
    std::cerr << "Error getting parameter 'fliph'" << std::endl;
}
else
{
    std::cout << "Flip H = " << flipH << std::endl;
}
bool flipV = false;
if( eNO_ERROR != pRotFlipFilter->setParameter( "Flip V", flipV ) )
{
    std::cerr << "Error getting parameter 'flipv'" << std::endl;
}
else
{
    std::cout << "Flip V = " << flipV << std::endl;
}
pRotFlipFilter->endParamTransfer();

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

<< IFrameFilter