root/tags/gdal_1_3_2/gcore/gdal.h

Revision 8754, 31.2 kB (checked in by fwarmerdam, 3 years ago)

fix up RAT API (bug 985)

  • Property svn:eol-style set to native
  • Property svn:keywords set to Author Date Id Revision
Line 
1 /******************************************************************************
2  * $Id$
3  *
4  * Project:  GDAL Core
5  * Purpose:  GDAL Core C/Public declarations.
6  * Author:   Frank Warmerdam, warmerdam@pobox.com
7  *
8  ******************************************************************************
9  * Copyright (c) 1998, 2002 Frank Warmerdam
10  *
11  * Permission is hereby granted, free of charge, to any person obtaining a
12  * copy of this software and associated documentation files (the "Software"),
13  * to deal in the Software without restriction, including without limitation
14  * the rights to use, copy, modify, merge, publish, distribute, sublicense,
15  * and/or sell copies of the Software, and to permit persons to whom the
16  * Software is furnished to do so, subject to the following conditions:
17  *
18  * The above copyright notice and this permission notice shall be included
19  * in all copies or substantial portions of the Software.
20  *
21  * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
22  * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
23  * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
24  * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
25  * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
26  * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
27  * DEALINGS IN THE SOFTWARE.
28  ******************************************************************************
29  *
30  * $Log$
31  * Revision 1.102  2005/11/01 22:16:00  fwarmerdam
32  * fix up RAT API (bug 985)
33  *
34  * Revision 1.101  2005/10/28 16:59:24  pnagy
35  * Added VRTDerivedBand support
36  *
37  * Revision 1.100  2005/09/28 21:29:30  fwarmerdam
38  * added RAT documentation
39  *
40  * Revision 1.99  2005/09/24 19:01:52  fwarmerdam
41  * added RAT related functions
42  *
43  * Revision 1.98  2005/09/24 04:18:43  fwarmerdam
44  * added void declaration for GDALRasterAttributeTableH
45  *
46  * Revision 1.97  2005/05/24 18:13:15  dron
47  * Added GDALGetDriverCreationOptionList() function.
48  *
49  * Revision 1.96  2005/05/16 21:34:33  fwarmerdam
50  * Added SetDefaultHistogram
51  *
52  * Revision 1.95  2005/05/11 14:04:08  fwarmerdam
53  * added getdefaulthistogram
54  *
55  * Revision 1.94  2005/04/27 16:28:39  fwarmerdam
56  * added GDALGetRasterStatistics
57  *
58  * Revision 1.93  2005/04/15 18:34:52  fwarmerdam
59  * Added area or point metadata constants.
60  *
61  * Revision 1.92  2005/04/04 15:24:48  fwarmerdam
62  * Most C entry points now CPL_STDCALL
63  *
64  * Revision 1.91  2005/03/16 19:21:35  fwarmerdam
65  * added methods for setting offset/scale
66  *
67  * Revision 1.90  2005/02/23 14:53:43  fwarmerdam
68  * moved version info into gdal_version.h
69  *
70  * Revision 1.89  2005/02/10 04:30:29  fwarmerdam
71  * added support for YCbCr color space
72  *
73  * Revision 1.88  2004/12/02 18:26:07  fwarmerdam
74  * added CPL_DLL specifier on two functions.
75  *
76  * Revision 1.87  2004/11/22 20:06:50  fwarmerdam
77  * Updated to 1.2.5.
78  *
79  * Revision 1.86  2004/11/05 18:00:04  fwarmerdam
80  * Updated to 1.2.4.0.
81  *
82  * Revision 1.85  2004/10/18 17:22:07  fwarmerdam
83  * added GCI_Max
84  *
85  * Revision 1.84  2004/09/25 05:51:03  fwarmerdam
86  * updated to version 1.2.3
87  *
88  * Revision 1.83  2004/09/16 18:30:13  fwarmerdam
89  * Updated to 1.2.2.
90  *
91  * Revision 1.82  2004/06/24 03:10:49  warmerda
92  * update to GDAL 1.2.1
93  *
94  * Revision 1.81  2004/04/29 13:42:58  warmerda
95  * added C Offset/Scale entry points
96  *
97  * Revision 1.80  2004/04/04 20:05:37  warmerda
98  * mark as 1.2.0.1
99  *
100  * Revision 1.79  2004/04/02 17:32:40  warmerda
101  * added GDALGeneralCmdLineProcessor()
102  *
103  * Revision 1.78  2004/03/28 16:01:46  warmerda
104  * added GDALApplyGeoTransform()
105  *
106  * Revision 1.77  2004/03/10 19:18:29  warmerda
107  * updated date
108  *
109  * Revision 1.76  2004/03/01 18:30:44  warmerda
110  * Updated release date.
111  *
112  * Revision 1.75  2004/02/25 09:03:15  dron
113  * Added GDALPackedDMSToDec() and GDALDecToPackedDMS() functions.
114  *
115  * Revision 1.74  2004/02/19 15:55:52  warmerda
116  * updated to 1.2.0
117  *
118  * Revision 1.73  2004/02/04 21:30:12  warmerda
119  * ensure GDALGetDataTypeByName is exported
120  *
121  * Revision 1.72  2004/01/18 16:43:37  dron
122  * Added GDALGetDataTypeByName() function.
123  */
124
125 #ifndef GDAL_H_INCLUDED
126 #define GDAL_H_INCLUDED
127
128 /**
129  * \file gdal.h
130  *
131  * Public (C callable) GDAL entry points.
132  */
133
134 #include "gdal_version.h"
135 #include "cpl_port.h"
136 #include "cpl_error.h"
137
138 /* -------------------------------------------------------------------- */
139 /*      Significant constants.                                          */
140 /* -------------------------------------------------------------------- */
141
142 CPL_C_START
143
144 /*! Pixel data types */
145 typedef enum {
146     GDT_Unknown = 0,
147     /*! Eight bit unsigned integer */           GDT_Byte = 1,
148     /*! Sixteen bit unsigned integer */         GDT_UInt16 = 2,
149     /*! Sixteen bit signed integer */           GDT_Int16 = 3,
150     /*! Thirty two bit unsigned integer */      GDT_UInt32 = 4,
151     /*! Thirty two bit signed integer */        GDT_Int32 = 5,
152     /*! Thirty two bit floating point */        GDT_Float32 = 6,
153     /*! Sixty four bit floating point */        GDT_Float64 = 7,
154     /*! Complex Int16 */                        GDT_CInt16 = 8,
155     /*! Complex Int32 */                        GDT_CInt32 = 9,
156     /*! Complex Float32 */                      GDT_CFloat32 = 10,
157     /*! Complex Float64 */                      GDT_CFloat64 = 11,
158     GDT_TypeCount = 12          /* maximum type # + 1 */
159 } GDALDataType;
160
161 int CPL_DLL CPL_STDCALL GDALGetDataTypeSize( GDALDataType );
162 int CPL_DLL CPL_STDCALL GDALDataTypeIsComplex( GDALDataType );
163 const char CPL_DLL * CPL_STDCALL GDALGetDataTypeName( GDALDataType );
164 GDALDataType CPL_DLL CPL_STDCALL GDALGetDataTypeByName( const char * );
165 GDALDataType CPL_DLL CPL_STDCALL GDALDataTypeUnion( GDALDataType, GDALDataType );
166
167 /*! Flag indicating read/write, or read-only access to data. */
168 typedef enum {
169     /*! Read only (no update) access */ GA_ReadOnly = 0,
170     /*! Read/write access. */           GA_Update = 1
171 } GDALAccess;
172
173 /*! Read/Write flag for RasterIO() method */
174 typedef enum {
175     /*! Read data */   GF_Read = 0,
176     /*! Write data */  GF_Write = 1
177 } GDALRWFlag;
178
179 /*! Types of color interpretation for raster bands. */
180 typedef enum
181 {
182     GCI_Undefined=0,
183     /*! Greyscale */                                      GCI_GrayIndex=1,
184     /*! Paletted (see associated color table) */          GCI_PaletteIndex=2,
185     /*! Red band of RGBA image */                         GCI_RedBand=3,
186     /*! Green band of RGBA image */                       GCI_GreenBand=4,
187     /*! Blue band of RGBA image */                        GCI_BlueBand=5,
188     /*! Alpha (0=transparent, 255=opaque) */              GCI_AlphaBand=6,
189     /*! Hue band of HLS image */                          GCI_HueBand=7,
190     /*! Saturation band of HLS image */                   GCI_SaturationBand=8,
191     /*! Lightness band of HLS image */                    GCI_LightnessBand=9,
192     /*! Cyan band of CMYK image */                        GCI_CyanBand=10,
193     /*! Magenta band of CMYK image */                     GCI_MagentaBand=11,
194     /*! Yellow band of CMYK image */                      GCI_YellowBand=12,
195     /*! Black band of CMLY image */                       GCI_BlackBand=13,
196     /*! Y Luminance */                                    GCI_YCbCr_YBand=14,
197     /*! Cb Chroma */                                      GCI_YCbCr_CbBand=15,
198     /*! Cr Chroma */                                      GCI_YCbCr_CrBand=16,
199     /*! Max current value */                              GCI_Max=16
200 } GDALColorInterp;
201
202 /*! Translate a GDALColorInterp into a user displayable string. */
203 const char CPL_DLL *GDALGetColorInterpretationName( GDALColorInterp );
204
205 /*! Types of color interpretations for a GDALColorTable. */
206 typedef enum
207 {
208   /*! Grayscale (in GDALColorEntry.c1) */                      GPI_Gray=0,
209   /*! Red, Green, Blue and Alpha in (in c1, c2, c3 and c4) */  GPI_RGB=1,
210   /*! Cyan, Magenta, Yellow and Black (in c1, c2, c3 and c4)*/ GPI_CMYK=2,
211   /*! Hue, Lightness and Saturation (in c1, c2, and c3) */     GPI_HLS=3
212 } GDALPaletteInterp;
213
214 /*! Translate a GDALPaletteInterp into a user displayable string. */
215 const char CPL_DLL *GDALGetPaletteInterpretationName( GDALPaletteInterp );
216
217 /* "well known" metadata items. */
218
219 #define GDALMD_AREA_OR_POINT   "AREA_OR_POINT"
220 define GDALMD_AOP_AREA      "Area"
221 define GDALMD_AOP_POINT     "Point"
222
223 /* -------------------------------------------------------------------- */
224 /*      GDAL Specific error codes.                                      */
225 /*                                                                      */
226 /*      error codes 100 to 299 reserved for GDAL.                       */
227 /* -------------------------------------------------------------------- */
228 #define CPLE_WrongFormat        200
229
230 /* -------------------------------------------------------------------- */
231 /*      Define handle types related to various internal classes.        */
232 /* -------------------------------------------------------------------- */
233 typedef void *GDALMajorObjectH;
234 typedef void *GDALDatasetH;
235 typedef void *GDALRasterBandH;
236 typedef void *GDALDriverH;
237 typedef void *GDALProjDefH;
238 typedef void *GDALColorTableH;
239 typedef void *GDALRasterAttributeTableH;
240
241 /* -------------------------------------------------------------------- */
242 /*      Callback "progress" function.                                   */
243 /* -------------------------------------------------------------------- */
244
245 typedef int (CPL_STDCALL *GDALProgressFunc)(double,const char *, void *);
246 int CPL_DLL CPL_STDCALL GDALDummyProgress( double, const char *, void *);
247 int CPL_DLL CPL_STDCALL GDALTermProgress( double, const char *, void *);
248 int CPL_DLL CPL_STDCALL GDALScaledProgress( double, const char *, void *);
249 void CPL_DLL * CPL_STDCALL GDALCreateScaledProgress( double, double,
250                                         GDALProgressFunc, void * );
251 void CPL_DLL CPL_STDCALL GDALDestroyScaledProgress( void * );
252
253 /* ==================================================================== */
254 /*      Registration/driver related.                                    */
255 /* ==================================================================== */
256
257 typedef struct {
258     char      *pszOptionName;
259     char      *pszValueType;   /* "boolean", "int", "float", "string",
260                                   "string-select" */
261     char      *pszDescription;
262     char      **papszOptions;
263 } GDALOptionDefinition;
264
265 #define GDAL_DMD_LONGNAME "DMD_LONGNAME"
266 #define GDAL_DMD_HELPTOPIC "DMD_HELPTOPIC"
267 #define GDAL_DMD_MIMETYPE "DMD_MIMETYPE"
268 #define GDAL_DMD_EXTENSION "DMD_EXTENSION"
269 #define GDAL_DMD_CREATIONOPTIONLIST "DMD_CREATIONOPTIONLIST"
270 #define GDAL_DMD_CREATIONDATATYPES "DMD_CREATIONDATATYPES"
271
272 #define GDAL_DCAP_CREATE     "DCAP_CREATE"
273 #define GDAL_DCAP_CREATECOPY "DCAP_CREATECOPY"
274
275 void CPL_DLL CPL_STDCALL GDALAllRegister( void );
276
277 GDALDatasetH CPL_DLL CPL_STDCALL GDALCreate( GDALDriverH hDriver,
278                                  const char *, int, int, int, GDALDataType,
279                                  char ** );
280 GDALDatasetH CPL_DLL CPL_STDCALL
281 GDALCreateCopy( GDALDriverH, const char *, GDALDatasetH,
282                 int, char **, GDALProgressFunc, void * );
283
284 GDALDatasetH CPL_DLL CPL_STDCALL
285 GDALOpen( const char *pszFilename, GDALAccess eAccess );
286 GDALDatasetH CPL_DLL CPL_STDCALL GDALOpenShared( const char *, GDALAccess );
287 int          CPL_DLL CPL_STDCALL GDALDumpOpenDatasets( FILE * );
288
289 GDALDriverH CPL_DLL CPL_STDCALL GDALGetDriverByName( const char * );
290 int CPL_DLL         CPL_STDCALL GDALGetDriverCount( void );
291 GDALDriverH CPL_DLL CPL_STDCALL GDALGetDriver( int );
292 int         CPL_DLL CPL_STDCALL GDALRegisterDriver( GDALDriverH );
293 void        CPL_DLL CPL_STDCALL GDALDeregisterDriver( GDALDriverH );
294 void        CPL_DLL CPL_STDCALL GDALDestroyDriverManager( void );
295 CPLErr      CPL_DLL CPL_STDCALL GDALDeleteDataset( GDALDriverH, const char * );
296
297 /* The following are deprecated */
298 const char CPL_DLL * CPL_STDCALL GDALGetDriverShortName( GDALDriverH );
299 const char CPL_DLL * CPL_STDCALL GDALGetDriverLongName( GDALDriverH );
300 const char CPL_DLL * CPL_STDCALL GDALGetDriverHelpTopic( GDALDriverH );
301 const char CPL_DLL * CPL_STDCALL GDALGetDriverCreationOptionList( GDALDriverH );
302
303 /* ==================================================================== */
304 /*      GDAL_GCP                                                        */
305 /* ==================================================================== */
306
307 /** Ground Control Point */
308 typedef struct
309 {
310     /** Unique identifier, often numeric */
311     char        *pszId;
312
313     /** Informational message or "" */
314     char        *pszInfo;
315
316     /** Pixel (x) location of GCP on raster */
317     double      dfGCPPixel;
318     /** Line (y) location of GCP on raster */
319     double      dfGCPLine;
320
321     /** X position of GCP in georeferenced space */
322     double      dfGCPX;
323
324     /** Y position of GCP in georeferenced space */
325     double      dfGCPY;
326
327     /** Elevation of GCP, or zero if not known */
328     double      dfGCPZ;
329 } GDAL_GCP;
330
331 void CPL_DLL CPL_STDCALL GDALInitGCPs( int, GDAL_GCP * );
332 void CPL_DLL CPL_STDCALL GDALDeinitGCPs( int, GDAL_GCP * );
333 GDAL_GCP CPL_DLL * CPL_STDCALL GDALDuplicateGCPs( int, const GDAL_GCP * );
334
335 int CPL_DLL CPL_STDCALL
336 GDALGCPsToGeoTransform( int nGCPCount, const GDAL_GCP *pasGCPs,
337                         double *padfGeoTransform, int bApproxOK );
338 int CPL_DLL CPL_STDCALL
339 GDALInvGeoTransform( double *padfGeoTransformIn,
340                      double *padfInvGeoTransformOut );
341 void CPL_DLL CPL_STDCALL GDALApplyGeoTransform( double *, double, double,
342                                                 double *, double * );
343
344 /* ==================================================================== */
345 /*      major objects (dataset, and, driver, drivermanager).            */
346 /* ==================================================================== */
347
348 char CPL_DLL  ** CPL_STDCALL GDALGetMetadata( GDALMajorObjectH, const char * );
349 CPLErr CPL_DLL CPL_STDCALL GDALSetMetadata( GDALMajorObjectH, char **,
350                                             const char * );
351 const char CPL_DLL * CPL_STDCALL
352 GDALGetMetadataItem( GDALMajorObjectH, const char *, const char * );
353 CPLErr CPL_DLL CPL_STDCALL
354 GDALSetMetadataItem( GDALMajorObjectH, const char *, const char *,
355                      const char * );
356 const char CPL_DLL * CPL_STDCALL GDALGetDescription( GDALMajorObjectH );
357 void CPL_DLL CPL_STDCALL GDALSetDescription( GDALMajorObjectH, const char * );
358
359 /* ==================================================================== */
360 /*      GDALDataset class ... normally this represents one file.        */
361 /* ==================================================================== */
362
363 GDALDriverH CPL_DLL CPL_STDCALL GDALGetDatasetDriver( GDALDatasetH );
364 void CPL_DLL CPL_STDCALL   GDALClose( GDALDatasetH );
365 int CPL_DLL CPL_STDCALL     GDALGetRasterXSize( GDALDatasetH );
366 int CPL_DLL CPL_STDCALL     GDALGetRasterYSize( GDALDatasetH );
367 int CPL_DLL CPL_STDCALL     GDALGetRasterCount( GDALDatasetH );
368 GDALRasterBandH CPL_DLL CPL_STDCALL GDALGetRasterBand( GDALDatasetH, int );
369
370 CPLErr CPL_DLL  CPL_STDCALL GDALAddBand( GDALDatasetH hDS, GDALDataType eType,
371                              char **papszOptions );
372
373 CPLErr CPL_DLL CPL_STDCALL GDALDatasetRasterIO(
374     GDALDatasetH hDS, GDALRWFlag eRWFlag,
375     int nDSXOff, int nDSYOff, int nDSXSize, int nDSYSize,
376     void * pBuffer, int nBXSize, int nBYSize, GDALDataType eBDataType,
377     int nBandCount, int *panBandCount,
378     int nPixelSpace, int nLineSpace, int nBandSpace);
379
380 CPLErr CPL_DLL CPL_STDCALL GDALDatasetAdviseRead( GDALDatasetH hDS,
381     int nDSXOff, int nDSYOff, int nDSXSize, int nDSYSize,
382     int nBXSize, int nBYSize, GDALDataType eBDataType,
383     int nBandCount, int *panBandCount, char **papszOptions );
384
385 const char CPL_DLL * CPL_STDCALL GDALGetProjectionRef( GDALDatasetH );
386 CPLErr CPL_DLL CPL_STDCALL GDALSetProjection( GDALDatasetH, const char * );
387 CPLErr CPL_DLL CPL_STDCALL GDALGetGeoTransform( GDALDatasetH, double * );
388 CPLErr CPL_DLL CPL_STDCALL GDALSetGeoTransform( GDALDatasetH, double * );
389
390 int CPL_DLL CPL_STDCALL  GDALGetGCPCount( GDALDatasetH );
391 const char CPL_DLL * CPL_STDCALL GDALGetGCPProjection( GDALDatasetH );
392 const GDAL_GCP CPL_DLL * CPL_STDCALL GDALGetGCPs( GDALDatasetH );
393 CPLErr CPL_DLL CPL_STDCALL GDALSetGCPs( GDALDatasetH, int, const GDAL_GCP *,
394                                         const char * );
395
396 void CPL_DLL * CPL_STDCALL GDALGetInternalHandle( GDALDatasetH, const char * );
397 int CPL_DLL CPL_STDCALL GDALReferenceDataset( GDALDatasetH );
398 int CPL_DLL CPL_STDCALL GDALDereferenceDataset( GDALDatasetH );
399
400 CPLErr CPL_DLL CPL_STDCALL
401 GDALBuildOverviews( GDALDatasetH, const char *, int, int *,
402                     int, int *, GDALProgressFunc, void * );
403 void CPL_DLL CPL_STDCALL GDALGetOpenDatasets( GDALDatasetH ***hDS, int *pnCount );
404 int CPL_DLL CPL_STDCALL GDALGetAccess( GDALDatasetH hDS );
405 void CPL_DLL CPL_STDCALL GDALFlushCache( GDALDatasetH hDS );
406
407 /* ==================================================================== */
408 /*      GDALRasterBand ... one band/channel in a dataset.               */
409 /* ==================================================================== */
410
411 /**
412  * SRCVAL - Macro which may be used by pixel functions to obtain
413  *          a pixel from a source buffer.
414  */
415 #define SRCVAL(papoSource, eSrcType, ii) \
416       (eSrcType == GDT_Byte ? \
417           ((char *)papoSource)[ii] : \
418       (eSrcType == GDT_Float32 ? \
419           ((float *)papoSource)[ii] : \
420       (eSrcType == GDT_Float64 ? \
421           ((double *)papoSource)[ii] : \
422       (eSrcType == GDT_Int32 ? \
423           ((GInt32 *)papoSource)[ii] : \
424       (eSrcType == GDT_UInt16 ? \
425           ((GUInt16 *)papoSource)[ii] : \
426       (eSrcType == GDT_Int16 ? \
427           ((GInt16 *)papoSource)[ii] : \
428       (eSrcType == GDT_UInt32 ? \
429           ((GUInt32 *)papoSource)[ii] : \
430       (eSrcType == GDT_CInt16 ? \
431           ((GInt16 *)papoSource)[ii * 2] : \
432       (eSrcType == GDT_CInt32 ? \
433           ((GInt32 *)papoSource)[ii * 2] : \
434       (eSrcType == GDT_CFloat32 ? \
435           ((float *)papoSource)[ii * 2] : \
436       (eSrcType == GDT_CFloat64 ? \
437           ((double *)papoSource)[ii * 2] : 0)))))))))))
438
439 typedef CPLErr
440 (*GDALDerivedPixelFunc)(void **papoSources, int nSources, void *pData,
441                         int nBufXSize, int nBufYSize,
442                         GDALDataType eSrcType, GDALDataType eBufType,
443                         int nPixelSpace, int nLineSpace);
444
445 GDALDataType CPL_DLL CPL_STDCALL GDALGetRasterDataType( GDALRasterBandH );
446 void CPL_DLL CPL_STDCALL
447 GDALGetBlockSize( GDALRasterBandH, int * pnXSize, int * pnYSize );
448
449 CPLErr CPL_DLL CPL_STDCALL GDALRasterAdviseRead( GDALRasterBandH hRB,
450     int nDSXOff, int nDSYOff, int nDSXSize, int nDSYSize,
451     int nBXSize, int nBYSize, GDALDataType eBDataType, char **papszOptions );
452
453 CPLErr CPL_DLL CPL_STDCALL
454 GDALRasterIO( GDALRasterBandH hRBand, GDALRWFlag eRWFlag,
455               int nDSXOff, int nDSYOff, int nDSXSize, int nDSYSize,
456               void * pBuffer, int nBXSize, int nBYSize,GDALDataType eBDataType,
457               int nPixelSpace, int nLineSpace );
458 CPLErr CPL_DLL CPL_STDCALL GDALReadBlock( GDALRasterBandH, int, int, void * );
459 CPLErr CPL_DLL CPL_STDCALL GDALWriteBlock( GDALRasterBandH, int, int, void * );
460 int CPL_DLL CPL_STDCALL GDALGetRasterBandXSize( GDALRasterBandH );
461 int CPL_DLL CPL_STDCALL GDALGetRasterBandYSize( GDALRasterBandH );
462 char CPL_DLL ** CPL_STDCALL GDALGetRasterMetadata( GDALRasterBandH );
463 GDALAccess CPL_DLL CPL_STDCALL GDALGetRasterAccess( GDALRasterBandH );
464 int CPL_DLL CPL_STDCALL GDALGetBandNumber( GDALRasterBandH );
465 GDALDatasetH CPL_DLL CPL_STDCALL GDALGetBandDataset( GDALRasterBandH );
466
467 GDALColorInterp CPL_DLL CPL_STDCALL
468 GDALGetRasterColorInterpretation( GDALRasterBandH );
469 CPLErr CPL_DLL CPL_STDCALL
470 GDALSetRasterColorInterpretation( GDALRasterBandH, GDALColorInterp );
471 GDALColorTableH CPL_DLL CPL_STDCALL GDALGetRasterColorTable( GDALRasterBandH );
472 CPLErr CPL_DLL CPL_STDCALL GDALSetRasterColorTable( GDALRasterBandH, GDALColorTableH );
473 int CPL_DLL CPL_STDCALL GDALHasArbitraryOverviews( GDALRasterBandH );
474 int CPL_DLL CPL_STDCALL GDALGetOverviewCount( GDALRasterBandH );
475 GDALRasterBandH CPL_DLL CPL_STDCALL GDALGetOverview( GDALRasterBandH, int );
476 double CPL_DLL CPL_STDCALL GDALGetRasterNoDataValue( GDALRasterBandH, int * );
477 CPLErr CPL_DLL CPL_STDCALL GDALSetRasterNoDataValue( GDALRasterBandH, double );
478 char CPL_DLL ** CPL_STDCALL GDALGetRasterCategoryNames( GDALRasterBandH );
479 CPLErr CPL_DLL CPL_STDCALL GDALSetRasterCategoryNames( GDALRasterBandH, char ** );
480 double CPL_DLL CPL_STDCALL GDALGetRasterMinimum( GDALRasterBandH, int *pbSuccess );
481 double CPL_DLL CPL_STDCALL GDALGetRasterMaximum( GDALRasterBandH, int *pbSuccess );
482 CPLErr CPL_DLL CPL_STDCALL GDALGetRasterStatistics(
483     GDALRasterBandH, int bApproxOK, int bForce,
484     double *pdfMin, double *pdfMax, double *pdfMean, double *pdfStdDev );
485 const char CPL_DLL * CPL_STDCALL GDALGetRasterUnitType( GDALRasterBandH );
486 double CPL_DLL CPL_STDCALL GDALGetRasterOffset( GDALRasterBandH, int *pbSuccess );
487 CPLErr CPL_DLL CPL_STDCALL GDALSetRasterOffset( GDALRasterBandH hBand, double dfNewOffset);
488 double CPL_DLL CPL_STDCALL GDALGetRasterScale( GDALRasterBandH, int *pbSuccess );
489 CPLErr CPL_DLL CPL_STDCALL GDALSetRasterScale( GDALRasterBandH hBand, double dfNewOffset );
490 void CPL_DLL CPL_STDCALL
491 GDALComputeRasterMinMax( GDALRasterBandH hBand, int bApproxOK,
492                          double adfMinMax[2] );
493 CPLErr CPL_DLL CPL_STDCALL GDALFlushRasterCache( GDALRasterBandH hBand );
494 CPLErr CPL_DLL CPL_STDCALL GDALGetRasterHistogram( GDALRasterBandH hBand,
495                                        double dfMin, double dfMax,
496                                        int nBuckets, int *panHistogram,
497                                        int bIncludeOutOfRange, int bApproxOK,
498                                        GDALProgressFunc pfnProgress,
499                                        void * pProgressData );
500 CPLErr CPL_DLL CPL_STDCALL GDALGetDefaultHistogram( GDALRasterBandH hBand,
501                                        double *pdfMin, double *pdfMax,
502                                        int *pnBuckets, int **ppanHistogram,
503                                        int bForce,
504                                        GDALProgressFunc pfnProgress,
505                                        void * pProgressData );
506 CPLErr CPL_DLL CPL_STDCALL GDALSetDefaultHistogram( GDALRasterBandH hBand,
507                                        double dfMin, double dfMax,
508                                        int nBuckets, int *panHistogram );
509 int CPL_DLL CPL_STDCALL
510 GDALGetRandomRasterSample( GDALRasterBandH, int, float * );
511 GDALRasterBandH CPL_DLL CPL_STDCALL
512 GDALGetRasterSampleOverview( GDALRasterBandH, int );
513 CPLErr CPL_DLL CPL_STDCALL GDALFillRaster( GDALRasterBandH hBand,
514                           double dfRealValue, double dfImaginaryValue );
515 CPLErr CPL_DLL CPL_STDCALL
516 GDALComputeBandStats( GDALRasterBandH hBand, int nSampleStep,
517                              double *pdfMean, double *pdfStdDev,
518                              GDALProgressFunc pfnProgress,
519                              void *pProgressData );
520 CPLErr CPL_DLL  GDALOverviewMagnitudeCorrection( GDALRasterBandH hBaseBand,
521                                         int nOverviewCount,
522                                         GDALRasterBandH *pahOverviews,
523                                         GDALProgressFunc pfnProgress,
524                                         void *pProgressData );
525
526 GDALRasterAttributeTableH CPL_DLL CPL_STDCALL GDALGetDefaultRAT(
527     GDALRasterBandH hBand );
528 CPLErr CPL_DLL CPL_STDCALL GDALSetDefaultRAT( GDALRasterBandH,
529                                               GDALRasterAttributeTableH );
530 CPLErr CPL_DLL CPL_STDCALL GDALAddDerivedBandPixelFunc( const char *pszName,
531                                     GDALDerivedPixelFunc pfnPixelFunc );
532
533 /* -------------------------------------------------------------------- */
534 /*      Helper functions.                                               */
535 /* -------------------------------------------------------------------- */
536 int CPL_DLL CPL_STDCALL GDALGeneralCmdLineProcessor( int nArgc, char ***ppapszArgv,
537                                          int nOptions );
538 void CPL_DLL CPL_STDCALL GDALSwapWords( void *pData, int nWordSize, int nWordCount,
539                             int nWordSkip );
540 void CPL_DLL CPL_STDCALL
541     GDALCopyWords( void * pSrcData, GDALDataType eSrcType, int nSrcPixelOffset,
542                    void * pDstData, GDALDataType eDstType, int nDstPixelOffset,
543                    int nWordCount );
544
545 int CPL_DLL CPL_STDCALL GDALReadWorldFile( const char *pszBaseFilename,
546                        const char *pszExtension,
547                        double * padfGeoTransform );
548 int CPL_DLL CPL_STDCALL GDALWriteWorldFile( const char *pszBaseFilename,
549                        const char *pszExtension,
550                        double * padfGeoTransform );
551 int CPL_DLL CPL_STDCALL GDALReadTabFile( const char *pszBaseFilename,
552                              double *padfGeoTransform, char **ppszWKT,
553                              int *pnGCPCount, GDAL_GCP **ppasGCPs );
554
555 const char CPL_DLL * CPL_STDCALL GDALDecToDMS( double, const char *, int );
556 double CPL_DLL CPL_STDCALL GDALPackedDMSToDec( double );
557 double CPL_DLL CPL_STDCALL GDALDecToPackedDMS( double );
558
559 const char CPL_DLL * CPL_STDCALL GDALVersionInfo( const char * );
560
561 typedef struct {
562     double      dfLINE_OFF;
563     double      dfSAMP_OFF;
564     double      dfLAT_OFF;
565     double      dfLONG_OFF;
566     double      dfHEIGHT_OFF;
567
568     double      dfLINE_SCALE;
569     double      dfSAMP_SCALE;
570     double      dfLAT_SCALE;
571     double      dfLONG_SCALE;
572     double      dfHEIGHT_SCALE;
573
574     double      adfLINE_NUM_COEFF[20];
575     double      adfLINE_DEN_COEFF[20];
576     double      adfSAMP_NUM_COEFF[20];
577     double      adfSAMP_DEN_COEFF[20];
578    
579     double      dfMIN_LONG;
580     double      dfMIN_LAT;
581     double      dfMAX_LONG;
582     double      dfMAX_LAT;
583
584 } GDALRPCInfo;
585
586 int CPL_DLL CPL_STDCALL GDALExtractRPCInfo( char **, GDALRPCInfo * );
587
588 /* ==================================================================== */
589 /*      Color tables.                                                   */
590 /* ==================================================================== */
591 /** Color tuple */
592 typedef struct
593 {
594     /*! gray, red, cyan or hue */
595     short      c1;     
596
597     /*! green, magenta, or lightness */   
598     short      c2;     
599
600     /*! blue, yellow, or saturation */
601     short      c3;     
602
603     /*! alpha or blackband */
604     short      c4;     
605 } GDALColorEntry;
606
607 GDALColorTableH CPL_DLL CPL_STDCALL GDALCreateColorTable( GDALPaletteInterp );
608 void CPL_DLL CPL_STDCALL GDALDestroyColorTable( GDALColorTableH );
609 GDALColorTableH CPL_DLL CPL_STDCALL GDALCloneColorTable( GDALColorTableH );
610 GDALPaletteInterp CPL_DLL CPL_STDCALL GDALGetPaletteInterpretation( GDALColorTableH );
611 int CPL_DLL CPL_STDCALL GDALGetColorEntryCount( GDALColorTableH );
612 const GDALColorEntry CPL_DLL * CPL_STDCALL GDALGetColorEntry( GDALColorTableH, int );
613 int CPL_DLL CPL_STDCALL GDALGetColorEntryAsRGB( GDALColorTableH, int, GDALColorEntry *);
614 void CPL_DLL CPL_STDCALL GDALSetColorEntry( GDALColorTableH, int, const GDALColorEntry * );
615
616 /* ==================================================================== */
617 /*      Raster Attribute Table                                          */
618 /* ==================================================================== */
619
620 typedef enum {
621     /*! Integer field */                   GFT_Integer ,
622     /*! Floating point (double) field */   GFT_Real,
623     /*! String field */                    GFT_String
624 } GDALRATFieldType;
625
626 typedef enum {
627     /*! General purpose field. */          GFU_Generic = 0, 
628     /*! Histogram pixel count */           GFU_PixelCount = 1,
629     /*! Class name */                      GFU_Name = 2,
630     /*! Class range minimum */             GFU_Min = 3,
631     /*! Class range maximum */             GFU_Max = 4,
632     /*! Class value (min=max) */           GFU_MinMax = 5,
633     /*! Red class color (0-255) */         GFU_Red = 6,
634     /*! Green class color (0-255) */       GFU_Green = 7,
635     /*! Blue class color (0-255) */        GFU_Blue = 8,
636     /*! Alpha (0=transparent,255=opaque)*/ GFU_Alpha = 9,
637     /*! Color Range Red Minimum */         GFU_RedMin = 10,
638     /*! Color Range Green Minimum */       GFU_GreenMin = 11,
639     /*! Color Range Blue Minimum */        GFU_BlueMin = 12,
640     /*! Color Range Alpha Minimum */       GFU_AlphaMin = 13,
641     /*! Color Range Red Maximum */         GFU_RedMax = 14,
642     /*! Color Range Green Maximum */       GFU_GreenMax = 15,
643     /*! Color Range Blue Maximum */        GFU_BlueMax = 16,
644     /*! Color Range Alpha Maximum */       GFU_AlphaMax = 17,
645     /*! Maximum GFU value */               GFU_MaxCount
646 } GDALRATFieldUsage;
647
648 GDALRasterAttributeTableH CPL_DLL CPL_STDCALL
649                                            GDALCreateRasterAttributeTable(void);
650 void CPL_DLL CPL_STDCALL GDALDestroyRasterAttributeTable(
651     GDALRasterAttributeTableH );
652
653 int CPL_DLL CPL_STDCALL GDALRATGetColumnCount( GDALRasterAttributeTableH );
654
655 const char CPL_DLL * CPL_STDCALL GDALRATGetNameOfCol(
656     GDALRasterAttributeTableH, int );
657 GDALRATFieldUsage CPL_DLL CPL_STDCALL GDALRATGetUsageOfCol(
658     GDALRasterAttributeTableH, int );
659 GDALRATFieldType CPL_DLL CPL_STDCALL GDALRATGetTypeOfCol(
660     GDALRasterAttributeTableH, int );
661
662 int CPL_DLL CPL_STDCALL GDALRATGetColOfUsage( GDALRasterAttributeTableH,
663                                               GDALRATFieldUsage );
664 int CPL_DLL CPL_STDCALL GDALRATGetRowCount( GDALRasterAttributeTableH );
665
666 const char CPL_DLL * CPL_STDCALL GDALRATGetValueAsString(
667     GDALRasterAttributeTableH, int ,int);
668 int CPL_DLL CPL_STDCALL GDALRATGetValueAsInt(
669     GDALRasterAttributeTableH, int ,int);
670 double CPL_DLL CPL_STDCALL GDALRATGetValueAsDouble(
671     GDALRasterAttributeTableH, int ,int);
672
673 void CPL_DLL CPL_STDCALL GDALRATSetValueAsString( GDALRasterAttributeTableH, int, int,
674                                                   const char * );
675 void CPL_DLL CPL_STDCALL GDALRATSetValueAsInt( GDALRasterAttributeTableH, int, int,
676                                                int );
677 void CPL_DLL CPL_STDCALL GDALRATSetValueAsDouble( GDALRasterAttributeTableH, int, int,
678                                                   double );
679 void CPL_DLL CPL_STDCALL GDALRATSetRowCount( GDALRasterAttributeTableH,
680                                              int );
681 CPLErr CPL_DLL CPL_STDCALL GDALRATCreateColumn( GDALRasterAttributeTableH,
682                                                 const char *,
683                                                 GDALRATFieldType,
684                                                 GDALRATFieldUsage );
685 CPLErr CPL_DLL CPL_STDCALL GDALRATSetLinearBinning( GDALRasterAttributeTableH,
686                                                     double, double );
687 int CPL_DLL CPL_STDCALL GDALRATGetLinearBinning( GDALRasterAttributeTableH,
688                                                  double *, double * );
689 CPLErr CPL_DLL CPL_STDCALL GDALRATInitializeFromColorTable(
690     GDALRasterAttributeTableH, GDALColorTableH );
691 void CPL_DLL CPL_STDCALL GDALRATDumpReadable( GDALRasterAttributeTableH,
692                                               FILE * );
693 GDALRasterAttributeTableH CPL_DLL CPL_STDCALL
694     GDALRATClone( GDALRasterAttributeTableH );
695
696 int CPL_DLL CPL_STDCALL GDALRATGetRowOfValue( GDALRasterAttributeTableH , double );
697
698
699 /* ==================================================================== */
700 /*      GDAL Cache Management                                           */
701 /* ==================================================================== */
702
703 void CPL_DLL CPL_STDCALL GDALSetCacheMax( int nBytes );
704 int CPL_DLL CPL_STDCALL GDALGetCacheMax(void);
705 int CPL_DLL CPL_STDCALL GDALGetCacheUsed(void);
706 int CPL_DLL CPL_STDCALL GDALFlushCacheBlock(void);
707
708 CPL_C_END
709
710 #endif /* ndef GDAL_H_INCLUDED */
Note: See TracBrowser for help on using the browser.