imgBayerColorDecode
Usage
rval imgBayerColorDecode(void* dst, const void* src, uInt32 rows, uInt32 cols, uInt32 dstRowPixels, uInt32 srcRowPixels, uInt32* redLUT, uInt32* greenLUT, uInt32* blueLUT, uInt8 bayerPattern, uInt8 bitDepth, uInt32 reserved)
Purpose
Decodes a Bayer-encoded image to produce an RGB representation of the image.
Parameters
Name | Type | Direction |
dst | void* | output |
src | const void* | input |
rows | uInt32 | input |
cols | uInt32 | input |
dstRowPixels | uInt32 | input |
srcRowPixels | uInt32 | input |
redLUT | uInt32* | input |
greenLUT | uInt32* | input |
blueLUT | uInt32* | input |
bayerPattern | uInt8 | input |
bitDepth | uInt8 | input |
reserved | uInt32 | input |
Parameter Discussion
dst: pointer to an area of memory that will contain the decoded image on return.
src: pointer to the source image.
rows: number of rows in the source image.
cols: number of columns in the source image.
dstRowPixels: number of pixels in each row of the destination image, including the borders.
srcRowPixels: number of pixels in each row of the source image, including the borders.
redLUT: pointer to an area of memory that contains the lookup table to be applied to the red pixels. This array must be allocated by the user and contain 256 elements for 8-bit images and 65,536 elements for 16-bit images. Generate the redLUT using imgCalculateBayerColorLUT.
greenLUT: pointer to an area of memory that contains the lookup table to be applied to the green pixels. This array must be allocated by the user and contain 256 elements for 8-bit images and 65,536 elements for 16-bit images. Generate the greenLUT using imgCalculateBayerColorLUT.
blueLUT: pointer to an area of memory that contains the lookup table to be applied to the blue pixels. This array be must allocated by the user and contain 256 elements for 8-bit images and 65,536 elements for 16-bit images. Generate the blueLUT using imgCalculateBayerColorLUT.
bayerPattern: Bayer encoding pattern. Valid patterns include the following values:
IMG_BAYER_PATTERN_GBGB_RGRG | Specifies the following Bayer pattern:
GBGB RGRG |
IMG_BAYER_PATTERN_GRGR_BGBG | Specifies the following Bayer pattern:
GRGR BGBG |
IMG_BAYER_PATTERN_BGBG_GRGR | Specifies the following Bayer pattern:
BGBG GRGR |
IMG_BAYER_PATTERN_RGRG_GBGB | Specifies the following Bayer pattern:
RGRG GBGB |
bitDepth: number of bits per pixel of the source image.
algorithm: reserved for future use. This value must be 0.
Tip For information about Bayer decoding, refer to the White Balancing Utility located at Start»All Programs»National Instruments»Vision»White Balancing Utility. |
Return Value
This function returns 0 on success. On failure, this function returns an error code. For information about the error code, call imgShowError.