00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028
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
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
00088
00089
00090 class GDALRasterPolygonEnumerator
00091
00092 {
00093 private:
00094 void MergePolygon( int nSrcId, int nDstId );
00095 int NewPolygon( GInt32 nValue );
00096
00097 public:
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