00001 00002 00003 00004 00005 00006 00007 00008 00009 00010 00011 00012 00013 00014 00015 00016 00017 00018 00019 00020 00021 00022 00023 00024 00025 00026 00027 00028 00029 00030 00031 00031 00031 00031 00032 00033 00034 00035 00036 00037 00038 00039 00040 00041 00042 00043 00044 00045 00046 00047 00048 00049 00050 00051 00052 00053 00054 00055 00056 00057 00058 00059 00060 00061 00062 00063 00064 00065 00066 00067 00068 00069 00070 00071 00072 00073 00074 00075 00076 00077 00078 00079 00080 00081 00082 00083 00084 00085 00086 00087 00088 00089 00090 00091 00092 00093 00094 00095 00096 00097 00098 00099 00100 00101 00102 00103 00104 00105 00106 00107 00108 00109 00110 00111 00112 00113 00114 00115 00116 00117 00118 00119 00120 00121 00122 00123 00124 00125
00126
00127 #ifndef GDAL_H_INCLUDED
00128 #define GDAL_H_INCLUDED
00129
00136 #include "cpl_port.h"
00137 #include "cpl_error.h"
00138
00139
00140
00141
00142
00143 CPL_C_START
00144
00146 typedef enum {
00147 GDT_Unknown = 0, GDT_Byte = 1, GDT_UInt16 = 2, GDT_Int16 = 3, GDT_UInt32 = 4, GDT_Int32 = 5, GDT_Float32 = 6, GDT_Float64 = 7, GDT_CInt16 = 8, GDT_CInt32 = 9, GDT_CFloat32 = 10, GDT_CFloat64 = 11,
00159 GDT_TypeCount = 12
00160 } GDALDataType;
00161
00162 int CPL_DLL GDALGetDataTypeSize( GDALDataType );
00163 int CPL_DLL GDALDataTypeIsComplex( GDALDataType );
00164 const char CPL_DLL *GDALGetDataTypeName( GDALDataType );
00165
00167 typedef enum { GA_ReadOnly = 0, GA_Update = 1
00170 } GDALAccess;
00171
00173 typedef enum { GF_Read = 0, GF_Write = 1
00176 } GDALRWFlag;
00177
00179 typedef enum
00180 {
00181 GCI_Undefined=0, GCI_GrayIndex=1, GCI_PaletteIndex=2, GCI_RedBand=3, GCI_GreenBand=4, GCI_BlueBand=5, GCI_AlphaBand=6, GCI_HueBand=7, GCI_SaturationBand=8, GCI_LightnessBand=9, GCI_CyanBand=10, GCI_MagentaBand=11, GCI_YellowBand=12, GCI_BlackBand=13
00195 } GDALColorInterp;
00196
00198 const char CPL_DLL *GDALGetColorInterpretationName( GDALColorInterp );
00199
00201 typedef enum
00202 { GPI_Gray=0, GPI_RGB=1, GPI_CMYK=2, GPI_HLS=3
00207 } GDALPaletteInterp;
00208
00210 const char CPL_DLL *GDALGetPaletteInterpretationName( GDALPaletteInterp );
00211
00212
00213
00214
00215
00216
00217 #define CPLE_WrongFormat 200
00218
00219
00220
00221
00222 typedef void *GDALMajorObjectH;
00223 typedef void *GDALDatasetH;
00224 typedef void *GDALRasterBandH;
00225 typedef void *GDALDriverH;
00226 typedef void *GDALProjDefH;
00227 typedef void *GDALColorTableH;
00228
00229
00230
00231
00234 typedef int (*GDALProgressFunc)(double,const char *, void *);
00235 int CPL_DLL GDALDummyProgress( double, const char *, void *);
00236 int CPL_DLL GDALTermProgress( double, const char *, void *);
00237 int CPL_DLL GDALScaledProgress( double, const char *, void *);
00238 void CPL_DLL *GDALCreateScaledProgress( double, double,
00239 GDALProgressFunc, void * );
00240 void CPL_DLL GDALDestroyScaledProgress( void * );
00241
00242
00243
00244
00245
00246 void CPL_DLL GDALAllRegister( void );
00247
00248 GDALDatasetH CPL_DLL GDALCreate( GDALDriverH hDriver,
00249 const char *, int, int, int, GDALDataType,
00250 char ** );
00251 GDALDatasetH CPL_DLL GDALCreateCopy( GDALDriverH, const char *, GDALDatasetH,
00252 int, char **, GDALProgressFunc, void * );
00253
00254 GDALDatasetH CPL_DLL GDALOpen( const char *, GDALAccess );
00255
00256 GDALDriverH CPL_DLL GDALGetDriverByName( const char * );
00257 int CPL_DLL GDALGetDriverCount();
00258 GDALDriverH CPL_DLL GDALGetDriver( int );
00259 int CPL_DLL GDALRegisterDriver( GDALDriverH );
00260 void CPL_DLL GDALDeregisterDriver( GDALDriverH );
00261 CPLErr CPL_DLL GDALDeleteDataset( GDALDriverH, const char * );
00262
00263 const char CPL_DLL *GDALGetDriverShortName( GDALDriverH );
00264 const char CPL_DLL *GDALGetDriverLongName( GDALDriverH );
00265 const char CPL_DLL *GDALGetDriverHelpTopic( GDALDriverH );
00266
00267
00268
00269
00270
00272 typedef struct
00273 {
00275 char *pszId;
00276
00278 char *pszInfo;
00279
00281 double dfGCPPixel;
00283 double dfGCPLine;
00284
00286 double dfGCPX;
00287
00289 double dfGCPY;
00290
00292 double dfGCPZ;
00293 } GDAL_GCP;
00294
00295 void CPL_DLL GDALInitGCPs( int, GDAL_GCP * );
00296 void CPL_DLL GDALDeinitGCPs( int, GDAL_GCP * );
00297 GDAL_GCP CPL_DLL *GDALDuplicateGCPs( int, const GDAL_GCP * );
00298
00299
00300
00301
00302
00303 char CPL_DLL **GDALGetMetadata( GDALMajorObjectH, const char * );
00304 CPLErr CPL_DLL GDALSetMetadata( GDALMajorObjectH, char **,
00305 const char * );
00306 char CPL_DLL **GDALGetMetadataItem( GDALMajorObjectH, const char * );
00307 CPLErr CPL_DLL GDALSetMetadataItem( GDALMajorObjectH,
00308 const char *, const char *,
00309 const char * );
00310 const char CPL_DLL *GDALGetDescription( GDALMajorObjectH );
00311
00312
00313
00314
00315
00316 GDALDriverH CPL_DLL GDALGetDatasetDriver( GDALDatasetH );
00317 void CPL_DLL GDALClose( GDALDatasetH );
00318 int CPL_DLL GDALGetRasterXSize( GDALDatasetH );
00319 int CPL_DLL GDALGetRasterYSize( GDALDatasetH );
00320 int CPL_DLL GDALGetRasterCount( GDALDatasetH );
00321 GDALRasterBandH CPL_DLL GDALGetRasterBand( GDALDatasetH, int );
00322
00323 const char CPL_DLL *GDALGetProjectionRef( GDALDatasetH );
00324 CPLErr CPL_DLL GDALSetProjection( GDALDatasetH, const char * );
00325 CPLErr CPL_DLL GDALGetGeoTransform( GDALDatasetH, double * );
00326 CPLErr CPL_DLL GDALSetGeoTransform( GDALDatasetH, double * );
00327
00328 int CPL_DLL GDALGetGCPCount( GDALDatasetH );
00329 const char CPL_DLL *GDALGetGCPProjection( GDALDatasetH );
00330 const GDAL_GCP CPL_DLL *GDALGetGCPs( GDALDatasetH );
00331
00332 void CPL_DLL *GDALGetInternalHandle( GDALDatasetH, const char * );
00333 int CPL_DLL GDALReferenceDataset( GDALDatasetH );
00334 int CPL_DLL GDALDereferenceDataset( GDALDatasetH );
00335
00336 CPLErr CPL_DLL GDALBuildOverviews( GDALDatasetH, const char *, int, int *,
00337 int, int *, GDALProgressFunc, void * );
00338
00339
00340
00341
00342
00343 GDALDataType CPL_DLL GDALGetRasterDataType( GDALRasterBandH );
00344 void CPL_DLL GDALGetBlockSize( GDALRasterBandH,
00345 int * pnXSize, int * pnYSize );
00346
00347 CPLErr CPL_DLL GDALRasterIO( GDALRasterBandH hRBand, GDALRWFlag eRWFlag,
00348 int nDSXOff, int nDSYOff,
00349 int nDSXSize, int nDSYSize,
00350 void * pBuffer, int nBXSize, int nBYSize,
00351 GDALDataType eBDataType,
00352 int nPixelSpace, int nLineSpace );
00353 CPLErr CPL_DLL GDALReadBlock( GDALRasterBandH, int, int, void * );
00354 CPLErr CPL_DLL GDALWriteBlock( GDALRasterBandH, int, int, void * );
00355 int CPL_DLL GDALGetRasterBandXSize( GDALRasterBandH );
00356 int CPL_DLL GDALGetRasterBandYSize( GDALRasterBandH );
00357 char CPL_DLL **GDALGetRasterMetadata( GDALRasterBandH );
00358
00359 GDALColorInterp CPL_DLL GDALGetRasterColorInterpretation( GDALRasterBandH );
00360 GDALColorTableH CPL_DLL GDALGetRasterColorTable( GDALRasterBandH );
00361 int CPL_DLL GDALHasArbitraryOverviews( GDALRasterBandH );
00362 int CPL_DLL GDALGetOverviewCount( GDALRasterBandH );
00363 GDALRasterBandH CPL_DLL GDALGetOverview( GDALRasterBandH, int );
00364 double CPL_DLL GDALGetRasterNoDataValue( GDALRasterBandH, int *pbSuccess );
00365 double CPL_DLL GDALGetRasterMinimum( GDALRasterBandH, int *pbSuccess );
00366 double CPL_DLL GDALGetRasterMaximum( GDALRasterBandH, int *pbSuccess );
00367 void CPL_DLL GDALComputeRasterMinMax( GDALRasterBandH hBand, int bApproxOK,
00368 double adfMinMax[2] );
00369 CPLErr CPL_DLL GDALFlushRasterCache( GDALRasterBandH hBand );
00370 CPLErr CPL_DLL GDALGetRasterHistogram( GDALRasterBandH hBand,
00371 double dfMin, double dfMax,
00372 int nBuckets, int *panHistogram,
00373 int bIncludeOutOfRange, int bApproxOK,
00374 GDALProgressFunc pfnProgress,
00375 void * pProgressData );
00376 int CPL_DLL GDALGetRandomRasterSample( GDALRasterBandH, int, float * );
00377 GDALRasterBandH CPL_DLL GDALGetRasterSampleOverview( GDALRasterBandH, int );
00378
00379
00380
00381
00382 void CPL_DLL GDALSwapWords( void *pData, int nWordSize, int nWordCount,
00383 int nWordSkip );
00384 void CPL_DLL
00385 GDALCopyWords( void * pSrcData, GDALDataType eSrcType, int nSrcPixelOffset,
00386 void * pDstData, GDALDataType eDstType, int nDstPixelOffset,
00387 int nWordCount );
00388
00389
00390
00391
00392
00394 typedef struct
00395 {
00397 short c1;
00398
00400 short c2;
00401
00403 short c3;
00404
00406 short c4;
00407 } GDALColorEntry;
00408
00409 GDALColorTableH CPL_DLL GDALCreateColorTable( GDALPaletteInterp );
00410 void CPL_DLL GDALDestroyColorTable( GDALColorTableH );
00411 GDALColorTableH CPL_DLL GDALCloneColorTable( GDALColorTableH );
00412 GDALPaletteInterp CPL_DLL GDALGetPaletteInterpretation( GDALColorTableH );
00413 int CPL_DLL GDALGetColorEntryCount( GDALColorTableH );
00414 const GDALColorEntry CPL_DLL *GDALGetColorEntry( GDALColorTableH, int );
00415 int CPL_DLL GDALGetColorEntryAsRGB( GDALColorTableH, int, GDALColorEntry *);
00416 void CPL_DLL GDALSetColorEntry( GDALColorTableH, int, const GDALColorEntry * );
00417
00418
00419
00420
00421
00422 GDALProjDefH CPL_DLL GDALCreateProjDef( const char * );
00423 CPLErr CPL_DLL GDALReprojectToLongLat( GDALProjDefH, double *, double * );
00424 CPLErr CPL_DLL GDALReprojectFromLongLat( GDALProjDefH, double *, double * );
00425 void CPL_DLL GDALDestroyProjDef( GDALProjDefH );
00426 const char CPL_DLL *GDALDecToDMS( double, const char *, int );
00427
00428
00429
00430
00431
00432 void CPL_DLL GDALSetCacheMax( int nBytes );
00433 int CPL_DLL GDALGetCacheMax();
00434 int CPL_DLL GDALGetCacheUsed();
00435 int CPL_DLL GDALFlushCacheBlock();
00436
00437 CPL_C_END
00438
00439 #endif