imaqChangeColorSpace2

NI Vision for LabWindows/CVI Function

imaqChangeColorSpace2

Usage

Color2 imaqChangeColorSpace2(const Color2* sourceColor, ColorMode sourceSpace, ColorMode destSpace, double offset, const CIEXYZValue* whiteReference);

Purpose

Maps the value of a color in one color space into the value of the same color in another color space.

Parameters

Name

Type

Description

sourceColor const Color2* The color in the source space. This parameter is required and cannot be NULL.
sourceSpace ColorMode The source color space.
destSpace ColorMode The destination color space.
offset double If the destination space is HSL, the offset to add to the calculated hue (from 0 to 360). The default offset value of 0 results in a hue value of 0 for the color red (R=255, G=0, B=0). By changing the offset value, you can specify the RGB color that maps to a hue value of 0. When you want to analyze red or colors close to red in the HSL space, you can add an offset so that the hue values associated with these colors are not zero.
whiteReference const CIEXYZValue* If the destination space is CIE L*a*b*, the CIE XYZ components that map to white. If this parameter is set to NULL, the default values (0.950456,1,1.088754, 0), which map to the RGB values (255,255,255, 0), are used.

Return Value

Type

Description

Color2 On success, this function returns the value of the color in the destination color space. On failure, this function returns black. To get extended error information, call imaqGetLastError().