imaqBCGTransform

NI Vision for LabWindows/CVI Function

imaqBCGTransform

Usage

int imaqBCGTransform(Image* dest, const Image* source, const BCGOptions* options, const Image* mask);

Purpose

Applies brightness, contrast, and gamma correction to an image by computing and applying a lookup table. The function computes the lookup table based on the values in BCGOptions.

Image Types Supported

IMAQ_IMAGE_U8

Parameters

Name

Type

Description

dest Image* The destination image.
source const Image* The image to transform.
options const BCGOptions* The parameters to use in the transform. This parameter is required and cannot be NULL.
mask const Image* An optional mask image. This image must be an IMAQ_IMAGE_U8 image. The function applies the transform only to those source pixels whose corresponding mask pixels are non-zero. All other pixel remain unchanged. Set this parameter to NULL to apply the transform to the whole source image.

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

options—If NULL is passed, the function uses the following default parameters:

brightness 128
contrast 45
gamma 1.0