- Main Page
- Related Pages
- Classes
- Files

- File List
- File Members

# geotiff.h

Go to the documentation of this file.

    00001 /**********************************************************************
    00002  *
    00003  *  geotiff.h - Public interface for Geotiff tag parsing.
    00004  *
    00005  *   Written By: Niles D. Ritter
    00006  *
    00007  *  copyright (c) 1995   Niles D. Ritter
    00008  *
    00009  *  Permission granted to use this software, so long as this copyright
    00010  *  notice accompanies any products derived therefrom.
    00011  **********************************************************************/
    00012
    00013 #ifndef __geotiff_h_
    00014 #define __geotiff_h_
    00015
    00027 /* This Version code should only change if a drastic
    00028  * alteration is made to the GeoTIFF key structure. Readers
    00029  * encountering a larger value should give up gracefully.
    00030  */
    00031 #define GvCurrentVersion   1
    00032
    00033 #define LIBGEOTIFF_VERSION 1400
    00034
    00035 #include "geo_config.h"
    00036 #include "geokeys.h"
    00037
    00038 /**********************************************************************
    00039  * Do we want to build as a DLL on windows?
    00040  **********************************************************************/
    00041 #if !defined(CPL_DLL)
    00042 #  if defined(_WIN32) && defined(BUILD_AS_DLL)
    00043 #    define CPL_DLL     __declspec(dllexport)
    00044 #  else
    00045 #    define CPL_DLL
    00046 #  endif
    00047 #endif
    00048
    00049 /**********************************************************************
    00050  *
    00051  *                 Public Structures & Definitions
    00052  *
    00053  **********************************************************************/
    00054
    00055 #if defined(__cplusplus)
    00056 extern "C" {
    00057 #endif
    00058
    00059 typedef struct gtiff GTIF;   /* struct gtiff is private */
    00060 typedef struct _TIFFMethod TIFFMethod;
    00061 typedef unsigned short tifftag_t;
    00062 typedef unsigned short geocode_t;
    00063 typedef int (*GTIFPrintMethod)(char *string, void *aux);
    00064 typedef int (*GTIFReadMethod)(char *string, void *aux);
    00065
    00066 typedef enum {
    00067    TYPE_BYTE=1,
    00068    TYPE_SHORT=2,
    00069    TYPE_LONG=3,
    00070    TYPE_RATIONAL=4,
    00071    TYPE_ASCII=5,
    00072    TYPE_FLOAT=6,
    00073    TYPE_DOUBLE=7,
    00074    TYPE_SBYTE=8,
    00075    TYPE_SSHORT=9,
    00076    TYPE_SLONG=10,
    00077    TYPE_UNKNOWN=11
    00078 } tagtype_t;
    00079
    00080
    00081 /**********************************************************************
    00082  *
    00083  *                 Public Function Declarations
    00084  *
    00085  **********************************************************************/
    00086
    00087 /* TIFF-level interface */
    00088 GTIF CPL_DLL *GTIFNew(void *tif);
    00089 GTIF CPL_DLL *GTIFNewSimpleTags(void *tif);
    00090 GTIF CPL_DLL *GTIFNewWithMethods(void *tif, TIFFMethod*);
    00091 void CPL_DLL  GTIFFree(GTIF *gtif);
    00092 int  CPL_DLL  GTIFWriteKeys(GTIF *gtif);
    00093 void CPL_DLL  GTIFDirectoryInfo(GTIF *gtif, int *versions, int *keycount);
    00094
    00095 /* GeoKey Access */
    00096 int  CPL_DLL  GTIFKeyInfo(GTIF *gtif, geokey_t key, int *size, tagtype_t* type);
    00097 int  CPL_DLL  GTIFKeyGet(GTIF *gtif, geokey_t key, void *val, int index,
    00098                          int count);
    00099 int  CPL_DLL  GTIFKeySet(GTIF *gtif, geokey_t keyID, tagtype_t type,
    00100                          int count,...);
    00101
    00102 /* Metadata Import-Export utilities */
    00103 void  CPL_DLL  GTIFPrint(GTIF *gtif, GTIFPrintMethod print, void *aux);
    00104 int   CPL_DLL  GTIFImport(GTIF *gtif, GTIFReadMethod scan, void *aux);
    00105 char  CPL_DLL *GTIFKeyName(geokey_t key);
    00106 char  CPL_DLL *GTIFValueName(geokey_t key,int value);
    00107 char  CPL_DLL *GTIFTypeName(tagtype_t type);
    00108 char  CPL_DLL *GTIFTagName(int tag);
    00109 int   CPL_DLL  GTIFKeyCode(char * key);
    00110 int   CPL_DLL  GTIFValueCode(geokey_t key,char *value);
    00111 int   CPL_DLL  GTIFTypeCode(char *type);
    00112 int   CPL_DLL  GTIFTagCode(char *tag);
    00113
    00114 /* Translation between image/PCS space */
    00115
    00116 int CPL_DLL    GTIFImageToPCS( GTIF *gtif, double *x, double *y );
    00117 int CPL_DLL    GTIFPCSToImage( GTIF *gtif, double *x, double *y );
    00118
    00119 #if defined(__cplusplus)
    00120 }
    00121 #endif
    00122
    00123 #endif /* __geotiff_h_ */