GDAL
gdal_alg_priv.h
1 /******************************************************************************
2  * $Id: gdal_alg_priv.h 22502 2011-06-04 21:33:58Z rouault $
3  *
4  * Project: GDAL Image Processing Algorithms
5  * Purpose: Prototypes and definitions for various GDAL based algorithms:
6  * private declarations.
7  * Author: Andrey Kiselev, dron@ak4719.spb.edu
8  *
9  ******************************************************************************
10  * Copyright (c) 2008, Andrey Kiselev <dron@ak4719.spb.edu>
11  *
12  * Permission is hereby granted, free of charge, to any person obtaining a
13  * copy of this software and associated documentation files (the "Software"),
14  * to deal in the Software without restriction, including without limitation
15  * the rights to use, copy, modify, merge, publish, distribute, sublicense,
16  * and/or sell copies of the Software, and to permit persons to whom the
17  * Software is furnished to do so, subject to the following conditions:
18  *
19  * The above copyright notice and this permission notice shall be included
20  * in all copies or substantial portions of the Software.
21  *
22  * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
23  * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
24  * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
25  * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
26  * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
27  * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
28  * DEALINGS IN THE SOFTWARE.
29  ****************************************************************************/
30 
31 #ifndef GDAL_ALG_PRIV_H_INCLUDED
32 #define GDAL_ALG_PRIV_H_INCLUDED
33 
34 #include "gdal_alg.h"
35 
36 CPL_C_START
37 
39 typedef enum { GBV_UserBurnValue = 0, GBV_Z = 1, GBV_M = 2
43 } GDALBurnValueSrc;
44 
45 typedef struct {
46  unsigned char * pabyChunkBuf;
47  int nXSize;
48  int nYSize;
49  int nBands;
50  GDALDataType eType;
51  double *padfBurnValue;
52  GDALBurnValueSrc eBurnValueSource;
54 
55 /************************************************************************/
56 /* Low level rasterizer API. */
57 /************************************************************************/
58 
59 typedef void (*llScanlineFunc)( void *, int, int, int, double );
60 typedef void (*llPointFunc)( void *, int, int, double );
61 
62 void GDALdllImagePoint( int nRasterXSize, int nRasterYSize,
63  int nPartCount, int *panPartSize,
64  double *padfX, double *padfY, double *padfVariant,
65  llPointFunc pfnPointFunc, void *pCBData );
66 
67 void GDALdllImageLine( int nRasterXSize, int nRasterYSize,
68  int nPartCount, int *panPartSize,
69  double *padfX, double *padfY, double *padfVariant,
70  llPointFunc pfnPointFunc, void *pCBData );
71 
72 void GDALdllImageLineAllTouched(int nRasterXSize, int nRasterYSize,
73  int nPartCount, int *panPartSize,
74  double *padfX, double *padfY,
75  double *padfVariant,
76  llPointFunc pfnPointFunc, void *pCBData );
77 
78 void GDALdllImageFilledPolygon(int nRasterXSize, int nRasterYSize,
79  int nPartCount, int *panPartSize,
80  double *padfX, double *padfY,
81  double *padfVariant,
82  llScanlineFunc pfnScanlineFunc, void *pCBData );
83 
84 CPL_C_END
85 
86 /************************************************************************/
87 /* Polygon Enumerator */
88 /************************************************************************/
89 
91 
92 {
93 private:
94  void MergePolygon( int nSrcId, int nDstId );
95  int NewPolygon( GInt32 nValue );
96 
97 public: // these are intended to be readonly.
98 
99  GInt32 *panPolyIdMap;
100  GInt32 *panPolyValue;
101 
102  int nNextPolygonId;
103  int nPolyAlloc;
104 
105  int nConnectedness;
106 
107 public:
108  GDALRasterPolygonEnumerator( int nConnectedness=4 );
110 
111  void ProcessLine( GInt32 *panLastLineVal, GInt32 *panThisLineVal,
112  GInt32 *panLastLineId, GInt32 *panThisLineId,
113  int nXSize );
114 
115  void CompleteMerges();
116 
117  void Clear();
118 };
119 
120 #ifdef OGR_ENABLED
121 /************************************************************************/
122 /* Polygon Enumerator */
123 /* */
124 /* Buffers has float values instead og GInt32 */
125 /************************************************************************/
127 
128 {
129 private:
130  void MergePolygon( int nSrcId, int nDstId );
131  int NewPolygon( float fValue );
132 
133 public: // these are intended to be readonly.
134 
135  GInt32 *panPolyIdMap;
136  float *pafPolyValue;
137 
138  int nNextPolygonId;
139  int nPolyAlloc;
140 
141  int nConnectedness;
142 
143 public:
144  GDALRasterFPolygonEnumerator( int nConnectedness=4 );
146 
147  void ProcessLine( float *pafLastLineVal, float *pafThisLineVal,
148  GInt32 *panLastLineId, GInt32 *panThisLineId,
149  int nXSize );
150 
151  void CompleteMerges();
152 
153  void Clear();
154 };
155 #endif
156 
157 typedef void* (*GDALTransformDeserializeFunc)( CPLXMLNode *psTree );
158 
159 void* GDALRegisterTransformDeserializer(const char* pszTransformName,
160  GDALTransformerFunc pfnTransformerFunc,
161  GDALTransformDeserializeFunc pfnDeserializeFunc);
162 void GDALUnregisterTransformDeserializer(void* pData);
163 
164 /************************************************************************/
165 /* Float comparison function. */
166 /************************************************************************/
167 
174 #define MAX_ULPS 10
175 
176 GBool GDALFloatEquals(float A, float B);
177 
178 #endif /* ndef GDAL_ALG_PRIV_H_INCLUDED */

Generated for GDAL by doxygen 1.8.2.