| 1 | /********************************************************************** |
| 2 | * |
| 3 | * geo_tiffp.h - Private interface for TIFF tag parsing. |
| 4 | * |
| 5 | * Written by: Niles D. Ritter |
| 6 | * |
| 7 | * This interface file encapsulates the interface to external TIFF |
| 8 | * file-io routines and definitions. The current configuration |
| 9 | * assumes that the "libtiff" module is used, but if you have your |
| 10 | * own TIFF reader, you may replace the definitions with your own |
| 11 | * here, and replace the implementations in geo_tiffp.c. No other |
| 12 | * modules have any explicit dependence on external TIFF modules. |
| 13 | * |
| 14 | * copyright (c) 1995 Niles D. Ritter |
| 15 | * |
| 16 | * Permission granted to use this software, so long as this copyright |
| 17 | * notice accompanies any products derived therefrom. |
| 18 | **********************************************************************/ |
| 19 | |
| 20 | #ifndef LIBGEOTIFF_GEO_TIFFP_H_ |
| 21 | #define LIBGEOTIFF_GEO_TIFFP_H_ |
| 22 | |
| 23 | /********************************************************************** |
| 24 | * |
| 25 | * Private includes |
| 26 | * |
| 27 | * If you are not using libtiff and XTIFF, replace this include file |
| 28 | * with the appropriate one for your own TIFF parsing routines. |
| 29 | * |
| 30 | **********************************************************************/ |
| 31 | |
| 32 | #include "geotiff.h" |
| 33 | #include "xtiffio.h" |
| 34 | #include "cpl_serv.h" |
| 35 | |
| 36 | /* |
| 37 | * dblparam_t is the type that a double precision |
| 38 | * floating point value will have on the parameter |
| 39 | * stack (when coerced by the compiler). You shouldn't |
| 40 | * have to change this. |
| 41 | */ |
| 42 | #ifdef applec |
| 43 | typedef extended dblparam_t; |
| 44 | #else |
| 45 | typedef double dblparam_t; |
| 46 | #endif |
| 47 | |
| 48 | |
| 49 | /********************************************************************** |
| 50 | * |
| 51 | * Private defines |
| 52 | * |
| 53 | * If you are not using "libtiff"/LIBXTIFF, replace these definitions |
| 54 | * with the appropriate definitions to access the geo-tags |
| 55 | * |
| 56 | **********************************************************************/ |
| 57 | |
| 58 | typedef unsigned short pinfo_t; /* SHORT ProjectionInfo tag type */ |
| 59 | typedef TIFF tiff_t; /* TIFF file descriptor */ |
| 60 | typedef tdata_t gdata_t; /* pointer to data */ |
| 61 | typedef tsize_t gsize_t; /* data allocation size */ |
| 62 | |
| 63 | #define GTIFF_GEOKEYDIRECTORY TIFFTAG_GEOKEYDIRECTORY /* from xtiffio.h */ |
| 64 | #define GTIFF_DOUBLEPARAMS TIFFTAG_GEODOUBLEPARAMS |
| 65 | #define GTIFF_ASCIIPARAMS TIFFTAG_GEOASCIIPARAMS |
| 66 | #define GTIFF_PIXELSCALE TIFFTAG_GEOPIXELSCALE |
| 67 | #define GTIFF_TRANSMATRIX TIFFTAG_GEOTRANSMATRIX |
| 68 | #define GTIFF_INTERGRAPH_MATRIX TIFFTAG_INTERGRAPH_MATRIX |
| 69 | #define GTIFF_TIEPOINTS TIFFTAG_GEOTIEPOINTS |
| 70 | #define GTIFF_LOCAL 0 |
| 71 | |
| 72 | #if defined(__cplusplus) |
| 73 | extern "C" { |
| 74 | #endif |
| 75 | |
| 76 | /* |
| 77 | * Method function pointer types |
| 78 | */ |
| 79 | typedef int (*GTGetFunction) (tiff_t *tif, pinfo_t tag, int *count, void *value ); |
| 80 | typedef int (*GTSetFunction) (tiff_t *tif, pinfo_t tag, int count, void *value ); |
| 81 | typedef tagtype_t (*GTTypeFunction) (tiff_t *tif, pinfo_t tag); |
| 82 | typedef struct _TIFFMethod { |
| 83 | GTGetFunction get; |
| 84 | GTSetFunction set; |
| 85 | GTTypeFunction type; |
| 86 | } TIFFMethod_t; |
| 87 | |
| 88 | /********************************************************************** |
| 89 | * |
| 90 | * Protected Function Declarations |
| 91 | * |
| 92 | * These routines are exposed implementations, and should not |
| 93 | * be used by external GEOTIFF client programs. |
| 94 | * |
| 95 | **********************************************************************/ |
| 96 | |
| 97 | extern gsize_t _gtiff_size[]; /* TIFF data sizes */ |
| 98 | extern void GTIF_DLL _GTIFSetDefaultTIFF(TIFFMethod *method); |
| 99 | extern gdata_t GTIF_DLL _GTIFcalloc(gsize_t); |
| 100 | extern gdata_t GTIF_DLL _GTIFrealloc(gdata_t,gsize_t); |
| 101 | extern void GTIF_DLL _GTIFFree(gdata_t data); |
| 102 | extern void GTIF_DLL _GTIFmemcpy(gdata_t out,gdata_t in,gsize_t size); |
| 103 | |
| 104 | #if defined(__cplusplus) |
| 105 | } |
| 106 | #endif |
| 107 | |
| 108 | |
| 109 | #endif /* LIBGEOTIFF_GEO_TIFFP_H_ */ |