- Main Page
- Classes
- Files
- Related Pages

- File List
- File Members

# gdal_alg.h

Go to the documentation of this file.

    00001 /******************************************************************************
    00002  * $Id: gdal_alg.h 13060 2007-11-26 14:16:04Z dron $
    00003  *
    00004  * Project:  GDAL Image Processing Algorithms
    00005  * Purpose:  Prototypes, and definitions for various GDAL based algorithms.
    00006  * Author:   Frank Warmerdam, warmerdam@pobox.com
    00007  *
    00008  ******************************************************************************
    00009  * Copyright (c) 2001, 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_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
    00066 /*
    00067  * Warp Related.
    00068  */
    00069
    00070 typedef int
    00071 (*GDALTransformerFunc)( void *pTransformerArg,
    00072                         int bDstToSrc, int nPointCount,
    00073                         double *x, double *y, double *z, int *panSuccess );
    00074
    00075 typedef struct {
    00076     char szSignature[4];
    00077     char *pszClassName;
    00078     GDALTransformerFunc pfnTransform;
    00079     void (*pfnCleanup)( void * );
    00080     CPLXMLNode *(*pfnSerialize)( void * );
    00081 } GDALTransformerInfo;
    00082
    00083 void CPL_DLL GDALDestroyTransformer( void *pTransformerArg );
    00084
    00085
    00086 /* High level transformer for going from image coordinates on one file
    00087    to image coordiantes on another, potentially doing reprojection,
    00088    utilizing GCPs or using the geotransform. */
    00089
    00090 void CPL_DLL *
    00091 GDALCreateGenImgProjTransformer( GDALDatasetH hSrcDS, const char *pszSrcWKT,
    00092                                  GDALDatasetH hDstDS, const char *pszDstWKT,
    00093                                  int bGCPUseOK, double dfGCPErrorThreshold,
    00094                                  int nOrder );
    00095 void CPL_DLL GDALSetGenImgProjTransformerDstGeoTransform( void *,
    00096                                                           const double * );
    00097 void CPL_DLL GDALDestroyGenImgProjTransformer( void * );
    00098 int CPL_DLL GDALGenImgProjTransform(
    00099     void *pTransformArg, int bDstToSrc, int nPointCount,
    00100     double *x, double *y, double *z, int *panSuccess );
    00101
    00102 /* Geo to geo reprojection transformer. */
    00103 void CPL_DLL *
    00104 GDALCreateReprojectionTransformer( const char *pszSrcWKT,
    00105                                    const char *pszDstWKT );
    00106 void CPL_DLL GDALDestroyReprojectionTransformer( void * );
    00107 int CPL_DLL GDALReprojectionTransform(
    00108     void *pTransformArg, int bDstToSrc, int nPointCount,
    00109     double *x, double *y, double *z, int *panSuccess );
    00110
    00111 /* GCP based transformer ... forward is to georef coordinates */
    00112 void CPL_DLL *
    00113 GDALCreateGCPTransformer( int nGCPCount, const GDAL_GCP *pasGCPList,
    00114                           int nReqOrder, int bReversed );
    00115 void CPL_DLL GDALDestroyGCPTransformer( void *pTransformArg );
    00116 int CPL_DLL GDALGCPTransform(
    00117     void *pTransformArg, int bDstToSrc, int nPointCount,
    00118     double *x, double *y, double *z, int *panSuccess );
    00119
    00120 /* Thin Plate Spine transformer ... forward is to georef coordinates */
    00121
    00122 void CPL_DLL *
    00123 GDALCreateTPSTransformer( int nGCPCount, const GDAL_GCP *pasGCPList,
    00124                           int bReversed );
    00125 void CPL_DLL GDALDestroyTPSTransformer( void *pTransformArg );
    00126 int CPL_DLL GDALTPSTransform(
    00127     void *pTransformArg, int bDstToSrc, int nPointCount,
    00128     double *x, double *y, double *z, int *panSuccess );
    00129
    00130 /* RPC based transformer ... src is pixel/line/elev, dst is long/lat/elev */
    00131
    00132 void CPL_DLL *
    00133 GDALCreateRPCTransformer( GDALRPCInfo *psRPC, int bReversed,
    00134                           double dfPixErrThreshold );
    00135 void CPL_DLL GDALDestroyRPCTransformer( void *pTransformArg );
    00136 int CPL_DLL GDALRPCTransform(
    00137     void *pTransformArg, int bDstToSrc, int nPointCount,
    00138     double *x, double *y, double *z, int *panSuccess );
    00139
    00140 /* Geolocation transformer */
    00141
    00142 void CPL_DLL *
    00143 GDALCreateGeoLocTransformer( GDALDatasetH hBaseDS,
    00144                              char **papszGeolocationInfo,
    00145                              int bReversed );
    00146 void CPL_DLL GDALDestroyGeoLocTransformer( void *pTransformArg );
    00147 int CPL_DLL GDALGeoLocTransform(
    00148     void *pTransformArg, int bDstToSrc, int nPointCount,
    00149     double *x, double *y, double *z, int *panSuccess );
    00150
    00151 /* Approximate transformer */
    00152 void CPL_DLL *
    00153 GDALCreateApproxTransformer( GDALTransformerFunc pfnRawTransformer,
    00154                              void *pRawTransformerArg, double dfMaxError );
    00155 void CPL_DLL GDALApproxTransformerOwnsSubtransformer( void *pCBData,
    00156                                                       int bOwnFlag );
    00157 void CPL_DLL GDALDestroyApproxTransformer( void *pApproxArg );
    00158 int  CPL_DLL GDALApproxTransform(
    00159     void *pTransformArg, int bDstToSrc, int nPointCount,
    00160     double *x, double *y, double *z, int *panSuccess );
    00161
    00162
    00163
    00164
    00165 int CPL_DLL CPL_STDCALL
    00166 GDALSimpleImageWarp( GDALDatasetH hSrcDS,
    00167                      GDALDatasetH hDstDS,
    00168                      int nBandCount, int *panBandList,
    00169                      GDALTransformerFunc pfnTransform,
    00170                      void *pTransformArg,
    00171                      GDALProgressFunc pfnProgress,
    00172                      void *pProgressArg,
    00173                      char **papszWarpOptions );
    00174
    00175 CPLErr CPL_DLL CPL_STDCALL
    00176 GDALSuggestedWarpOutput( GDALDatasetH hSrcDS,
    00177                          GDALTransformerFunc pfnTransformer,
    00178                          void *pTransformArg,
    00179                          double *padfGeoTransformOut,
    00180                          int *pnPixels, int *pnLines );
    00181 CPLErr CPL_DLL CPL_STDCALL
    00182 GDALSuggestedWarpOutput2( GDALDatasetH hSrcDS,
    00183                           GDALTransformerFunc pfnTransformer,
    00184                           void *pTransformArg,
    00185                           double *padfGeoTransformOut,
    00186                           int *pnPixels, int *pnLines,
    00187                           double *padfExtents,
    00188                           int nOptions );
    00189
    00190 CPLXMLNode CPL_DLL *
    00191 GDALSerializeTransformer( GDALTransformerFunc pfnFunc, void *pTransformArg );
    00192 CPLErr CPL_DLL GDALDeserializeTransformer( CPLXMLNode *psTree,
    00193                                            GDALTransformerFunc *ppfnFunc,
    00194                                            void **ppTransformArg );
    00195
    00196
    00197 /* -------------------------------------------------------------------- */
    00198 /*      Contour Line Generation                                         */
    00199 /* -------------------------------------------------------------------- */
    00200
    00201 typedef CPLErr (*GDALContourWriter)( double dfLevel, int nPoints,
    00202                                      double *padfX, double *padfY, void * );
    00203
    00204 typedef void *GDALContourGeneratorH;
    00205
    00206 GDALContourGeneratorH CPL_DLL
    00207 GDAL_CG_Create( int nWidth, int nHeight,
    00208                 int bNoDataSet, double dfNoDataValue,
    00209                 double dfContourInterval, double dfContourBase,
    00210                 GDALContourWriter pfnWriter, void *pCBData );
    00211 CPLErr CPL_DLL GDAL_CG_FeedLine( GDALContourGeneratorH hCG,
    00212                                  double *padfScanline );
    00213 void CPL_DLL GDAL_CG_Destroy( GDALContourGeneratorH hCG );
    00214
    00215 typedef struct
    00216 {
    00217     void   *hLayer;
    00218
    00219     double adfGeoTransform[6];
    00220
    00221     int    nElevField;
    00222     int    nIDField;
    00223     int    nNextID;
    00224 } OGRContourWriterInfo;
    00225
    00226 CPLErr CPL_DLL
    00227 OGRContourWriter( double, int, double *, double *, void *pInfo );
    00228
    00229 CPLErr CPL_DLL
    00230 GDALContourGenerate( GDALRasterBandH hBand,
    00231                             double dfContourInterval, double dfContourBase,
    00232                             int nFixedLevelCount, double *padfFixedLevels,
    00233                             int bUseNoData, double dfNoDataValue,
    00234                             void *hLayer, int iIDField, int iElevField,
    00235                             GDALProgressFunc pfnProgress, void *pProgressArg );
    00236
    00237 /* -------------------------------------------------------------------- */
    00238 /*      Low level rasterizer API.                                       */
    00239 /* -------------------------------------------------------------------- */
    00240 typedef void (*llScanlineFunc)( void *pCBData, int nY, int nXStart, int nXEnd);
    00241
    00242
    00243 void GDALdllImageFilledPolygon(int nRasterXSize, int nRasterYSize,
    00244                                int nPartCount, int *panPartSize,
    00245                                double *padfX, double *padfY,
    00246                                llScanlineFunc pfnScanlineFunc, void *pCBData );
    00247
    00248 /* -------------------------------------------------------------------- */
    00249 /*      High level API - GvShapes burned into GDAL raster.              */
    00250 /* -------------------------------------------------------------------- */
    00251
    00252 CPLErr CPL_DLL
    00253 GDALRasterizeGeometries( GDALDatasetH hDS,
    00254                          int nBandCount, int *panBandList,
    00255                          int nGeomCount, OGRGeometryH *pahGeometries,
    00256                          GDALTransformerFunc pfnTransformer,
    00257                          void *pTransformArg,
    00258                          double *padfGeomBurnValue,
    00259                          char **papszOptions,
    00260                          GDALProgressFunc pfnProgress,
    00261                          void * pProgressArg );
    00262
    00263 /************************************************************************/
    00264 /*  Gridding interface.                                                 */
    00265 /************************************************************************/
    00266
    00268 typedef enum {    GGA_InverseDistanceToAPower = 1,                 GGA_MovingAverage = 2,               GGA_NearestNeighbor = 3
    00272 } GDALGridAlgorithm;
    00273
    00275 typedef struct
    00276 {
    00278     double  dfPower;
    00280     double  dfSmoothing;
    00282     double  dfAnisotropyRatio;
    00284     double  dfAnisotropyAngle;
    00286     double  dfRadius1;
    00288     double  dfRadius2;
    00293     double  dfAngle;
    00300     GUInt32 nMaxPoints;
    00306     GUInt32 nMinPoints;
    00308     double  dfNoDataValue;
    00309 } GDALGridInverseDistanceToAPowerOptions;
    00310
    00312 typedef struct
    00313 {
    00315     double  dfRadius1;
    00317     double  dfRadius2;
    00322     double  dfAngle;
    00328     GUInt32 nMinPoints;
    00330     double  dfNoDataValue;
    00331 } GDALGridMovingAverageOptions;
    00332
    00334 typedef struct
    00335 {
    00337     double  dfRadius1;
    00339     double  dfRadius2;
    00344     double  dfAngle;
    00346     double  dfNoDataValue;
    00347 } GDALGridNearestNeighborOptions;
    00348
    00349 CPLErr CPL_DLL
    00350 GDALGridCreate( GDALGridAlgorithm, const void *, GUInt32,
    00351                 const double *, const double *, const double *,
    00352                 double, double, double, double,
    00353                 GUInt32, GUInt32, GDALDataType, void *,
    00354                 GDALProgressFunc, void *);
    00355
    00356 CPL_C_END
    00357
    00358 #endif /* ndef GDAL_ALG_H_INCLUDED */

Generated for GDAL by 1.5.1.