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  *   Revision History
31  *
32  *      19 September 1995   ndr    Demoted Intergraph trans matrix.
33  *
34  **********************************************************************/
35 
36 #include "geotiff.h"
37 #include "xtiffio.h"
38 #include "cpl_serv.h"
39 
40 /*
41  * dblparam_t is the type that a double precision
42  * floating point value will have on the parameter
43  * stack (when coerced by the compiler). You shouldn't
44  * have to change this.
45  */
46 #ifdef applec
47 typedef extended dblparam_t;
48 #else
49 typedef double dblparam_t;
50 #endif
51 
52 
53 /**********************************************************************
54  *
55  *                        Private defines
56  *
57  *   If you are not using "libtiff"/LIBXTIFF, replace these definitions
58  *   with the appropriate definitions to access the geo-tags
59  *
60  **********************************************************************/
61 
62 typedef unsigned short pinfo_t;    /* SHORT ProjectionInfo tag type */
63 typedef TIFF    tiff_t;            /* TIFF file descriptor          */
64 typedef tdata_t  gdata_t;          /* pointer to data */
65 typedef tsize_t  gsize_t;          /* data allocation size */
66 
67 #define GTIFF_GEOKEYDIRECTORY   TIFFTAG_GEOKEYDIRECTORY /* from xtiffio.h */
68 #define GTIFF_DOUBLEPARAMS      TIFFTAG_GEODOUBLEPARAMS
69 #define GTIFF_ASCIIPARAMS       TIFFTAG_GEOASCIIPARAMS
70 #define GTIFF_PIXELSCALE        TIFFTAG_GEOPIXELSCALE
71 #define GTIFF_TRANSMATRIX       TIFFTAG_GEOTRANSMATRIX
72 #define GTIFF_INTERGRAPH_MATRIX TIFFTAG_INTERGRAPH_MATRIX
73 #define GTIFF_TIEPOINTS         TIFFTAG_GEOTIEPOINTS
74 #define GTIFF_LOCAL          0
75 
76 #if defined(__cplusplus)
77 extern "C" {
78 #endif
79 
80 /*
81  * Method function pointer types
82  */
83 typedef int        (*GTGetFunction) (tiff_t *tif, pinfo_t tag, int *count, void *value );
84 typedef int        (*GTSetFunction) (tiff_t *tif, pinfo_t tag, int  count, void *value );
85 typedef tagtype_t  (*GTTypeFunction) (tiff_t *tif, pinfo_t tag);
86 typedef struct     _TIFFMethod {
87 	GTGetFunction get;
88 	GTSetFunction set;
89 	GTTypeFunction type;
90 } TIFFMethod_t;
91 
92 /**********************************************************************
93  *
94  *               Protected Function Declarations
95  *
96  *   These routines are exposed implementations, and should not
97  *   be used by external GEOTIFF client programs.
98  *
99  **********************************************************************/
100 
101 extern gsize_t _gtiff_size[]; /* TIFF data sizes */
102 extern void GTIF_DLL _GTIFSetDefaultTIFF(TIFFMethod *method);
103 extern gdata_t GTIF_DLL _GTIFcalloc(gsize_t);
104 extern gdata_t GTIF_DLL _GTIFrealloc(gdata_t,gsize_t);
105 extern void GTIF_DLL _GTIFFree(gdata_t data);
106 extern void GTIF_DLL _GTIFmemcpy(gdata_t out,gdata_t in,gsize_t size);
107 
108 #if defined(__cplusplus)
109 }
110 #endif
111 
112 
113 #endif /* LIBGEOTIFF_GEO_TIFFP_H_ */
114