Main Page | Class Hierarchy | Class List | File List | Class Members | File Members | Related Pages

gdal_alg.h

Go to the documentation of this file.
00001 /******************************************************************************
00002  * $Id: gdal_alg.h,v 1.16 2003/12/15 15:59:25 warmerda Exp $
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  * $Log: gdal_alg.h,v $
00031  * Revision 1.16  2003/12/15 15:59:25  warmerda
00032  * added CPL_DLL on contour stuff.
00033  *
00034  * Revision 1.15  2003/10/16 16:44:05  warmerda
00035  * added support for fixed levels
00036  *
00037  * Revision 1.14  2003/10/15 20:22:16  warmerda
00038  * removed C++ contour definitions
00039  *
00040  * Revision 1.13  2003/10/14 15:25:01  warmerda
00041  * added contour stuff
00042  *
00043  * Revision 1.12  2003/06/03 19:42:20  warmerda
00044  * modified rpc api
00045  *
00046  * Revision 1.11  2003/06/03 17:36:47  warmerda
00047  * Added RPC entry points
00048  *
00049  * Revision 1.10  2003/03/02 05:24:35  warmerda
00050  * added GDALChecksumImage
00051  *
00052  * Revision 1.9  2002/12/09 18:56:10  warmerda
00053  * added missing CPL_DLL
00054  *
00055  * Revision 1.8  2002/12/09 16:08:32  warmerda
00056  * added approximating transformer
00057  *
00058  * Revision 1.7  2002/12/07 22:58:42  warmerda
00059  * added initialization support for simple warper
00060  *
00061  * Revision 1.6  2002/12/07 17:09:38  warmerda
00062  * added order flag to GenImgProjTransformer
00063  *
00064  * Revision 1.5  2002/12/06 21:43:12  warmerda
00065  * tweak prototypes
00066  *
00067  * Revision 1.4  2002/12/05 21:44:35  warmerda
00068  * fixed prototype
00069  *
00070  * Revision 1.3  2002/12/05 05:43:28  warmerda
00071  * added warp/transformer definition
00072  *
00073  * Revision 1.2  2001/02/02 21:19:25  warmerda
00074  * added CPL_DLL for functions
00075  *
00076  * Revision 1.1  2001/01/22 22:30:59  warmerda
00077  * New
00078  */
00079 
00080 #ifndef GDAL_ALG_H_INCLUDED
00081 #define GDAL_ALG_H_INCLUDED
00082 
00089 #include "gdal.h"
00090 
00091 CPL_C_START
00092 
00093 int CPL_DLL GDALComputeMedianCutPCT( GDALRasterBandH hRed, 
00094                              GDALRasterBandH hGreen, 
00095                              GDALRasterBandH hBlue, 
00096                              int (*pfnIncludePixel)(int,int,void*),
00097                              int nColors, 
00098                              GDALColorTableH hColorTable,
00099                              GDALProgressFunc pfnProgress, 
00100                              void * pProgressArg );
00101 
00102 int CPL_DLL GDALDitherRGB2PCT( GDALRasterBandH hRed, 
00103                        GDALRasterBandH hGreen, 
00104                        GDALRasterBandH hBlue, 
00105                        GDALRasterBandH hTarget, 
00106                        GDALColorTableH hColorTable, 
00107                        GDALProgressFunc pfnProgress, 
00108                        void * pProgressArg );
00109 
00110 int CPL_DLL GDALChecksumImage( GDALRasterBandH hBand, 
00111                                int nXOff, int nYOff, int nXSize, int nYSize );
00112                                
00113 
00114 /*
00115  * Warp Related.
00116  */
00117 
00118 typedef int 
00119 (*GDALTransformerFunc)( void *pTransformerArg, 
00120                         int bDstToSrc, int nPointCount, 
00121                         double *x, double *y, double *z, int *panSuccess );
00122 
00123 /* High level transformer for going from image coordinates on one file
00124    to image coordiantes on another, potentially doing reprojection, 
00125    utilizing GCPs or using the geotransform. */
00126 
00127 void CPL_DLL *
00128 GDALCreateGenImgProjTransformer( GDALDatasetH hSrcDS, const char *pszSrcWKT,
00129                                  GDALDatasetH hDstDS, const char *pszDstWKT,
00130                                  int bGCPUseOK, double dfGCPErrorThreshold,
00131                                  int nOrder );
00132 void CPL_DLL GDALDestroyGenImgProjTransformer( void * );
00133 int CPL_DLL GDALGenImgProjTransform( 
00134     void *pTransformArg, int bDstToSrc, int nPointCount,
00135     double *x, double *y, double *z, int *panSuccess );
00136 
00137 /* Geo to geo reprojection transformer. */
00138 void CPL_DLL *
00139 GDALCreateReprojectionTransformer( const char *pszSrcWKT, 
00140                                    const char *pszDstWKT );
00141 void CPL_DLL GDALDestroyReprojectionTransformer( void * );
00142 int CPL_DLL GDALReprojectionTransform( 
00143     void *pTransformArg, int bDstToSrc, int nPointCount,
00144     double *x, double *y, double *z, int *panSuccess );
00145 
00146 /* GCP based transformer ... forward is to georef coordinates */
00147 void CPL_DLL *
00148 GDALCreateGCPTransformer( int nGCPCount, const GDAL_GCP *pasGCPList, 
00149                           int nReqOrder, int bReversed );
00150 void CPL_DLL GDALDestroyGCPTransformer( void *pTransformArg );
00151 int CPL_DLL GDALGCPTransform( 
00152     void *pTransformArg, int bDstToSrc, int nPointCount,
00153     double *x, double *y, double *z, int *panSuccess );
00154 
00155 /* RPC based transformer ... src is pixel/line/elev, dst is long/lat/elev */
00156 
00157 void CPL_DLL *
00158 GDALCreateRPCTransformer( GDALRPCInfo *psRPC, int bReversed, 
00159                           double dfPixErrThreshold );
00160 void CPL_DLL GDALDestroyRPCTransformer( void *pTransformArg );
00161 int CPL_DLL GDALRPCTransform( 
00162     void *pTransformArg, int bDstToSrc, int nPointCount,
00163     double *x, double *y, double *z, int *panSuccess );
00164 
00165 /* Approximate transformer */
00166 void CPL_DLL *
00167 GDALCreateApproxTransformer( GDALTransformerFunc pfnRawTransformer, 
00168                              void *pRawTransformerArg, double dfMaxError );
00169 void CPL_DLL GDALDestroyApproxTransformer( void *pApproxArg );
00170 int  CPL_DLL GDALApproxTransform(
00171     void *pTransformArg, int bDstToSrc, int nPointCount,
00172     double *x, double *y, double *z, int *panSuccess );
00173 
00174                       
00175 
00176 
00177 int CPL_DLL GDALSimpleImageWarp( GDALDatasetH hSrcDS, 
00178                                  GDALDatasetH hDstDS, 
00179                                  int nBandCount, int *panBandList,
00180                                  GDALTransformerFunc pfnTransform,
00181                                  void *pTransformArg,
00182                                  GDALProgressFunc pfnProgress, 
00183                                  void *pProgressArg, 
00184                                  char **papszWarpOptions );
00185 
00186 CPLErr CPL_DLL
00187 GDALSuggestedWarpOutput( GDALDatasetH hSrcDS, 
00188                          GDALTransformerFunc pfnTransformer,
00189                          void *pTransformArg,
00190                          double *padfGeoTransformOut, 
00191                          int *pnPixels, int *pnLines );
00192 
00193 /* -------------------------------------------------------------------- */
00194 /*      Contour Line Generation                                         */
00195 /* -------------------------------------------------------------------- */
00196 
00197 typedef CPLErr (*GDALContourWriter)( double dfLevel, int nPoints,
00198                                      double *padfX, double *padfY, void * );
00199 
00200 typedef void *GDALContourGeneratorH;
00201 
00202 GDALContourGeneratorH CPL_DLL
00203 GDAL_CG_Create( int nWidth, int nHeight, 
00204                 int bNoDataSet, double dfNoDataValue,
00205                 double dfContourInterval, double dfContourBase,
00206                 GDALContourWriter pfnWriter, void *pCBData );
00207 CPLErr CPL_DLL GDAL_CG_FeedLine( GDALContourGeneratorH hCG, 
00208                                  double *padfScanline );
00209 void CPL_DLL GDAL_CG_Destroy( GDALContourGeneratorH hCG );
00210 
00211 typedef struct 
00212 {
00213     void   *hLayer;
00214 
00215     double adfGeoTransform[6];
00216     
00217     int    nElevField;
00218     int    nIDField;
00219     int    nNextID;
00220 } OGRContourWriterInfo;
00221 
00222 CPLErr CPL_DLL 
00223 OGRContourWriter( double, int, double *, double *, void *pInfo );
00224 
00225 CPLErr CPL_DLL
00226 GDALContourGenerate( GDALRasterBandH hBand, 
00227                             double dfContourInterval, double dfContourBase,
00228                             int nFixedLevelCount, double *padfFixedLevels,
00229                             int bUseNoData, double dfNoDataValue, 
00230                             void *hLayer, int iIDField, int iElevField,
00231                             GDALProgressFunc pfnProgress, void *pProgressArg );
00232 
00233 CPL_C_END
00234                             
00235 #endif /* ndef GDAL_ALG_H_INCLUDED */

Generated on Thu Mar 25 08:13:39 2004 for GDAL by doxygen 1.3.6-20040222