imaqExtractColorPlanes

NI Vision for LabWindows/CVI Function

imaqExtractColorPlanes

Usage

int imaqExtractColorPlanes(const Image* image, ColorMode mode, Image* plane1, Image* plane2, Image* plane3);

Purpose

Extracts the individual color planes from a color image. The plane you extract may be independent from the type of the image. For example, you can extract the hue plane from a 32-bit RGB image or the green plane from 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 RGB images.

Image Types Supported

IMAQ_IMAGE_RGB, IMAQ_IMAGE_HSL, IMAQ_IMAGE_RGB_U64

Parameters

Name

Type

Description

image const Image* The source image that the function extracts the planes from.
mode ColorMode The color space that the function extracts the planes from.
plane1 Image* On return, the first extracted plane. Set this parameter to NULL if you do not need this information.
plane2 Image* On return, the second extracted plane. Set this parameter to NULL if you do not need this information.
plane3 Image* On return, the third plane. Set this parameter to NULL if you do not need this information.

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 in plane1 depends on the mode, as follows:

Mode Plane
IMAQ_RGB Red
IMAQ_HSL Hue
IMAQ_HSV Hue
IMAQ_HSI Hue

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

Mode Plane
IMAQ_RGB Green
IMAQ_HSL Saturation
IMAQ_HSV Saturation
IMAQ_HSI Saturation

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

Mode Plane
IMAQ_RGB Blue
IMAQ_HSL Luminance
IMAQ_HSV Value
IMAQ_HSI Intensity