FrameFilterImpl.AddIntParam Method

Registers a integer parameter than can be accessed using the methods of FrameFilter.
Syntax:
public delegate void SetIntParam( int value );
public delegate int GetIntParam();
protected void AddIntParam( string name, SetIntParam setFunc, GetIntParam getFunc );

Name Description
name

Name of the parameter. This string has to be passed to FrameFilter.SetIntParameter or FrameFilter.GetIntParameter to access the parameter.

getFunc

GetIntParam delegates responsible to return the current state of the parameter.

setFunc

SetIntParam delegates responsible to receive and handle changes of the parameter.

Remarks:

All parameters of a frame filter should be registered in its constructor.

Example:

The following sample code shows how to add two parameters. One is named "enable" and the other one, which is an int parameter is named "threshold":

[C#]
public BinarizationFilter() { AddBoolParam( "enable", new SetBoolParam( setEnable ), new GetBoolParam( getEnable ) ); AddIntParam( "threshold", new SetIntParam( setThreshold ), new GetIntParam( getThreshold ) ); }

The functions, that are referenced in AddIntParam to set the integer parameter are implemeted as follows:

[C#]
void setThreshold( int threshold ) { _threshold = threshold; }
[C#]
int getThreshold() { return _threshold; }
See also: FrameFilterImpl, FrameFilterImpl.AddBoolParam, FrameFilterImpl.AddFloatParam, FrameFilterImpl.AddStringParam, FrameFilterImpl.AddDataParam

<< FrameFilterImpl