imaqWriteTIFFFile

NI Vision for LabWindows/CVI Function

imaqWriteTIFFFile

Usage

int imaqWriteTIFFFile(const Image* image, const char* fileName, const TIFFFileOptions* options, const RGBValue* colorTable);

Purpose

Writes an image to a TIFF file. This function stores a CalibrationUnit of IMAQ_CENTIMETER or IMAQ_INCH only. If you pass an image to this function that has a metric CalibrationUnit other than IMAQ_CENTIMETER, the function converts xStep and yStep from the supplied unit into centimeters. If you pass an image to this function that has an English CalibrationUnit other than IMAQ_INCH, the function converts xStep and yStep from the supplied unit into inches.

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.
options const TIFFFileOptions* A structure defining the specific options to use while writing the TIFF 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. If the compressionType element of options is IMAQ_JPEG, the function ignores this parameter.

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—Set options to NULL to use the default options, as follows:

rowsPerStrip 0, which writes all data in one strip
photoInterp IMAQ_BLACK_IS_ZERO
compressionType IMAQ_NO_COMPRESSION