The APIs in this section are used to parse a TIFF file and retrieve meta data. Meta data such as image dimensions, samples per pixel may be used to allocate output buffers on device memory.
nvtiffStreamParseFromFile()¶
Parses the TIFF file and stores the meta data in nvtiffStream_t .
Signature:
nvtiffStatus_t nvtiffStreamParseFromFile(const char *fname,
nvtiffStream_t tiff_stream)
Parameters:
Parameter |
Input/Output |
Memory |
Description |
|---|---|---|---|
const char *fname |
Input |
Host |
tiff file name on disk |
nvtiffStream_t tiff_stream |
Input/Output |
Host |
tiff stream handle |
Returns:
nvtiffStatus_t - An error code as specified in Decode API Return Status Codes
nvtiffStreamPrint()¶
Prints to standard output, the TIFF file meta data stored in nvtiffStream_t.
Signature:
nvtiffStatus_t nvtiffStreamPrint(nvtiffStream_t tiff_stream)
Parameters:
Parameter |
Input/Output |
Memory |
Description |
|---|---|---|---|
nvtiffStream_t tiff_stream |
Input |
Host |
tiff stream handle |
Returns:
nvtiffStatus_t - An error code as specified in Decode API Return Status Codes
nvtiffStreamGetFileInfo()¶
Retrieves the image information defined in TIFF File Information.
Signature:
nvtiffStatus_t nvtiffStreamGetFileInfo(nvtiffStream_t tiff_stream,
nvtiffFileInfo_t *file_info)
Parameters:
Parameter |
Input/Output |
Memory |
Description |
|---|---|---|---|
nvtiffStream_t tiff_stream |
Input |
Host |
tiff stream handle |
nvtiffFileInfo_t *file_info |
Input/Output |
Host |
pointer to nvtiffFileInfo_t |
Returns:
nvtiffStatus_t - An error code as specified in Decode API Return Status Codes
nvtiffStreamGetNumImages()¶
Retrieves the number of images stored in a TIFF file.
Signature:
nvtiffStatus_t nvtiffStreamGetNumImages(nvtiffStream_t tiff_stream,
uint32_t *num_images)
Parameters:
Parameter |
Input/Output |
Memory |
Description |
|---|---|---|---|
nvtiffStream_t tiff_stream |
Input |
Host |
tiff stream handle |
uint32_t *num_images |
Output |
Host |
Pointer to buffer containing number of images |
Returns:
nvtiffStatus_t - An error code as specified in Decode API Return Status Codes
nvtiffStreamGetImageInfo()¶
Retrieves the image information of a given image stored in a TIFF file. Refer to TIFF Image Information for details on what information is retrieved.
Signature:
nvtiffStatus_t nvtiffStreamGetImageInfo(nvtiffStream_t tiff_stream,
uint32_t image_id,
nvtiffImageInfo_t *image_info)
Parameters:
Parameter |
Input/Output |
Memory |
Description |
|---|---|---|---|
nvtiffStream_t tiff_stream |
Input |
Host |
tiff stream handle |
uint32_t image_id |
Input |
Host |
Image index |
nvtiffImageInfo_t *image_info |
Output |
Host |
Pointer to nvtiffImageInfo_t |
Returns:
nvtiffStatus_t - An error code as specified in Decode API Return Status Codes
nvtiffStreamGetGeoKeyInfo()¶
Retrieves the information about a geo key defined in GeoTIFF Keys. This information is useful in retrieving the values associated with the geo key.
Signature:
nvtiffStatus_t nvtiffStreamGetGeoKeyInfo(nvtiffStream_t tiff_stream,
nvtiffGeoKey_t key,
uint32_t *size,
uint32_t *count,
nvtiffGeoKeyDataType_t* type)
Parameters:
Parameter |
Input/Output |
Memory |
Description |
|---|---|---|---|
nvtiffStream_t tiff_stream |
Input |
Host |
tiff stream handle |
nvtiffGeoKey_t key |
Input |
Host |
GeoTIFF key |
uint32_t *size |
Output |
Host |
Pointer to size of each value (in bytes) stored in key |
uint32_t *count |
Output |
Host |
Pointer to number of values stored in key |
nvtiffGeoKeyDataType_t *type |
Output |
Host |
Pointer to datatype of values stored in key |
Returns:
nvtiffStatus_t - An error code as specified in Decode API Return Status Codes
nvtiffStreamGetNumberOfGeoKeys()¶
Retrieves the list of geokeys present in a TIFF file and their count. This information is later useful in retrieving the values associated with each geo key.
Signature:
nvtiffStatus_t nvtiffStreamGetNumberOfGeoKeys(nvtiffStream_t tiff_stream,
nvtiffGeoKey_t* key,
uint32_t *num_keys)
Parameters:
Parameter |
Input/Output |
Memory |
Description |
|---|---|---|---|
nvtiffStream_t tiff_stream |
Input |
Host |
tiff stream handle |
nvtiffGeoKey_t *key |
Output |
Host |
Pointer to user allocated buffer for storing all geokeys in TIFF file (can be |
uint32_t *num_keys |
Output |
Host |
Pointer to number of geokeys stored in TIFF file |
Returns:
nvtiffStatus_t - An error code as specified in Decode API Return Status Codes
nvtiffStreamGetTagInfo()¶
Retrieves the information about a TIFF tag defined in TIFF Tags. This information is later useful in retrieving the values associated with the TIFF tag.
Signature:
nvtiffStatus_t nvtiffStreamGetTagInfo(nvtiffStream_t tiff_stream,
uint32_t image_id,
nvtiffTag_t tiff_tag,
nvtiffTagDataType_t *tag_type,
uint32_t *size,
uint32_t *count);
Parameters:
Parameter |
Input/Output |
Memory |
Description |
|---|---|---|---|
nvtiffStream_t tiff_stream |
Input |
Host |
tiff stream handle |
uint32_t image_id |
Input |
Host |
image index |
nvtiffTag_t tiff_tag |
Input |
Host |
tiff tag |
nvtiffTagDataType_t *tag_type, |
Output |
Host |
Pointer to buffer containing the datatype of |
uint32_t *size |
Output |
Host |
Pointer to buffer containing size of individual values in |
uint32_t *count |
Output |
Host |
Pointer to buffer containing number of values in |
Returns:
nvtiffStatus_t - An error code as specified in Decode API Return Status Codes
nvtiffStreamGetTagValue()¶
Retrieves the values stored in a TIFF tag.
Signature:
nvtiffStatus_t nvtiffStreamGetTagValue(nvtiffStream_t tiff_stream,
uint32_t image_id,
nvtiffTag_t tiff_tag,
void *tag_value,
uint32_t count);
Parameters:
Parameter |
Input/Output |
Memory |
Description |
|---|---|---|---|
nvtiffStream_t tiff_stream |
Input |
Host |
tiff stream handle |
uint32_t image_id |
Input |
Host |
image index |
nvtiffTag_t tiff_tag |
Input |
Host |
tiff tag |
void *tag_value |
Output |
Host |
Pointer to buffer containing values associated with |
uint32_t *count |
Output |
Host |
Pointer to buffer containing number of values in |
Returns:
nvtiffStatus_t - An error code as specified in Decode API Return Status Codes
nvtiffStreamGetGeoKey()¶
Retrieves the values associated with a given geo key stored in a TIFF file.
Signature:
nvtiffStatus_t nvtiffStreamGetGeoKey(nvtiffStream_t tiff_stream,
nvtiffGeoKey_t key,
void *val,
uint32_t count);
Parameters:
Parameter |
Input/Output |
Memory |
Description |
|---|---|---|---|
nvtiffStream_t tiff_stream |
Input |
Host |
tiff stream handle |
nvtiffGeoKey_t key |
Input |
Host |
geo key for which information is retrieved |
void *val |
Output |
Host |
Pointer to user allocated buffer for storing values associated with |
uint32_t count |
Input |
Host |
Number of values copied (for geo key of type |
Returns:
nvtiffStatus_t - An error code as specified in Decode API Return Status Codes
nvtiffStreamGetGeoKeyASCII()¶
Retrieves the values associated with geo key having ASCII values.
Signature:
nvtiffStatus_t NVTIFFAPI nvtiffStreamGetGeoKeyASCII(nvtiffStream_t tiff_stream,
nvtiffGeoKey_t key,
char* szStr,
uint32_t szStrMaxLen)
Parameters:
Parameter |
Input/Output |
Memory |
Description |
|---|---|---|---|
nvtiffStream_t tiff_stream |
Input |
Host |
tiff stream handle |
nvtiffGeoKey_t key |
Input |
Host |
geo key for which information is retrieved |
char *szStr |
Output |
Host |
Pointer to user allocated buffer containing key values |
uint32_t szStrMaxLen |
Input |
Host |
Size of the user allocated buffer |
Returns:
nvtiffStatus_t - An error code as specified in Decode API Return Status Codes
nvtiffStreamGetGeoKeySHORT()¶
Retrieves the values associated with geo key having SHORT values.
Signature:
nvtiffStatus_t NVTIFFAPI nvtiffStreamGetGeoKeySHORT(nvtiffStream_t tiff_stream,
nvtiffGeoKey_t key,
unsigned short *val,
uint32_t index,
uint32_t count)
Parameters:
Parameter |
Input/Output |
Memory |
Description |
|---|---|---|---|
nvtiffStream_t tiff_stream |
Input |
Host |
tiff stream handle |
nvtiffGeoKey_t key |
Input |
Host |
geo key for which information is retrieved |
unsigned short *val |
Output |
Host |
Pointer to user allocated buffer containing key values |
uint32_t count |
Input |
Host |
Number of values which are required to be copied to |
uint32_t index |
Input |
Host |
Index of the starting value to be copied to |
Returns:
nvtiffStatus_t - An error code as specified in Decode API Return Status Codes
nvtiffStreamGetGeoKeyDOUBLE()¶
Retrieves the values associated with geo key having DOUBLE values.
Signature:
nvtiffStatus_t NVTIFFAPI nvtiffStreamGetGeoKeyDOUBLE(nvtiffStream_t tiff_stream,
nvtiffGeoKey_t key,
double *val,
uint32_t index,
uint32_t count)
Parameters:
Parameter |
Input/Output |
Memory |
Description |
|---|---|---|---|
nvtiffStream_t tiff_stream |
Input |
Host |
tiff stream handle |
nvtiffGeoKey_t key |
Input |
Host |
geo key for which information is retrieved |
double *val |
Output |
Host |
Pointer to user allocated buffer containing key values |
uint32_t count |
Input |
Host |
Number of values which are required to be copied to |
uint32_t index |
Input |
Host |
Index of the starting value to be copied to |
Returns:
nvtiffStatus_t - An error code as specified in Decode API Return Status Codes