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
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
00128
00129
00130
00131
00132
00133
00134
00135
00136
00137
00138
00139
00140
00141
00142
00143
00144
00145
00146
00147
00148
00149
00150
00151
00152
00153
00154
00155
00156
00157
00158
00159
00160
00161
00162
00163
00164
00165
00166
00167
00168
00169
00170
00171
00172
00173
00174
00175
00176
00177 #ifndef GDAL_H_INCLUDED
00178 #define GDAL_H_INCLUDED
00179
00186 #include "gdal_version.h"
00187 #include "cpl_port.h"
00188 #include "cpl_error.h"
00189
00190
00191
00192
00193
00194 CPL_C_START
00195
00197 typedef enum {
00198 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,
00210 GDT_TypeCount = 12
00211 } GDALDataType;
00212
00213 int CPL_DLL GDALGetDataTypeSize( GDALDataType );
00214 int CPL_DLL GDALDataTypeIsComplex( GDALDataType );
00215 const char CPL_DLL *GDALGetDataTypeName( GDALDataType );
00216 GDALDataType CPL_DLL GDALGetDataTypeByName( const char * );
00217 GDALDataType CPL_DLL GDALDataTypeUnion( GDALDataType, GDALDataType );
00218
00220 typedef enum { GA_ReadOnly = 0, GA_Update = 1
00223 } GDALAccess;
00224
00226 typedef enum { GF_Read = 0, GF_Write = 1
00229 } GDALRWFlag;
00230
00232 typedef enum
00233 {
00234 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, GCI_YCbCr_YBand=14, GCI_YCbCr_CbBand=15, GCI_YCbCr_CrBand=16, GCI_Max=16
00252 } GDALColorInterp;
00253
00255 const char CPL_DLL *GDALGetColorInterpretationName( GDALColorInterp );
00256
00258 typedef enum
00259 { GPI_Gray=0, GPI_RGB=1, GPI_CMYK=2, GPI_HLS=3
00264 } GDALPaletteInterp;
00265
00267 const char CPL_DLL *GDALGetPaletteInterpretationName( GDALPaletteInterp );
00268
00269
00270
00271
00272
00273
00274 #define CPLE_WrongFormat 200
00275
00276
00277
00278
00279 typedef void *GDALMajorObjectH;
00280 typedef void *GDALDatasetH;
00281 typedef void *GDALRasterBandH;
00282 typedef void *GDALDriverH;
00283 typedef void *GDALProjDefH;
00284 typedef void *GDALColorTableH;
00285
00286
00287
00288
00289
00290 typedef int (*GDALProgressFunc)(double,const char *, void *);
00291 int CPL_DLL GDALDummyProgress( double, const char *, void *);
00292 int CPL_DLL GDALTermProgress( double, const char *, void *);
00293 int CPL_DLL GDALScaledProgress( double, const char *, void *);
00294 void CPL_DLL *GDALCreateScaledProgress( double, double,
00295 GDALProgressFunc, void * );
00296 void CPL_DLL GDALDestroyScaledProgress( void * );
00297
00298
00299
00300
00301
00302 typedef struct {
00303 char *pszOptionName;
00304 char *pszValueType;
00305
00306 char *pszDescription;
00307 char **papszOptions;
00308 } GDALOptionDefinition;
00309
00310 #define GDAL_DMD_LONGNAME "DMD_LONGNAME"
00311 #define GDAL_DMD_HELPTOPIC "DMD_HELPTOPIC"
00312 #define GDAL_DMD_MIMETYPE "DMD_MIMETYPE"
00313 #define GDAL_DMD_EXTENSION "DMD_EXTENSION"
00314 #define GDAL_DMD_CREATIONOPTIONLIST "DMD_CREATIONOPTIONLIST"
00315 #define GDAL_DMD_CREATIONDATATYPES "DMD_CREATIONDATATYPES"
00316
00317 #define GDAL_DCAP_CREATE "DCAP_CREATE"
00318 #define GDAL_DCAP_CREATECOPY "DCAP_CREATECOPY"
00319
00320 void CPL_DLL GDALAllRegister( void );
00321
00322 GDALDatasetH CPL_DLL GDALCreate( GDALDriverH hDriver,
00323 const char *, int, int, int, GDALDataType,
00324 char ** );
00325 GDALDatasetH CPL_DLL GDALCreateCopy( GDALDriverH, const char *, GDALDatasetH,
00326 int, char **, GDALProgressFunc, void * );
00327
00328 GDALDatasetH CPL_DLL GDALOpen( const char *pszFilename, GDALAccess eAccess );
00329 GDALDatasetH CPL_DLL GDALOpenShared( const char *, GDALAccess );
00330 int CPL_DLL GDALDumpOpenDatasets( FILE * );
00331
00332 GDALDriverH CPL_DLL GDALGetDriverByName( const char * );
00333 int CPL_DLL GDALGetDriverCount();
00334 GDALDriverH CPL_DLL GDALGetDriver( int );
00335 int CPL_DLL GDALRegisterDriver( GDALDriverH );
00336 void CPL_DLL GDALDeregisterDriver( GDALDriverH );
00337 void CPL_DLL GDALDestroyDriverManager( void );
00338 CPLErr CPL_DLL GDALDeleteDataset( GDALDriverH, const char * );
00339
00340
00341 const char CPL_DLL *GDALGetDriverShortName( GDALDriverH );
00342 const char CPL_DLL *GDALGetDriverLongName( GDALDriverH );
00343 const char CPL_DLL *GDALGetDriverHelpTopic( GDALDriverH );
00344
00345
00346
00347
00348
00350 typedef struct
00351 {
00353 char *pszId;
00354
00356 char *pszInfo;
00357
00359 double dfGCPPixel;
00361 double dfGCPLine;
00362
00364 double dfGCPX;
00365
00367 double dfGCPY;
00368
00370 double dfGCPZ;
00371 } GDAL_GCP;
00372
00373 void CPL_DLL GDALInitGCPs( int, GDAL_GCP * );
00374 void CPL_DLL GDALDeinitGCPs( int, GDAL_GCP * );
00375 GDAL_GCP CPL_DLL *GDALDuplicateGCPs( int, const GDAL_GCP * );
00376
00377 int CPL_DLL GDALGCPsToGeoTransform( int nGCPCount, const GDAL_GCP *pasGCPs,
00378 double *padfGeoTransform, int bApproxOK );
00379 int CPL_DLL GDALInvGeoTransform( double *padfGeoTransformIn,
00380 double *padfInvGeoTransformOut );
00381 void CPL_DLL GDALApplyGeoTransform( double *, double, double,
00382 double *, double * );
00383
00384
00385
00386
00387
00388 char CPL_DLL **GDALGetMetadata( GDALMajorObjectH, const char * );
00389 CPLErr CPL_DLL GDALSetMetadata( GDALMajorObjectH, char **,
00390 const char * );
00391 const char CPL_DLL *GDALGetMetadataItem( GDALMajorObjectH, const char *,
00392 const char * );
00393 CPLErr CPL_DLL GDALSetMetadataItem( GDALMajorObjectH,
00394 const char *, const char *,
00395 const char * );
00396 const char CPL_DLL *GDALGetDescription( GDALMajorObjectH );
00397 void CPL_DLL GDALSetDescription( GDALMajorObjectH, const char * );
00398
00399
00400
00401
00402
00403 GDALDriverH CPL_DLL GDALGetDatasetDriver( GDALDatasetH );
00404 void CPL_DLL GDALClose( GDALDatasetH );
00405 int CPL_DLL GDALGetRasterXSize( GDALDatasetH );
00406 int CPL_DLL GDALGetRasterYSize( GDALDatasetH );
00407 int CPL_DLL GDALGetRasterCount( GDALDatasetH );
00408 GDALRasterBandH CPL_DLL GDALGetRasterBand( GDALDatasetH, int );
00409
00410 CPLErr CPL_DLL GDALAddBand( GDALDatasetH hDS, GDALDataType eType,
00411 char **papszOptions );
00412
00413 CPLErr CPL_DLL GDALDatasetRasterIO(
00414 GDALDatasetH hDS, GDALRWFlag eRWFlag,
00415 int nDSXOff, int nDSYOff, int nDSXSize, int nDSYSize,
00416 void * pBuffer, int nBXSize, int nBYSize, GDALDataType eBDataType,
00417 int nBandCount, int *panBandCount,
00418 int nPixelSpace, int nLineSpace, int nBandSpace);
00419
00420 CPLErr CPL_DLL GDALDatasetAdviseRead( GDALDatasetH hDS,
00421 int nDSXOff, int nDSYOff, int nDSXSize, int nDSYSize,
00422 int nBXSize, int nBYSize, GDALDataType eBDataType,
00423 int nBandCount, int *panBandCount, char **papszOptions );
00424
00425 const char CPL_DLL *GDALGetProjectionRef( GDALDatasetH );
00426 CPLErr CPL_DLL GDALSetProjection( GDALDatasetH, const char * );
00427 CPLErr CPL_DLL GDALGetGeoTransform( GDALDatasetH, double * );
00428 CPLErr CPL_DLL GDALSetGeoTransform( GDALDatasetH, double * );
00429
00430 int CPL_DLL GDALGetGCPCount( GDALDatasetH );
00431 const char CPL_DLL *GDALGetGCPProjection( GDALDatasetH );
00432 const GDAL_GCP CPL_DLL *GDALGetGCPs( GDALDatasetH );
00433 CPLErr CPL_DLL GDALSetGCPs( GDALDatasetH, int, const GDAL_GCP *,
00434 const char * );
00435
00436 void CPL_DLL *GDALGetInternalHandle( GDALDatasetH, const char * );
00437 int CPL_DLL GDALReferenceDataset( GDALDatasetH );
00438 int CPL_DLL GDALDereferenceDataset( GDALDatasetH );
00439
00440 CPLErr CPL_DLL GDALBuildOverviews( GDALDatasetH, const char *, int, int *,
00441 int, int *, GDALProgressFunc, void * );
00442 void CPL_DLL GDALGetOpenDatasets( GDALDatasetH ***hDS, int *pnCount );
00443 int CPL_DLL GDALGetAccess( GDALDatasetH hDS );
00444 void CPL_DLL GDALFlushCache( GDALDatasetH hDS );
00445
00446
00447
00448
00449
00450 GDALDataType CPL_DLL GDALGetRasterDataType( GDALRasterBandH );
00451 void CPL_DLL GDALGetBlockSize( GDALRasterBandH,
00452 int * pnXSize, int * pnYSize );
00453
00454 CPLErr CPL_DLL GDALRasterAdviseRead( GDALRasterBandH hRB,
00455 int nDSXOff, int nDSYOff, int nDSXSize, int nDSYSize,
00456 int nBXSize, int nBYSize, GDALDataType eBDataType, char **papszOptions );
00457
00458 CPLErr CPL_DLL GDALRasterIO( GDALRasterBandH hRBand, GDALRWFlag eRWFlag,
00459 int nDSXOff, int nDSYOff,
00460 int nDSXSize, int nDSYSize,
00461 void * pBuffer, int nBXSize, int nBYSize,
00462 GDALDataType eBDataType,
00463 int nPixelSpace, int nLineSpace );
00464 CPLErr CPL_DLL GDALReadBlock( GDALRasterBandH, int, int, void * );
00465 CPLErr CPL_DLL GDALWriteBlock( GDALRasterBandH, int, int, void * );
00466 int CPL_DLL GDALGetRasterBandXSize( GDALRasterBandH );
00467 int CPL_DLL GDALGetRasterBandYSize( GDALRasterBandH );
00468 char CPL_DLL **GDALGetRasterMetadata( GDALRasterBandH );
00469 GDALAccess CPL_DLL GDALGetRasterAccess( GDALRasterBandH );
00470 int CPL_DLL GDALGetBandNumber( GDALRasterBandH );
00471 GDALDatasetH CPL_DLL GDALGetBandDataset( GDALRasterBandH );
00472
00473 GDALColorInterp CPL_DLL GDALGetRasterColorInterpretation( GDALRasterBandH );
00474 CPLErr CPL_DLL GDALSetRasterColorInterpretation( GDALRasterBandH,
00475 GDALColorInterp );
00476 GDALColorTableH CPL_DLL GDALGetRasterColorTable( GDALRasterBandH );
00477 CPLErr CPL_DLL GDALSetRasterColorTable( GDALRasterBandH, GDALColorTableH );
00478 int CPL_DLL GDALHasArbitraryOverviews( GDALRasterBandH );
00479 int CPL_DLL GDALGetOverviewCount( GDALRasterBandH );
00480 GDALRasterBandH CPL_DLL GDALGetOverview( GDALRasterBandH, int );
00481 double CPL_DLL GDALGetRasterNoDataValue( GDALRasterBandH, int * );
00482 CPLErr CPL_DLL GDALSetRasterNoDataValue( GDALRasterBandH, double );
00483 char CPL_DLL ** GDALGetRasterCategoryNames( GDALRasterBandH );
00484 CPLErr CPL_DLL GDALSetRasterCategoryNames( GDALRasterBandH, char ** );
00485 double CPL_DLL GDALGetRasterMinimum( GDALRasterBandH, int *pbSuccess );
00486 double CPL_DLL GDALGetRasterMaximum( GDALRasterBandH, int *pbSuccess );
00487 const char CPL_DLL *GDALGetRasterUnitType( GDALRasterBandH );
00488 double CPL_DLL GDALGetRasterOffset( GDALRasterBandH, int *pbSuccess );
00489 double CPL_DLL GDALGetRasterScale( GDALRasterBandH, int *pbSuccess );
00490 void CPL_DLL GDALComputeRasterMinMax( GDALRasterBandH hBand, int bApproxOK,
00491 double adfMinMax[2] );
00492 CPLErr CPL_DLL GDALFlushRasterCache( GDALRasterBandH hBand );
00493 CPLErr CPL_DLL GDALGetRasterHistogram( GDALRasterBandH hBand,
00494 double dfMin, double dfMax,
00495 int nBuckets, int *panHistogram,
00496 int bIncludeOutOfRange, int bApproxOK,
00497 GDALProgressFunc pfnProgress,
00498 void * pProgressData );
00499 int CPL_DLL GDALGetRandomRasterSample( GDALRasterBandH, int, float * );
00500 GDALRasterBandH CPL_DLL GDALGetRasterSampleOverview( GDALRasterBandH, int );
00501 CPLErr CPL_DLL GDALFillRaster( GDALRasterBandH hBand, double dfRealValue,
00502 double dfImaginaryValue );
00503 CPLErr CPL_DLL GDALComputeBandStats( GDALRasterBandH hBand, int nSampleStep,
00504 double *pdfMean, double *pdfStdDev,
00505 GDALProgressFunc pfnProgress,
00506 void *pProgressData );
00507 CPLErr CPL_DLL GDALOverviewMagnitudeCorrection( GDALRasterBandH hBaseBand,
00508 int nOverviewCount,
00509 GDALRasterBandH *pahOverviews,
00510 GDALProgressFunc pfnProgress,
00511 void *pProgressData );
00512
00513
00514
00515
00516 int CPL_DLL GDALGeneralCmdLineProcessor( int nArgc, char ***ppapszArgv,
00517 int nOptions );
00518 void CPL_DLL GDALSwapWords( void *pData, int nWordSize, int nWordCount,
00519 int nWordSkip );
00520 void CPL_DLL
00521 GDALCopyWords( void * pSrcData, GDALDataType eSrcType, int nSrcPixelOffset,
00522 void * pDstData, GDALDataType eDstType, int nDstPixelOffset,
00523 int nWordCount );
00524
00525 int CPL_DLL GDALReadWorldFile( const char *pszBaseFilename,
00526 const char *pszExtension,
00527 double * padfGeoTransform );
00528 int CPL_DLL GDALWriteWorldFile( const char *pszBaseFilename,
00529 const char *pszExtension,
00530 double * padfGeoTransform );
00531 int CPL_DLL GDALReadTabFile( const char *pszBaseFilename,
00532 double *padfGeoTransform, char **ppszWKT,
00533 int *pnGCPCount, GDAL_GCP **ppasGCPs );
00534
00535 const char CPL_DLL *GDALDecToDMS( double, const char *, int );
00536 double CPL_DLL GDALPackedDMSToDec( double );
00537 double CPL_DLL GDALDecToPackedDMS( double );
00538
00539 const char CPL_DLL *GDALVersionInfo( const char * );
00540
00541 typedef struct {
00542 double dfLINE_OFF;
00543 double dfSAMP_OFF;
00544 double dfLAT_OFF;
00545 double dfLONG_OFF;
00546 double dfHEIGHT_OFF;
00547
00548 double dfLINE_SCALE;
00549 double dfSAMP_SCALE;
00550 double dfLAT_SCALE;
00551 double dfLONG_SCALE;
00552 double dfHEIGHT_SCALE;
00553
00554 double adfLINE_NUM_COEFF[20];
00555 double adfLINE_DEN_COEFF[20];
00556 double adfSAMP_NUM_COEFF[20];
00557 double adfSAMP_DEN_COEFF[20];
00558
00559 double dfMIN_LONG;
00560 double dfMIN_LAT;
00561 double dfMAX_LONG;
00562 double dfMAX_LAT;
00563
00564 } GDALRPCInfo;
00565
00566 int CPL_DLL GDALExtractRPCInfo( char **, GDALRPCInfo * );
00567
00568
00569
00570
00572 typedef struct
00573 {
00575 short c1;
00576
00578 short c2;
00579
00581 short c3;
00582
00584 short c4;
00585 } GDALColorEntry;
00586
00587 GDALColorTableH CPL_DLL GDALCreateColorTable( GDALPaletteInterp );
00588 void CPL_DLL GDALDestroyColorTable( GDALColorTableH );
00589 GDALColorTableH CPL_DLL GDALCloneColorTable( GDALColorTableH );
00590 GDALPaletteInterp CPL_DLL GDALGetPaletteInterpretation( GDALColorTableH );
00591 int CPL_DLL GDALGetColorEntryCount( GDALColorTableH );
00592 const GDALColorEntry CPL_DLL *GDALGetColorEntry( GDALColorTableH, int );
00593 int CPL_DLL GDALGetColorEntryAsRGB( GDALColorTableH, int, GDALColorEntry *);
00594 void CPL_DLL GDALSetColorEntry( GDALColorTableH, int, const GDALColorEntry * );
00595
00596
00597
00598
00599
00600 void CPL_DLL GDALSetCacheMax( int nBytes );
00601 int CPL_DLL GDALGetCacheMax();
00602 int CPL_DLL GDALGetCacheUsed();
00603 int CPL_DLL GDALFlushCacheBlock();
00604
00605 CPL_C_END
00606
00607 #endif