IC Imaging Control C++

IFrameFilter::getParameter Method

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

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