00001 /****************************************************************************** 00002 * $Id: gdal_alg_h-source.html,v 1.2 2002/12/21 19:13:12 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-source.html,v $ 00030 * Revision 1.2 2002/12/21 19:13:12 warmerda 00030 * updated 00030 * 00031 * Revision 1.9 2002/12/09 18:56:10 warmerda 00032 * added missing CPL_DLL 00033 * 00034 * Revision 1.8 2002/12/09 16:08:32 warmerda 00035 * added approximating transformer 00036 * 00037 * Revision 1.7 2002/12/07 22:58:42 warmerda 00038 * added initialization support for simple warper 00039 * 00040 * Revision 1.6 2002/12/07 17:09:38 warmerda 00041 * added order flag to GenImgProjTransformer 00042 * 00043 * Revision 1.5 2002/12/06 21:43:12 warmerda 00044 * tweak prototypes 00045 * 00046 * Revision 1.4 2002/12/05 21:44:35 warmerda 00047 * fixed prototype 00048 * 00049 * Revision 1.3 2002/12/05 05:43:28 warmerda 00050 * added warp/transformer definition 00051 * 00052 * Revision 1.2 2001/02/02 21:19:25 warmerda 00053 * added CPL_DLL for functions 00054 * 00055 * Revision 1.1 2001/01/22 22:30:59 warmerda 00056 * New 00057 */ 00058 00059 #ifndef GDAL_ALG_H_INCLUDED 00060 #define GDAL_ALG_H_INCLUDED 00061 00068 #include "gdal.h" 00069 00070 CPL_C_START 00071 00072 int CPL_DLL GDALComputeMedianCutPCT( GDALRasterBandH hRed, 00073 GDALRasterBandH hGreen, 00074 GDALRasterBandH hBlue, 00075 int (*pfnIncludePixel)(int,int,void*), 00076 int nColors, 00077 GDALColorTableH hColorTable, 00078 GDALProgressFunc pfnProgress, 00079 void * pProgressArg ); 00080 00081 int CPL_DLL GDALDitherRGB2PCT( GDALRasterBandH hRed, 00082 GDALRasterBandH hGreen, 00083 GDALRasterBandH hBlue, 00084 GDALRasterBandH hTarget, 00085 GDALColorTableH hColorTable, 00086 GDALProgressFunc pfnProgress, 00087 void * pProgressArg ); 00088 00089 /* 00090 * Warp Related. 00091 */ 00092 00093 typedef int 00094 (*GDALTransformerFunc)( void *pTransformerArg, 00095 int bDstToSrc, int nPointCount, 00096 double *x, double *y, double *z, int *panSuccess ); 00097 00098 /* High level transformer for going from image coordinates on one file 00099 to image coordiantes on another, potentially doing reprojection, 00100 utilizing GCPs or using the geotransform. */ 00101 00102 void CPL_DLL * 00103 GDALCreateGenImgProjTransformer( GDALDatasetH hSrcDS, const char *pszSrcWKT, 00104 GDALDatasetH hDstDS, const char *pszDstWKT, 00105 int bGCPUseOK, double dfGCPErrorThreshold, 00106 int nOrder ); 00107 void CPL_DLL GDALDestroyGenImgProjTransformer( void * ); 00108 int CPL_DLL GDALGenImgProjTransform( 00109 void *pTransformArg, int bDstToSrc, int nPointCount, 00110 double *x, double *y, double *z, int *panSuccess ); 00111 00112 /* Geo to geo reprojection transformer. */ 00113 void CPL_DLL * 00114 GDALCreateReprojectionTransformer( const char *pszSrcWKT, 00115 const char *pszDstWKT ); 00116 void CPL_DLL GDALDestroyReprojectionTransformer( void * ); 00117 int CPL_DLL GDALReprojectionTransform( 00118 void *pTransformArg, int bDstToSrc, int nPointCount, 00119 double *x, double *y, double *z, int *panSuccess ); 00120 00121 /* GCP based transformer ... forward is to georef coordinates */ 00122 void CPL_DLL * 00123 GDALCreateGCPTransformer( int nGCPCount, const GDAL_GCP *pasGCPList, 00124 int nReqOrder, int bReversed ); 00125 void CPL_DLL GDALDestroyGCPTransformer( void *pTransformArg ); 00126 int CPL_DLL GDALGCPTransform( 00127 void *pTransformArg, int bDstToSrc, int nPointCount, 00128 double *x, double *y, double *z, int *panSuccess ); 00129 00130 /* Approximate transformer */ 00131 void CPL_DLL * 00132 GDALCreateApproxTransformer( GDALTransformerFunc pfnRawTransformer, 00133 void *pRawTransformerArg, double dfMaxError ); 00134 void CPL_DLL GDALDestroyApproxTransformer( void *pApproxArg ); 00135 int CPL_DLL GDALApproxTransform( 00136 void *pTransformArg, int bDstToSrc, int nPointCount, 00137 double *x, double *y, double *z, int *panSuccess ); 00138 00139 00140 00141 00142 int CPL_DLL GDALSimpleImageWarp( GDALDatasetH hSrcDS, 00143 GDALDatasetH hDstDS, 00144 int nBandCount, int *panBandList, 00145 GDALTransformerFunc pfnTransform, 00146 void *pTransformArg, 00147 GDALProgressFunc pfnProgress, 00148 void *pProgressArg, 00149 char **papszWarpOptions ); 00150 00151 CPLErr CPL_DLL 00152 GDALSuggestedWarpOutput( GDALDatasetH hSrcDS, 00153 GDALTransformerFunc pfnTransformer, 00154 void *pTransformArg, 00155 double *padfGeoTransformOut, 00156 int *pnPixels, int *pnLines ); 00157 00158 00159 CPL_C_END 00160 00161 #endif /* ndef GDAL_ALG_H_INCLUDED */