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

Generated on Tue Mar 15 07:12:59 2005 for GDAL by  doxygen 1.4.0