poIImagePlane SetFilterType

Sets the current image post-processing filter type for the image plane.

Syntax

Imageplane_handle SetFilterType ftype

Application

HyperView Tcl Modify

Description

The image plane offers several image post-processing filters that can be applied on the image or video. This command sets/changes the filter type currently being used on the image plane.

Inputs

ftype
The filter type name. Valid values are returned by GetFilterTypeList, and consist of, “None”, “Edge”, and “ColorAlpha”. "None" means to use no post processing filter. “Edge” is an edge detection filter. “ColorAlpha” replaces a range of color values in the image with transparency.

Context

Example

To create one image plane, and use the edge detection filter to draw the edges in black, and then use the color alpha filter to remove all “white” from the image (making those areas of the image transparent):
Note: The image plane without the filter is shown in Figure 1 (below). The image plane with the edge detection filter active is shown in Figure 2 (below).
hwi OpenStack
if {[catch {
    hwi GetActiveClientHandle client_handle
    hwi GetSessionHandle session_handle
    client_handle GetImagePlaneCtrlHandle ipc_handle
    set ipid1 [ipc_handle AddImagePlane Logo1]
    ipc_handle GetImagePlaneHandle imageplane_handle $ipid1
    imageplane_handle SetFileName g:/samples2/VideoOverlay/Altair_logo.jpg
    imageplane_handle SetMode background
    imageplane_handle SetCrop 0 0 0.9995 0.995
    imageplane_handle SetFilterType ColorAlpha;
    imageplane_handle SetFilterMode equal;
    imageplane_handle SetColorAlphaTarget "255 255 255"
    imageplane_handle SetColorAlphaTolerance 18
    imageplane_handle SetMipMapMode Linear1
    puts "  Filter Type: [imageplane_handle GetFilterType]";
    puts "  Filter Mode: [imageplane_handle GetFilterMode]";
    puts "  Alpha Color Target: [imageplane_handle GetColorAlphaTarget]";
    puts "  Alpha Color Tolerance: [imageplane_handle GetColorAlphaTolerance]";
    puts "  MipMap Mode: [imageplane_handle GetMipMapMode]";
    client_handle Draw
} result]} {
    global errorInfo;
    puts stderr $result;
    puts "[session_handle GetError]";
    puts stderr "*** Tcl TRACE ***";
    puts stderr $errorInfo;
} else {
    puts "No errors.";
    puts "Warnings: ";
    puts "    [session_handle GetError]";
}

hwi CloseStack
The image plane without the filter is shown in Figure 3. The image plane with the filter active is shown in Figure 4.

Error

Returns HW_InvalidHandle if the image plane handle is invalid, or poInvalidImgFilterType if the specified filter type is not recognized.