imgCalculateBayerColorLUT

NI IMAQ Function

imgCalculateBayerColorLUT

Usage

rval imgCalculateBayerColorLUT(double redGain, double greenGain, double blueGain, uInt32* redLUT, uInt32* greenLUT, uInt32* blueLUT, uInt32 bitDepth)

Purpose

Calculates the red, green, and blue lookup tables (LUTs) based on the input gain values. Call this function before you enter the acquisition loop. You can then pass the LUTs to imgBayerColorDecode to quickly perform the color decode.

Parameters

Name Type Direction
redGain double input
greenGain double input
blueGain double input
redLUT uInt32* output
greenLUT uInt32* output
blueLUT uInt32* output
bitDepth uInt32 input

Parameter Discussion

redGain: gain used to generate the redLUT. The value must be between 0 and 3.999.

greenGain: gain used to generate the greenLUT. The value must be between 0 and 3.999.

blueGain: gain used to generate the blueLUT. The value must be between 0 and 3.999.

Tip  To find the appropriate values for the gains, use the White Balancing Utility located at Start»All Programs»National Instruments»Vision»White Balancing Utility.

redLUT: pointer to an area of memory that will contain the red lookup table on return. For 8-bit images this array must contain 256 elements. For images with bit depths greater than 8, this array must contain 65,536 elements. You must allocate this array before passing it to the function.

greenLUT: pointer to an area of memory that will contain the green lookup table on return. For 8-bit images this array must contain 256 elements. For images with bit depths greater than 8, this array must contain 65,536 elements. You must allocate this array before passing it to the function.

blueLUT: pointer to an area of memory that will contain the blue lookup table on return. For 8-bit images this array must contain 256 elements. For images with bit depths greater than 8, this array must contain 65,536 elements. You must allocate this array before passing it to the function.

bitDepth: bits per pixel of the monochrome source image.

Return Value

This function returns 0 on success. On failure, this function returns an error code. For information about the error code, call imgShowError.