IC Imaging Control C++

FrameFilterImpl::addFloatParam Method

FrameFilterImpl::addFloatParam Method

Registers a float parameter than can be accessed using the methods of IFrameFilter.
Syntax:
protected:
    void addFloatParam( const std::string& name, tFilterError (T::*getFunc)( float& ), tFilterError (T::*setFunc)( float ) );
    void addFloatParam( const std::wstring& name, tFilterError (T::*getFunc)( float& ), tFilterError (T::*setFunc)( float ) );
Name Description
name

Name of the parameter. This string has to be passed to IFrameFilter::setParameter or IFrameFilter::getParameter to access the parameter.

getFunc

Name of a member function of the class derived from FrameFilterImpl. Has to take a reference to a float as its only parameter and return a tFilterError.

setFunc

Name of a member function of the class derived from FrameFilterImpl. Has to take a float as its only parameter and return a tFilterError.

Remarks:

You should register all parameters of your frame filter in your constructor.

Example:

This example shows how to register a float parameter and implement the necessary access methods.

In the constructor of your frame filter implementation, add a call to addFloatParam:

CRotateTransform::CRotateTransform()
    :    m_Angle( 0.0f )
{
    addFloatParam( "angle", &CRotateTransform::getAngle, &CRotateTransform::setAngle );
}

Declare the methods setAngle and getAngle in the header file...

DShowLib::tFilterError    setAngle( float val );
DShowLib::tFilterError    getAngle( float& val );

...and implement them in the source file:

tFilterError    CRotateTransform::setAngle( float val )
{
    m_Angle = val;
    return eNO_ERROR;
}
tFilterError    CRotateTransform::getAngle( float& val )
{
    val = m_Angle;
    return eNO_ERROR;
}
See also: FrameFilterImpl, FrameFilterImpl::addBoolParam, FrameFilterImpl::addLongParam, FrameFilterImpl::addStringParam, FrameFilterImpl::addDataParam

<< FrameFilterImpl

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