Rotate Flip Filter

Rotate Flip Filter

The Rotate Flip filter allows image data to be flipped and rotated in steps of 90 degrees.

Using the Rotate Flip Filter

The Rotate Flip filter is loaded by an application using the following code:

    // Load the Rotate Flip filter from the stdfilters.ftf module.
#ifdef _DEBUG
    smart_com<IFrameFilter> pFilter = FilterLoader::createFilter( "Rotate Flip",   // Filter name.
                                                                  "stdfiltersd.ftf" ); // Module file.
#else
    smart_com<IFrameFilter> pFilter = FilterLoader::createFilter( "Rotate Flip",   // Filter name.
                                                                  "stdfilters.ftf" ); // Module file.
#endif

Parameters

The part of the image that is copied to the destination frame is determined by four filter parameters:

Rotation Angle
This parameter sets the rotation angle.
Available angles are:
Please note that this parameter can only be changed in steps of 180° when live mode is running. Otherwise, the changes would alter the output video format.
Flip V
This parameter determines whether the image should be flipped vertically. As it is a boolean parameter, valid values are true and false. The setting of the flip parameters does not cause a video format change. Thus, they can be set regardless of whether the live video is running or not.
Flip H
This parameter determines whether the image should be flipped horizontally. As it is a boolean parameter, valid values are true and false. The setting of the flip parameters does not cause a video format change. Thus, they can be set regardless of whether the live video is running or not.

Property Dialog

The rotation angle and flipping modes can be specified in the filter's property dialog:

image

Programmatically access the Parameters

If the parameters should be set by an application, the following source code can be used:

long lAngle = 0;
long lNewAngle = 0;
bool bFlipVertical = false;
bool bFlipHorizontal = false;
//Retrieve the current parameter settings.
pFilter->getParameter( "Rotation Angle", lAngle  );
pFilter->getParameter( "Flip V", bFlipVertical );
pFilter->getParameter( "Flip H", bFlipHorizontal );
//Change the parameters.
lNewAngle = 90; // Only the values 0, 90, 180 270 are allowed.
// If the rotation value is 90 or 270, then the resulting video format
// is changed. Thus, the new value can only be set while the live video is
// stopped. Otherwise, an error is returned by setParameter().
if( abs(lAngle - lNewAngle) == 90 || abs(lAngle - lNewAngle ) == 270 )
{
    if( m_Grabber.isLive() == false )
    {
        pFilter->setParameter( "Rotation Angle", lAngle  );
    }
}
else
{
    pFilter->setParameter( "Rotation Angle", lAngle  );
}
// The flip parameters do not cause a video format change, so they can be
// set regardless of whether the live video is running.
bFlipVertical = true;
bFlipHorizontal = true;
pFilter->setParameter( "Flip V", bFlipVertical );
pFilter->setParameter( "Flip H", bFlipHorizontal );

<< IC Imaging Control Standard Filters