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
00178
00179
00180
00181
00182
00183
00184
00185
00186
00187
00188
00189
00190
00191
00192
00193
00194
00195
00196
00197
00198 #ifndef GDAL_H_INCLUDED
00199 #define GDAL_H_INCLUDED
00200
00207 #include "gdal_version.h"
00208 #include "cpl_port.h"
00209 #include "cpl_error.h"
00210
00211
00212
00213
00214
00215 CPL_C_START
00216
00218 typedef enum {
00219 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,
00231 GDT_TypeCount = 12
00232 } GDALDataType;
00233
00234 int CPL_DLL CPL_STDCALL GDALGetDataTypeSize( GDALDataType );
00235 int CPL_DLL CPL_STDCALL GDALDataTypeIsComplex( GDALDataType );
00236 const char CPL_DLL * CPL_STDCALL GDALGetDataTypeName( GDALDataType );
00237 GDALDataType CPL_DLL CPL_STDCALL GDALGetDataTypeByName( const char * );
00238 GDALDataType CPL_DLL CPL_STDCALL GDALDataTypeUnion( GDALDataType, GDALDataType );
00239
00241 typedef enum { GA_ReadOnly = 0, GA_Update = 1
00244 } GDALAccess;
00245
00247 typedef enum { GF_Read = 0, GF_Write = 1
00250 } GDALRWFlag;
00251
00253 typedef enum
00254 {
00255 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
00273 } GDALColorInterp;
00274
00276 const char CPL_DLL *GDALGetColorInterpretationName( GDALColorInterp );
00277
00279 typedef enum
00280 { GPI_Gray=0, GPI_RGB=1, GPI_CMYK=2, GPI_HLS=3
00285 } GDALPaletteInterp;
00286
00288 const char CPL_DLL *GDALGetPaletteInterpretationName( GDALPaletteInterp );
00289
00290
00291
00292 #define GDALMD_AREA_OR_POINT "AREA_OR_POINT"
00293 # define GDALMD_AOP_AREA "Area"
00294 # define GDALMD_AOP_POINT "Point"
00295
00296
00297
00298
00299
00300
00301 #define CPLE_WrongFormat 200
00302
00303
00304
00305
00306 typedef void *GDALMajorObjectH;
00307 typedef void *GDALDatasetH;
00308 typedef void *GDALRasterBandH;
00309 typedef void *GDALDriverH;
00310 typedef void *GDALProjDefH;
00311 typedef void *GDALColorTableH;
00312
00313
00314
00315
00316
00317 typedef int (CPL_STDCALL *GDALProgressFunc)(double,const char *, void *);
00318 int CPL_DLL CPL_STDCALL GDALDummyProgress( double, const char *, void *);
00319 int CPL_DLL CPL_STDCALL GDALTermProgress( double, const char *, void *);
00320 int CPL_DLL CPL_STDCALL GDALScaledProgress( double, const char *, void *);
00321 void CPL_DLL * CPL_STDCALL GDALCreateScaledProgress( double, double,
00322 GDALProgressFunc, void * );
00323 void CPL_DLL CPL_STDCALL GDALDestroyScaledProgress( void * );
00324
00325
00326
00327
00328
00329 typedef struct {
00330 char *pszOptionName;
00331 char *pszValueType;
00332
00333 char *pszDescription;
00334 char **papszOptions;
00335 } GDALOptionDefinition;
00336
00337 #define GDAL_DMD_LONGNAME "DMD_LONGNAME"
00338 #define GDAL_DMD_HELPTOPIC "DMD_HELPTOPIC"
00339 #define GDAL_DMD_MIMETYPE "DMD_MIMETYPE"
00340 #define GDAL_DMD_EXTENSION "DMD_EXTENSION"
00341 #define GDAL_DMD_CREATIONOPTIONLIST "DMD_CREATIONOPTIONLIST"
00342 #define GDAL_DMD_CREATIONDATATYPES "DMD_CREATIONDATATYPES"
00343
00344 #define GDAL_DCAP_CREATE "DCAP_CREATE"
00345 #define GDAL_DCAP_CREATECOPY "DCAP_CREATECOPY"
00346
00347 void CPL_DLL CPL_STDCALL GDALAllRegister( void );
00348
00349 GDALDatasetH CPL_DLL CPL_STDCALL GDALCreate( GDALDriverH hDriver,
00350 const char *, int, int, int, GDALDataType,
00351 char ** );
00352 GDALDatasetH CPL_DLL CPL_STDCALL
00353 GDALCreateCopy( GDALDriverH, const char *, GDALDatasetH,
00354 int, char **, GDALProgressFunc, void * );
00355
00356 GDALDatasetH CPL_DLL CPL_STDCALL
00357 GDALOpen( const char *pszFilename, GDALAccess eAccess );
00358 GDALDatasetH CPL_DLL CPL_STDCALL GDALOpenShared( const char *, GDALAccess );
00359 int CPL_DLL CPL_STDCALL GDALDumpOpenDatasets( FILE * );
00360
00361 GDALDriverH CPL_DLL CPL_STDCALL GDALGetDriverByName( const char * );
00362 int CPL_DLL CPL_STDCALL GDALGetDriverCount();
00363 GDALDriverH CPL_DLL CPL_STDCALL GDALGetDriver( int );
00364 int CPL_DLL CPL_STDCALL GDALRegisterDriver( GDALDriverH );
00365 void CPL_DLL CPL_STDCALL GDALDeregisterDriver( GDALDriverH );
00366 void CPL_DLL CPL_STDCALL GDALDestroyDriverManager( void );
00367 CPLErr CPL_DLL CPL_STDCALL GDALDeleteDataset( GDALDriverH, const char * );
00368
00369
00370 const char CPL_DLL * CPL_STDCALL GDALGetDriverShortName( GDALDriverH );
00371 const char CPL_DLL * CPL_STDCALL GDALGetDriverLongName( GDALDriverH );
00372 const char CPL_DLL * CPL_STDCALL GDALGetDriverHelpTopic( GDALDriverH );
00373 const char CPL_DLL * CPL_STDCALL GDALGetDriverCreationOptionList( GDALDriverH );
00374
00375
00376
00377
00378
00380 typedef struct
00381 {
00383 char *pszId;
00384
00386 char *pszInfo;
00387
00389 double dfGCPPixel;
00391 double dfGCPLine;
00392
00394 double dfGCPX;
00395
00397 double dfGCPY;
00398
00400 double dfGCPZ;
00401 } GDAL_GCP;
00402
00403 void CPL_DLL CPL_STDCALL GDALInitGCPs( int, GDAL_GCP * );
00404 void CPL_DLL CPL_STDCALL GDALDeinitGCPs( int, GDAL_GCP * );
00405 GDAL_GCP CPL_DLL * CPL_STDCALL GDALDuplicateGCPs( int, const GDAL_GCP * );
00406
00407 int CPL_DLL CPL_STDCALL
00408 GDALGCPsToGeoTransform( int nGCPCount, const GDAL_GCP *pasGCPs,
00409 double *padfGeoTransform, int bApproxOK );
00410 int CPL_DLL CPL_STDCALL
00411 GDALInvGeoTransform( double *padfGeoTransformIn,
00412 double *padfInvGeoTransformOut );
00413 void CPL_DLL CPL_STDCALL GDALApplyGeoTransform( double *, double, double,
00414 double *, double * );
00415
00416
00417
00418
00419
00420 char CPL_DLL ** CPL_STDCALL GDALGetMetadata( GDALMajorObjectH, const char * );
00421 CPLErr CPL_DLL CPL_STDCALL GDALSetMetadata( GDALMajorObjectH, char **,
00422 const char * );
00423 const char CPL_DLL * CPL_STDCALL
00424 GDALGetMetadataItem( GDALMajorObjectH, const char *, const char * );
00425 CPLErr CPL_DLL CPL_STDCALL
00426 GDALSetMetadataItem( GDALMajorObjectH, const char *, const char *,
00427 const char * );
00428 const char CPL_DLL * CPL_STDCALL GDALGetDescription( GDALMajorObjectH );
00429 void CPL_DLL CPL_STDCALL GDALSetDescription( GDALMajorObjectH, const char * );
00430
00431
00432
00433
00434
00435 GDALDriverH CPL_DLL CPL_STDCALL GDALGetDatasetDriver( GDALDatasetH );
00436 void CPL_DLL CPL_STDCALL GDALClose( GDALDatasetH );
00437 int CPL_DLL CPL_STDCALL GDALGetRasterXSize( GDALDatasetH );
00438 int CPL_DLL CPL_STDCALL GDALGetRasterYSize( GDALDatasetH );
00439 int CPL_DLL CPL_STDCALL GDALGetRasterCount( GDALDatasetH );
00440 GDALRasterBandH CPL_DLL CPL_STDCALL GDALGetRasterBand( GDALDatasetH, int );
00441
00442 CPLErr CPL_DLL CPL_STDCALL GDALAddBand( GDALDatasetH hDS, GDALDataType eType,
00443 char **papszOptions );
00444
00445 CPLErr CPL_DLL CPL_STDCALL GDALDatasetRasterIO(
00446 GDALDatasetH hDS, GDALRWFlag eRWFlag,
00447 int nDSXOff, int nDSYOff, int nDSXSize, int nDSYSize,
00448 void * pBuffer, int nBXSize, int nBYSize, GDALDataType eBDataType,
00449 int nBandCount, int *panBandCount,
00450 int nPixelSpace, int nLineSpace, int nBandSpace);
00451
00452 CPLErr CPL_DLL CPL_STDCALL GDALDatasetAdviseRead( GDALDatasetH hDS,
00453 int nDSXOff, int nDSYOff, int nDSXSize, int nDSYSize,
00454 int nBXSize, int nBYSize, GDALDataType eBDataType,
00455 int nBandCount, int *panBandCount, char **papszOptions );
00456
00457 const char CPL_DLL * CPL_STDCALL GDALGetProjectionRef( GDALDatasetH );
00458 CPLErr CPL_DLL CPL_STDCALL GDALSetProjection( GDALDatasetH, const char * );
00459 CPLErr CPL_DLL CPL_STDCALL GDALGetGeoTransform( GDALDatasetH, double * );
00460 CPLErr CPL_DLL CPL_STDCALL GDALSetGeoTransform( GDALDatasetH, double * );
00461
00462 int CPL_DLL CPL_STDCALL GDALGetGCPCount( GDALDatasetH );
00463 const char CPL_DLL * CPL_STDCALL GDALGetGCPProjection( GDALDatasetH );
00464 const GDAL_GCP CPL_DLL * CPL_STDCALL GDALGetGCPs( GDALDatasetH );
00465 CPLErr CPL_DLL CPL_STDCALL GDALSetGCPs( GDALDatasetH, int, const GDAL_GCP *,
00466 const char * );
00467
00468 void CPL_DLL * CPL_STDCALL GDALGetInternalHandle( GDALDatasetH, const char * );
00469 int CPL_DLL CPL_STDCALL GDALReferenceDataset( GDALDatasetH );
00470 int CPL_DLL CPL_STDCALL GDALDereferenceDataset( GDALDatasetH );
00471
00472 CPLErr CPL_DLL CPL_STDCALL
00473 GDALBuildOverviews( GDALDatasetH, const char *, int, int *,
00474 int, int *, GDALProgressFunc, void * );
00475 void CPL_DLL CPL_STDCALL GDALGetOpenDatasets( GDALDatasetH ***hDS, int *pnCount );
00476 int CPL_DLL CPL_STDCALL GDALGetAccess( GDALDatasetH hDS );
00477 void CPL_DLL CPL_STDCALL GDALFlushCache( GDALDatasetH hDS );
00478
00479
00480
00481
00482
00483 GDALDataType CPL_DLL CPL_STDCALL GDALGetRasterDataType( GDALRasterBandH );
00484 void CPL_DLL CPL_STDCALL
00485 GDALGetBlockSize( GDALRasterBandH, int * pnXSize, int * pnYSize );
00486
00487 CPLErr CPL_DLL CPL_STDCALL GDALRasterAdviseRead( GDALRasterBandH hRB,
00488 int nDSXOff, int nDSYOff, int nDSXSize, int nDSYSize,
00489 int nBXSize, int nBYSize, GDALDataType eBDataType, char **papszOptions );
00490
00491 CPLErr CPL_DLL CPL_STDCALL
00492 GDALRasterIO( GDALRasterBandH hRBand, GDALRWFlag eRWFlag,
00493 int nDSXOff, int nDSYOff, int nDSXSize, int nDSYSize,
00494 void * pBuffer, int nBXSize, int nBYSize,GDALDataType eBDataType,
00495 int nPixelSpace, int nLineSpace );
00496 CPLErr CPL_DLL CPL_STDCALL GDALReadBlock( GDALRasterBandH, int, int, void * );
00497 CPLErr CPL_DLL CPL_STDCALL GDALWriteBlock( GDALRasterBandH, int, int, void * );
00498 int CPL_DLL CPL_STDCALL GDALGetRasterBandXSize( GDALRasterBandH );
00499 int CPL_DLL CPL_STDCALL GDALGetRasterBandYSize( GDALRasterBandH );
00500 char CPL_DLL ** CPL_STDCALL GDALGetRasterMetadata( GDALRasterBandH );
00501 GDALAccess CPL_DLL CPL_STDCALL GDALGetRasterAccess( GDALRasterBandH );
00502 int CPL_DLL CPL_STDCALL GDALGetBandNumber( GDALRasterBandH );
00503 GDALDatasetH CPL_DLL CPL_STDCALL GDALGetBandDataset( GDALRasterBandH );
00504
00505 GDALColorInterp CPL_DLL CPL_STDCALL
00506 GDALGetRasterColorInterpretation( GDALRasterBandH );
00507 CPLErr CPL_DLL CPL_STDCALL
00508 GDALSetRasterColorInterpretation( GDALRasterBandH, GDALColorInterp );
00509 GDALColorTableH CPL_DLL CPL_STDCALL GDALGetRasterColorTable( GDALRasterBandH );
00510 CPLErr CPL_DLL CPL_STDCALL GDALSetRasterColorTable( GDALRasterBandH, GDALColorTableH );
00511 int CPL_DLL CPL_STDCALL GDALHasArbitraryOverviews( GDALRasterBandH );
00512 int CPL_DLL CPL_STDCALL GDALGetOverviewCount( GDALRasterBandH );
00513 GDALRasterBandH CPL_DLL CPL_STDCALL GDALGetOverview( GDALRasterBandH, int );
00514 double CPL_DLL CPL_STDCALL GDALGetRasterNoDataValue( GDALRasterBandH, int * );
00515 CPLErr CPL_DLL CPL_STDCALL GDALSetRasterNoDataValue( GDALRasterBandH, double );
00516 char CPL_DLL ** CPL_STDCALL GDALGetRasterCategoryNames( GDALRasterBandH );
00517 CPLErr CPL_DLL CPL_STDCALL GDALSetRasterCategoryNames( GDALRasterBandH, char ** );
00518 double CPL_DLL CPL_STDCALL GDALGetRasterMinimum( GDALRasterBandH, int *pbSuccess );
00519 double CPL_DLL CPL_STDCALL GDALGetRasterMaximum( GDALRasterBandH, int *pbSuccess );
00520 CPLErr CPL_DLL CPL_STDCALL GDALGetRasterStatistics(
00521 GDALRasterBandH, int bApproxOK, int bForce,
00522 double *pdfMin, double *pdfMax, double *pdfMean, double *pdfStdDev );
00523 const char CPL_DLL * CPL_STDCALL GDALGetRasterUnitType( GDALRasterBandH );
00524 double CPL_DLL CPL_STDCALL GDALGetRasterOffset( GDALRasterBandH, int *pbSuccess );
00525 CPLErr CPL_DLL CPL_STDCALL GDALSetRasterOffset( GDALRasterBandH hBand, double dfNewOffset);
00526 double CPL_DLL CPL_STDCALL GDALGetRasterScale( GDALRasterBandH, int *pbSuccess );
00527 CPLErr CPL_DLL CPL_STDCALL GDALSetRasterScale( GDALRasterBandH hBand, double dfNewOffset );
00528 void CPL_DLL CPL_STDCALL
00529 GDALComputeRasterMinMax( GDALRasterBandH hBand, int bApproxOK,
00530 double adfMinMax[2] );
00531 CPLErr CPL_DLL CPL_STDCALL GDALFlushRasterCache( GDALRasterBandH hBand );
00532 CPLErr CPL_DLL CPL_STDCALL GDALGetRasterHistogram( GDALRasterBandH hBand,
00533 double dfMin, double dfMax,
00534 int nBuckets, int *panHistogram,
00535 int bIncludeOutOfRange, int bApproxOK,
00536 GDALProgressFunc pfnProgress,
00537 void * pProgressData );
00538 CPLErr CPL_DLL CPL_STDCALL GDALGetDefaultHistogram( GDALRasterBandH hBand,
00539 double *pdfMin, double *pdfMax,
00540 int *pnBuckets, int **ppanHistogram,
00541 int bForce,
00542 GDALProgressFunc pfnProgress,
00543 void * pProgressData );
00544 CPLErr CPL_DLL CPL_STDCALL GDALSetDefaultHistogram( GDALRasterBandH hBand,
00545 double dfMin, double dfMax,
00546 int nBuckets, int *panHistogram );
00547 int CPL_DLL CPL_STDCALL
00548 GDALGetRandomRasterSample( GDALRasterBandH, int, float * );
00549 GDALRasterBandH CPL_DLL CPL_STDCALL
00550 GDALGetRasterSampleOverview( GDALRasterBandH, int );
00551 CPLErr CPL_DLL CPL_STDCALL GDALFillRaster( GDALRasterBandH hBand,
00552 double dfRealValue, double dfImaginaryValue );
00553 CPLErr CPL_DLL CPL_STDCALL
00554 GDALComputeBandStats( GDALRasterBandH hBand, int nSampleStep,
00555 double *pdfMean, double *pdfStdDev,
00556 GDALProgressFunc pfnProgress,
00557 void *pProgressData );
00558 CPLErr CPL_DLL GDALOverviewMagnitudeCorrection( GDALRasterBandH hBaseBand,
00559 int nOverviewCount,
00560 GDALRasterBandH *pahOverviews,
00561 GDALProgressFunc pfnProgress,
00562 void *pProgressData );
00563
00564
00565
00566
00567 int CPL_DLL CPL_STDCALL GDALGeneralCmdLineProcessor( int nArgc, char ***ppapszArgv,
00568 int nOptions );
00569 void CPL_DLL CPL_STDCALL GDALSwapWords( void *pData, int nWordSize, int nWordCount,
00570 int nWordSkip );
00571 void CPL_DLL CPL_STDCALL
00572 GDALCopyWords( void * pSrcData, GDALDataType eSrcType, int nSrcPixelOffset,
00573 void * pDstData, GDALDataType eDstType, int nDstPixelOffset,
00574 int nWordCount );
00575
00576 int CPL_DLL CPL_STDCALL GDALReadWorldFile( const char *pszBaseFilename,
00577 const char *pszExtension,
00578 double * padfGeoTransform );
00579 int CPL_DLL CPL_STDCALL GDALWriteWorldFile( const char *pszBaseFilename,
00580 const char *pszExtension,
00581 double * padfGeoTransform );
00582 int CPL_DLL CPL_STDCALL GDALReadTabFile( const char *pszBaseFilename,
00583 double *padfGeoTransform, char **ppszWKT,
00584 int *pnGCPCount, GDAL_GCP **ppasGCPs );
00585
00586 const char CPL_DLL * CPL_STDCALL GDALDecToDMS( double, const char *, int );
00587 double CPL_DLL CPL_STDCALL GDALPackedDMSToDec( double );
00588 double CPL_DLL CPL_STDCALL GDALDecToPackedDMS( double );
00589
00590 const char CPL_DLL * CPL_STDCALL GDALVersionInfo( const char * );
00591
00592 typedef struct {
00593 double dfLINE_OFF;
00594 double dfSAMP_OFF;
00595 double dfLAT_OFF;
00596 double dfLONG_OFF;
00597 double dfHEIGHT_OFF;
00598
00599 double dfLINE_SCALE;
00600 double dfSAMP_SCALE;
00601 double dfLAT_SCALE;
00602 double dfLONG_SCALE;
00603 double dfHEIGHT_SCALE;
00604
00605 double adfLINE_NUM_COEFF[20];
00606 double adfLINE_DEN_COEFF[20];
00607 double adfSAMP_NUM_COEFF[20];
00608 double adfSAMP_DEN_COEFF[20];
00609
00610 double dfMIN_LONG;
00611 double dfMIN_LAT;
00612 double dfMAX_LONG;
00613 double dfMAX_LAT;
00614
00615 } GDALRPCInfo;
00616
00617 int CPL_DLL CPL_STDCALL GDALExtractRPCInfo( char **, GDALRPCInfo * );
00618
00619
00620
00621
00623 typedef struct
00624 {
00626 short c1;
00627
00629 short c2;
00630
00632 short c3;
00633
00635 short c4;
00636 } GDALColorEntry;
00637
00638 GDALColorTableH CPL_DLL CPL_STDCALL GDALCreateColorTable( GDALPaletteInterp );
00639 void CPL_DLL CPL_STDCALL GDALDestroyColorTable( GDALColorTableH );
00640 GDALColorTableH CPL_DLL CPL_STDCALL GDALCloneColorTable( GDALColorTableH );
00641 GDALPaletteInterp CPL_DLL CPL_STDCALL GDALGetPaletteInterpretation( GDALColorTableH );
00642 int CPL_DLL CPL_STDCALL GDALGetColorEntryCount( GDALColorTableH );
00643 const GDALColorEntry CPL_DLL * CPL_STDCALL GDALGetColorEntry( GDALColorTableH, int );
00644 int CPL_DLL CPL_STDCALL GDALGetColorEntryAsRGB( GDALColorTableH, int, GDALColorEntry *);
00645 void CPL_DLL CPL_STDCALL GDALSetColorEntry( GDALColorTableH, int, const GDALColorEntry * );
00646
00647
00648
00649
00650
00651 void CPL_DLL CPL_STDCALL GDALSetCacheMax( int nBytes );
00652 int CPL_DLL CPL_STDCALL GDALGetCacheMax();
00653 int CPL_DLL CPL_STDCALL GDALGetCacheUsed();
00654 int CPL_DLL CPL_STDCALL GDALFlushCacheBlock();
00655
00656 CPL_C_END
00657
00658 #endif