| 1 |
|
| 2 |
|
| 3 |
|
| 4 |
|
| 5 |
|
| 6 |
|
| 7 |
|
| 8 |
|
| 9 |
|
| 10 |
|
| 11 |
|
| 12 |
|
| 13 |
#ifndef LIBGEOTIFF_GEO_KEYP_H_ |
| 14 |
#define LIBGEOTIFF_GEO_KEYP_H_ |
| 15 |
|
| 16 |
#include <stdlib.h> |
| 17 |
|
| 18 |
#include "proj.h" |
| 19 |
|
| 20 |
|
| 21 |
|
| 22 |
|
| 23 |
|
| 24 |
struct GeoKey { |
| 25 |
int gk_key; |
| 26 |
size_t gk_size; |
| 27 |
tagtype_t gk_type; |
| 28 |
long gk_count; |
| 29 |
char* gk_data; |
| 30 |
}; |
| 31 |
typedef struct GeoKey GeoKey; |
| 32 |
|
| 33 |
|
| 34 |
|
| 35 |
|
| 36 |
|
| 37 |
|
| 38 |
struct KeyEntry { |
| 39 |
pinfo_t ent_key; |
| 40 |
pinfo_t ent_location; |
| 41 |
pinfo_t ent_count; |
| 42 |
pinfo_t ent_val_offset; |
| 43 |
}; |
| 44 |
typedef struct KeyEntry KeyEntry; |
| 45 |
|
| 46 |
|
| 47 |
|
| 48 |
|
| 49 |
|
| 50 |
|
| 51 |
|
| 52 |
|
| 53 |
struct KeyHeader{ |
| 54 |
pinfo_t hdr_version; |
| 55 |
pinfo_t hdr_rev_major; |
| 56 |
pinfo_t hdr_rev_minor; |
| 57 |
pinfo_t hdr_num_keys; |
| 58 |
}; |
| 59 |
typedef struct KeyHeader KeyHeader; |
| 60 |
|
| 61 |
|
| 62 |
|
| 63 |
|
| 64 |
|
| 65 |
struct TempKeyData { |
| 66 |
char *tk_asciiParams; |
| 67 |
int tk_asciiParamsLength; |
| 68 |
int tk_asciiParamsOffset; |
| 69 |
}; |
| 70 |
typedef struct TempKeyData TempKeyData; |
| 71 |
|
| 72 |
struct gtiff; |
| 73 |
|
| 74 |
#ifndef GTIF_PRINT_FUNC_FORMAT |
| 75 |
#if defined(__GNUC__) && __GNUC__ >= 3 |
| 76 |
#define GTIF_PRINT_FUNC_FORMAT( format_idx, arg_idx ) __attribute__((__format__ (__printf__, format_idx, arg_idx))) |
| 77 |
#else |
| 78 |
#define GTIF_PRINT_FUNC_FORMAT( format_idx, arg_idx ) |
| 79 |
#endif |
| 80 |
#endif |
| 81 |
|
| 82 |
#ifndef GTERRORCALLBACK_DEFINED |
| 83 |
#define GTERRORCALLBACK_DEFINED |
| 84 |
|
| 85 |
typedef void (*GTErrorCallback) (struct gtiff*, |
| 86 |
int level, |
| 87 |
const char* msg, ...) GTIF_PRINT_FUNC_FORMAT(3,4); |
| 88 |
#endif |
| 89 |
|
| 90 |
struct gtiff { |
| 91 |
tiff_t* gt_tif; |
| 92 |
struct _TIFFMethod gt_methods; |
| 93 |
int gt_flags; |
| 94 |
|
| 95 |
pinfo_t gt_version; |
| 96 |
pinfo_t gt_rev_major; |
| 97 |
pinfo_t gt_rev_minor; |
| 98 |
|
| 99 |
int gt_num_keys; |
| 100 |
GeoKey* gt_keys; |
| 101 |
int* gt_keyindex; |
| 102 |
int gt_keymin; |
| 103 |
int gt_keymax; |
| 104 |
|
| 105 |
pinfo_t* gt_short; |
| 106 |
double* gt_double; |
| 107 |
int gt_nshorts; |
| 108 |
int gt_ndoubles; |
| 109 |
|
| 110 |
GTErrorCallback gt_error_callback; |
| 111 |
void* gt_user_data; |
| 112 |
|
| 113 |
PJ_CONTEXT *pj_context; |
| 114 |
int own_pj_context; |
| 115 |
|
| 116 |
char szTmpBufferForGTIFValueNameEx[160]; |
| 117 |
}; |
| 118 |
|
| 119 |
typedef enum { |
| 120 |
FLAG_FILE_OPEN=1, |
| 121 |
FLAG_FILE_MODIFIED=2 |
| 122 |
} gtiff_flags; |
| 123 |
|
| 124 |
#define MAX_KEYINDEX 65535 |
| 125 |
#define MAX_KEYS 100 |
| 126 |
#define MAX_VALUES 1000 |
| 127 |
|
| 128 |
#endif |