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:

[C#]
FrameFilter RotateFlipFilter; RotateFlipFilter = ICImagingControl1.FrameFilterCreate("Rotate Flip", ""); if( RotateFlipFilter == null ) MessageBox.Show("Failed to create RotateFlipFilter"); else ICImagingControl1.DeviceFrameFilters.Add(RotateFlipFilter);

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, following source code can be used:

[C#]
// Retrieve the current parameter settings. int angle = RotateFlipFilter.GetIntParameter("Rotation Angle"); bool flipVertical = RotateFlipFilter.GetBoolParameter("Flip V"); bool flipHorizontal = RotateFlipFilter.GetBoolParameter("Flip H"); // Change the parameters. int newAngle = 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. if( Math.Abs(angle - newAngle) == 90 || Math.Abs(angle - newAngle) == 270 ) { if( !ICImagingControl1.LiveVideoRunning ) { RotateFlipFilter.SetIntParameter("Rotation Angle", newAngle); } } else { RotateFlipFilter.SetIntParameter("Rotation Angle", newAngle); } // The flip parameters do not cause a video format change, so they can be // set regardless of whether the live video is running. flipVertical = true; flipHorizontal = true; RotateFlipFilter.SetBoolParameter("Flip V", flipVertical); RotateFlipFilter.SetBoolParameter("Flip H", flipHorizontal);

<< IC Imaging Control Standard Filters