imaqReplaceColorPlanes

NI Vision for LabWindows/CVI Function

imaqReplaceColorPlanes

Usage

int imaqReplaceColorPlanes(Image* dest, const Image* source, ColorMode mode, const Image* plane1, const Image* plane2, const Image* plane3);

Purpose

Replaces one or more of the color planes of a color image. The plane you replace may be independent of the image type. For example, you can replace the green plane of an RGB image or the hue plane of an HSL image.

Note  This function does not support the CIE L*a*b* and CIE XYZ color modes. This function only supports the RGB color mode for 64-bit images.

Image Types Supported

IMAQ_IMAGE_RGB, IMAQ_IMAGE_HSL, IMAQ_IMAGE_RGB_U64

Parameters

Name

Type

Description

dest Image* The destination image.
source const Image* The source image.
mode ColorMode The color space in which the function replaces planes.
plane1 const Image* The first plane of replacement data. Set this parameter to NULL if you do not want to change the first plane of the source image.
plane2 const Image* The second plane of replacement data. Set this parameter to NULL if you do not want to change the second plane of the source image.
plane3 const Image* The third plane of replacement data. Set this parameter to NULL if you do not want to change the third plane of the source image.

Return Value

Type

Description

int On success, this function returns a non-zero value. On failure, this function returns 0. To get extended error information, call imaqGetLastError().

Parameter Discussion

plane1—The data contained here depends on mode, as follows:

Mode Plane
IMAQ_RGB Red
IMAQ_HSL Hue
IMAQ_HSV Hue
IMAQ_HSI Hue

plane2—The data contained here depends on mode, as follows:

Mode Plane
IMAQ_RGB Green
IMAQ_HSL Saturation
IMAQ_HSV Saturation
IMAQ_HSI Saturation

plane3—The data contained here depends on mode, as follows:

Mode Plane
IMAQ_RGB Blue
IMAQ_HSL Luminance
IMAQ_HSV Value
IMAQ_HSI Intensity