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 #ifndef GDAL_ALG_H_INCLUDED
00031 #define GDAL_ALG_H_INCLUDED
00032
00039 #include "gdal.h"
00040 #include "cpl_minixml.h"
00041 #include "ogr_api.h"
00042
00043 CPL_C_START
00044
00045 int CPL_DLL CPL_STDCALL GDALComputeMedianCutPCT( GDALRasterBandH hRed,
00046 GDALRasterBandH hGreen,
00047 GDALRasterBandH hBlue,
00048 int (*pfnIncludePixel)(int,int,void*),
00049 int nColors,
00050 GDALColorTableH hColorTable,
00051 GDALProgressFunc pfnProgress,
00052 void * pProgressArg );
00053
00054 int CPL_DLL CPL_STDCALL GDALDitherRGB2PCT( GDALRasterBandH hRed,
00055 GDALRasterBandH hGreen,
00056 GDALRasterBandH hBlue,
00057 GDALRasterBandH hTarget,
00058 GDALColorTableH hColorTable,
00059 GDALProgressFunc pfnProgress,
00060 void * pProgressArg );
00061
00062 int CPL_DLL CPL_STDCALL GDALChecksumImage( GDALRasterBandH hBand,
00063 int nXOff, int nYOff, int nXSize, int nYSize );
00064
00065 CPLErr CPL_DLL CPL_STDCALL
00066 GDALComputeProximity( GDALRasterBandH hSrcBand,
00067 GDALRasterBandH hProximityBand,
00068 char **papszOptions,
00069 GDALProgressFunc pfnProgress,
00070 void * pProgressArg );
00071
00072
00073
00074
00075
00076 typedef int
00077 (*GDALTransformerFunc)( void *pTransformerArg,
00078 int bDstToSrc, int nPointCount,
00079 double *x, double *y, double *z, int *panSuccess );
00080
00081 typedef struct {
00082 char szSignature[4];
00083 const char *pszClassName;
00084 GDALTransformerFunc pfnTransform;
00085 void (*pfnCleanup)( void * );
00086 CPLXMLNode *(*pfnSerialize)( void * );
00087 } GDALTransformerInfo;
00088
00089 void CPL_DLL GDALDestroyTransformer( void *pTransformerArg );
00090 int CPL_DLL GDALUseTransformer( void *pTranformerArg,
00091 int bDstToSrc, int nPointCount,
00092 double *x, double *y, double *z,
00093 int *panSuccess );
00094
00095
00096
00097
00098
00099 void CPL_DLL *
00100 GDALCreateGenImgProjTransformer( GDALDatasetH hSrcDS, const char *pszSrcWKT,
00101 GDALDatasetH hDstDS, const char *pszDstWKT,
00102 int bGCPUseOK, double dfGCPErrorThreshold,
00103 int nOrder );
00104 void CPL_DLL *
00105 GDALCreateGenImgProjTransformer2( GDALDatasetH hSrcDS, GDALDatasetH hDstDS,
00106 char **papszOptions );
00107 void CPL_DLL GDALSetGenImgProjTransformerDstGeoTransform( void *,
00108 const double * );
00109 void CPL_DLL GDALDestroyGenImgProjTransformer( void * );
00110 int CPL_DLL GDALGenImgProjTransform(
00111 void *pTransformArg, int bDstToSrc, int nPointCount,
00112 double *x, double *y, double *z, int *panSuccess );
00113
00114
00115 void CPL_DLL *
00116 GDALCreateReprojectionTransformer( const char *pszSrcWKT,
00117 const char *pszDstWKT );
00118 void CPL_DLL GDALDestroyReprojectionTransformer( void * );
00119 int CPL_DLL GDALReprojectionTransform(
00120 void *pTransformArg, int bDstToSrc, int nPointCount,
00121 double *x, double *y, double *z, int *panSuccess );
00122
00123
00124 void CPL_DLL *
00125 GDALCreateGCPTransformer( int nGCPCount, const GDAL_GCP *pasGCPList,
00126 int nReqOrder, int bReversed );
00127 void CPL_DLL GDALDestroyGCPTransformer( void *pTransformArg );
00128 int CPL_DLL GDALGCPTransform(
00129 void *pTransformArg, int bDstToSrc, int nPointCount,
00130 double *x, double *y, double *z, int *panSuccess );
00131
00132
00133
00134 void CPL_DLL *
00135 GDALCreateTPSTransformer( int nGCPCount, const GDAL_GCP *pasGCPList,
00136 int bReversed );
00137 void CPL_DLL GDALDestroyTPSTransformer( void *pTransformArg );
00138 int CPL_DLL GDALTPSTransform(
00139 void *pTransformArg, int bDstToSrc, int nPointCount,
00140 double *x, double *y, double *z, int *panSuccess );
00141
00142
00143
00144 void CPL_DLL *
00145 GDALCreateRPCTransformer( GDALRPCInfo *psRPC, int bReversed,
00146 double dfPixErrThreshold,
00147 char **papszOptions );
00148 void CPL_DLL GDALDestroyRPCTransformer( void *pTransformArg );
00149 int CPL_DLL GDALRPCTransform(
00150 void *pTransformArg, int bDstToSrc, int nPointCount,
00151 double *x, double *y, double *z, int *panSuccess );
00152
00153
00154
00155 void CPL_DLL *
00156 GDALCreateGeoLocTransformer( GDALDatasetH hBaseDS,
00157 char **papszGeolocationInfo,
00158 int bReversed );
00159 void CPL_DLL GDALDestroyGeoLocTransformer( void *pTransformArg );
00160 int CPL_DLL GDALGeoLocTransform(
00161 void *pTransformArg, int bDstToSrc, int nPointCount,
00162 double *x, double *y, double *z, int *panSuccess );
00163
00164
00165 void CPL_DLL *
00166 GDALCreateApproxTransformer( GDALTransformerFunc pfnRawTransformer,
00167 void *pRawTransformerArg, double dfMaxError );
00168 void CPL_DLL GDALApproxTransformerOwnsSubtransformer( void *pCBData,
00169 int bOwnFlag );
00170 void CPL_DLL GDALDestroyApproxTransformer( void *pApproxArg );
00171 int CPL_DLL GDALApproxTransform(
00172 void *pTransformArg, int bDstToSrc, int nPointCount,
00173 double *x, double *y, double *z, int *panSuccess );
00174
00175
00176
00177
00178 int CPL_DLL CPL_STDCALL
00179 GDALSimpleImageWarp( GDALDatasetH hSrcDS,
00180 GDALDatasetH hDstDS,
00181 int nBandCount, int *panBandList,
00182 GDALTransformerFunc pfnTransform,
00183 void *pTransformArg,
00184 GDALProgressFunc pfnProgress,
00185 void *pProgressArg,
00186 char **papszWarpOptions );
00187
00188 CPLErr CPL_DLL CPL_STDCALL
00189 GDALSuggestedWarpOutput( GDALDatasetH hSrcDS,
00190 GDALTransformerFunc pfnTransformer,
00191 void *pTransformArg,
00192 double *padfGeoTransformOut,
00193 int *pnPixels, int *pnLines );
00194 CPLErr CPL_DLL CPL_STDCALL
00195 GDALSuggestedWarpOutput2( GDALDatasetH hSrcDS,
00196 GDALTransformerFunc pfnTransformer,
00197 void *pTransformArg,
00198 double *padfGeoTransformOut,
00199 int *pnPixels, int *pnLines,
00200 double *padfExtents,
00201 int nOptions );
00202
00203 CPLXMLNode CPL_DLL *
00204 GDALSerializeTransformer( GDALTransformerFunc pfnFunc, void *pTransformArg );
00205 CPLErr CPL_DLL GDALDeserializeTransformer( CPLXMLNode *psTree,
00206 GDALTransformerFunc *ppfnFunc,
00207 void **ppTransformArg );
00208
00209
00210
00211
00212
00213
00214 typedef CPLErr (*GDALContourWriter)( double dfLevel, int nPoints,
00215 double *padfX, double *padfY, void * );
00216
00217 typedef void *GDALContourGeneratorH;
00218
00219 GDALContourGeneratorH CPL_DLL
00220 GDAL_CG_Create( int nWidth, int nHeight,
00221 int bNoDataSet, double dfNoDataValue,
00222 double dfContourInterval, double dfContourBase,
00223 GDALContourWriter pfnWriter, void *pCBData );
00224 CPLErr CPL_DLL GDAL_CG_FeedLine( GDALContourGeneratorH hCG,
00225 double *padfScanline );
00226 void CPL_DLL GDAL_CG_Destroy( GDALContourGeneratorH hCG );
00227
00228 typedef struct
00229 {
00230 void *hLayer;
00231
00232 double adfGeoTransform[6];
00233
00234 int nElevField;
00235 int nIDField;
00236 int nNextID;
00237 } OGRContourWriterInfo;
00238
00239 CPLErr CPL_DLL
00240 OGRContourWriter( double, int, double *, double *, void *pInfo );
00241
00242 CPLErr CPL_DLL
00243 GDALContourGenerate( GDALRasterBandH hBand,
00244 double dfContourInterval, double dfContourBase,
00245 int nFixedLevelCount, double *padfFixedLevels,
00246 int bUseNoData, double dfNoDataValue,
00247 void *hLayer, int iIDField, int iElevField,
00248 GDALProgressFunc pfnProgress, void *pProgressArg );
00249
00250
00251
00252
00253 typedef void (*llScanlineFunc)( void *pCBData, int nY, int nXStart, int nXEnd);
00254
00255
00256 void GDALdllImageFilledPolygon(int nRasterXSize, int nRasterYSize,
00257 int nPartCount, int *panPartSize,
00258 double *padfX, double *padfY,
00259 llScanlineFunc pfnScanlineFunc, void *pCBData );
00260
00261
00262
00263
00264
00265 CPLErr CPL_DLL
00266 GDALRasterizeGeometries( GDALDatasetH hDS,
00267 int nBandCount, int *panBandList,
00268 int nGeomCount, OGRGeometryH *pahGeometries,
00269 GDALTransformerFunc pfnTransformer,
00270 void *pTransformArg,
00271 double *padfGeomBurnValue,
00272 char **papszOptions,
00273 GDALProgressFunc pfnProgress,
00274 void * pProgressArg );
00275
00276
00277
00278
00279
00281 typedef enum { GGA_InverseDistanceToAPower = 1, GGA_MovingAverage = 2, GGA_NearestNeighbor = 3, GGA_MetricMinimum = 4, GGA_MetricMaximum = 5, GGA_MetricRange = 6
00288 } GDALGridAlgorithm;
00289
00291 typedef struct
00292 {
00294 double dfPower;
00296 double dfSmoothing;
00298 double dfAnisotropyRatio;
00300 double dfAnisotropyAngle;
00302 double dfRadius1;
00304 double dfRadius2;
00309 double dfAngle;
00316 GUInt32 nMaxPoints;
00322 GUInt32 nMinPoints;
00324 double dfNoDataValue;
00325 } GDALGridInverseDistanceToAPowerOptions;
00326
00328 typedef struct
00329 {
00331 double dfRadius1;
00333 double dfRadius2;
00338 double dfAngle;
00344 GUInt32 nMinPoints;
00346 double dfNoDataValue;
00347 } GDALGridMovingAverageOptions;
00348
00350 typedef struct
00351 {
00353 double dfRadius1;
00355 double dfRadius2;
00360 double dfAngle;
00362 double dfNoDataValue;
00363 } GDALGridNearestNeighborOptions;
00364
00366 typedef struct
00367 {
00369 double dfRadius1;
00371 double dfRadius2;
00376 double dfAngle;
00382 GUInt32 nMinPoints;
00384 double dfNoDataValue;
00385 } GDALGridDataMetricsOptions;
00386
00387 CPLErr CPL_DLL
00388 GDALGridCreate( GDALGridAlgorithm, const void *, GUInt32,
00389 const double *, const double *, const double *,
00390 double, double, double, double,
00391 GUInt32, GUInt32, GDALDataType, void *,
00392 GDALProgressFunc, void *);
00393
00394 CPL_C_END
00395
00396 #endif