GDAL
gdal_alg.h
Go to the documentation of this file.
1 /******************************************************************************
2  * $Id: gdal_alg.h 25741 2013-03-13 19:19:16Z ilucena $
3  *
4  * Project: GDAL Image Processing Algorithms
5  * Purpose: Prototypes, and definitions for various GDAL based algorithms.
6  * Author: Frank Warmerdam, warmerdam@pobox.com
7  *
8  ******************************************************************************
9  * Copyright (c) 2001, Frank Warmerdam
10  *
11  * Permission is hereby granted, free of charge, to any person obtaining a
12  * copy of this software and associated documentation files (the "Software"),
13  * to deal in the Software without restriction, including without limitation
14  * the rights to use, copy, modify, merge, publish, distribute, sublicense,
15  * and/or sell copies of the Software, and to permit persons to whom the
16  * Software is furnished to do so, subject to the following conditions:
17  *
18  * The above copyright notice and this permission notice shall be included
19  * in all copies or substantial portions of the Software.
20  *
21  * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
22  * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
23  * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
24  * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
25  * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
26  * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
27  * DEALINGS IN THE SOFTWARE.
28  ****************************************************************************/
29 
30 #ifndef GDAL_ALG_H_INCLUDED
31 #define GDAL_ALG_H_INCLUDED
32 
39 #ifndef DOXYGEN_SKIP
40 #include "gdal.h"
41 #include "cpl_minixml.h"
42 #include "ogr_api.h"
43 #endif
44 
45 CPL_C_START
46 
47 int CPL_DLL CPL_STDCALL GDALComputeMedianCutPCT( GDALRasterBandH hRed,
48  GDALRasterBandH hGreen,
49  GDALRasterBandH hBlue,
50  int (*pfnIncludePixel)(int,int,void*),
51  int nColors,
52  GDALColorTableH hColorTable,
53  GDALProgressFunc pfnProgress,
54  void * pProgressArg );
55 
56 int CPL_DLL CPL_STDCALL GDALDitherRGB2PCT( GDALRasterBandH hRed,
57  GDALRasterBandH hGreen,
58  GDALRasterBandH hBlue,
59  GDALRasterBandH hTarget,
60  GDALColorTableH hColorTable,
61  GDALProgressFunc pfnProgress,
62  void * pProgressArg );
63 
64 int CPL_DLL CPL_STDCALL GDALChecksumImage( GDALRasterBandH hBand,
65  int nXOff, int nYOff, int nXSize, int nYSize );
66 
67 CPLErr CPL_DLL CPL_STDCALL
69  GDALRasterBandH hProximityBand,
70  char **papszOptions,
71  GDALProgressFunc pfnProgress,
72  void * pProgressArg );
73 
74 CPLErr CPL_DLL CPL_STDCALL
75 GDALFillNodata( GDALRasterBandH hTargetBand,
76  GDALRasterBandH hMaskBand,
77  double dfMaxSearchDist,
78  int bDeprecatedOption,
79  int nSmoothingIterations,
80  char **papszOptions,
81  GDALProgressFunc pfnProgress,
82  void * pProgressArg );
83 
84 CPLErr CPL_DLL CPL_STDCALL
86  GDALRasterBandH hMaskBand,
87  OGRLayerH hOutLayer, int iPixValField,
88  char **papszOptions,
89  GDALProgressFunc pfnProgress,
90  void * pProgressArg );
91 
92 CPLErr CPL_DLL CPL_STDCALL
93 GDALFPolygonize( GDALRasterBandH hSrcBand,
94  GDALRasterBandH hMaskBand,
95  OGRLayerH hOutLayer, int iPixValField,
96  char **papszOptions,
97  GDALProgressFunc pfnProgress,
98  void * pProgressArg );
99 
100 CPLErr CPL_DLL CPL_STDCALL
101 GDALSieveFilter( GDALRasterBandH hSrcBand, GDALRasterBandH hMaskBand,
102  GDALRasterBandH hDstBand,
103  int nSizeThreshold, int nConnectedness,
104  char **papszOptions,
105  GDALProgressFunc pfnProgress,
106  void * pProgressArg );
107 
108 /*
109  * Warp Related.
110  */
111 
112 typedef int
113 (*GDALTransformerFunc)( void *pTransformerArg,
114  int bDstToSrc, int nPointCount,
115  double *x, double *y, double *z, int *panSuccess );
116 
117 typedef struct {
118  char szSignature[4];
119  const char *pszClassName;
120  GDALTransformerFunc pfnTransform;
121  void (*pfnCleanup)( void * );
122  CPLXMLNode *(*pfnSerialize)( void * );
123  /* TODO GDAL 2.0 : add a void* (*pfnClone) (void *) member */
125 
126 void CPL_DLL GDALDestroyTransformer( void *pTransformerArg );
127 int CPL_DLL GDALUseTransformer( void *pTranformerArg,
128  int bDstToSrc, int nPointCount,
129  double *x, double *y, double *z,
130  int *panSuccess );
131 
132 /* High level transformer for going from image coordinates on one file
133  to image coordiantes on another, potentially doing reprojection,
134  utilizing GCPs or using the geotransform. */
135 
136 void CPL_DLL *
137 GDALCreateGenImgProjTransformer( GDALDatasetH hSrcDS, const char *pszSrcWKT,
138  GDALDatasetH hDstDS, const char *pszDstWKT,
139  int bGCPUseOK, double dfGCPErrorThreshold,
140  int nOrder );
141 void CPL_DLL *
143  char **papszOptions );
144 void CPL_DLL *
145 GDALCreateGenImgProjTransformer3( const char *pszSrcWKT,
146  const double *padfSrcGeoTransform,
147  const char *pszDstWKT,
148  const double *padfDstGeoTransform );
149 void CPL_DLL GDALSetGenImgProjTransformerDstGeoTransform( void *,
150  const double * );
151 void CPL_DLL GDALDestroyGenImgProjTransformer( void * );
152 int CPL_DLL GDALGenImgProjTransform(
153  void *pTransformArg, int bDstToSrc, int nPointCount,
154  double *x, double *y, double *z, int *panSuccess );
155 
156 /* Geo to geo reprojection transformer. */
157 void CPL_DLL *
158 GDALCreateReprojectionTransformer( const char *pszSrcWKT,
159  const char *pszDstWKT );
160 void CPL_DLL GDALDestroyReprojectionTransformer( void * );
161 int CPL_DLL GDALReprojectionTransform(
162  void *pTransformArg, int bDstToSrc, int nPointCount,
163  double *x, double *y, double *z, int *panSuccess );
164 
165 /* GCP based transformer ... forward is to georef coordinates */
166 void CPL_DLL *
167 GDALCreateGCPTransformer( int nGCPCount, const GDAL_GCP *pasGCPList,
168  int nReqOrder, int bReversed );
169 
170 /* GCP based transformer with refinement of the GCPs ... forward is to georef coordinates */
171 void CPL_DLL *
172 GDALCreateGCPRefineTransformer( int nGCPCount, const GDAL_GCP *pasGCPList,
173  int nReqOrder, int bReversed, double tolerance, int minimumGcps);
174 
175 void CPL_DLL GDALDestroyGCPTransformer( void *pTransformArg );
176 int CPL_DLL GDALGCPTransform(
177  void *pTransformArg, int bDstToSrc, int nPointCount,
178  double *x, double *y, double *z, int *panSuccess );
179 
180 /* Thin Plate Spine transformer ... forward is to georef coordinates */
181 
182 void CPL_DLL *
183 GDALCreateTPSTransformer( int nGCPCount, const GDAL_GCP *pasGCPList,
184  int bReversed );
185 void CPL_DLL GDALDestroyTPSTransformer( void *pTransformArg );
186 int CPL_DLL GDALTPSTransform(
187  void *pTransformArg, int bDstToSrc, int nPointCount,
188  double *x, double *y, double *z, int *panSuccess );
189 
190 char CPL_DLL ** RPCInfoToMD( GDALRPCInfo *psRPCInfo );
191 
192 /* RPC based transformer ... src is pixel/line/elev, dst is long/lat/elev */
193 
194 void CPL_DLL *
195 GDALCreateRPCTransformer( GDALRPCInfo *psRPC, int bReversed,
196  double dfPixErrThreshold,
197  char **papszOptions );
198 void CPL_DLL GDALDestroyRPCTransformer( void *pTransformArg );
199 int CPL_DLL GDALRPCTransform(
200  void *pTransformArg, int bDstToSrc, int nPointCount,
201  double *x, double *y, double *z, int *panSuccess );
202 
203 /* Geolocation transformer */
204 
205 void CPL_DLL *
206 GDALCreateGeoLocTransformer( GDALDatasetH hBaseDS,
207  char **papszGeolocationInfo,
208  int bReversed );
209 void CPL_DLL GDALDestroyGeoLocTransformer( void *pTransformArg );
210 int CPL_DLL GDALGeoLocTransform(
211  void *pTransformArg, int bDstToSrc, int nPointCount,
212  double *x, double *y, double *z, int *panSuccess );
213 
214 /* Approximate transformer */
215 void CPL_DLL *
217  void *pRawTransformerArg, double dfMaxError );
218 void CPL_DLL GDALApproxTransformerOwnsSubtransformer( void *pCBData,
219  int bOwnFlag );
220 void CPL_DLL GDALDestroyApproxTransformer( void *pApproxArg );
221 int CPL_DLL GDALApproxTransform(
222  void *pTransformArg, int bDstToSrc, int nPointCount,
223  double *x, double *y, double *z, int *panSuccess );
224 
225 
226 
227 
228 int CPL_DLL CPL_STDCALL
230  GDALDatasetH hDstDS,
231  int nBandCount, int *panBandList,
232  GDALTransformerFunc pfnTransform,
233  void *pTransformArg,
234  GDALProgressFunc pfnProgress,
235  void *pProgressArg,
236  char **papszWarpOptions );
237 
238 CPLErr CPL_DLL CPL_STDCALL
240  GDALTransformerFunc pfnTransformer,
241  void *pTransformArg,
242  double *padfGeoTransformOut,
243  int *pnPixels, int *pnLines );
244 CPLErr CPL_DLL CPL_STDCALL
246  GDALTransformerFunc pfnTransformer,
247  void *pTransformArg,
248  double *padfGeoTransformOut,
249  int *pnPixels, int *pnLines,
250  double *padfExtents,
251  int nOptions );
252 
253 CPLXMLNode CPL_DLL *
254 GDALSerializeTransformer( GDALTransformerFunc pfnFunc, void *pTransformArg );
255 CPLErr CPL_DLL GDALDeserializeTransformer( CPLXMLNode *psTree,
256  GDALTransformerFunc *ppfnFunc,
257  void **ppTransformArg );
258 
259 CPLErr CPL_DLL
261  GDALRasterBandH hYBand,
262  GDALRasterBandH hZBand,
263  GDALTransformerFunc pfnTransformer,
264  void *pTransformArg,
265  GDALProgressFunc pfnProgress,
266  void *pProgressArg,
267  char **papszOptions );
268 
269 /* -------------------------------------------------------------------- */
270 /* Contour Line Generation */
271 /* -------------------------------------------------------------------- */
272 
273 typedef CPLErr (*GDALContourWriter)( double dfLevel, int nPoints,
274  double *padfX, double *padfY, void * );
275 
276 typedef void *GDALContourGeneratorH;
277 
278 GDALContourGeneratorH CPL_DLL
279 GDAL_CG_Create( int nWidth, int nHeight,
280  int bNoDataSet, double dfNoDataValue,
281  double dfContourInterval, double dfContourBase,
282  GDALContourWriter pfnWriter, void *pCBData );
283 CPLErr CPL_DLL GDAL_CG_FeedLine( GDALContourGeneratorH hCG,
284  double *padfScanline );
285 void CPL_DLL GDAL_CG_Destroy( GDALContourGeneratorH hCG );
286 
287 typedef struct
288 {
289  void *hLayer;
290 
291  double adfGeoTransform[6];
292 
293  int nElevField;
294  int nIDField;
295  int nNextID;
297 
298 CPLErr CPL_DLL
299 OGRContourWriter( double, int, double *, double *, void *pInfo );
300 
301 CPLErr CPL_DLL
302 GDALContourGenerate( GDALRasterBandH hBand,
303  double dfContourInterval, double dfContourBase,
304  int nFixedLevelCount, double *padfFixedLevels,
305  int bUseNoData, double dfNoDataValue,
306  void *hLayer, int iIDField, int iElevField,
307  GDALProgressFunc pfnProgress, void *pProgressArg );
308 
309 /************************************************************************/
310 /* Rasterizer API - geometries burned into GDAL raster. */
311 /************************************************************************/
312 
313 CPLErr CPL_DLL
315  int nBandCount, int *panBandList,
316  int nGeomCount, OGRGeometryH *pahGeometries,
317  GDALTransformerFunc pfnTransformer,
318  void *pTransformArg,
319  double *padfGeomBurnValue,
320  char **papszOptions,
321  GDALProgressFunc pfnProgress,
322  void * pProgressArg );
323 CPLErr CPL_DLL
325  int nBandCount, int *panBandList,
326  int nLayerCount, OGRLayerH *pahLayers,
327  GDALTransformerFunc pfnTransformer,
328  void *pTransformArg,
329  double *padfLayerBurnValues,
330  char **papszOptions,
331  GDALProgressFunc pfnProgress,
332  void *pProgressArg );
333 
334 CPLErr CPL_DLL
335 GDALRasterizeLayersBuf( void *pData, int nBufXSize, int nBufYSize,
336  GDALDataType eBufType, int nPixelSpace, int nLineSpace,
337  int nLayerCount, OGRLayerH *pahLayers,
338  const char *pszDstProjection,
339  double *padfDstGeoTransform,
340  GDALTransformerFunc pfnTransformer,
341  void *pTransformArg, double dfBurnValue,
342  char **papszOptions, GDALProgressFunc pfnProgress,
343  void *pProgressArg );
344 
345 
346 /************************************************************************/
347 /* Gridding interface. */
348 /************************************************************************/
349 
363 
365 typedef struct
366 {
368  double dfPower;
370  double dfSmoothing;
376  double dfRadius1;
378  double dfRadius2;
383  double dfAngle;
390  GUInt32 nMaxPoints;
396  GUInt32 nMinPoints;
400 
402 typedef struct
403 {
405  double dfRadius1;
407  double dfRadius2;
412  double dfAngle;
418  GUInt32 nMinPoints;
422 
424 typedef struct
425 {
427  double dfRadius1;
429  double dfRadius2;
434  double dfAngle;
438 
440 typedef struct
441 {
443  double dfRadius1;
445  double dfRadius2;
450  double dfAngle;
456  GUInt32 nMinPoints;
460 
461 CPLErr CPL_DLL
462 GDALGridCreate( GDALGridAlgorithm, const void *, GUInt32,
463  const double *, const double *, const double *,
464  double, double, double, double,
465  GUInt32, GUInt32, GDALDataType, void *,
466  GDALProgressFunc, void *);
467 
468 GDAL_GCP CPL_DLL *
469 GDALComputeMatchingPoints( GDALDatasetH hFirstImage,
470  GDALDatasetH hSecondImage,
471  char **papszOptions,
472  int *pnGCPCount );
473 CPL_C_END
474 
475 #endif /* ndef GDAL_ALG_H_INCLUDED */

Generated for GDAL by doxygen 1.8.4.