geotiff.h

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

Generated on Tue Jul 24 14:49:47 2007 for libgeotiff by  doxygen 1.5.1