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 #ifndef GDAL_H_INCLUDED
00139 #define GDAL_H_INCLUDED
00140
00147 #include "cpl_port.h"
00148 #include "cpl_error.h"
00149
00150
00151
00152
00153 #ifndef GDAL_VERSION_NUM
00154 # define GDAL_VERSION_NUM 1200
00155 #endif
00156 #ifndef GDAL_RELEASE_DATE
00157 # define GDAL_RELEASE_DATE 20040310
00158 #endif
00159 #ifndef GDAL_RELEASE_NAME
00160 # define GDAL_RELEASE_NAME "1.2.0.0"
00161 #endif
00162
00163
00164
00165
00166
00167 CPL_C_START
00168
00170 typedef enum {
00171 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,
00183 GDT_TypeCount = 12
00184 } GDALDataType;
00185
00186 int CPL_DLL GDALGetDataTypeSize( GDALDataType );
00187 int CPL_DLL GDALDataTypeIsComplex( GDALDataType );
00188 const char CPL_DLL *GDALGetDataTypeName( GDALDataType );
00189 GDALDataType CPL_DLL GDALGetDataTypeByName( const char * );
00190 GDALDataType CPL_DLL GDALDataTypeUnion( GDALDataType, GDALDataType );
00191
00193 typedef enum { GA_ReadOnly = 0, GA_Update = 1
00196 } GDALAccess;
00197
00199 typedef enum { GF_Read = 0, GF_Write = 1
00202 } GDALRWFlag;
00203
00205 typedef enum
00206 {
00207 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
00221 } GDALColorInterp;
00222
00224 const char CPL_DLL *GDALGetColorInterpretationName( GDALColorInterp );
00225
00227 typedef enum
00228 { GPI_Gray=0, GPI_RGB=1, GPI_CMYK=2, GPI_HLS=3
00233 } GDALPaletteInterp;
00234
00236 const char CPL_DLL *GDALGetPaletteInterpretationName( GDALPaletteInterp );
00237
00238
00239
00240
00241
00242
00243 #define CPLE_WrongFormat 200
00244
00245
00246
00247
00248 typedef void *GDALMajorObjectH;
00249 typedef void *GDALDatasetH;
00250 typedef void *GDALRasterBandH;
00251 typedef void *GDALDriverH;
00252 typedef void *GDALProjDefH;
00253 typedef void *GDALColorTableH;
00254
00255
00256
00257
00258
00259 typedef int (*GDALProgressFunc)(double,const char *, void *);
00260 int CPL_DLL GDALDummyProgress( double, const char *, void *);
00261 int CPL_DLL GDALTermProgress( double, const char *, void *);
00262 int CPL_DLL GDALScaledProgress( double, const char *, void *);
00263 void CPL_DLL *GDALCreateScaledProgress( double, double,
00264 GDALProgressFunc, void * );
00265 void CPL_DLL GDALDestroyScaledProgress( void * );
00266
00267
00268
00269
00270
00271 typedef struct {
00272 char *pszOptionName;
00273 char *pszValueType;
00274
00275 char *pszDescription;
00276 char **papszOptions;
00277 } GDALOptionDefinition;
00278
00279 #define GDAL_DMD_LONGNAME "DMD_LONGNAME"
00280 #define GDAL_DMD_HELPTOPIC "DMD_HELPTOPIC"
00281 #define GDAL_DMD_MIMETYPE "DMD_MIMETYPE"
00282 #define GDAL_DMD_EXTENSION "DMD_EXTENSION"
00283 #define GDAL_DMD_CREATIONOPTIONLIST "DMD_CREATIONOPTIONLIST"
00284 #define GDAL_DMD_CREATIONDATATYPES "DMD_CREATIONDATATYPES"
00285
00286 #define GDAL_DCAP_CREATE "DCAP_CREATE"
00287 #define GDAL_DCAP_CREATECOPY "DCAP_CREATECOPY"
00288
00289 void CPL_DLL GDALAllRegister( void );
00290
00291 GDALDatasetH CPL_DLL GDALCreate( GDALDriverH hDriver,
00292 const char *, int, int, int, GDALDataType,
00293 char ** );
00294 GDALDatasetH CPL_DLL GDALCreateCopy( GDALDriverH, const char *, GDALDatasetH,
00295 int, char **, GDALProgressFunc, void * );
00296
00297 GDALDatasetH CPL_DLL GDALOpen( const char *pszFilename, GDALAccess eAccess );
00298 GDALDatasetH CPL_DLL GDALOpenShared( const char *, GDALAccess );
00299 int CPL_DLL GDALDumpOpenDatasets( FILE * );
00300
00301 GDALDriverH CPL_DLL GDALGetDriverByName( const char * );
00302 int CPL_DLL GDALGetDriverCount();
00303 GDALDriverH CPL_DLL GDALGetDriver( int );
00304 int CPL_DLL GDALRegisterDriver( GDALDriverH );
00305 void CPL_DLL GDALDeregisterDriver( GDALDriverH );
00306 void CPL_DLL GDALDestroyDriverManager( void );
00307 CPLErr CPL_DLL GDALDeleteDataset( GDALDriverH, const char * );
00308
00309
00310 const char CPL_DLL *GDALGetDriverShortName( GDALDriverH );
00311 const char CPL_DLL *GDALGetDriverLongName( GDALDriverH );
00312 const char CPL_DLL *GDALGetDriverHelpTopic( GDALDriverH );
00313
00314
00315
00316
00317
00319 typedef struct
00320 {
00322 char *pszId;
00323
00325 char *pszInfo;
00326
00328 double dfGCPPixel;
00330 double dfGCPLine;
00331
00333 double dfGCPX;
00334
00336 double dfGCPY;
00337
00339 double dfGCPZ;
00340 } GDAL_GCP;
00341
00342 void CPL_DLL GDALInitGCPs( int, GDAL_GCP * );
00343 void CPL_DLL GDALDeinitGCPs( int, GDAL_GCP * );
00344 GDAL_GCP CPL_DLL *GDALDuplicateGCPs( int, const GDAL_GCP * );
00345
00346 int CPL_DLL GDALGCPsToGeoTransform( int nGCPCount, const GDAL_GCP *pasGCPs,
00347 double *padfGeoTransform, int bApproxOK );
00348 int CPL_DLL GDALInvGeoTransform( double *padfGeoTransformIn,
00349 double *padfInvGeoTransformOut );
00350
00351
00352
00353
00354
00355 char CPL_DLL **GDALGetMetadata( GDALMajorObjectH, const char * );
00356 CPLErr CPL_DLL GDALSetMetadata( GDALMajorObjectH, char **,
00357 const char * );
00358 const char CPL_DLL *GDALGetMetadataItem( GDALMajorObjectH, const char *,
00359 const char * );
00360 CPLErr CPL_DLL GDALSetMetadataItem( GDALMajorObjectH,
00361 const char *, const char *,
00362 const char * );
00363 const char CPL_DLL *GDALGetDescription( GDALMajorObjectH );
00364 void CPL_DLL GDALSetDescription( GDALMajorObjectH, const char * );
00365
00366
00367
00368
00369
00370 GDALDriverH CPL_DLL GDALGetDatasetDriver( GDALDatasetH );
00371 void CPL_DLL GDALClose( GDALDatasetH );
00372 int CPL_DLL GDALGetRasterXSize( GDALDatasetH );
00373 int CPL_DLL GDALGetRasterYSize( GDALDatasetH );
00374 int CPL_DLL GDALGetRasterCount( GDALDatasetH );
00375 GDALRasterBandH CPL_DLL GDALGetRasterBand( GDALDatasetH, int );
00376
00377 CPLErr CPL_DLL GDALAddBand( GDALDatasetH hDS, GDALDataType eType,
00378 char **papszOptions );
00379
00380 CPLErr CPL_DLL GDALDatasetRasterIO(
00381 GDALDatasetH hDS, GDALRWFlag eRWFlag,
00382 int nDSXOff, int nDSYOff, int nDSXSize, int nDSYSize,
00383 void * pBuffer, int nBXSize, int nBYSize, GDALDataType eBDataType,
00384 int nBandCount, int *panBandCount,
00385 int nPixelSpace, int nLineSpace, int nBandSpace);
00386
00387 const char CPL_DLL *GDALGetProjectionRef( GDALDatasetH );
00388 CPLErr CPL_DLL GDALSetProjection( GDALDatasetH, const char * );
00389 CPLErr CPL_DLL GDALGetGeoTransform( GDALDatasetH, double * );
00390 CPLErr CPL_DLL GDALSetGeoTransform( GDALDatasetH, double * );
00391
00392 int CPL_DLL GDALGetGCPCount( GDALDatasetH );
00393 const char CPL_DLL *GDALGetGCPProjection( GDALDatasetH );
00394 const GDAL_GCP CPL_DLL *GDALGetGCPs( GDALDatasetH );
00395 CPLErr CPL_DLL GDALSetGCPs( GDALDatasetH, int, const GDAL_GCP *,
00396 const char * );
00397
00398 void CPL_DLL *GDALGetInternalHandle( GDALDatasetH, const char * );
00399 int CPL_DLL GDALReferenceDataset( GDALDatasetH );
00400 int CPL_DLL GDALDereferenceDataset( GDALDatasetH );
00401
00402 CPLErr CPL_DLL GDALBuildOverviews( GDALDatasetH, const char *, int, int *,
00403 int, int *, GDALProgressFunc, void * );
00404 void CPL_DLL GDALGetOpenDatasets( GDALDatasetH ***hDS, int *pnCount );
00405 int CPL_DLL GDALGetAccess( GDALDatasetH hDS );
00406 void CPL_DLL GDALFlushCache( GDALDatasetH hDS );
00407
00408
00409
00410
00411
00412 GDALDataType CPL_DLL GDALGetRasterDataType( GDALRasterBandH );
00413 void CPL_DLL GDALGetBlockSize( GDALRasterBandH,
00414 int * pnXSize, int * pnYSize );
00415
00416 CPLErr CPL_DLL GDALRasterIO( GDALRasterBandH hRBand, GDALRWFlag eRWFlag,
00417 int nDSXOff, int nDSYOff,
00418 int nDSXSize, int nDSYSize,
00419 void * pBuffer, int nBXSize, int nBYSize,
00420 GDALDataType eBDataType,
00421 int nPixelSpace, int nLineSpace );
00422 CPLErr CPL_DLL GDALReadBlock( GDALRasterBandH, int, int, void * );
00423 CPLErr CPL_DLL GDALWriteBlock( GDALRasterBandH, int, int, void * );
00424 int CPL_DLL GDALGetRasterBandXSize( GDALRasterBandH );
00425 int CPL_DLL GDALGetRasterBandYSize( GDALRasterBandH );
00426 char CPL_DLL **GDALGetRasterMetadata( GDALRasterBandH );
00427 GDALAccess CPL_DLL GDALGetRasterAccess( GDALRasterBandH );
00428 int CPL_DLL GDALGetBandNumber( GDALRasterBandH );
00429 GDALDatasetH CPL_DLL GDALGetBandDataset( GDALRasterBandH );
00430
00431 GDALColorInterp CPL_DLL GDALGetRasterColorInterpretation( GDALRasterBandH );
00432 CPLErr CPL_DLL GDALSetRasterColorInterpretation( GDALRasterBandH,
00433 GDALColorInterp );
00434 GDALColorTableH CPL_DLL GDALGetRasterColorTable( GDALRasterBandH );
00435 CPLErr CPL_DLL GDALSetRasterColorTable( GDALRasterBandH, GDALColorTableH );
00436 int CPL_DLL GDALHasArbitraryOverviews( GDALRasterBandH );
00437 int CPL_DLL GDALGetOverviewCount( GDALRasterBandH );
00438 GDALRasterBandH CPL_DLL GDALGetOverview( GDALRasterBandH, int );
00439 double CPL_DLL GDALGetRasterNoDataValue( GDALRasterBandH, int * );
00440 CPLErr CPL_DLL GDALSetRasterNoDataValue( GDALRasterBandH, double );
00441 char CPL_DLL ** GDALGetRasterCategoryNames( GDALRasterBandH );
00442 CPLErr CPL_DLL GDALSetRasterCategoryNames( GDALRasterBandH, char ** );
00443 double CPL_DLL GDALGetRasterMinimum( GDALRasterBandH, int *pbSuccess );
00444 double CPL_DLL GDALGetRasterMaximum( GDALRasterBandH, int *pbSuccess );
00445 const char CPL_DLL *GDALGetRasterUnitType( GDALRasterBandH );
00446 void CPL_DLL GDALComputeRasterMinMax( GDALRasterBandH hBand, int bApproxOK,
00447 double adfMinMax[2] );
00448 CPLErr CPL_DLL GDALFlushRasterCache( GDALRasterBandH hBand );
00449 CPLErr CPL_DLL GDALGetRasterHistogram( GDALRasterBandH hBand,
00450 double dfMin, double dfMax,
00451 int nBuckets, int *panHistogram,
00452 int bIncludeOutOfRange, int bApproxOK,
00453 GDALProgressFunc pfnProgress,
00454 void * pProgressData );
00455 int CPL_DLL GDALGetRandomRasterSample( GDALRasterBandH, int, float * );
00456 GDALRasterBandH CPL_DLL GDALGetRasterSampleOverview( GDALRasterBandH, int );
00457 CPLErr CPL_DLL GDALFillRaster( GDALRasterBandH hBand, double dfRealValue,
00458 double dfImaginaryValue );
00459 CPLErr GDALComputeBandStats( GDALRasterBandH hBand, int nSampleStep,
00460 double *pdfMean, double *pdfStdDev,
00461 GDALProgressFunc pfnProgress,
00462 void *pProgressData );
00463 CPLErr GDALOverviewMagnitudeCorrection( GDALRasterBandH hBaseBand,
00464 int nOverviewCount,
00465 GDALRasterBandH *pahOverviews,
00466 GDALProgressFunc pfnProgress,
00467 void *pProgressData );
00468
00469
00470
00471
00472 void CPL_DLL GDALSwapWords( void *pData, int nWordSize, int nWordCount,
00473 int nWordSkip );
00474 void CPL_DLL
00475 GDALCopyWords( void * pSrcData, GDALDataType eSrcType, int nSrcPixelOffset,
00476 void * pDstData, GDALDataType eDstType, int nDstPixelOffset,
00477 int nWordCount );
00478
00479 int CPL_DLL GDALReadWorldFile( const char *pszBaseFilename,
00480 const char *pszExtension,
00481 double * padfGeoTransform );
00482 int CPL_DLL GDALWriteWorldFile( const char *pszBaseFilename,
00483 const char *pszExtension,
00484 double * padfGeoTransform );
00485 int CPL_DLL GDALReadTabFile( const char *pszBaseFilename,
00486 double *padfGeoTransform, char **ppszWKT,
00487 int *pnGCPCount, GDAL_GCP **ppasGCPs );
00488
00489 const char CPL_DLL *GDALDecToDMS( double, const char *, int );
00490 double CPL_DLL GDALPackedDMSToDec( double );
00491 double CPL_DLL GDALDecToPackedDMS( double );
00492
00493 const char CPL_DLL *GDALVersionInfo( const char * );
00494
00495 typedef struct {
00496 double dfLINE_OFF;
00497 double dfSAMP_OFF;
00498 double dfLAT_OFF;
00499 double dfLONG_OFF;
00500 double dfHEIGHT_OFF;
00501
00502 double dfLINE_SCALE;
00503 double dfSAMP_SCALE;
00504 double dfLAT_SCALE;
00505 double dfLONG_SCALE;
00506 double dfHEIGHT_SCALE;
00507
00508 double adfLINE_NUM_COEFF[20];
00509 double adfLINE_DEN_COEFF[20];
00510 double adfSAMP_NUM_COEFF[20];
00511 double adfSAMP_DEN_COEFF[20];
00512
00513 double dfMIN_LONG;
00514 double dfMIN_LAT;
00515 double dfMAX_LONG;
00516 double dfMAX_LAT;
00517
00518 } GDALRPCInfo;
00519
00520 int CPL_DLL GDALExtractRPCInfo( char **, GDALRPCInfo * );
00521
00522
00523
00524
00526 typedef struct
00527 {
00529 short c1;
00530
00532 short c2;
00533
00535 short c3;
00536
00538 short c4;
00539 } GDALColorEntry;
00540
00541 GDALColorTableH CPL_DLL GDALCreateColorTable( GDALPaletteInterp );
00542 void CPL_DLL GDALDestroyColorTable( GDALColorTableH );
00543 GDALColorTableH CPL_DLL GDALCloneColorTable( GDALColorTableH );
00544 GDALPaletteInterp CPL_DLL GDALGetPaletteInterpretation( GDALColorTableH );
00545 int CPL_DLL GDALGetColorEntryCount( GDALColorTableH );
00546 const GDALColorEntry CPL_DLL *GDALGetColorEntry( GDALColorTableH, int );
00547 int CPL_DLL GDALGetColorEntryAsRGB( GDALColorTableH, int, GDALColorEntry *);
00548 void CPL_DLL GDALSetColorEntry( GDALColorTableH, int, const GDALColorEntry * );
00549
00550
00551
00552
00553
00554 void CPL_DLL GDALSetCacheMax( int nBytes );
00555 int CPL_DLL GDALGetCacheMax();
00556 int CPL_DLL GDALGetCacheUsed();
00557 int CPL_DLL GDALFlushCacheBlock();
00558
00559 CPL_C_END
00560
00561 #endif