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