imaqColorLookup

NI Vision for LabWindows/CVI Function

imaqColorLookup

Usage

int imaqColorLookup(Image* dest, const Image* source, ColorMode mode, const Image* mask, const short* plane1, const short* plane2, const short* plane3);

Purpose

Performs a transformation on an image by replacing each pixel value in a given color plane with the lookup table entry corresponding to that value.

Note  This function does not support the CIE L*a*b* and CIE XYZ color modes.

Image Types Supported

IMAQ_IMAGE_RGB, IMAQ_IMAGE_HSL

Parameters

Name

Type

Description

dest Image* The destination image.
source const Image* The image to apply the lookup table to.
mode ColorMode The color space in which to apply the lookup table. If the image is not in the color space you specify, the function converts the pixels into the specified color space, applies the lookup table, and converts the pixels back to their original color space.
mask const Image* An optional mask image. This image must be an IMAQ_IMAGE_U8 image. The function applies the lookup to only those pixels in the source image whose corresponding pixels in the mask image are non-zero. Set this parameter to NULL to apply the lookup to the whole image.
plane1 const short* The lookup table for the first plane of the image. If you set this parameter, the lookup table must contain 256 values. Set this parameter to NULL to leave the first plane unchanged.
plane2 const short* The lookup table for the second plane of the image. If you set this parameter, the lookup table must contain 256 values. Set this parameter to NULL to leave the second plane unchanged.
plane3 const short* The lookup table for the third plane of the image. If you set this parameter, the lookup table must contain 256 values. Set this parameter to NULL to leave the third plane unchanged.

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

IMAQ_RGB red plane
IMAQ_HSL hue plane
IMAQ_HSV hue plane
IMAQ_HSI hue plane

plane2—The color plane depends on mode, as follows:

IMAQ_RGB green plane
IMAQ_HSL saturation plane
IMAQ_HSV saturation plane
IMAQ_HSI saturation plane

plane3—The color plane depends on mode, as follows:

IMAQ_RGB blue plane
IMAQ_HSL luminance plane
IMAQ_HSV value plane
IMAQ_HSI intensity plane