- Main Page
- Related Pages
- Classes
- Files

- File List
- File Members

# gdal_alg_priv.h

    00001 /******************************************************************************
    00002  * $Id: gdal_alg_priv.h 27044 2014-03-16 23:41:27Z rouault $
    00003  *
    00004  * Project:  GDAL Image Processing Algorithms
    00005  * Purpose:  Prototypes and definitions for various GDAL based algorithms:
    00006  *           private declarations.
    00007  * Author:   Andrey Kiselev, dron@ak4719.spb.edu
    00008  *
    00009  ******************************************************************************
    00010  * Copyright (c) 2008, Andrey Kiselev <dron@ak4719.spb.edu>
    00011  * Copyright (c) 2010-2013, Even Rouault <even dot rouault at mines-paris dot org>
    00012  *
    00013  * Permission is hereby granted, free of charge, to any person obtaining a
    00014  * copy of this software and associated documentation files (the "Software"),
    00015  * to deal in the Software without restriction, including without limitation
    00016  * the rights to use, copy, modify, merge, publish, distribute, sublicense,
    00017  * and/or sell copies of the Software, and to permit persons to whom the
    00018  * Software is furnished to do so, subject to the following conditions:
    00019  *
    00020  * The above copyright notice and this permission notice shall be included
    00021  * in all copies or substantial portions of the Software.
    00022  *
    00023  * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
    00024  * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
    00025  * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
    00026  * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
    00027  * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
    00028  * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
    00029  * DEALINGS IN THE SOFTWARE.
    00030  ****************************************************************************/
    00031
    00032 #ifndef GDAL_ALG_PRIV_H_INCLUDED
    00033 #define GDAL_ALG_PRIV_H_INCLUDED
    00034
    00035 #include "gdal_alg.h"
    00036
    00037 CPL_C_START
    00038
    00040 typedef enum {    GBV_UserBurnValue = 0,    GBV_Z = 1,    GBV_M = 2
    00044 } GDALBurnValueSrc;
    00045
    00046 typedef enum {
    00047     GRMA_Replace = 0,
    00048     GRMA_Add = 1,
    00049 } GDALRasterMergeAlg;
    00050
    00051 typedef struct {
    00052     unsigned char * pabyChunkBuf;
    00053     int nXSize;
    00054     int nYSize;
    00055     int nBands;
    00056     GDALDataType eType;
    00057     double *padfBurnValue;
    00058     GDALBurnValueSrc eBurnValueSource;
    00059     GDALRasterMergeAlg eMergeAlg;
    00060 } GDALRasterizeInfo;
    00061
    00062 /************************************************************************/
    00063 /*      Low level rasterizer API.                                       */
    00064 /************************************************************************/
    00065
    00066 typedef void (*llScanlineFunc)( void *, int, int, int, double );
    00067 typedef void (*llPointFunc)( void *, int, int, double );
    00068
    00069 void GDALdllImagePoint( int nRasterXSize, int nRasterYSize,
    00070                         int nPartCount, int *panPartSize,
    00071                         double *padfX, double *padfY, double *padfVariant,
    00072                         llPointFunc pfnPointFunc, void *pCBData );
    00073
    00074 void GDALdllImageLine( int nRasterXSize, int nRasterYSize,
    00075                        int nPartCount, int *panPartSize,
    00076                        double *padfX, double *padfY, double *padfVariant,
    00077                        llPointFunc pfnPointFunc, void *pCBData );
    00078
    00079 void GDALdllImageLineAllTouched(int nRasterXSize, int nRasterYSize,
    00080                                 int nPartCount, int *panPartSize,
    00081                                 double *padfX, double *padfY,
    00082                                 double *padfVariant,
    00083                                 llPointFunc pfnPointFunc, void *pCBData );
    00084
    00085 void GDALdllImageFilledPolygon(int nRasterXSize, int nRasterYSize,
    00086                                int nPartCount, int *panPartSize,
    00087                                double *padfX, double *padfY,
    00088                                double *padfVariant,
    00089                                llScanlineFunc pfnScanlineFunc, void *pCBData );
    00090
    00091 CPL_C_END
    00092
    00093 /************************************************************************/
    00094 /*                          Polygon Enumerator                          */
    00095 /************************************************************************/
    00096
    00097 class GDALRasterPolygonEnumerator
    00098
    00099 {
    00100 private:
    00101     void     MergePolygon( int nSrcId, int nDstId );
    00102     int      NewPolygon( GInt32 nValue );
    00103
    00104 public:  // these are intended to be readonly.
    00105
    00106     GInt32   *panPolyIdMap;
    00107     GInt32   *panPolyValue;
    00108
    00109     int      nNextPolygonId;
    00110     int      nPolyAlloc;
    00111
    00112     int      nConnectedness;
    00113
    00114 public:
    00115              GDALRasterPolygonEnumerator( int nConnectedness=4 );
    00116             ~GDALRasterPolygonEnumerator();
    00117
    00118     void     ProcessLine( GInt32 *panLastLineVal, GInt32 *panThisLineVal,
    00119                           GInt32 *panLastLineId,  GInt32 *panThisLineId,
    00120                           int nXSize );
    00121
    00122     void     CompleteMerges();
    00123
    00124     void     Clear();
    00125 };
    00126
    00127 #ifdef OGR_ENABLED
    00128 /************************************************************************/
    00129 /*                          Polygon Enumerator                          */
    00130 /*                                                                      */
    00131 /*              Buffers has float values instead og GInt32              */
    00132 /************************************************************************/
    00133 class GDALRasterFPolygonEnumerator
    00134
    00135 {
    00136 private:
    00137     void     MergePolygon( int nSrcId, int nDstId );
    00138     int      NewPolygon( float fValue );
    00139
    00140 public:  // these are intended to be readonly.
    00141
    00142     GInt32   *panPolyIdMap;
    00143     float    *pafPolyValue;
    00144
    00145     int      nNextPolygonId;
    00146     int      nPolyAlloc;
    00147
    00148     int      nConnectedness;
    00149
    00150 public:
    00151              GDALRasterFPolygonEnumerator( int nConnectedness=4 );
    00152             ~GDALRasterFPolygonEnumerator();
    00153
    00154     void     ProcessLine( float *pafLastLineVal, float *pafThisLineVal,
    00155                           GInt32 *panLastLineId,  GInt32 *panThisLineId,
    00156                           int nXSize );
    00157
    00158     void     CompleteMerges();
    00159
    00160     void     Clear();
    00161 };
    00162 #endif
    00163
    00164 typedef void* (*GDALTransformDeserializeFunc)( CPLXMLNode *psTree );
    00165
    00166 void* GDALRegisterTransformDeserializer(const char* pszTransformName,
    00167                                        GDALTransformerFunc pfnTransformerFunc,
    00168                                        GDALTransformDeserializeFunc pfnDeserializeFunc);
    00169 void GDALUnregisterTransformDeserializer(void* pData);
    00170
    00171 void GDALCleanupTransformDeserializerMutex();
    00172
    00173 /* Transformer cloning */
    00174
    00175 void* GDALCloneTPSTransformer( void *pTransformArg );
    00176 void* GDALCloneGenImgProjTransformer( void *pTransformArg );
    00177 void* GDALCloneApproxTransformer( void *pTransformArg );
    00178 /* TODO : GDALCloneGeoLocTransformer? , GDALCloneRPCTransformer? */
    00179
    00180 void* GDALCreateTPSTransformerInt( int nGCPCount, const GDAL_GCP *pasGCPList,
    00181                                    int bReversed, char** papszOptions );
    00182
    00183 void CPL_DLL * GDALCloneTransformer( void *pTranformerArg );
    00184
    00185 /************************************************************************/
    00186 /*      Float comparison function.                                      */
    00187 /************************************************************************/
    00188
    00195 #define MAX_ULPS 10
    00196
    00197 GBool GDALFloatEquals(float A, float B);
    00198
    00199 #endif /* ndef GDAL_ALG_PRIV_H_INCLUDED */

Generated for GDAL by 1.7.1.