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 #ifndef GDAL_H_INCLUDED
00169 #define GDAL_H_INCLUDED
00170
00177 #include "cpl_port.h"
00178 #include "cpl_error.h"
00179
00180
00181
00182
00183 #ifndef GDAL_VERSION_NUM
00184 # define GDAL_VERSION_NUM 1250
00185 #endif
00186 #ifndef GDAL_RELEASE_DATE
00187 # define GDAL_RELEASE_DATE 20041122
00188 #endif
00189 #ifndef GDAL_RELEASE_NAME
00190 # define GDAL_RELEASE_NAME "1.2.5.0"
00191 #endif
00192
00193
00194
00195
00196
00197 CPL_C_START
00198
00200 typedef enum {
00201 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,
00213 GDT_TypeCount = 12
00214 } GDALDataType;
00215
00216 int CPL_DLL GDALGetDataTypeSize( GDALDataType );
00217 int CPL_DLL GDALDataTypeIsComplex( GDALDataType );
00218 const char CPL_DLL *GDALGetDataTypeName( GDALDataType );
00219 GDALDataType CPL_DLL GDALGetDataTypeByName( const char * );
00220 GDALDataType CPL_DLL GDALDataTypeUnion( GDALDataType, GDALDataType );
00221
00223 typedef enum { GA_ReadOnly = 0, GA_Update = 1
00226 } GDALAccess;
00227
00229 typedef enum { GF_Read = 0, GF_Write = 1
00232 } GDALRWFlag;
00233
00235 typedef enum
00236 {
00237 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_Max=13
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 const char CPL_DLL *GDALGetProjectionRef( GDALDatasetH );
00421 CPLErr CPL_DLL GDALSetProjection( GDALDatasetH, const char * );
00422 CPLErr CPL_DLL GDALGetGeoTransform( GDALDatasetH, double * );
00423 CPLErr CPL_DLL GDALSetGeoTransform( GDALDatasetH, double * );
00424
00425 int CPL_DLL GDALGetGCPCount( GDALDatasetH );
00426 const char CPL_DLL *GDALGetGCPProjection( GDALDatasetH );
00427 const GDAL_GCP CPL_DLL *GDALGetGCPs( GDALDatasetH );
00428 CPLErr CPL_DLL GDALSetGCPs( GDALDatasetH, int, const GDAL_GCP *,
00429 const char * );
00430
00431 void CPL_DLL *GDALGetInternalHandle( GDALDatasetH, const char * );
00432 int CPL_DLL GDALReferenceDataset( GDALDatasetH );
00433 int CPL_DLL GDALDereferenceDataset( GDALDatasetH );
00434
00435 CPLErr CPL_DLL GDALBuildOverviews( GDALDatasetH, const char *, int, int *,
00436 int, int *, GDALProgressFunc, void * );
00437 void CPL_DLL GDALGetOpenDatasets( GDALDatasetH ***hDS, int *pnCount );
00438 int CPL_DLL GDALGetAccess( GDALDatasetH hDS );
00439 void CPL_DLL GDALFlushCache( GDALDatasetH hDS );
00440
00441
00442
00443
00444
00445 GDALDataType CPL_DLL GDALGetRasterDataType( GDALRasterBandH );
00446 void CPL_DLL GDALGetBlockSize( GDALRasterBandH,
00447 int * pnXSize, int * pnYSize );
00448
00449 CPLErr CPL_DLL GDALRasterIO( GDALRasterBandH hRBand, GDALRWFlag eRWFlag,
00450 int nDSXOff, int nDSYOff,
00451 int nDSXSize, int nDSYSize,
00452 void * pBuffer, int nBXSize, int nBYSize,
00453 GDALDataType eBDataType,
00454 int nPixelSpace, int nLineSpace );
00455 CPLErr CPL_DLL GDALReadBlock( GDALRasterBandH, int, int, void * );
00456 CPLErr CPL_DLL GDALWriteBlock( GDALRasterBandH, int, int, void * );
00457 int CPL_DLL GDALGetRasterBandXSize( GDALRasterBandH );
00458 int CPL_DLL GDALGetRasterBandYSize( GDALRasterBandH );
00459 char CPL_DLL **GDALGetRasterMetadata( GDALRasterBandH );
00460 GDALAccess CPL_DLL GDALGetRasterAccess( GDALRasterBandH );
00461 int CPL_DLL GDALGetBandNumber( GDALRasterBandH );
00462 GDALDatasetH CPL_DLL GDALGetBandDataset( GDALRasterBandH );
00463
00464 GDALColorInterp CPL_DLL GDALGetRasterColorInterpretation( GDALRasterBandH );
00465 CPLErr CPL_DLL GDALSetRasterColorInterpretation( GDALRasterBandH,
00466 GDALColorInterp );
00467 GDALColorTableH CPL_DLL GDALGetRasterColorTable( GDALRasterBandH );
00468 CPLErr CPL_DLL GDALSetRasterColorTable( GDALRasterBandH, GDALColorTableH );
00469 int CPL_DLL GDALHasArbitraryOverviews( GDALRasterBandH );
00470 int CPL_DLL GDALGetOverviewCount( GDALRasterBandH );
00471 GDALRasterBandH CPL_DLL GDALGetOverview( GDALRasterBandH, int );
00472 double CPL_DLL GDALGetRasterNoDataValue( GDALRasterBandH, int * );
00473 CPLErr CPL_DLL GDALSetRasterNoDataValue( GDALRasterBandH, double );
00474 char CPL_DLL ** GDALGetRasterCategoryNames( GDALRasterBandH );
00475 CPLErr CPL_DLL GDALSetRasterCategoryNames( GDALRasterBandH, char ** );
00476 double CPL_DLL GDALGetRasterMinimum( GDALRasterBandH, int *pbSuccess );
00477 double CPL_DLL GDALGetRasterMaximum( GDALRasterBandH, int *pbSuccess );
00478 const char CPL_DLL *GDALGetRasterUnitType( GDALRasterBandH );
00479 double CPL_DLL GDALGetRasterOffset( GDALRasterBandH, int *pbSuccess );
00480 double CPL_DLL GDALGetRasterScale( GDALRasterBandH, int *pbSuccess );
00481 void CPL_DLL GDALComputeRasterMinMax( GDALRasterBandH hBand, int bApproxOK,
00482 double adfMinMax[2] );
00483 CPLErr CPL_DLL GDALFlushRasterCache( GDALRasterBandH hBand );
00484 CPLErr CPL_DLL GDALGetRasterHistogram( GDALRasterBandH hBand,
00485 double dfMin, double dfMax,
00486 int nBuckets, int *panHistogram,
00487 int bIncludeOutOfRange, int bApproxOK,
00488 GDALProgressFunc pfnProgress,
00489 void * pProgressData );
00490 int CPL_DLL GDALGetRandomRasterSample( GDALRasterBandH, int, float * );
00491 GDALRasterBandH CPL_DLL GDALGetRasterSampleOverview( GDALRasterBandH, int );
00492 CPLErr CPL_DLL GDALFillRaster( GDALRasterBandH hBand, double dfRealValue,
00493 double dfImaginaryValue );
00494 CPLErr GDALComputeBandStats( GDALRasterBandH hBand, int nSampleStep,
00495 double *pdfMean, double *pdfStdDev,
00496 GDALProgressFunc pfnProgress,
00497 void *pProgressData );
00498 CPLErr GDALOverviewMagnitudeCorrection( GDALRasterBandH hBaseBand,
00499 int nOverviewCount,
00500 GDALRasterBandH *pahOverviews,
00501 GDALProgressFunc pfnProgress,
00502 void *pProgressData );
00503
00504
00505
00506
00507 int CPL_DLL GDALGeneralCmdLineProcessor( int nArgc, char ***ppapszArgv,
00508 int nOptions );
00509 void CPL_DLL GDALSwapWords( void *pData, int nWordSize, int nWordCount,
00510 int nWordSkip );
00511 void CPL_DLL
00512 GDALCopyWords( void * pSrcData, GDALDataType eSrcType, int nSrcPixelOffset,
00513 void * pDstData, GDALDataType eDstType, int nDstPixelOffset,
00514 int nWordCount );
00515
00516 int CPL_DLL GDALReadWorldFile( const char *pszBaseFilename,
00517 const char *pszExtension,
00518 double * padfGeoTransform );
00519 int CPL_DLL GDALWriteWorldFile( const char *pszBaseFilename,
00520 const char *pszExtension,
00521 double * padfGeoTransform );
00522 int CPL_DLL GDALReadTabFile( const char *pszBaseFilename,
00523 double *padfGeoTransform, char **ppszWKT,
00524 int *pnGCPCount, GDAL_GCP **ppasGCPs );
00525
00526 const char CPL_DLL *GDALDecToDMS( double, const char *, int );
00527 double CPL_DLL GDALPackedDMSToDec( double );
00528 double CPL_DLL GDALDecToPackedDMS( double );
00529
00530 const char CPL_DLL *GDALVersionInfo( const char * );
00531
00532 typedef struct {
00533 double dfLINE_OFF;
00534 double dfSAMP_OFF;
00535 double dfLAT_OFF;
00536 double dfLONG_OFF;
00537 double dfHEIGHT_OFF;
00538
00539 double dfLINE_SCALE;
00540 double dfSAMP_SCALE;
00541 double dfLAT_SCALE;
00542 double dfLONG_SCALE;
00543 double dfHEIGHT_SCALE;
00544
00545 double adfLINE_NUM_COEFF[20];
00546 double adfLINE_DEN_COEFF[20];
00547 double adfSAMP_NUM_COEFF[20];
00548 double adfSAMP_DEN_COEFF[20];
00549
00550 double dfMIN_LONG;
00551 double dfMIN_LAT;
00552 double dfMAX_LONG;
00553 double dfMAX_LAT;
00554
00555 } GDALRPCInfo;
00556
00557 int CPL_DLL GDALExtractRPCInfo( char **, GDALRPCInfo * );
00558
00559
00560
00561
00563 typedef struct
00564 {
00566 short c1;
00567
00569 short c2;
00570
00572 short c3;
00573
00575 short c4;
00576 } GDALColorEntry;
00577
00578 GDALColorTableH CPL_DLL GDALCreateColorTable( GDALPaletteInterp );
00579 void CPL_DLL GDALDestroyColorTable( GDALColorTableH );
00580 GDALColorTableH CPL_DLL GDALCloneColorTable( GDALColorTableH );
00581 GDALPaletteInterp CPL_DLL GDALGetPaletteInterpretation( GDALColorTableH );
00582 int CPL_DLL GDALGetColorEntryCount( GDALColorTableH );
00583 const GDALColorEntry CPL_DLL *GDALGetColorEntry( GDALColorTableH, int );
00584 int CPL_DLL GDALGetColorEntryAsRGB( GDALColorTableH, int, GDALColorEntry *);
00585 void CPL_DLL GDALSetColorEntry( GDALColorTableH, int, const GDALColorEntry * );
00586
00587
00588
00589
00590
00591 void CPL_DLL GDALSetCacheMax( int nBytes );
00592 int CPL_DLL GDALGetCacheMax();
00593 int CPL_DLL GDALGetCacheUsed();
00594 int CPL_DLL GDALFlushCacheBlock();
00595
00596 CPL_C_END
00597
00598 #endif