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

Generated on Thu Nov 13 00:08:21 2003 for GDAL by doxygen 1.3.4