The APIs under this category are used to initialize the decoding parameters as part of the nvtiffDecodeParams_t handle. Once initialized, the handle can be passed as an input to nvtiffDecodeImage()

nvtiffDecodeParamsSetOutputFormat()#

Used to set the decode output format. See Decode Output Format for details. The default value is NVTIFF_OUTPUT_UNCHANGED_I.

Note

When the photometric interpretation is NVTIFF_PHOTOMETRIC_YCBCR and compression is NVTIFF_COMPRESSION_JPEG, output format must be set to either NVTIFF_OUTPUT_RGB_I_UINT8 or NVTIFF_OUTPUT_RGB_I_UINT16.

Note

When the photometric interpretation is NVTIFF_PHOTOMETRIC_MASK, only NVTIFF_OUTPUT_UNCHANGED_I can be used.

When setting the output format to NVTIFF_OUTPUT_UNCHANGED_I-

the size in bytes of the decode output buffer when bits_per_pixel is a multiple 8, should be image_width * image_height * (bits_per_pixel/8). If using _nvtiffdecodeimageex-label, the pitch must be at least image_width * (bits_per_pixel/8) and aligned to bits_per_sample[0]/8.

the size in bytes of the decode output buffer when bits_per_pixel is less than 8, should be (image_width * bits_per_pixel + 7)/8  * image_height. If using _nvtiffdecodeimageex-label, the pitch must be at least (image_width * bits_per_pixel + 7)/8) and aligned to bits_per_sample[0]/8.

When setting the output to NVTIFF_OUTPUT_RGB_I_UINT8-

the size in bytes of the decode output buffer should be image_width * image_height * 3 * sizeof(uint8_t). If using _nvtiffdecodeimageex-label, the pitch must be at least image_width * 3 * sizeof(uint8_t).

When setting the output to NVTIFF_OUTPUT_RGB_I_UINT16-

the size in bytes of the decode output buffer should be image_width * image_height * 3 * sizeof(uint16_t). If using _nvtiffdecodeimageex-label, the pitch must be at least image_width * 3 * sizeof(uint8_t), and aligned to sizeof(uint16_t).

Signature:

nvtiffStatus_t nvtiffDecodeParamsSetOutputFormat(nvtiffDecodeParams_t decode_params,
    nvtiffOutputFormat_t format);

Parameters:

Parameter

Input/Output

Memory

Description

nvtiffDecodeParams_t decode_params

Input/Output

Host

Decode output parameters handle.

nvtiffOutputFormat_t format

Input

Host

Output format value. Defaults to NVTIFF_OUTPUT_UNCHANGED_I.

Returns:

nvtiffStatus_t - An error code as specified in Decode API Return Status Codes

nvtiffDecodeParamsSetROI()#

Used to set the region of interest for decoding. The entire image is decoded by default.

  • offset_x and offset_y should be greater than or equal to 0, and cannot exceed image width and height respectively.

  • offset_x + roi_width and offset_y + roi_height cannot exceed image width and image height respectively.

  • When image bitdepth is 1, offset_x and roi_width should be a multiple of 8

Signature:

nvtiffStatus_t nvtiffDecodeParamsSetROI(nvtiffDecodeParams_t decode_params,
        int32_t offset_x,
        int32_t offset_y,
        int32_t roi_width,
        int32_t roi_height)

Parameters:

Parameter

Input/Output

Memory

Description

nvtiffDecodeParams_t decode_params

Input/Output

Host

Decode output parameter handle

int32_t offset_x

Input

Host

Image offset along the horizontal direction relative to the top left corner.

int32_t offset_y

Input

Host

Image offset along the vertical direction relative to the top left corner.

int32_t roi_width

Input

Host

Image width relative to offset_x

int32_t roi_height

Input

Host

Image height relative to offset_y

Returns:

nvtiffStatus_t - An error code as specified in Decode API Return Status Codes