GDAL

gdal_alg_priv.h

00001 /******************************************************************************
00002  * $Id: gdal_alg_priv.h 18522 2010-01-11 18:07:15Z mloskot $
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  *
00012  * Permission is hereby granted, free of charge, to any person obtaining a
00013  * copy of this software and associated documentation files (the "Software"),
00014  * to deal in the Software without restriction, including without limitation
00015  * the rights to use, copy, modify, merge, publish, distribute, sublicense,
00016  * and/or sell copies of the Software, and to permit persons to whom the
00017  * Software is furnished to do so, subject to the following conditions:
00018  *
00019  * The above copyright notice and this permission notice shall be included
00020  * in all copies or substantial portions of the Software.
00021  *
00022  * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
00023  * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
00024  * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
00025  * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
00026  * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
00027  * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
00028  * DEALINGS IN THE SOFTWARE.
00029  ****************************************************************************/
00030 
00031 #ifndef GDAL_ALG_PRIV_H_INCLUDED
00032 #define GDAL_ALG_PRIV_H_INCLUDED
00033 
00034 #include "gdal_alg.h"
00035 
00036 CPL_C_START
00037 
00039 typedef enum {    GBV_UserBurnValue = 0,    GBV_Z = 1,    GBV_M = 2
00043 } GDALBurnValueSrc;
00044 
00045 typedef struct {
00046     unsigned char * pabyChunkBuf;
00047     int nXSize;
00048     int nYSize;
00049     int nBands;
00050     GDALDataType eType;
00051     double *padfBurnValue;
00052     GDALBurnValueSrc eBurnValueSource;
00053 } GDALRasterizeInfo;
00054 
00055 /************************************************************************/
00056 /*      Low level rasterizer API.                                       */
00057 /************************************************************************/
00058 
00059 typedef void (*llScanlineFunc)( void *, int, int, int, double );
00060 typedef void (*llPointFunc)( void *, int, int, double );
00061 
00062 void GDALdllImagePoint( int nRasterXSize, int nRasterYSize,
00063                         int nPartCount, int *panPartSize,
00064                         double *padfX, double *padfY, double *padfVariant,
00065                         llPointFunc pfnPointFunc, void *pCBData );
00066 
00067 void GDALdllImageLine( int nRasterXSize, int nRasterYSize, 
00068                        int nPartCount, int *panPartSize,
00069                        double *padfX, double *padfY, double *padfVariant,
00070                        llPointFunc pfnPointFunc, void *pCBData );
00071 
00072 void GDALdllImageLineAllTouched(int nRasterXSize, int nRasterYSize, 
00073                                 int nPartCount, int *panPartSize,
00074                                 double *padfX, double *padfY,
00075                                 double *padfVariant,
00076                                 llPointFunc pfnPointFunc, void *pCBData );
00077 
00078 void GDALdllImageFilledPolygon(int nRasterXSize, int nRasterYSize, 
00079                                int nPartCount, int *panPartSize,
00080                                double *padfX, double *padfY,
00081                                double *padfVariant,
00082                                llScanlineFunc pfnScanlineFunc, void *pCBData );
00083 
00084 CPL_C_END
00085 
00086 /************************************************************************/
00087 /*                          Polygon Enumerator                          */
00088 /************************************************************************/
00089 
00090 class GDALRasterPolygonEnumerator
00091 
00092 {
00093 private:
00094     void     MergePolygon( int nSrcId, int nDstId );
00095     int      NewPolygon( GInt32 nValue );
00096 
00097 public:  // these are intended to be readonly.
00098 
00099     GInt32   *panPolyIdMap;
00100     GInt32   *panPolyValue;
00101 
00102     int      nNextPolygonId;
00103     int      nPolyAlloc;
00104 
00105     int      nConnectedness;
00106 
00107 public:
00108              GDALRasterPolygonEnumerator( int nConnectedness=4 );
00109             ~GDALRasterPolygonEnumerator();
00110 
00111     void     ProcessLine( GInt32 *panLastLineVal, GInt32 *panThisLineVal,
00112                           GInt32 *panLastLineId,  GInt32 *panThisLineId, 
00113                           int nXSize );
00114 
00115     void     CompleteMerges();
00116 
00117     void     Clear();
00118 };
00119 
00120 #endif /* ndef GDAL_ALG_PRIV_H_INCLUDED */

Generated for GDAL by doxygen 1.7.3.