Get the type of a tag.
Copy Code
|
|
---|---|
AT_ERRCOUNT ACCUAPI IG_ISIS_tag_get_type( HISISDRV hDriver, AT_MODE nTag, LPAT_MODE lpnType ); |
Name | Type | Description |
---|---|---|
hDriver | HISISDRV | The handle to the driver. |
nTag | AT_MODE | Specifies the tag for which to return the type. |
lpnType | LPAT_MODE |
Points to the address which will contain the type of wTag after this function completes. lpnType is filled in with one of the following values:
The TIFF specification normally treats all values as unsigned. Note also that the types IG_ISIS_TAG_TYPE_BYTE, IG_ISIS_TAG_TYPE_SHORT, and IG_ISIS_TAG_TYPE_LONG are all accessed as longs in toolkit functions to reduce the total number of functions needed.
|
Returns the number of ImageGear errors that occurred during this function call. If there are no errors, the return value is IGE_SUCCESS.
This function does not process image pixels.
The IG_ISIS_tag_get_type function retrieves the type of the specified tag.
Use IG_ISIS_tag_get_type to determine the type of a tag before performing other functions such as IG_ISIS_tag_get_long, IG_ISIS_tag_get_long_default, etc., or IG_ISIS_choice_get_long, etc..
The following example returns a text string that indicates the type of a tag based on checking the tag inside a driver.
Copy Code
|
|
---|---|
char FAR *GetTagText (HISISDRV hDriver, AT_MODE nTag) { DWORD dwLength ; LONG lTemp ; WORD wTemp ; AT_ISIS_RAT ratValue ; char FAR *cpString ; if (IG_ISIS_tag_get_type (hDriver, nTag, &wTemp)) return NULL ; switch (wTemp) { case IG_ISIS_TAG_TYPE_STRING:IG_ISIS_tag_get_length (hDriver, nTag, &dwLength) ; if (NULL == (cpString = (char FAR *) malloc((ulLength + 1)))) return NULL ;IG_ISIS_tag_get_ascii (hDriver, nTag, dwLength, cpString) ; return cpString ; case IG_ISIS_TAG_TYPE_BYTE: case IG_ISIS_TAG_TYPE_SHORT: case IG_ISIS_TAG_TYPE_LONG: /* Return only first value. */ if (NULL == (cpString = (char FAR *) malloc(20))) return NULL ;IG_ISIS_tag_get_long (hDriver, nTag, 0, &lTemp) ; sprintf (cpString, "%d", lTemp, 0) ; return cpString ; case IG_ISIS_TAG_TYPE_RATIONAL: /* Return only first value. */ if (NULL == (cpString = (char FAR *) malloc(20))) return NULL ;IG_ISIS_tag_get_long (hDriver, nTag, 0, &ratValue) ; lTemp = (LONG) (ratValue.Num / ratValue.Denom) ; sprintf (cpString, "%d", lTemp, 0) ; return cpString ; default: return NULL ; } } |
IG_ISIS_tag_get_length_default
IG_ISIS_tag_get_rational_default