imaqWriteJPEG2000File

NI Vision for LabWindows/CVI Function

imaqWriteJPEG2000File

Usage

int imaqWriteJPEG2000File(const Image* image, const char* fileName, int lossless, float compressionRatio, const JPEG2000FileAdvancedOptions* advancedOptions, const RGBValue* colorTable);

Purpose

Writes an image to a JPEG2000 file.

Image Types Supported

IMAQ_IMAGE_U8, IMAQ_IMAGE_U16, IMAQ_IMAGE_I16, IMAQ_IMAGE_RGB, IMAQ_IMAGE_RGB_U64

Parameters

Name

Type

Description

image const Image* The image to write to a file.
fileName const char* The name of the file to write. This parameter is required and cannot be NULL.
lossless int Set this parameter to TRUE to write the JPEG2000 file without loss of information. Set this parameter to FALSE to write the JPEG2000 file as an approximation to the image.
compressionRatio float Specifies the degree to which to compress the JPEG2000 file. For example, a compressionRatio of 50 means that the resulting JPEG2000 file will be 50 times smaller than the size of the image in memory. This parameter is ignored if lossless is TRUE.
advancedOptions const JPEG2000FileAdvancedOptions* Specifies advanced behaviors when writing a JPEG2000 file.
colorTable const RGBValue* An optional color table to associate with 8-bit images. If you provide a color table, the table must have 256 elements. Set this parameter to NULL to write a grayscale palette to the 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

advancedOptions—Set advancedOptions to NULL to use the following default values:

waveletMode IMAQ_WAVELET_TRANSFORM_INTEGER
useMultiComponentTransform TRUE
maxWaveletTransformLevel 5
quantizationStepSize 0