IC Imaging Control C++

Frame Filter Parameter Wizard

Frame Filter Parameter Wizard

This chapter shows how to add a new parameter to a frame filter class using the Frame Filter Parameter wizard.

Introduction

A frame filter parameter provides a generic way of manipulating a frame filter's behavior. After a frame filter has been created, using the Frame Filter Module Wizard, frame filter parameters can be added. By using the Frame Filter Parameter Wizard, a member variable and two access methods are added to the filter class. The access methods are registered in the filter's constructor, so that they can be accessed from code that uses the frame filter.

How to use

You can find the Frame Filter Parameter Wizard in Visual Studio's Class View. In the Class View, right click on the application's name (the root entry on the top). In the context menu that is now displayed, click on the Add button and on the sub-menu Add class. (Please be sure that you use Add Class - due to technical reasons the context menu of the Class View can not be enhanced.) The parameter wizard selection is shown, as follows:

image

Select the IC Frame Filter Parameter icon. Then, click on the Open button. Now, you can enter the properties of the new member variable:

image

Input field description

Class name
The class in to which the new member variable is to be inserted, can be selected in this combo box. This combo box contains all frame filter classes of the current project.
Display name
This is the name of the parameter that is used when an application accesses the parameter, using IFrameFilter::setParameter or IFrameFilter::getParameter.
Variable name
This is the C++ name of the member variable in the frame filter class.
Type
Using this combo box, you can select the type of the member variable.
Access
Using this combo box, you can select the access type (public, private or protected) of the member variable.
Parameter limits
If the new member variable is of a numeric type, such as long or float, you can set minimum and maximum values. In the associated set-method of this member variable, the limits are checked. Should a value be set that does not lie within the bounds of the values specified here, eINVALID_PARAM_VALUE is returned by the set-method:
tFilterError CMyFilter::setTheVariable(long Value)
{
    if( Value >= 0 && Value <= 255)
        m_TheVariable = Value;
    else
        return eINVALID_PARAM_VALUE;
    return eNO_ERROR;
}
Can only be set, if live video is not running
Some properties may only be set, if live video is not running. If this check box is checked, the functionality for checking this will be implemented into the frame filter class. If the notifyStart and notifyStop methods are not already implemented in the frame filter class, they will be implemented automatically by the Frame Filter Parameter Wizard. Using these methods, the frame filter class can determine, whether the live video has been started or stopped. A new internal member variable m_bLiveVideoRunning is inserted in to the class. When the live video is started, it is set to true. This variable is checked in the set-method of the new parameter:
tFilterError CMyFilter::setTheVariable(long Value)
{
    if( m_bLiveVideoRunning == true )
        return eINVALID_FILTER_STATE;
    else
    {
        m_TheVariable = Value;
    }
    return eNO_ERROR;
}
If the setTheVariable method is called while the live video is running, the member variable m_TheVariable will not be set. Instead eINVALID_FILTER_STATE is returned.

Once you have followed all the above instructions, click on the finish button. The new member variable and the related methods are implemented by the Frame Filter Parameter Wizard. If a property dialog is associated with the frame filter class, it is not altered by the Frame Filter Parameter Wizard.

<< Project Wizards

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