root / tags / v1_0_2_Build_908 / libraries / libjni-ecw / include / NCSECWClient.h @ 11054
History | View | Annotate | Download (33 KB)
1 | 3538 | nacho | /**********************************************************
|
---|---|---|---|
2 | ** Copyright 1999 Earth Resource Mapping Ltd.
|
||
3 | ** This document contains proprietary source code of
|
||
4 | ** Earth Resource Mapping Ltd, and can only be used under
|
||
5 | ** one of the three licenses as described in the
|
||
6 | ** license.txt file supplied with this distribution.
|
||
7 | ** See separate license.txt file for license details
|
||
8 | ** and conditions.
|
||
9 | **
|
||
10 | ** This software is covered by US patent #6,442,298,
|
||
11 | ** #6,102,897 and #6,633,688. Rights to use these patents
|
||
12 | ** is included in the license agreements.
|
||
13 | **
|
||
14 | ** FILE: NCSECWClient.wc
|
||
15 | ** CREATED: 08 May 1999
|
||
16 | ** AUTHOR: TIS
|
||
17 | ** PURPOSE: Public Client Interface library to Image Web Server ECW image decompression library
|
||
18 | ** EDITS:
|
||
19 | ** [01] tis 01-May-99 Created file
|
||
20 | ** [02] sjc 09-Jul-99 added SetFileViewEx() call.
|
||
21 | ** [03] sjc 30-Sep-99 added NCScbmCloseFileViewEx() call.
|
||
22 | ** [04] sjc 26-Oct-00 Added NCSecwSetIOCallbacks()
|
||
23 | ** [05] ddi 14-Nov-00 Added NCScbmReadViewLineIEEE4() and NCScbmReadViewLineUINT16()
|
||
24 | ** [06] sjc 22-Jan-02 New config get/set routines and enum
|
||
25 | ** [07] sjc 04-Feb-02 Added MAXOPEN
|
||
26 | ** [08] sjc 20-Feb-02 Added a bunch of tuneable parameters
|
||
27 | ** [09] sjc 30-Apr-03 Added low-mem compression config option
|
||
28 | ** [10] rar 02-Sep-03 Added option to try ecwp re-connection if connection lost
|
||
29 | ** [11] tfl 02-Jul-04 Moved declaration of NCSEcwCellType from here to NCSTypes.h
|
||
30 | ** [12] tfl 05-Jul-04 Added #define of allowed JPEG2000 file extensions
|
||
31 | ** [13] tfl 06-Jan-05 Added and fixed C exports of GDT related functions
|
||
32 | **
|
||
33 | ** NOTES
|
||
34 | **
|
||
35 | ** (1) This file must be kept in synch with NCSECW.H
|
||
36 | **
|
||
37 | **
|
||
38 | ********************************************************/
|
||
39 | |||
40 | /** @file NCSECWClient.h */
|
||
41 | |||
42 | #ifndef NCSECWCLIENT_H
|
||
43 | #define NCSECWCLIENT_H
|
||
44 | |||
45 | #ifndef NCSDEFS_H
|
||
46 | #include "NCSDefs.h" |
||
47 | #endif
|
||
48 | #ifndef NCSERRORS_H
|
||
49 | #include "NCSErrors.h" |
||
50 | #endif
|
||
51 | |||
52 | #ifdef __cplusplus
|
||
53 | extern "C" { |
||
54 | #endif
|
||
55 | |||
56 | /**
|
||
57 | * @enum
|
||
58 | * Enumerated type for the return status from read line routines.
|
||
59 | * The application should treat CANCELLED operations as non-fatal,
|
||
60 | * in that they most likely mean this view read was cancelled for
|
||
61 | * performance reasons.
|
||
62 | */
|
||
63 | typedef enum { |
||
64 | /** Successful read */
|
||
65 | NCSECW_READ_OK = 0,
|
||
66 | /** Read failed due to an error */
|
||
67 | NCSECW_READ_FAILED = 1,
|
||
68 | /** Read was cancelled, either because a new SetView arrived or a
|
||
69 | library shutdown is in progress */
|
||
70 | NCSECW_READ_CANCELLED = 2
|
||
71 | } NCSEcwReadStatus; |
||
72 | |||
73 | /**
|
||
74 | * @enum
|
||
75 | * Enumerated type for the cell sizes supported by the SDK.
|
||
76 | */
|
||
77 | typedef enum { |
||
78 | /** Invalid cell units */
|
||
79 | ECW_CELL_UNITS_INVALID = 0,
|
||
80 | /** Cell units are standard meters */
|
||
81 | ECW_CELL_UNITS_METERS = 1,
|
||
82 | /** Degrees */
|
||
83 | ECW_CELL_UNITS_DEGREES = 2,
|
||
84 | /** US Survey feet */
|
||
85 | ECW_CELL_UNITS_FEET = 3,
|
||
86 | /** Unknown cell units */
|
||
87 | ECW_CELL_UNITS_UNKNOWN = 4
|
||
88 | } CellSizeUnits; |
||
89 | |||
90 | /*[11] NCSEcwCellType declaration moved to NCSTypes.h */
|
||
91 | |||
92 | /**
|
||
93 | * @enum
|
||
94 | * Enumerated type for file types supported by the SDK.
|
||
95 | */
|
||
96 | typedef enum { |
||
97 | /** Unknown file type or no file open */
|
||
98 | NCS_FILE_UNKNOWN = 0,
|
||
99 | /** The file is an ECW */
|
||
100 | NCS_FILE_ECW = 1,
|
||
101 | /** The file is a Jpeg 2000 File */
|
||
102 | NCS_FILE_JP2 = 2,
|
||
103 | } NCSFileType; |
||
104 | |||
105 | |||
106 | /**
|
||
107 | * @enum
|
||
108 | * Enumerated type for all the possible argument types
|
||
109 | * for the SDK configuration function NCSEcwSetConfig
|
||
110 | */
|
||
111 | typedef enum { |
||
112 | /** BOOLEAN value, whether to texture image */
|
||
113 | NCSCFG_TEXTURE_DITHER = 0,
|
||
114 | /** BOOLEAN value, whether to reopen file for each view opened */
|
||
115 | NCSCFG_FORCE_FILE_REOPEN = 1,
|
||
116 | /** UINT32 value, target maximum memory cache size */
|
||
117 | NCSCFG_CACHE_MAXMEM = 2,
|
||
118 | /** UINT32 value, target maximum number of files to have open to use for cache */ /*[07]*/ |
||
119 | NCSCFG_CACHE_MAXOPEN = 3,
|
||
120 | /** NCSTimeStampMs value, time an ecwp:// blocking read will wait before returning - default 10000 ms */ /*[08]*/ |
||
121 | NCSCFG_BLOCKING_TIME_MS = 4,
|
||
122 | /** NCSTimeStampMs value, time delay between blocks arriving and the next refresh callback - default 500 ms */
|
||
123 | NCSCFG_REFRESH_TIME_MS = 5,
|
||
124 | /** NCSTimeStampMs value, minimum time delay between last cache purge and the next one - default 1000 ms */ /*[08]*/ |
||
125 | NCSCFG_PURGE_DELAY_MS = 6,
|
||
126 | /** NCSTimeStampMs value, time delay between last view closing and file being purged from cache - default 1800000ms */ /*[08]*/ |
||
127 | NCSCFG_FILE_PURGE_DELAY_MS = 7,
|
||
128 | /** NCSTimeStampMs value, minimum time delay between last view closing and file being purged from cache - default 30000 ms */ /*[08]*/ |
||
129 | NCSCFG_MIN_FILE_PURGE_DELAY_MS = 8,
|
||
130 | /** (char *) value, "server" name of ECWP proxy server */
|
||
131 | NCSCFG_ECWP_PROXY = 9,
|
||
132 | /** BOOLEAN value, whether to force a low-memory compression */ /*[09]*/ |
||
133 | NCSCFG_FORCE_LOWMEM_COMPRESS = 10,
|
||
134 | /** BOOLEAN value, whether to try to reconnect if ECWP connection is lost */ /*[10]*/ |
||
135 | NCSCFG_TRY_ECWP_RECONNECT = 11,
|
||
136 | /** BOOLEAN value, whether to manage ICC profiles on file read */
|
||
137 | NCSCFG_JP2_MANAGE_ICC = 12,
|
||
138 | /** UINT32 value, number of cahce bytes to use for JP2 file I/O caching - default 2^15 == 32768 */
|
||
139 | NCSCFG_JP2_FILEIO_CACHE_MAXMEM = 13
|
||
140 | } NCSEcwConfigType; /*[06]*/
|
||
141 | |||
142 | /**
|
||
143 | * @enum
|
||
144 | * Enumerated type to describe the usage and precedence of geographic metadata in conjunction with JPEG 2000.
|
||
145 | */
|
||
146 | typedef enum { |
||
147 | /** Do not use geodata */
|
||
148 | JP2_GEODATA_USE_NONE = 0, //000000000 |
||
149 | /** Use GeoTIFF UUID box metadata only */
|
||
150 | JP2_GEODATA_USE_PCS_ONLY = 1, //000000001 |
||
151 | /** Use GML header box metadata only */
|
||
152 | JP2_GEODATA_USE_GML_ONLY = 2, //000000010 |
||
153 | /** Use world files only */
|
||
154 | JP2_GEODATA_USE_WLD_ONLY = 4, //000000100 |
||
155 | /** Use the GML box then the GeoTIFF box */
|
||
156 | JP2_GEODATA_USE_GML_PCS = 10, //000001010 |
||
157 | /** Use the world file then the GeoTIFF box */
|
||
158 | JP2_GEODATA_USE_WLD_PCS = 12, //000001100 |
||
159 | /** Use the GeoTIFF box then the GML box */
|
||
160 | JP2_GEODATA_USE_PCS_GML = 17, //000010001 |
||
161 | /** Use the world file then the GML box */
|
||
162 | JP2_GEODATA_USE_WLD_GML = 20, //000010100 |
||
163 | /** Use the GeoTIFF box then the world file */
|
||
164 | JP2_GEODATA_USE_PCS_WLD = 33, //000100001 |
||
165 | /** Use the GML box then the world file */
|
||
166 | JP2_GEODATA_USE_GML_WLD = 34, //000100010 |
||
167 | /** Use the world file, then the GML box, then the GeoTIFF box */
|
||
168 | JP2_GEODATA_USE_WLD_GML_PCS = 84, //001010100 |
||
169 | /** Use the GML box, then the world file, then the GeoTIFF box */
|
||
170 | JP2_GEODATA_USE_GML_WLD_PCS = 98, //001100010 |
||
171 | /** Use the world file, then the GeoTIFF box, then the GML box */
|
||
172 | JP2_GEODATA_USE_WLD_PCS_GML = 140, //010001100 |
||
173 | /** Use the GeoTIFF box, then the world file, then the GML box */
|
||
174 | JP2_GEODATA_USE_PCS_WLD_GML = 161, //010100001 |
||
175 | /** Use the GML box, then the GeoTIFF box, then the world file */
|
||
176 | JP2_GEODATA_USE_GML_PCS_WLD = 266, //100001010 |
||
177 | /** Use the GeoTIFF box, then the GML box, then the world file */
|
||
178 | JP2_GEODATA_USE_PCS_GML_WLD = 273 //100010001 |
||
179 | } GeodataUsage; |
||
180 | |||
181 | /**
|
||
182 | * @struct
|
||
183 | * Structure containing file metadata for the ECW interface.
|
||
184 | * SDK method NCScbmGetViewFileInfo returns a pointer to this file info structure for a view
|
||
185 | */
|
||
186 | typedef struct { |
||
187 | /** Dataset cells in X direction */
|
||
188 | UINT32 nSizeX; |
||
189 | /** Dataset cells in Y direction */
|
||
190 | UINT32 nSizeY; |
||
191 | /** Number of bands in the file, e.g. 3 for a RGB file */
|
||
192 | UINT16 nBands; |
||
193 | /** Target compression rate, e,g, 20 == 20:1 compression. May be zero */
|
||
194 | UINT16 nCompressionRate; |
||
195 | /** Units used for pixel size */
|
||
196 | CellSizeUnits eCellSizeUnits; |
||
197 | /** Increment in eCellSizeUnits in X direction. May be negative. Never zero */
|
||
198 | IEEE8 fCellIncrementX; |
||
199 | /** Increment in eCellSizeUnits in Y direction. May be negative. Never zero */
|
||
200 | IEEE8 fCellIncrementY; |
||
201 | /** World X origin for top left corner of top left cell, in eCellSizeUnits */
|
||
202 | IEEE8 fOriginX; |
||
203 | /** World Y origin for top left corner of top left cell, in eCellSizeUnits */
|
||
204 | IEEE8 fOriginY; |
||
205 | /** ER Mapper style Datum name string, e.g. "RAW" or "NAD27". Never NULL */
|
||
206 | char *szDatum;
|
||
207 | /** ER Mapper style Projection name string, e.g. "RAW" or "GEODETIC". Never NULL */
|
||
208 | char *szProjection;
|
||
209 | } NCSFileViewFileInfo; |
||
210 | |||
211 | /**
|
||
212 | * @struct
|
||
213 | * Struct containing metadata for a specific band in the file.
|
||
214 | */
|
||
215 | typedef struct { |
||
216 | /** Bit depth used in band, including sign bit */
|
||
217 | UINT8 nBits; |
||
218 | /** Whether band data is signed */
|
||
219 | BOOLEAN bSigned; |
||
220 | /** ASCII description of band, e.g. "Red" or "Band1" */
|
||
221 | char *szDesc;
|
||
222 | } NCSFileBandInfo; |
||
223 | |||
224 | /**
|
||
225 | * @defgroup banddescs
|
||
226 | * These are the allowable ASCII descriptions in the current implementation.
|
||
227 | * @{
|
||
228 | */
|
||
229 | /** @def */
|
||
230 | #define NCS_BANDDESC_Red "Red" |
||
231 | /** @def */
|
||
232 | #define NCS_BANDDESC_Green "Green" |
||
233 | /** @def */
|
||
234 | #define NCS_BANDDESC_Blue "Blue" |
||
235 | /** @def */
|
||
236 | #define NCS_BANDDESC_All "All" |
||
237 | /** @def */
|
||
238 | #define NCS_BANDDESC_RedOpacity "RedOpacity" |
||
239 | /** @def */
|
||
240 | #define NCS_BANDDESC_GreenOpacity "GreenOpacity" |
||
241 | /** @def */
|
||
242 | #define NCS_BANDDESC_BlueOpacity "BlueOpacity" |
||
243 | /** @def */
|
||
244 | #define NCS_BANDDESC_AllOpacity "AllOpacity" |
||
245 | /** @def */
|
||
246 | #define NCS_BANDDESC_RedOpacityPremultiplied "RedOpacityPremultiplied" |
||
247 | /** @def */
|
||
248 | #define NCS_BANDDESC_GreenOpacityPremultiplied "GreenOpacityPremultiplied" |
||
249 | /** @def */
|
||
250 | #define NCS_BANDDESC_BlueOpacityPremultiplied "BlueOpacityPremultiplied" |
||
251 | /** @def */
|
||
252 | #define NCS_BANDDESC_AllOpacityPremultiplied "AllOpacityPremultiplied" |
||
253 | /** @def */
|
||
254 | #define NCS_BANDDESC_Greyscale "Grayscale" |
||
255 | /** @def */
|
||
256 | #define NCS_BANDDESC_GreyscaleOpacity "GrayscaleOpacity" |
||
257 | /** @def */
|
||
258 | #define NCS_BANDDESC_GreyscaleOpacityPremultiplied "GrayscaleOpacityPremultiplied" |
||
259 | /** @def */
|
||
260 | #define NCS_BANDDESC_Band "Band #%d" |
||
261 | /*@}*/
|
||
262 | |||
263 | /**
|
||
264 | * @enum
|
||
265 | * The color space used by a compressed file.
|
||
266 | * For compatibility with ECW, these values cannot be changed or reordered.
|
||
267 | */
|
||
268 | typedef enum { |
||
269 | /** No color space */
|
||
270 | NCSCS_NONE = 0,
|
||
271 | /** Greyscale image */
|
||
272 | NCSCS_GREYSCALE = 1, // Greyscale |
||
273 | /** Luminance-chrominance color space */
|
||
274 | NCSCS_YUV = 2, // YUV - JPEG Digital, JP2 ICT |
||
275 | /** Multiband image */
|
||
276 | NCSCS_MULTIBAND = 3, // Multi-band imagery |
||
277 | /** sRGB color space */
|
||
278 | NCSCS_sRGB = 4, // sRGB |
||
279 | /** Modified luminance-chrominance color space */
|
||
280 | NCSCS_YCbCr = 5 // YCbCr - JP2 ONLY, Auto-converted to sRGB |
||
281 | } NCSFileColorSpace; |
||
282 | |||
283 | /**
|
||
284 | * @struct
|
||
285 | * Extended file metadata structure for the JPEG 2000 interface.
|
||
286 | * This structure is derived from a compressed JPEG 2000 file.
|
||
287 | * It is important to note that the information contained within it
|
||
288 | * is informative, not normative. For example, although the file may
|
||
289 | * contain metadata that indicates the image it contains is to be rotated,
|
||
290 | * the SDK will not rotate that image itself.
|
||
291 | * The SDK function NCScbmGetViewFileInfoEx() returns a pointer to this
|
||
292 | * file info structure for a given view.
|
||
293 | */
|
||
294 | typedef struct { |
||
295 | /** Dataset cells in X direction */
|
||
296 | UINT32 nSizeX; |
||
297 | /** Dataset cells in X direction */
|
||
298 | UINT32 nSizeY; |
||
299 | /** Number of bands in the file, e.g. 3 for a RGB file */
|
||
300 | UINT16 nBands; |
||
301 | /** Target compression rate, e,g, 20 == 20:1 compression. May be zero */
|
||
302 | UINT16 nCompressionRate; |
||
303 | /** Units used for pixel size */
|
||
304 | CellSizeUnits eCellSizeUnits; |
||
305 | /** Increment in eCellSizeUnits in X direction. May be negative. Never zero */
|
||
306 | IEEE8 fCellIncrementX; |
||
307 | /** Increment in eCellSizeUnits in Y direction. May be negative. Never zero */
|
||
308 | IEEE8 fCellIncrementY; |
||
309 | /** World X origin for top left corner of top left cell, in eCellSizeUnits */
|
||
310 | IEEE8 fOriginX; |
||
311 | /** World Y origin for top left corner of top left cell, in eCellSizeUnits */
|
||
312 | IEEE8 fOriginY; |
||
313 | /** ER Mapper style Datum name string, e.g. "RAW" or "NAD27". Never NULL */
|
||
314 | char *szDatum;
|
||
315 | /** ER Mapper style Projection name string, e.g. "RAW" or "GEODETIC". Never NULL */
|
||
316 | char *szProjection;
|
||
317 | /** Clockwise rotation of image in degrees */
|
||
318 | IEEE8 fCWRotationDegrees; |
||
319 | /** Color space of image */
|
||
320 | NCSFileColorSpace eColorSpace; |
||
321 | /** Cell type of image samples */
|
||
322 | NCSEcwCellType eCellType; |
||
323 | /** A pointer to an array of band information structures for each band of the image */
|
||
324 | NCSFileBandInfo *pBands; |
||
325 | } NCSFileViewFileInfoEx; |
||
326 | |||
327 | /**
|
||
328 | * @struct
|
||
329 | * Information about an open view into a compressed image file.
|
||
330 | * This structure contains updated information about the extents and processing status
|
||
331 | * of an open file view. NCScbmGetViewSetInfo() will return a pointer to this structure
|
||
332 | * for a file view
|
||
333 | */
|
||
334 | typedef struct { |
||
335 | /** Client data */
|
||
336 | void *pClientData;
|
||
337 | /** Number of bands to read */
|
||
338 | UINT32 nBands; |
||
339 | /** Array of band indices being read from the file - the size of this array is nBands */
|
||
340 | UINT32 *pBandList; |
||
341 | /** Top left of the view in image coordinates */
|
||
342 | UINT32 nTopX, nLeftY; |
||
343 | /** Bottom right of the view in image coordinates */
|
||
344 | UINT32 nBottomX, nRightY; |
||
345 | /** Size of the view in pixels */
|
||
346 | UINT32 nSizeX, nSizeY; |
||
347 | /** Number of file blocks within the view area */
|
||
348 | UINT32 nBlocksInView; |
||
349 | /** Number of these file blocks that are currently available */
|
||
350 | UINT32 nBlocksAvailable; |
||
351 | /** Blocks of the file that were available at the time of the corresponding SetView */
|
||
352 | UINT32 nBlocksAvailableAtSetView; |
||
353 | /** Number of blocks that were missed during the read of this view */
|
||
354 | UINT32 nMissedBlocksDuringRead; |
||
355 | /** Top left of the view in world coordinates (if using SetViewEx) */
|
||
356 | IEEE8 fTopX, fLeftY; |
||
357 | /** Bottom right of the view in world coordinates (if using SetViewEx) */ /*[02]*/ |
||
358 | IEEE8 fBottomX, fRightY; |
||
359 | } NCSFileViewSetInfo; |
||
360 | |||
361 | /*
|
||
362 | ** The public library is included into the private library to pick up the public
|
||
363 | ** structures. If being included, we don't use the public function call definitions
|
||
364 | */
|
||
365 | |||
366 | #ifndef ERS_WAVELET_DATASET_EXT
|
||
367 | /**
|
||
368 | * @def
|
||
369 | * Allowed file extensions for ECW files
|
||
370 | */
|
||
371 | #define ERS_WAVELET_DATASET_EXT ".ecw" /* compressed wavelet format file extension */ |
||
372 | #endif
|
||
373 | #ifndef ERS_JP2_DATASET_EXTS
|
||
374 | /**
|
||
375 | * @def
|
||
376 | * Allowed file extensions for JPEG 2000 files
|
||
377 | */
|
||
378 | #define ERS_JP2_DATASET_EXTS { ".jp2" , ".j2k" , ".j2c" , ".jpc", ".jpx", ".jpf" } /*[12]*/ |
||
379 | #endif
|
||
380 | |||
381 | #ifndef ERS_JP2_WORLD_FILE_EXTS
|
||
382 | #define ERS_JP2_WORLD_FILE_EXTS { ".j2w" , ".jxw" , ".jfw" } |
||
383 | #endif
|
||
384 | |||
385 | #ifndef ERSWAVE_VERSION_STRING
|
||
386 | /**
|
||
387 | * @def
|
||
388 | * Current version of the ECW format
|
||
389 | */
|
||
390 | #define ERSWAVE_VERSION_STRING "2.0" /* should be in sync with the above */ |
||
391 | #endif
|
||
392 | #ifndef NCS_ECW_PROXY_KEY
|
||
393 | #define NCS_ECW_PROXY_KEY "ECWP Proxy" |
||
394 | #endif // NCS_ECW_PROXY_KEY |
||
395 | |||
396 | /**
|
||
397 | * @typedef
|
||
398 | * This type definition promotes properly transparent usage of the SDK structures.
|
||
399 | */
|
||
400 | typedef struct NCSFileStruct NCSFile; |
||
401 | /**
|
||
402 | * @typedef
|
||
403 | * This type definition promotes properly transparent usage of the SDK structures.
|
||
404 | */
|
||
405 | typedef struct NCSFileViewStruct NCSFileView; |
||
406 | |||
407 | /*
|
||
408 | ** Note: routines return non-zero if there was an error
|
||
409 | */
|
||
410 | |||
411 | /*
|
||
412 | ** Do not call these unless directly including the NCSECW code rather than linking against the DLL
|
||
413 | */
|
||
414 | /**
|
||
415 | * Initialise the SDK libraries. Should not be called directly unless you are directly including
|
||
416 | * the SDK code rather than linking against the DLL.
|
||
417 | */
|
||
418 | extern void NCS_CALL NCSecwInit(void); // DO NOT call if linking against the DLL |
||
419 | /**
|
||
420 | * Initialise the SDK libraries. Should not be called directly unless you are directly including
|
||
421 | * the SDK code rather than linking against the DLL.
|
||
422 | */
|
||
423 | extern void NCS_CALL NCSecwShutdown(void); // DO NOT call if linking against the DLL |
||
424 | |||
425 | /*[04]*/
|
||
426 | /**
|
||
427 | * Set custom functions to be used by the SDK library to open, close, read, seek and tell input files.
|
||
428 | * This can be used to manage "wrapper" files which encapsulate the ordinary compressed files
|
||
429 | * handled by the SDK.
|
||
430 | *
|
||
431 | * @param[in] pOpenCB Callback function for opening input files
|
||
432 | * @param[in] pCloseCB Callback function for closing input files
|
||
433 | * @param[in] pReadCB Callback function for reading input files
|
||
434 | * @param[in] pSeekCB Callback function for seeking input files
|
||
435 | * @param[in] pTellCB Callback function for telling input files
|
||
436 | * @return NCSError value, NCS_SUCCESS or the code of any applicable error
|
||
437 | */
|
||
438 | extern NCSError NCSecwSetIOCallbacks(NCSError (NCS_CALL *pOpenCB)(char *szFileName, void **ppClientData), |
||
439 | NCSError (NCS_CALL *pCloseCB)(void *pClientData),
|
||
440 | NCSError (NCS_CALL *pReadCB)(void *pClientData, void *pBuffer, UINT32 nLength), |
||
441 | NCSError (NCS_CALL *pSeekCB)(void *pClientData, UINT64 nOffset),
|
||
442 | NCSError (NCS_CALL *pTellCB)(void *pClientData, UINT64 *pOffset));
|
||
443 | |||
444 | /*
|
||
445 | ** This is used for multi-client load testing and texture management. Never call this routine.
|
||
446 | */
|
||
447 | extern void NCS_CALL NCSecwConfig(BOOLEAN bNoTextureDither, BOOLEAN bForceFileReopen); |
||
448 | |||
449 | /**
|
||
450 | * Reports if this is a local or remote file, and breaks URL down into sections
|
||
451 | *
|
||
452 | * @param[in] szUrlPath The URL to be broken down and analysed
|
||
453 | * @param[out] ppProtocol The protocol of the URL (pointer to char *)
|
||
454 | * @param[out] pnProtocolLength The length of the protocol
|
||
455 | * @param[out] ppHost The hostname specified in the URL
|
||
456 | * @param[out] pnHostLength The length of the specified hostname
|
||
457 | * @param[out] ppFilename The filename specified by the URL
|
||
458 | * @param[out] pnFilenameLength The length of the specified filename
|
||
459 | * @return BOOLEAN value, if this is a local file
|
||
460 | */
|
||
461 | extern BOOLEAN NCS_CALL NCSecwNetBreakdownUrl( char *szUrlPath, |
||
462 | char **ppProtocol, int *pnProtocolLength, |
||
463 | char **ppHost, int *pnHostLength, |
||
464 | char **ppFilename, int *pnFilenameLength); |
||
465 | |||
466 | /**
|
||
467 | * Opens a file view. After calling this function, call GetViewFileInfo to obtain file metadata
|
||
468 | *
|
||
469 | * @param[in] szUrlPath The location of the file on which to open a view
|
||
470 | * @param[out] ppNCSFileView The NCSFileView structure to initialise
|
||
471 | * @param[in] pRefreshCallback The refresh callback with which to handle progressive reads (may be NULL for the blocking interface)
|
||
472 | * @return NCSError value, NCS_SUCCESS or any applicable error code
|
||
473 | */
|
||
474 | extern NCSError NCS_CALL NCScbmOpenFileView(char *szUrlPath, NCSFileView **ppNCSFileView, |
||
475 | NCSEcwReadStatus (*pRefreshCallback)(NCSFileView *pNCSFileView)); |
||
476 | |||
477 | /**
|
||
478 | * Closes a file view. This can be called at any time after NCScbmOpenFileView is called to clean up an open file view.
|
||
479 | *
|
||
480 | * @param[in] pNCSFileView The file view to close
|
||
481 | * @return NCSError value, NCS_SUCCESS or any applicable error code
|
||
482 | */
|
||
483 | extern NCSError NCS_CALL NCScbmCloseFileView(NCSFileView *pNCSFileView);
|
||
484 | |||
485 | /**
|
||
486 | * Closes a file view. This can be called at any time after NCScbmOpenFileView is called to clean up an open file view.
|
||
487 | *
|
||
488 | * This version allows the developer to forcibly close a file and free the resources allocated to it.
|
||
489 | * @param[in] pNCSFileView The file view to close
|
||
490 | * @param[in] bFreeCachedFile Whether to force the freeing of the file's memory cache
|
||
491 | * @return NCSError value, NCS_SUCCESS or any applicable error code
|
||
492 | */
|
||
493 | extern NCSError NCS_CALL NCScbmCloseFileViewEx(NCSFileView *pNCSFileView, BOOLEAN bFreeCachedFile); /*[03]*/ |
||
494 | |||
495 | |||
496 | /**
|
||
497 | * Populates a structure with information about an open image file. Use this version when dealing with ECW files only.
|
||
498 | *
|
||
499 | * @param[in] pNCSFileView The file view open on the file whose metadata is being obtained
|
||
500 | * @param[out] ppNCSFileViewFileInfo A pointer to a pointer to the NCSFileViewFileInfo struct to populate with the metadata
|
||
501 | * @return NCSError value, NCS_SUCCESS or any applicable error code
|
||
502 | */
|
||
503 | extern NCSError NCS_CALL NCScbmGetViewFileInfo(NCSFileView *pNCSFileView, NCSFileViewFileInfo **ppNCSFileViewFileInfo);
|
||
504 | |||
505 | /**
|
||
506 | * Populates a structure with information about an open image file. This is the extended version which will return additional
|
||
507 | *
|
||
508 | * metadata for a JPEG 2000 file that is irrelevant in the case of ECW input. Note the different parameter type.
|
||
509 | * @param[in] pNCSFileView The file view open on the file whose metadata is being obtained
|
||
510 | * @param[out] ppNCSFileViewFileInfo A pointer to a pointer to the NCSFileViewFileInfoEx struct to populate with the metadata
|
||
511 | * @return NCSError value, NCS_SUCCESS or any applicable error code
|
||
512 | */
|
||
513 | extern NCSError NCS_CALL NCScbmGetViewFileInfoEx(NCSFileView *pNCSFileView, NCSFileViewFileInfoEx **ppNCSFileViewFileInfo);
|
||
514 | |||
515 | /**
|
||
516 | * Obtains information about the current request to set the view, including statistics about the data being processed
|
||
517 | *
|
||
518 | * @param[in] pNCSFileView The open file view the extents of which are currently being set
|
||
519 | * @param[out] ppNCSFileViewSetInfo The information about the view being set
|
||
520 | * @return NCSError value, either NCS_SUCCESS or an applicable error code
|
||
521 | */
|
||
522 | extern NCSError NCS_CALL NCScbmGetViewInfo(NCSFileView *pNCSFileView, NCSFileViewSetInfo **ppNCSFileViewSetInfo);
|
||
523 | |||
524 | /**
|
||
525 | * Sets the extents and band content of an open file view, and the output view size. This function can be called at
|
||
526 | * any time after a successful call to NCScbmOpenFileView. In progressive mode, multiple calls to NCScbmSetFileView
|
||
527 | * can be made, even if previous SetViews are still being processed, enhancing client interaction with the view. After
|
||
528 | * the call to NCScbmSetFileView, the band list array pBandList can be freed if so desired. It is used only during the
|
||
529 | * processing of the call, and not afterward.
|
||
530 | *
|
||
531 | * @param[in] pNCSFileView The open file view to set
|
||
532 | * @param[in] pBandList An array of integers specifying which bands of the image to read, and in which order
|
||
533 | * @param[in] nTopX Left edge of the view in dataset cells
|
||
534 | * @param[in] nLeftY Top edge of the view in dataset cells
|
||
535 | * @param[in] nBottomX Right edge of the view in dataset cells
|
||
536 | * @param[in] nRightY Bottom edge of the view in dataset cells
|
||
537 | * @param[in] nSizeX Width of the view to be constructed from the image subset
|
||
538 | * @param[in] nSizeY Height of the view to be constructed from the image subset
|
||
539 | * @return NCSError value, NCS_SUCCESS or any applicable error code
|
||
540 | */
|
||
541 | extern NCSError NCS_CALL NCScbmSetFileView(NCSFileView *pNCSFileView,
|
||
542 | UINT32 nBands, |
||
543 | UINT32 *pBandList, |
||
544 | UINT32 nTopX, UINT32 nLeftY, |
||
545 | UINT32 nBottomX, UINT32 nRightY, |
||
546 | UINT32 nSizeX, UINT32 nSizeY); |
||
547 | |||
548 | /**
|
||
549 | * Sets the extents and band content of an open file view, and the output view size. This function can be called at
|
||
550 | * any time after a successful call to NCScbmOpenFileView. In progressive mode, multiple calls to NCScbmSetFileView
|
||
551 | * can be made, even if previous SetViews are still being processed, enhancing client interaction with the view. After
|
||
552 | * the call to NCScbmSetFileView, the band list array pBandList can be freed if so desired. It is used only during the
|
||
553 | * processing of the call, and not afterward. This version also allows the calling program to specify world coordinates
|
||
554 | * for the view.
|
||
555 | *
|
||
556 | * @param[in] pNCSFileView The open file view to set
|
||
557 | * @param[in] pBandList An array of integers specifying which bands of the image to read, and in which order
|
||
558 | * @param[in] nTopX Left edge of the view in dataset cells
|
||
559 | * @param[in] nLeftY Top edge of the view in dataset cells
|
||
560 | * @param[in] nBottomX Bottom edge of the view in dataset cells
|
||
561 | * @param[in] nRightY Right edge of the view in dataset cells
|
||
562 | * @param[in] nSizeX Width of the view to be constructed from the image subset
|
||
563 | * @param[in] nSizeY Height of the view to be constructed from the image subset
|
||
564 | * @param[in] fTopX Left edge of the view in world coordinates
|
||
565 | * @param[in] fLeftY Top edge of the view in world coordinates
|
||
566 | * @param[in] fBottomX Right edge of the view in world coordinates
|
||
567 | * @param[in] fRightY Bottom edge of the view in world coordinates
|
||
568 | * @return NCSError value, NCS_SUCCESS or any applicable error code
|
||
569 | */
|
||
570 | extern NCSError NCS_CALL NCScbmSetFileViewEx(NCSFileView *pNCSFileView, /*[02]*/ |
||
571 | UINT32 nBands, |
||
572 | UINT32 *pBandList, |
||
573 | UINT32 nTopX, UINT32 nLeftY, |
||
574 | UINT32 nBottomX, UINT32 nRightY, |
||
575 | UINT32 nSizeX, UINT32 nSizeY, |
||
576 | IEEE8 fTopX, IEEE8 fLeftY, |
||
577 | IEEE8 fBottomX, IEEE8 fRightY); |
||
578 | |||
579 | /**
|
||
580 | * Read line by line in BIL format.
|
||
581 | *
|
||
582 | * @param[in] pNCSFileView The open file view from which to read view lines
|
||
583 | * @param[out] ppOutputLine The buffer into which to read the interleaved band information
|
||
584 | * @return NCSEcwReadStatus value, NCSECW_READ_OK or any applicable error code
|
||
585 | */
|
||
586 | NCSEcwReadStatus NCS_CALL NCScbmReadViewLineBIL( NCSFileView *pNCSFileView, UINT8 **ppOutputLine); |
||
587 | |||
588 | /**
|
||
589 | * Read line by line in BIL format to different data types. This extended version allows the client
|
||
590 | *
|
||
591 | * program to read in view lines made up of cells with sample bitdepth other than 8-bit.
|
||
592 | * @param[in] pNCSFileView The open file view from which to read view lines
|
||
593 | * @param[in] eType The cell type of the view lines being read
|
||
594 | * @param[out] ppOutputLine The buffer into which to read the interleaved band information
|
||
595 | * @return NCSEcwReadStatus value, NCSECW_READ_OK or any applicable error code
|
||
596 | */
|
||
597 | NCSEcwReadStatus NCS_CALL NCScbmReadViewLineBILEx( NCSFileView *pNCSFileView, NCSEcwCellType eType, void **ppOutputLine); /**[05]**/ |
||
598 | |||
599 | /**
|
||
600 | * Read line by line in RGB format.
|
||
601 | *
|
||
602 | * @param[in] pNCSFileView The open file view from which to read view lines
|
||
603 | * @param[out] pRGBTriplets The buffer into which to read the red-green-blue sample triplets.
|
||
604 | * @return NCSEcwReadStatus value, NCSECW_READ_OK or any applicable error code
|
||
605 | */
|
||
606 | NCSEcwReadStatus NCS_CALL NCScbmReadViewLineRGB( NCSFileView *pNCSFileView, UINT8 *pRGBTriplets); |
||
607 | |||
608 | /**
|
||
609 | * Read line by line in BGR format.
|
||
610 | *
|
||
611 | * @param[in] pNCSFileView The open file view from which to read view lines
|
||
612 | * @param[out] pBGRTriplets The buffer into which to read the blue-red-green sample triplets.
|
||
613 | * @return NCSEcwReadStatus value, NCSECW_READ_OK or any applicable error code
|
||
614 | */
|
||
615 | NCSEcwReadStatus NCS_CALL NCScbmReadViewLineBGR( NCSFileView *pNCSFileView, UINT8 *pBGRTriplets); |
||
616 | |||
617 | /**
|
||
618 | * Read line by line in RGBA format. Samples are read into a buffer of UINT32 values, each value comprising
|
||
619 | * the four bytes of a red-green-blue-alpha sample. Alpha values will be zero if the input file is in ECW
|
||
620 | * format as this format does not 'understand' alpha channels. SDK programmers wanting to compress and
|
||
621 | * decompress data in four bands are advised to use multiband compression and NCScbmReadViewLineBil(Ex) to
|
||
622 | * handle their data.
|
||
623 | *
|
||
624 | * @param[in] pNCSFileView The open file view from which to read view lines
|
||
625 | * @param[out] pRGBA The buffer of packed UINT32 values.
|
||
626 | * @return NCSEcwReadStatus value, NCSECW_READ_OK or any applicable error code
|
||
627 | */
|
||
628 | NCSEcwReadStatus NCS_CALL NCScbmReadViewLineRGBA( NCSFileView *pNCSFileView, UINT32 *pRGBA); |
||
629 | |||
630 | /**
|
||
631 | * Read line by line in BGRA format. Samples are read into a buffer of UINT32 values, each value comprising
|
||
632 | * the four bytes of a red-green-blue-alpha sample. Alpha values will be zero if the input file is in ECW
|
||
633 | * format as this format does not 'understand' alpha channels. SDK programmers wanting to compress and
|
||
634 | * decompress data in four bands are advised to use multiband compression and NCScbmReadViewLineBil(Ex) to
|
||
635 | * handle their data.
|
||
636 | *
|
||
637 | * @param[in] pNCSFileView The open file view from which to read view lines
|
||
638 | * @param[out] pBGRA The buffer of packed UINT32 values.
|
||
639 | * @return NCSEcwReadStatus value, NCSECW_READ_OK or any applicable error code
|
||
640 | */
|
||
641 | NCSEcwReadStatus NCS_CALL NCScbmReadViewLineBGRA( NCSFileView *pNCSFileView, UINT32 *pBGRA); |
||
642 | |||
643 | /*
|
||
644 | ** Used for testing purposes, to simulate the Inverse DWT process
|
||
645 | */
|
||
646 | NCSEcwReadStatus NCS_CALL NCScbmReadViewFake( NCSFileView *pNCSFileView); // a fake reader, for performance testing
|
||
647 | |||
648 | /**
|
||
649 | * Return the major and minor versions of this SDK.
|
||
650 | *
|
||
651 | * @param[out] nMajor The major version
|
||
652 | * @param[out] nMinor The minor version
|
||
653 | */
|
||
654 | void NCSGetLibVersion( INT32 *nMajor, INT32 *nMinor );
|
||
655 | |||
656 | /**
|
||
657 | * Set configuration parameters for the SDK functions
|
||
658 | *
|
||
659 | * @param[in] eType The configuration parameter to set, to be followed in the variable argument list by its desired value
|
||
660 | * @return NCSError value, NCS_SUCCESS or any applicable error code
|
||
661 | */
|
||
662 | NCSError NCSecwSetConfig(NCSEcwConfigType eType, ...); |
||
663 | |||
664 | /**
|
||
665 | * Get configuration parameters for the SDK functions
|
||
666 | *
|
||
667 | * @param[in] eType The configuration parameter to obtain, to be followed in the variable argument list by a value buffer
|
||
668 | * @return NCSError value, NCS_SUCCESS or any applicable error code
|
||
669 | */
|
||
670 | NCSError NCSecwGetConfig(NCSEcwConfigType eType, ...); |
||
671 | |||
672 | /**
|
||
673 | * Purge the memory cache being used by the SDK for the current file view.
|
||
674 | *
|
||
675 | * @param[in] pView The file view which should have its cache purged
|
||
676 | */
|
||
677 | |||
678 | extern void NCScbmPurgeCache(NCSFileView *pView); |
||
679 | |||
680 | // JPC wrapper entry points
|
||
681 | extern void NCS_CALL NCSecwInit_ECW(void); |
||
682 | extern void NCS_CALL NCSecwShutdown_ECW(void); |
||
683 | extern NCSError NCSecwSetIOCallbacks_ECW(NCSError (NCS_CALL *pOpenCB)(char *szFileName, void **ppClientData), |
||
684 | NCSError (NCS_CALL *pCloseCB)(void *pClientData),
|
||
685 | NCSError (NCS_CALL *pReadCB)(void *pClientData, void *pBuffer, UINT32 nLength), |
||
686 | NCSError (NCS_CALL *pSeekCB)(void *pClientData, UINT64 nOffset),
|
||
687 | NCSError (NCS_CALL *pTellCB)(void *pClientData, UINT64 *pOffset));
|
||
688 | extern void NCS_CALL NCSecwConfig_ECW(BOOLEAN bNoTextureDither, BOOLEAN bForceFileReopen); |
||
689 | extern BOOLEAN NCS_CALL NCSecwNetBreakdownUrl_ECW( char *szUrlPath, |
||
690 | char **ppProtocol, int *pnProtocolLength, |
||
691 | char **ppHost, int *pnHostLength, |
||
692 | char **ppFilename, int *pnFilenameLength); |
||
693 | extern NCSError NCS_CALL NCScbmOpenFileView_ECW(char *szUrlPath, NCSFileView **ppNCSFileView, |
||
694 | NCSEcwReadStatus (*pRefreshCallback)(NCSFileView *pNCSFileView)); |
||
695 | extern NCSError NCS_CALL NCScbmCloseFileView_ECW(NCSFileView *pNCSFileView);
|
||
696 | extern NCSError NCS_CALL NCScbmCloseFileViewEx_ECW(NCSFileView *pNCSFileView, BOOLEAN bFreeCachedFile); /**[03]**/ |
||
697 | extern NCSError NCS_CALL NCScbmGetViewFileInfo_ECW(NCSFileView *pNCSFileView, NCSFileViewFileInfo **ppNCSFileViewFileInfo);
|
||
698 | extern NCSError NCS_CALL NCScbmGetViewFileInfoEx_ECW(NCSFileView *pNCSFileView, NCSFileViewFileInfoEx **ppNCSFileViewFileInfo);
|
||
699 | extern NCSError NCS_CALL NCScbmGetViewInfo_ECW(NCSFileView *pNCSFileView, NCSFileViewSetInfo **ppNCSFileViewSetInfo);
|
||
700 | extern NCSError NCS_CALL NCScbmSetFileView_ECW(NCSFileView *pNCSFileView,
|
||
701 | UINT32 nBands, // number of bands to read
|
||
702 | UINT32 *pBandList, // index into actual band numbers from source file
|
||
703 | UINT32 nTopX, UINT32 nLeftY, // Top-Left in image coordinates
|
||
704 | UINT32 nBottomX, UINT32 nRightY,// Bottom-Left in image coordinates
|
||
705 | UINT32 nSizeX, UINT32 nSizeY); // Output view size in window pixels
|
||
706 | |||
707 | extern NCSError NCS_CALL NCScbmSetFileViewEx_ECW(NCSFileView *pNCSFileView, /*[02]*/ |
||
708 | UINT32 nBands, // number of bands to read
|
||
709 | UINT32 *pBandList, // index into actual band numbers from source file
|
||
710 | UINT32 nTopX, UINT32 nLeftY, // Top-Left in image coordinates
|
||
711 | UINT32 nBottomX, UINT32 nRightY,// Bottom-Right in image coordinates
|
||
712 | UINT32 nSizeX, UINT32 nSizeY, // Output view size in window pixels
|
||
713 | IEEE8 fTopX, IEEE8 fLeftY, // Top-Left in world coordinates
|
||
714 | IEEE8 fBottomX, IEEE8 fRightY); // Bottom-Right in world coordinates
|
||
715 | NCSEcwReadStatus NCS_CALL NCScbmReadViewLineBIL_ECW( NCSFileView *pNCSFileView, UINT8 **p_p_output_line); |
||
716 | NCSEcwReadStatus NCS_CALL NCScbmReadViewLineBILEx_ECW( NCSFileView *pNCSFileView, NCSEcwCellType eType, void **p_p_output_line); /**[05]**/ |
||
717 | NCSEcwReadStatus NCS_CALL NCScbmReadViewLineRGB_ECW( NCSFileView *pNCSFileView, UINT8 *pRGBTriplets); |
||
718 | NCSEcwReadStatus NCS_CALL NCScbmReadViewLineBGR_ECW( NCSFileView *pNCSFileView, UINT8 *pRGBTriplets); |
||
719 | NCSEcwReadStatus NCS_CALL NCScbmReadViewLineRGBA_ECW( NCSFileView *pNCSFileView, UINT32 *pRGBA); |
||
720 | NCSEcwReadStatus NCS_CALL NCScbmReadViewLineBGRA_ECW( NCSFileView *pNCSFileView, UINT32 *pBGRA); |
||
721 | NCSEcwReadStatus NCS_CALL NCScbmReadViewFake_ECW( NCSFileView *pNCSFileView); // a fake reader, for performance testing
|
||
722 | NCSError NCSecwSetConfig_ECW(NCSEcwConfigType eType, ...); |
||
723 | NCSError NCSecwGetConfig_ECW(NCSEcwConfigType eType, ...); |
||
724 | extern NCSError NCSecwOpenFile_ECW(NCSFile **ppNCSFile,
|
||
725 | char *szInputFilename, // input file name or network path |
||
726 | BOOLEAN bReadOffsets, // TRUE if the client wants the block Offset Table
|
||
727 | BOOLEAN bReadMemImage); // TRUE if the client wants a Memory Image of the Header
|
||
728 | extern int NCSecwCloseFile_ECW( NCSFile *pNCSFile); |
||
729 | extern int NCSecwReadLocalBlock_ECW( NCSFile *pNCSFile, UINT64 nBlockNumber, UINT8 **ppBlock, UINT32 *pBlockLength); |
||
730 | #ifdef MACINTOSH
|
||
731 | Handle NCScbmReadFileBlockLocal_ECW(NCSFile *pNCSFile, NCSBlockId nBlock, UINT32 *pBlockLength ); |
||
732 | #else
|
||
733 | UINT8 *NCScbmReadFileBlockLocal_ECW(NCSFile *pNCSFile, NCSBlockId nBlock, UINT32 *pBlockLength ); |
||
734 | #endif
|
||
735 | extern BOOLEAN NCScbmGetFileBlockSizeLocal_ECW(NCSFile *pNCSFile, NCSBlockId nBlock, UINT32 *pBlockLength, UINT64 *pBlockOffset );
|
||
736 | extern struct tagNCSEcwStatistics *NCSecwGetStatistics_ECW( void ); |
||
737 | UINT32 get_qmf_tree_nr_blocks_ECW( struct qmf_level_struct *p_top_qmf );
|
||
738 | |||
739 | extern void NCSecwGlobalLock(void); |
||
740 | extern void NCSecwGlobalUnLock(void); |
||
741 | |||
742 | void NCSInitFileInfoEx(NCSFileViewFileInfoEx *pDst);
|
||
743 | void NCSFreeFileInfoEx(NCSFileViewFileInfoEx *pDst);
|
||
744 | void NCSCopyFileInfoEx(NCSFileViewFileInfoEx *pDst, NCSFileViewFileInfoEx *pSrc);
|
||
745 | BOOLEAN NCSIsFileInfoExGeoreferenced(NCSFileViewFileInfoEx *pInfo); |
||
746 | void NCSStandardizeFileInfoEx(NCSFileViewFileInfoEx *pDst);
|
||
747 | /**start [13]*/
|
||
748 | void NCSSetGDTPath(char *szPath); |
||
749 | char *NCSGetGDTPath(void); |
||
750 | void NCSDetectGDTPath();
|
||
751 | NCSError NCSGetEPSGCode(char *szDatum, char *szProjection, INT32 *pnEPSG); |
||
752 | NCSError NCSGetProjectionAndDatum(INT32 nEPSG, char **pszProjection, char **pszDatum); |
||
753 | /**end [13]*/
|
||
754 | |||
755 | NCSFileType NCScbmGetFileType( NCSFileView *pNCSFileView ); |
||
756 | char *NCScbmGetFileMimeType( NCSFileView *pNCSFileView );
|
||
757 | |||
758 | #ifdef __cplusplus
|
||
759 | } |
||
760 | #endif
|
||
761 | |||
762 | #endif // NCSECWCLIENT_H |