nvtiffDecode()#
Decodes image data on the GPU which is specified in tiff_stream.
Each image in the TIFF file is copied into the respective buffer pointed to by “imageOut_d”. This function is fully asynchronous.
When the photometric interpretation of an image is NVTIFF_PHOTOMETRIC_PALETTE or NVTIFF_PHOTOMETRIC_YCBCR, the decode output will be converted to RGB.
For images with multiple samples, the decode output will always be in planar contiguous format.
Signature:
nvtiffStatus_t nvtiffDecode(nvtiffStream_t tiff_stream,
nvtiffDecoder_t nvtiff_decoder,
unsigned char **image_out,
cudaStream_t cuda_stream);
Parameters:
Parameter |
Input/Output |
Memory |
Description |
|---|---|---|---|
nvtiffStream_t tiff_stream |
Input |
Host |
|
nvtiffDecoder_t nvtiff_decoder |
Input |
Host |
Decoder handle |
unsigned char **imageOut_d |
Output |
Host |
Host array (of size num_images in the TIFF file) of pointers to device buffers.Each device buffer should have a size of image_width * image height * bitdepth * samples_per_pixel When the photometric interpretation for an image is palette mode, the device buffer should have a size of image_width * image height * 3 * 2 |
cudaStream_t cuda_stream |
Input |
Host |
|
Returns:
nvtiffStatus_t - An error code as specified in Decode API Return Status Codes
nvtiffDecodeRange()#
This function is similar to nvtiffDecode(). It allows the user to specify a range of images to be decoded
(instead of decoding all images in the file).
When the photometric interpretation of an image is NVTIFF_PHOTOMETRIC_PALETTE or NVTIFF_PHOTOMETRIC_YCBCR, the decode output will be converted to RGB.
For images with multiple samples, the decode output will always be in planar contiguous format.
Signature:
nvtiffStatus_t NVTIFFAPI nvtiffDecodeRange(nvtiffStream_t tiff_stream,
nvtiffDecoder_t decoder,
unsigned int sub_file_start,
unsigned int sub_file_num,
unsigned char **image_out,
cudaStream_t cuda_stream);
Parameters:
Parameter |
Input/Output |
Memory |
Description |
|---|---|---|---|
nvtiffStream_t tiff_stream |
Input |
Host |
|
nvtiffDecoder_t nvtiff_decoder |
Input |
Host |
Decoder handle |
unsigned int sub_file_start |
Input |
Host |
Index of the first image to decode, in [0, tiff_info.num_sub_files). |
unsigned int sub_file_num |
Input |
Host |
Number of images to decode starting from |
unsigned char **imageOut_d |
Output |
Host |
Host array (of size num_images in the TIFF file) of pointers to device buffers.Each device buffer should have a size of image_width * image height * bitdepth * samples_per_pixel When the photometric interpretation for an image is palette mode, the device buffer should have a size of image_width * image height * 3 * 2 |
cudaStream_t cuda_stream |
Input |
Host |
|
Returns:
nvtiffStatus_t - An error code as specified in Decode API Return Status Codes
nvtiffDecodeImage()#
Decodes a single image on the GPU which is specified in tiff_stream. The function is asynchronous with respect to the host.
Additional control of the decode output is possible using an instance nvtiffDecodeParams_t.
Signature:
nvtiffStatus_t nvtiffDecodeImage(nvtiffStream_t tiff_stream,
nvtiffDecoder_t decoder,
nvtiffDecodeParams_t params,
uint32_t image_id,
void* image_out_d,
cudaStream_t cuda_stream);
Parameters:
Parameter |
Input/Output |
Memory |
Description |
|---|---|---|---|
nvtiffStream_t tiff_stream |
Input |
Host |
|
nvtiffDecoder_t nvtiff_decoder |
Input |
Host |
Decoder handle |
nvtiffDecodeParams_t params |
Input |
Host |
Used to control the decoded output (like specifying ROI, output format). |
uint32_t image_id |
Input |
Host |
Corresponds to the image index(IFDs) within a multi images TIFF file. Cannot exceed the total number of images in a TIFF file. |
void* image_out_d |
Output |
Device |
Decode output buffer. For allocation size, see nvtiffDecodeParamsSetOutputFormat() |
cudaStream_t cuda_stream |
Input |
Host |
|
Returns:
nvtiffStatus_t - An error code as specified in Decode API Return Status Codes
nvtiffDecodeImageEx()#
Decodes a single image on the GPU which is specified in tiff_stream. The function is asynchronous with respect to the host.
Additional control of the decode output is possible using an instance nvtiffDecodeParams_t.
Signature:
nvtiffStatus_t nvtiffDecodeImageEx(nvtiffStream_t tiff_stream,
nvtiffDecoder_t decoder,
nvtiffDecodeParams_t params,
uint32_t image_id,
nvtiffImage_t* image_out,
cudaStream_t cuda_stream);
Parameters:
Parameter |
Input/Output |
Memory |
Description |
|---|---|---|---|
nvtiffStream_t tiff_stream |
Input |
Host |
|
nvtiffDecoder_t nvtiff_decoder |
Input |
Host |
Decoder handle |
nvtiffDecodeParams_t params |
Input |
Host |
Used to control the decoded output (like specifying ROI, output format). |
uint32_t image_id |
Input |
Host |
Corresponds to the image index(IFDs) within a multi images TIFF file. Cannot exceed the total number of images in a TIFF file. |
nvtiffImage_t* image_out |
Output |
Host |
Decode output image, see TIFF Image Data. Only one output plane is currently supported. For buffer allocation size and pitch, see nvtiffDecodeParamsSetOutputFormat(). Note that the pitch must be aligned to the size of the sample type. |
cudaStream_t cuda_stream |
Input |
Host |
|
Returns:
nvtiffStatus_t - An error code as specified in Decode API Return Status Codes
nvtiffDecodeCheckSupported()#
Helps determine whether any given image within a tiff file specified by tiff_stream can be decoded by nvTIFF.
Returns NVTIFF_STATUS_SUCCESS, if the image is supported
Signature:
nvtiffStatus_t nvtiffDecodeCheckSupported(nvtiffStream_t tiff_stream,
nvtiffDecoder_t decoder,
nvtiffDecodeParams_t params,
uint32_t image_id);
Parameters:
Parameter |
Input/Output |
Memory |
Description |
|---|---|---|---|
nvtiffStream_t tiff_stream |
Input |
Host |
|
nvtiffDecoder_t nvtiff_decoder |
Input |
Host |
Decoder handle |
nvtiffDecodeParams_t params |
Input |
Host |
Used to control the decoded output (like specifying ROI, output format). |
uint32_t image_id |
Input |
Host |
Corresponds to the image index(IFDs) within a multi images TIFF file. Cannot exceed the total number of images in a TIFF file. |
Returns:
nvtiffStatus_t - An error code as specified in Decode API Return Status Codes