GDAL
|
00001 /****************************************************************************** 00002 * $Id: gdal.h 25545 2013-01-25 17:55:47Z warmerdam $ 00003 * 00004 * Project: GDAL Core 00005 * Purpose: GDAL Core C/Public declarations. 00006 * Author: Frank Warmerdam, warmerdam@pobox.com 00007 * 00008 ****************************************************************************** 00009 * Copyright (c) 1998, 2002 Frank Warmerdam 00010 * 00011 * Permission is hereby granted, free of charge, to any person obtaining a 00012 * copy of this software and associated documentation files (the "Software"), 00013 * to deal in the Software without restriction, including without limitation 00014 * the rights to use, copy, modify, merge, publish, distribute, sublicense, 00015 * and/or sell copies of the Software, and to permit persons to whom the 00016 * Software is furnished to do so, subject to the following conditions: 00017 * 00018 * The above copyright notice and this permission notice shall be included 00019 * in all copies or substantial portions of the Software. 00020 * 00021 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS 00022 * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 00023 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL 00024 * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 00025 * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING 00026 * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER 00027 * DEALINGS IN THE SOFTWARE. 00028 ****************************************************************************/ 00029 00030 #ifndef GDAL_H_INCLUDED 00031 #define GDAL_H_INCLUDED 00032 00039 #ifndef DOXYGEN_SKIP 00040 #include "gdal_version.h" 00041 #include "cpl_port.h" 00042 #include "cpl_error.h" 00043 #include "cpl_progress.h" 00044 #endif 00045 00046 /* -------------------------------------------------------------------- */ 00047 /* Significant constants. */ 00048 /* -------------------------------------------------------------------- */ 00049 00050 CPL_C_START 00051 00053 typedef enum { 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, 00066 GDT_TypeCount = 12 /* maximum type # + 1 */ 00067 } GDALDataType; 00068 00069 int CPL_DLL CPL_STDCALL GDALGetDataTypeSize( GDALDataType ); 00070 int CPL_DLL CPL_STDCALL GDALDataTypeIsComplex( GDALDataType ); 00071 const char CPL_DLL * CPL_STDCALL GDALGetDataTypeName( GDALDataType ); 00072 GDALDataType CPL_DLL CPL_STDCALL GDALGetDataTypeByName( const char * ); 00073 GDALDataType CPL_DLL CPL_STDCALL GDALDataTypeUnion( GDALDataType, GDALDataType ); 00074 00078 typedef enum 00079 { 00080 GARIO_PENDING = 0, 00081 GARIO_UPDATE = 1, 00082 GARIO_ERROR = 2, 00083 GARIO_COMPLETE = 3, 00084 GARIO_TypeCount = 4 00085 } GDALAsyncStatusType; 00086 00087 const char CPL_DLL * CPL_STDCALL GDALGetAsyncStatusTypeName( GDALAsyncStatusType ); 00088 GDALAsyncStatusType CPL_DLL CPL_STDCALL GDALGetAsyncStatusTypeByName( const char * ); 00089 00091 typedef enum { GA_ReadOnly = 0, GA_Update = 1 00094 } GDALAccess; 00095 00097 typedef enum { GF_Read = 0, GF_Write = 1 00100 } GDALRWFlag; 00101 00103 typedef enum 00104 { 00105 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 00123 } GDALColorInterp; 00124 00125 const char CPL_DLL *GDALGetColorInterpretationName( GDALColorInterp ); 00126 GDALColorInterp CPL_DLL GDALGetColorInterpretationByName( const char *pszName ); 00127 00129 typedef enum 00130 { GPI_Gray=0, GPI_RGB=1, GPI_CMYK=2, GPI_HLS=3 00135 } GDALPaletteInterp; 00136 00137 const char CPL_DLL *GDALGetPaletteInterpretationName( GDALPaletteInterp ); 00138 00139 /* "well known" metadata items. */ 00140 00141 #define GDALMD_AREA_OR_POINT "AREA_OR_POINT" 00142 # define GDALMD_AOP_AREA "Area" 00143 # define GDALMD_AOP_POINT "Point" 00144 00145 /* -------------------------------------------------------------------- */ 00146 /* GDAL Specific error codes. */ 00147 /* */ 00148 /* error codes 100 to 299 reserved for GDAL. */ 00149 /* -------------------------------------------------------------------- */ 00150 #define CPLE_WrongFormat 200 00151 00152 /* -------------------------------------------------------------------- */ 00153 /* Define handle types related to various internal classes. */ 00154 /* -------------------------------------------------------------------- */ 00155 00157 typedef void *GDALMajorObjectH; 00158 00160 typedef void *GDALDatasetH; 00161 00163 typedef void *GDALRasterBandH; 00164 00166 typedef void *GDALDriverH; 00167 00168 #ifndef DOXYGEN_SKIP 00169 /* Deprecated / unused */ 00170 typedef void *GDALProjDefH; 00171 #endif 00172 00174 typedef void *GDALColorTableH; 00175 00177 typedef void *GDALRasterAttributeTableH; 00178 00180 typedef void *GDALAsyncReaderH; 00181 00182 /* ==================================================================== */ 00183 /* Registration/driver related. */ 00184 /* ==================================================================== */ 00185 00186 #ifndef DOXYGEN_SKIP 00187 /* Deprecated / unused */ 00188 typedef struct { 00189 char *pszOptionName; 00190 char *pszValueType; /* "boolean", "int", "float", "string", 00191 "string-select" */ 00192 char *pszDescription; 00193 char **papszOptions; 00194 } GDALOptionDefinition; 00195 #endif 00196 00197 #define GDAL_DMD_LONGNAME "DMD_LONGNAME" 00198 #define GDAL_DMD_HELPTOPIC "DMD_HELPTOPIC" 00199 #define GDAL_DMD_MIMETYPE "DMD_MIMETYPE" 00200 #define GDAL_DMD_EXTENSION "DMD_EXTENSION" 00201 #define GDAL_DMD_CREATIONOPTIONLIST "DMD_CREATIONOPTIONLIST" 00202 #define GDAL_DMD_CREATIONDATATYPES "DMD_CREATIONDATATYPES" 00203 #define GDAL_DMD_SUBDATASETS "DMD_SUBDATASETS" 00204 00205 #define GDAL_DCAP_CREATE "DCAP_CREATE" 00206 #define GDAL_DCAP_CREATECOPY "DCAP_CREATECOPY" 00207 #define GDAL_DCAP_VIRTUALIO "DCAP_VIRTUALIO" 00208 00209 void CPL_DLL CPL_STDCALL GDALAllRegister( void ); 00210 00211 GDALDatasetH CPL_DLL CPL_STDCALL GDALCreate( GDALDriverH hDriver, 00212 const char *, int, int, int, GDALDataType, 00213 char ** ) CPL_WARN_UNUSED_RESULT; 00214 GDALDatasetH CPL_DLL CPL_STDCALL 00215 GDALCreateCopy( GDALDriverH, const char *, GDALDatasetH, 00216 int, char **, GDALProgressFunc, void * ) CPL_WARN_UNUSED_RESULT; 00217 00218 GDALDriverH CPL_DLL CPL_STDCALL GDALIdentifyDriver( const char * pszFilename, 00219 char ** papszFileList ); 00220 GDALDatasetH CPL_DLL CPL_STDCALL 00221 GDALOpen( const char *pszFilename, GDALAccess eAccess ) CPL_WARN_UNUSED_RESULT; 00222 GDALDatasetH CPL_DLL CPL_STDCALL GDALOpenShared( const char *, GDALAccess ) CPL_WARN_UNUSED_RESULT; 00223 int CPL_DLL CPL_STDCALL GDALDumpOpenDatasets( FILE * ); 00224 00225 GDALDriverH CPL_DLL CPL_STDCALL GDALGetDriverByName( const char * ); 00226 int CPL_DLL CPL_STDCALL GDALGetDriverCount( void ); 00227 GDALDriverH CPL_DLL CPL_STDCALL GDALGetDriver( int ); 00228 void CPL_DLL CPL_STDCALL GDALDestroyDriver( GDALDriverH ); 00229 int CPL_DLL CPL_STDCALL GDALRegisterDriver( GDALDriverH ); 00230 void CPL_DLL CPL_STDCALL GDALDeregisterDriver( GDALDriverH ); 00231 void CPL_DLL CPL_STDCALL GDALDestroyDriverManager( void ); 00232 CPLErr CPL_DLL CPL_STDCALL GDALDeleteDataset( GDALDriverH, const char * ); 00233 CPLErr CPL_DLL CPL_STDCALL GDALRenameDataset( GDALDriverH, 00234 const char * pszNewName, 00235 const char * pszOldName ); 00236 CPLErr CPL_DLL CPL_STDCALL GDALCopyDatasetFiles( GDALDriverH, 00237 const char * pszNewName, 00238 const char * pszOldName); 00239 int CPL_DLL CPL_STDCALL GDALValidateCreationOptions( GDALDriverH, 00240 char** papszCreationOptions); 00241 00242 /* The following are deprecated */ 00243 const char CPL_DLL * CPL_STDCALL GDALGetDriverShortName( GDALDriverH ); 00244 const char CPL_DLL * CPL_STDCALL GDALGetDriverLongName( GDALDriverH ); 00245 const char CPL_DLL * CPL_STDCALL GDALGetDriverHelpTopic( GDALDriverH ); 00246 const char CPL_DLL * CPL_STDCALL GDALGetDriverCreationOptionList( GDALDriverH ); 00247 00248 /* ==================================================================== */ 00249 /* GDAL_GCP */ 00250 /* ==================================================================== */ 00251 00253 typedef struct 00254 { 00256 char *pszId; 00257 00259 char *pszInfo; 00260 00262 double dfGCPPixel; 00264 double dfGCPLine; 00265 00267 double dfGCPX; 00268 00270 double dfGCPY; 00271 00273 double dfGCPZ; 00274 } GDAL_GCP; 00275 00276 void CPL_DLL CPL_STDCALL GDALInitGCPs( int, GDAL_GCP * ); 00277 void CPL_DLL CPL_STDCALL GDALDeinitGCPs( int, GDAL_GCP * ); 00278 GDAL_GCP CPL_DLL * CPL_STDCALL GDALDuplicateGCPs( int, const GDAL_GCP * ); 00279 00280 int CPL_DLL CPL_STDCALL 00281 GDALGCPsToGeoTransform( int nGCPCount, const GDAL_GCP *pasGCPs, 00282 double *padfGeoTransform, int bApproxOK ); 00283 int CPL_DLL CPL_STDCALL 00284 GDALInvGeoTransform( double *padfGeoTransformIn, 00285 double *padfInvGeoTransformOut ); 00286 void CPL_DLL CPL_STDCALL GDALApplyGeoTransform( double *, double, double, 00287 double *, double * ); 00288 00289 /* ==================================================================== */ 00290 /* major objects (dataset, and, driver, drivermanager). */ 00291 /* ==================================================================== */ 00292 00293 char CPL_DLL ** CPL_STDCALL GDALGetMetadata( GDALMajorObjectH, const char * ); 00294 CPLErr CPL_DLL CPL_STDCALL GDALSetMetadata( GDALMajorObjectH, char **, 00295 const char * ); 00296 const char CPL_DLL * CPL_STDCALL 00297 GDALGetMetadataItem( GDALMajorObjectH, const char *, const char * ); 00298 CPLErr CPL_DLL CPL_STDCALL 00299 GDALSetMetadataItem( GDALMajorObjectH, const char *, const char *, 00300 const char * ); 00301 const char CPL_DLL * CPL_STDCALL GDALGetDescription( GDALMajorObjectH ); 00302 void CPL_DLL CPL_STDCALL GDALSetDescription( GDALMajorObjectH, const char * ); 00303 00304 /* ==================================================================== */ 00305 /* GDALDataset class ... normally this represents one file. */ 00306 /* ==================================================================== */ 00307 00308 GDALDriverH CPL_DLL CPL_STDCALL GDALGetDatasetDriver( GDALDatasetH ); 00309 char CPL_DLL ** CPL_STDCALL GDALGetFileList( GDALDatasetH ); 00310 void CPL_DLL CPL_STDCALL GDALClose( GDALDatasetH ); 00311 int CPL_DLL CPL_STDCALL GDALGetRasterXSize( GDALDatasetH ); 00312 int CPL_DLL CPL_STDCALL GDALGetRasterYSize( GDALDatasetH ); 00313 int CPL_DLL CPL_STDCALL GDALGetRasterCount( GDALDatasetH ); 00314 GDALRasterBandH CPL_DLL CPL_STDCALL GDALGetRasterBand( GDALDatasetH, int ); 00315 00316 CPLErr CPL_DLL CPL_STDCALL GDALAddBand( GDALDatasetH hDS, GDALDataType eType, 00317 char **papszOptions ); 00318 00319 GDALAsyncReaderH CPL_DLL CPL_STDCALL 00320 GDALBeginAsyncReader(GDALDatasetH hDS, int nXOff, int nYOff, 00321 int nXSize, int nYSize, 00322 void *pBuf, int nBufXSize, int nBufYSize, 00323 GDALDataType eBufType, int nBandCount, int* panBandMap, 00324 int nPixelSpace, int nLineSpace, int nBandSpace, 00325 char **papszOptions); 00326 00327 void CPL_DLL CPL_STDCALL 00328 GDALEndAsyncReader(GDALDatasetH hDS, GDALAsyncReaderH hAsynchReaderH); 00329 00330 CPLErr CPL_DLL CPL_STDCALL GDALDatasetRasterIO( 00331 GDALDatasetH hDS, GDALRWFlag eRWFlag, 00332 int nDSXOff, int nDSYOff, int nDSXSize, int nDSYSize, 00333 void * pBuffer, int nBXSize, int nBYSize, GDALDataType eBDataType, 00334 int nBandCount, int *panBandCount, 00335 int nPixelSpace, int nLineSpace, int nBandSpace); 00336 00337 CPLErr CPL_DLL CPL_STDCALL GDALDatasetAdviseRead( GDALDatasetH hDS, 00338 int nDSXOff, int nDSYOff, int nDSXSize, int nDSYSize, 00339 int nBXSize, int nBYSize, GDALDataType eBDataType, 00340 int nBandCount, int *panBandCount, char **papszOptions ); 00341 00342 const char CPL_DLL * CPL_STDCALL GDALGetProjectionRef( GDALDatasetH ); 00343 CPLErr CPL_DLL CPL_STDCALL GDALSetProjection( GDALDatasetH, const char * ); 00344 CPLErr CPL_DLL CPL_STDCALL GDALGetGeoTransform( GDALDatasetH, double * ); 00345 CPLErr CPL_DLL CPL_STDCALL GDALSetGeoTransform( GDALDatasetH, double * ); 00346 00347 int CPL_DLL CPL_STDCALL GDALGetGCPCount( GDALDatasetH ); 00348 const char CPL_DLL * CPL_STDCALL GDALGetGCPProjection( GDALDatasetH ); 00349 const GDAL_GCP CPL_DLL * CPL_STDCALL GDALGetGCPs( GDALDatasetH ); 00350 CPLErr CPL_DLL CPL_STDCALL GDALSetGCPs( GDALDatasetH, int, const GDAL_GCP *, 00351 const char * ); 00352 00353 void CPL_DLL * CPL_STDCALL GDALGetInternalHandle( GDALDatasetH, const char * ); 00354 int CPL_DLL CPL_STDCALL GDALReferenceDataset( GDALDatasetH ); 00355 int CPL_DLL CPL_STDCALL GDALDereferenceDataset( GDALDatasetH ); 00356 00357 CPLErr CPL_DLL CPL_STDCALL 00358 GDALBuildOverviews( GDALDatasetH, const char *, int, int *, 00359 int, int *, GDALProgressFunc, void * ); 00360 void CPL_DLL CPL_STDCALL GDALGetOpenDatasets( GDALDatasetH **hDS, int *pnCount ); 00361 int CPL_DLL CPL_STDCALL GDALGetAccess( GDALDatasetH hDS ); 00362 void CPL_DLL CPL_STDCALL GDALFlushCache( GDALDatasetH hDS ); 00363 00364 CPLErr CPL_DLL CPL_STDCALL 00365 GDALCreateDatasetMaskBand( GDALDatasetH hDS, int nFlags ); 00366 00367 CPLErr CPL_DLL CPL_STDCALL GDALDatasetCopyWholeRaster( 00368 GDALDatasetH hSrcDS, GDALDatasetH hDstDS, char **papszOptions, 00369 GDALProgressFunc pfnProgress, void *pProgressData ); 00370 00371 CPLErr CPL_DLL CPL_STDCALL GDALRasterBandCopyWholeRaster( 00372 GDALRasterBandH hSrcBand, GDALRasterBandH hDstBand, char **papszOptions, 00373 GDALProgressFunc pfnProgress, void *pProgressData ); 00374 00375 CPLErr CPL_DLL 00376 GDALRegenerateOverviews( GDALRasterBandH hSrcBand, 00377 int nOverviewCount, GDALRasterBandH *pahOverviewBands, 00378 const char *pszResampling, 00379 GDALProgressFunc pfnProgress, void *pProgressData ); 00380 00381 /* ==================================================================== */ 00382 /* GDALRasterBand ... one band/channel in a dataset. */ 00383 /* ==================================================================== */ 00384 00389 #define SRCVAL(papoSource, eSrcType, ii) \ 00390 (eSrcType == GDT_Byte ? \ 00391 ((GByte *)papoSource)[ii] : \ 00392 (eSrcType == GDT_Float32 ? \ 00393 ((float *)papoSource)[ii] : \ 00394 (eSrcType == GDT_Float64 ? \ 00395 ((double *)papoSource)[ii] : \ 00396 (eSrcType == GDT_Int32 ? \ 00397 ((GInt32 *)papoSource)[ii] : \ 00398 (eSrcType == GDT_UInt16 ? \ 00399 ((GUInt16 *)papoSource)[ii] : \ 00400 (eSrcType == GDT_Int16 ? \ 00401 ((GInt16 *)papoSource)[ii] : \ 00402 (eSrcType == GDT_UInt32 ? \ 00403 ((GUInt32 *)papoSource)[ii] : \ 00404 (eSrcType == GDT_CInt16 ? \ 00405 ((GInt16 *)papoSource)[ii * 2] : \ 00406 (eSrcType == GDT_CInt32 ? \ 00407 ((GInt32 *)papoSource)[ii * 2] : \ 00408 (eSrcType == GDT_CFloat32 ? \ 00409 ((float *)papoSource)[ii * 2] : \ 00410 (eSrcType == GDT_CFloat64 ? \ 00411 ((double *)papoSource)[ii * 2] : 0))))))))))) 00412 00413 typedef CPLErr 00414 (*GDALDerivedPixelFunc)(void **papoSources, int nSources, void *pData, 00415 int nBufXSize, int nBufYSize, 00416 GDALDataType eSrcType, GDALDataType eBufType, 00417 int nPixelSpace, int nLineSpace); 00418 00419 GDALDataType CPL_DLL CPL_STDCALL GDALGetRasterDataType( GDALRasterBandH ); 00420 void CPL_DLL CPL_STDCALL 00421 GDALGetBlockSize( GDALRasterBandH, int * pnXSize, int * pnYSize ); 00422 00423 CPLErr CPL_DLL CPL_STDCALL GDALRasterAdviseRead( GDALRasterBandH hRB, 00424 int nDSXOff, int nDSYOff, int nDSXSize, int nDSYSize, 00425 int nBXSize, int nBYSize, GDALDataType eBDataType, char **papszOptions ); 00426 00427 CPLErr CPL_DLL CPL_STDCALL 00428 GDALRasterIO( GDALRasterBandH hRBand, GDALRWFlag eRWFlag, 00429 int nDSXOff, int nDSYOff, int nDSXSize, int nDSYSize, 00430 void * pBuffer, int nBXSize, int nBYSize,GDALDataType eBDataType, 00431 int nPixelSpace, int nLineSpace ); 00432 CPLErr CPL_DLL CPL_STDCALL GDALReadBlock( GDALRasterBandH, int, int, void * ); 00433 CPLErr CPL_DLL CPL_STDCALL GDALWriteBlock( GDALRasterBandH, int, int, void * ); 00434 int CPL_DLL CPL_STDCALL GDALGetRasterBandXSize( GDALRasterBandH ); 00435 int CPL_DLL CPL_STDCALL GDALGetRasterBandYSize( GDALRasterBandH ); 00436 GDALAccess CPL_DLL CPL_STDCALL GDALGetRasterAccess( GDALRasterBandH ); 00437 int CPL_DLL CPL_STDCALL GDALGetBandNumber( GDALRasterBandH ); 00438 GDALDatasetH CPL_DLL CPL_STDCALL GDALGetBandDataset( GDALRasterBandH ); 00439 00440 GDALColorInterp CPL_DLL CPL_STDCALL 00441 GDALGetRasterColorInterpretation( GDALRasterBandH ); 00442 CPLErr CPL_DLL CPL_STDCALL 00443 GDALSetRasterColorInterpretation( GDALRasterBandH, GDALColorInterp ); 00444 GDALColorTableH CPL_DLL CPL_STDCALL GDALGetRasterColorTable( GDALRasterBandH ); 00445 CPLErr CPL_DLL CPL_STDCALL GDALSetRasterColorTable( GDALRasterBandH, GDALColorTableH ); 00446 int CPL_DLL CPL_STDCALL GDALHasArbitraryOverviews( GDALRasterBandH ); 00447 int CPL_DLL CPL_STDCALL GDALGetOverviewCount( GDALRasterBandH ); 00448 GDALRasterBandH CPL_DLL CPL_STDCALL GDALGetOverview( GDALRasterBandH, int ); 00449 double CPL_DLL CPL_STDCALL GDALGetRasterNoDataValue( GDALRasterBandH, int * ); 00450 CPLErr CPL_DLL CPL_STDCALL GDALSetRasterNoDataValue( GDALRasterBandH, double ); 00451 char CPL_DLL ** CPL_STDCALL GDALGetRasterCategoryNames( GDALRasterBandH ); 00452 CPLErr CPL_DLL CPL_STDCALL GDALSetRasterCategoryNames( GDALRasterBandH, char ** ); 00453 double CPL_DLL CPL_STDCALL GDALGetRasterMinimum( GDALRasterBandH, int *pbSuccess ); 00454 double CPL_DLL CPL_STDCALL GDALGetRasterMaximum( GDALRasterBandH, int *pbSuccess ); 00455 CPLErr CPL_DLL CPL_STDCALL GDALGetRasterStatistics( 00456 GDALRasterBandH, int bApproxOK, int bForce, 00457 double *pdfMin, double *pdfMax, double *pdfMean, double *pdfStdDev ); 00458 CPLErr CPL_DLL CPL_STDCALL GDALComputeRasterStatistics( 00459 GDALRasterBandH, int bApproxOK, 00460 double *pdfMin, double *pdfMax, double *pdfMean, double *pdfStdDev, 00461 GDALProgressFunc pfnProgress, void *pProgressData ); 00462 CPLErr CPL_DLL CPL_STDCALL GDALSetRasterStatistics( 00463 GDALRasterBandH hBand, 00464 double dfMin, double dfMax, double dfMean, double dfStdDev ); 00465 00466 const char CPL_DLL * CPL_STDCALL GDALGetRasterUnitType( GDALRasterBandH ); 00467 CPLErr CPL_DLL CPL_STDCALL GDALSetRasterUnitType( GDALRasterBandH hBand, const char *pszNewValue ); 00468 double CPL_DLL CPL_STDCALL GDALGetRasterOffset( GDALRasterBandH, int *pbSuccess ); 00469 CPLErr CPL_DLL CPL_STDCALL GDALSetRasterOffset( GDALRasterBandH hBand, double dfNewOffset); 00470 double CPL_DLL CPL_STDCALL GDALGetRasterScale( GDALRasterBandH, int *pbSuccess ); 00471 CPLErr CPL_DLL CPL_STDCALL GDALSetRasterScale( GDALRasterBandH hBand, double dfNewOffset ); 00472 void CPL_DLL CPL_STDCALL 00473 GDALComputeRasterMinMax( GDALRasterBandH hBand, int bApproxOK, 00474 double adfMinMax[2] ); 00475 CPLErr CPL_DLL CPL_STDCALL GDALFlushRasterCache( GDALRasterBandH hBand ); 00476 CPLErr CPL_DLL CPL_STDCALL GDALGetRasterHistogram( GDALRasterBandH hBand, 00477 double dfMin, double dfMax, 00478 int nBuckets, int *panHistogram, 00479 int bIncludeOutOfRange, int bApproxOK, 00480 GDALProgressFunc pfnProgress, 00481 void * pProgressData ); 00482 CPLErr CPL_DLL CPL_STDCALL GDALGetDefaultHistogram( GDALRasterBandH hBand, 00483 double *pdfMin, double *pdfMax, 00484 int *pnBuckets, int **ppanHistogram, 00485 int bForce, 00486 GDALProgressFunc pfnProgress, 00487 void * pProgressData ); 00488 CPLErr CPL_DLL CPL_STDCALL GDALSetDefaultHistogram( GDALRasterBandH hBand, 00489 double dfMin, double dfMax, 00490 int nBuckets, int *panHistogram ); 00491 int CPL_DLL CPL_STDCALL 00492 GDALGetRandomRasterSample( GDALRasterBandH, int, float * ); 00493 GDALRasterBandH CPL_DLL CPL_STDCALL 00494 GDALGetRasterSampleOverview( GDALRasterBandH, int ); 00495 CPLErr CPL_DLL CPL_STDCALL GDALFillRaster( GDALRasterBandH hBand, 00496 double dfRealValue, double dfImaginaryValue ); 00497 CPLErr CPL_DLL CPL_STDCALL 00498 GDALComputeBandStats( GDALRasterBandH hBand, int nSampleStep, 00499 double *pdfMean, double *pdfStdDev, 00500 GDALProgressFunc pfnProgress, 00501 void *pProgressData ); 00502 CPLErr CPL_DLL GDALOverviewMagnitudeCorrection( GDALRasterBandH hBaseBand, 00503 int nOverviewCount, 00504 GDALRasterBandH *pahOverviews, 00505 GDALProgressFunc pfnProgress, 00506 void *pProgressData ); 00507 00508 GDALRasterAttributeTableH CPL_DLL CPL_STDCALL GDALGetDefaultRAT( 00509 GDALRasterBandH hBand ); 00510 CPLErr CPL_DLL CPL_STDCALL GDALSetDefaultRAT( GDALRasterBandH, 00511 GDALRasterAttributeTableH ); 00512 CPLErr CPL_DLL CPL_STDCALL GDALAddDerivedBandPixelFunc( const char *pszName, 00513 GDALDerivedPixelFunc pfnPixelFunc ); 00514 00515 GDALRasterBandH CPL_DLL CPL_STDCALL GDALGetMaskBand( GDALRasterBandH hBand ); 00516 int CPL_DLL CPL_STDCALL GDALGetMaskFlags( GDALRasterBandH hBand ); 00517 CPLErr CPL_DLL CPL_STDCALL 00518 GDALCreateMaskBand( GDALRasterBandH hBand, int nFlags ); 00519 00520 #define GMF_ALL_VALID 0x01 00521 #define GMF_PER_DATASET 0x02 00522 #define GMF_ALPHA 0x04 00523 #define GMF_NODATA 0x08 00524 00525 /* ==================================================================== */ 00526 /* GDALAsyncReader */ 00527 /* ==================================================================== */ 00528 00529 GDALAsyncStatusType CPL_DLL CPL_STDCALL 00530 GDALARGetNextUpdatedRegion(GDALAsyncReaderH hARIO, double dfTimeout, 00531 int* pnXBufOff, int* pnYBufOff, 00532 int* pnXBufSize, int* pnYBufSize ); 00533 int CPL_DLL CPL_STDCALL GDALARLockBuffer(GDALAsyncReaderH hARIO, 00534 double dfTimeout); 00535 void CPL_DLL CPL_STDCALL GDALARUnlockBuffer(GDALAsyncReaderH hARIO); 00536 00537 /* -------------------------------------------------------------------- */ 00538 /* Helper functions. */ 00539 /* -------------------------------------------------------------------- */ 00540 int CPL_DLL CPL_STDCALL GDALGeneralCmdLineProcessor( int nArgc, char ***ppapszArgv, 00541 int nOptions ); 00542 void CPL_DLL CPL_STDCALL GDALSwapWords( void *pData, int nWordSize, int nWordCount, 00543 int nWordSkip ); 00544 void CPL_DLL CPL_STDCALL 00545 GDALCopyWords( void * pSrcData, GDALDataType eSrcType, int nSrcPixelOffset, 00546 void * pDstData, GDALDataType eDstType, int nDstPixelOffset, 00547 int nWordCount ); 00548 00549 void CPL_DLL 00550 GDALCopyBits( const GByte *pabySrcData, int nSrcOffset, int nSrcStep, 00551 GByte *pabyDstData, int nDstOffset, int nDstStep, 00552 int nBitCount, int nStepCount ); 00553 00554 int CPL_DLL CPL_STDCALL GDALLoadWorldFile( const char *, double * ); 00555 int CPL_DLL CPL_STDCALL GDALReadWorldFile( const char *, const char *, 00556 double * ); 00557 int CPL_DLL CPL_STDCALL GDALWriteWorldFile( const char *, const char *, 00558 double * ); 00559 int CPL_DLL CPL_STDCALL GDALLoadTabFile( const char *, double *, char **, 00560 int *, GDAL_GCP ** ); 00561 int CPL_DLL CPL_STDCALL GDALReadTabFile( const char *, double *, char **, 00562 int *, GDAL_GCP ** ); 00563 int CPL_DLL CPL_STDCALL GDALLoadOziMapFile( const char *, double *, char **, 00564 int *, GDAL_GCP ** ); 00565 int CPL_DLL CPL_STDCALL GDALReadOziMapFile( const char * , double *, 00566 char **, int *, GDAL_GCP ** ); 00567 char CPL_DLL ** CPL_STDCALL GDALLoadRPBFile( const char *pszFilename, 00568 char **papszSiblingFiles ); 00569 char CPL_DLL ** CPL_STDCALL GDALLoadRPCFile( const char *pszFilename, 00570 char **papszSiblingFiles ); 00571 CPLErr CPL_DLL CPL_STDCALL GDALWriteRPBFile( const char *pszFilename, 00572 char **papszMD ); 00573 char CPL_DLL ** CPL_STDCALL GDALLoadIMDFile( const char *pszFilename, 00574 char **papszSiblingFiles ); 00575 CPLErr CPL_DLL CPL_STDCALL GDALWriteIMDFile( const char *pszFilename, 00576 char **papszMD ); 00577 00578 const char CPL_DLL * CPL_STDCALL GDALDecToDMS( double, const char *, int ); 00579 double CPL_DLL CPL_STDCALL GDALPackedDMSToDec( double ); 00580 double CPL_DLL CPL_STDCALL GDALDecToPackedDMS( double ); 00581 00582 /* Note to developers : please keep this section in sync with ogr_core.h */ 00583 00584 #ifndef GDAL_VERSION_INFO_DEFINED 00585 #define GDAL_VERSION_INFO_DEFINED 00586 const char CPL_DLL * CPL_STDCALL GDALVersionInfo( const char * ); 00587 #endif 00588 00589 #ifndef GDAL_CHECK_VERSION 00590 00591 int CPL_DLL CPL_STDCALL GDALCheckVersion( int nVersionMajor, int nVersionMinor, 00592 const char* pszCallingComponentName); 00593 00597 #define GDAL_CHECK_VERSION(pszCallingComponentName) \ 00598 GDALCheckVersion(GDAL_VERSION_MAJOR, GDAL_VERSION_MINOR, pszCallingComponentName) 00599 00600 #endif 00601 00602 typedef struct { 00603 double dfLINE_OFF; 00604 double dfSAMP_OFF; 00605 double dfLAT_OFF; 00606 double dfLONG_OFF; 00607 double dfHEIGHT_OFF; 00608 00609 double dfLINE_SCALE; 00610 double dfSAMP_SCALE; 00611 double dfLAT_SCALE; 00612 double dfLONG_SCALE; 00613 double dfHEIGHT_SCALE; 00614 00615 double adfLINE_NUM_COEFF[20]; 00616 double adfLINE_DEN_COEFF[20]; 00617 double adfSAMP_NUM_COEFF[20]; 00618 double adfSAMP_DEN_COEFF[20]; 00619 00620 double dfMIN_LONG; 00621 double dfMIN_LAT; 00622 double dfMAX_LONG; 00623 double dfMAX_LAT; 00624 00625 } GDALRPCInfo; 00626 00627 int CPL_DLL CPL_STDCALL GDALExtractRPCInfo( char **, GDALRPCInfo * ); 00628 00629 /* ==================================================================== */ 00630 /* Color tables. */ 00631 /* ==================================================================== */ 00632 00634 typedef struct 00635 { 00637 short c1; 00638 00640 short c2; 00641 00643 short c3; 00644 00646 short c4; 00647 } GDALColorEntry; 00648 00649 GDALColorTableH CPL_DLL CPL_STDCALL GDALCreateColorTable( GDALPaletteInterp ); 00650 void CPL_DLL CPL_STDCALL GDALDestroyColorTable( GDALColorTableH ); 00651 GDALColorTableH CPL_DLL CPL_STDCALL GDALCloneColorTable( GDALColorTableH ); 00652 GDALPaletteInterp CPL_DLL CPL_STDCALL GDALGetPaletteInterpretation( GDALColorTableH ); 00653 int CPL_DLL CPL_STDCALL GDALGetColorEntryCount( GDALColorTableH ); 00654 const GDALColorEntry CPL_DLL * CPL_STDCALL GDALGetColorEntry( GDALColorTableH, int ); 00655 int CPL_DLL CPL_STDCALL GDALGetColorEntryAsRGB( GDALColorTableH, int, GDALColorEntry *); 00656 void CPL_DLL CPL_STDCALL GDALSetColorEntry( GDALColorTableH, int, const GDALColorEntry * ); 00657 void CPL_DLL CPL_STDCALL GDALCreateColorRamp( GDALColorTableH hTable, 00658 int nStartIndex, const GDALColorEntry *psStartColor, 00659 int nEndIndex, const GDALColorEntry *psEndColor ); 00660 00661 /* ==================================================================== */ 00662 /* Raster Attribute Table */ 00663 /* ==================================================================== */ 00664 00666 typedef enum { GFT_Integer , GFT_Real, GFT_String 00670 } GDALRATFieldType; 00671 00673 typedef enum { GFU_Generic = 0, GFU_PixelCount = 1, GFU_Name = 2, GFU_Min = 3, GFU_Max = 4, GFU_MinMax = 5, GFU_Red = 6, GFU_Green = 7, GFU_Blue = 8, GFU_Alpha = 9, GFU_RedMin = 10, GFU_GreenMin = 11, GFU_BlueMin = 12, GFU_AlphaMin = 13, GFU_RedMax = 14, GFU_GreenMax = 15, GFU_BlueMax = 16, GFU_AlphaMax = 17, GFU_MaxCount 00693 } GDALRATFieldUsage; 00694 00695 GDALRasterAttributeTableH CPL_DLL CPL_STDCALL 00696 GDALCreateRasterAttributeTable(void); 00697 void CPL_DLL CPL_STDCALL GDALDestroyRasterAttributeTable( 00698 GDALRasterAttributeTableH ); 00699 00700 int CPL_DLL CPL_STDCALL GDALRATGetColumnCount( GDALRasterAttributeTableH ); 00701 00702 const char CPL_DLL * CPL_STDCALL GDALRATGetNameOfCol( 00703 GDALRasterAttributeTableH, int ); 00704 GDALRATFieldUsage CPL_DLL CPL_STDCALL GDALRATGetUsageOfCol( 00705 GDALRasterAttributeTableH, int ); 00706 GDALRATFieldType CPL_DLL CPL_STDCALL GDALRATGetTypeOfCol( 00707 GDALRasterAttributeTableH, int ); 00708 00709 int CPL_DLL CPL_STDCALL GDALRATGetColOfUsage( GDALRasterAttributeTableH, 00710 GDALRATFieldUsage ); 00711 int CPL_DLL CPL_STDCALL GDALRATGetRowCount( GDALRasterAttributeTableH ); 00712 00713 const char CPL_DLL * CPL_STDCALL GDALRATGetValueAsString( 00714 GDALRasterAttributeTableH, int ,int); 00715 int CPL_DLL CPL_STDCALL GDALRATGetValueAsInt( 00716 GDALRasterAttributeTableH, int ,int); 00717 double CPL_DLL CPL_STDCALL GDALRATGetValueAsDouble( 00718 GDALRasterAttributeTableH, int ,int); 00719 00720 void CPL_DLL CPL_STDCALL GDALRATSetValueAsString( GDALRasterAttributeTableH, int, int, 00721 const char * ); 00722 void CPL_DLL CPL_STDCALL GDALRATSetValueAsInt( GDALRasterAttributeTableH, int, int, 00723 int ); 00724 void CPL_DLL CPL_STDCALL GDALRATSetValueAsDouble( GDALRasterAttributeTableH, int, int, 00725 double ); 00726 void CPL_DLL CPL_STDCALL GDALRATSetRowCount( GDALRasterAttributeTableH, 00727 int ); 00728 CPLErr CPL_DLL CPL_STDCALL GDALRATCreateColumn( GDALRasterAttributeTableH, 00729 const char *, 00730 GDALRATFieldType, 00731 GDALRATFieldUsage ); 00732 CPLErr CPL_DLL CPL_STDCALL GDALRATSetLinearBinning( GDALRasterAttributeTableH, 00733 double, double ); 00734 int CPL_DLL CPL_STDCALL GDALRATGetLinearBinning( GDALRasterAttributeTableH, 00735 double *, double * ); 00736 CPLErr CPL_DLL CPL_STDCALL GDALRATInitializeFromColorTable( 00737 GDALRasterAttributeTableH, GDALColorTableH ); 00738 GDALColorTableH CPL_DLL CPL_STDCALL GDALRATTranslateToColorTable( 00739 GDALRasterAttributeTableH, int nEntryCount ); 00740 void CPL_DLL CPL_STDCALL GDALRATDumpReadable( GDALRasterAttributeTableH, 00741 FILE * ); 00742 GDALRasterAttributeTableH CPL_DLL CPL_STDCALL 00743 GDALRATClone( GDALRasterAttributeTableH ); 00744 00745 int CPL_DLL CPL_STDCALL GDALRATGetRowOfValue( GDALRasterAttributeTableH , double ); 00746 00747 00748 /* ==================================================================== */ 00749 /* GDAL Cache Management */ 00750 /* ==================================================================== */ 00751 00752 void CPL_DLL CPL_STDCALL GDALSetCacheMax( int nBytes ); 00753 int CPL_DLL CPL_STDCALL GDALGetCacheMax(void); 00754 int CPL_DLL CPL_STDCALL GDALGetCacheUsed(void); 00755 void CPL_DLL CPL_STDCALL GDALSetCacheMax64( GIntBig nBytes ); 00756 GIntBig CPL_DLL CPL_STDCALL GDALGetCacheMax64(void); 00757 GIntBig CPL_DLL CPL_STDCALL GDALGetCacheUsed64(void); 00758 00759 int CPL_DLL CPL_STDCALL GDALFlushCacheBlock(void); 00760 00761 CPL_C_END 00762 00763 #endif /* ndef GDAL_H_INCLUDED */