GDAL
gdal_alg_priv.h
1 /******************************************************************************
2  * $Id: gdal_alg_priv.h 27044 2014-03-16 23:41:27Z 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  * Copyright (c) 2010-2013, Even Rouault <even dot rouault at mines-paris dot org>
12  *
13  * Permission is hereby granted, free of charge, to any person obtaining a
14  * copy of this software and associated documentation files (the "Software"),
15  * to deal in the Software without restriction, including without limitation
16  * the rights to use, copy, modify, merge, publish, distribute, sublicense,
17  * and/or sell copies of the Software, and to permit persons to whom the
18  * Software is furnished to do so, subject to the following conditions:
19  *
20  * The above copyright notice and this permission notice shall be included
21  * in all copies or substantial portions of the Software.
22  *
23  * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
24  * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
25  * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
26  * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
27  * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
28  * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
29  * DEALINGS IN THE SOFTWARE.
30  ****************************************************************************/
31 
32 #ifndef GDAL_ALG_PRIV_H_INCLUDED
33 #define GDAL_ALG_PRIV_H_INCLUDED
34 
35 #include "gdal_alg.h"
36 
37 CPL_C_START
38 
40 typedef enum { GBV_UserBurnValue = 0, GBV_Z = 1, GBV_M = 2
44 } GDALBurnValueSrc;
45 
46 typedef enum {
47  GRMA_Replace = 0,
48  GRMA_Add = 1,
49 } GDALRasterMergeAlg;
50 
51 typedef struct {
52  unsigned char * pabyChunkBuf;
53  int nXSize;
54  int nYSize;
55  int nBands;
56  GDALDataType eType;
57  double *padfBurnValue;
58  GDALBurnValueSrc eBurnValueSource;
59  GDALRasterMergeAlg eMergeAlg;
61 
62 /************************************************************************/
63 /* Low level rasterizer API. */
64 /************************************************************************/
65 
66 typedef void (*llScanlineFunc)( void *, int, int, int, double );
67 typedef void (*llPointFunc)( void *, int, int, double );
68 
69 void GDALdllImagePoint( int nRasterXSize, int nRasterYSize,
70  int nPartCount, int *panPartSize,
71  double *padfX, double *padfY, double *padfVariant,
72  llPointFunc pfnPointFunc, void *pCBData );
73 
74 void GDALdllImageLine( int nRasterXSize, int nRasterYSize,
75  int nPartCount, int *panPartSize,
76  double *padfX, double *padfY, double *padfVariant,
77  llPointFunc pfnPointFunc, void *pCBData );
78 
79 void GDALdllImageLineAllTouched(int nRasterXSize, int nRasterYSize,
80  int nPartCount, int *panPartSize,
81  double *padfX, double *padfY,
82  double *padfVariant,
83  llPointFunc pfnPointFunc, void *pCBData );
84 
85 void GDALdllImageFilledPolygon(int nRasterXSize, int nRasterYSize,
86  int nPartCount, int *panPartSize,
87  double *padfX, double *padfY,
88  double *padfVariant,
89  llScanlineFunc pfnScanlineFunc, void *pCBData );
90 
91 CPL_C_END
92 
93 /************************************************************************/
94 /* Polygon Enumerator */
95 /************************************************************************/
96 
98 
99 {
100 private:
101  void MergePolygon( int nSrcId, int nDstId );
102  int NewPolygon( GInt32 nValue );
103 
104 public: // these are intended to be readonly.
105 
106  GInt32 *panPolyIdMap;
107  GInt32 *panPolyValue;
108 
109  int nNextPolygonId;
110  int nPolyAlloc;
111 
112  int nConnectedness;
113 
114 public:
115  GDALRasterPolygonEnumerator( int nConnectedness=4 );
117 
118  void ProcessLine( GInt32 *panLastLineVal, GInt32 *panThisLineVal,
119  GInt32 *panLastLineId, GInt32 *panThisLineId,
120  int nXSize );
121 
122  void CompleteMerges();
123 
124  void Clear();
125 };
126 
127 #ifdef OGR_ENABLED
128 /************************************************************************/
129 /* Polygon Enumerator */
130 /* */
131 /* Buffers has float values instead og GInt32 */
132 /************************************************************************/
134 
135 {
136 private:
137  void MergePolygon( int nSrcId, int nDstId );
138  int NewPolygon( float fValue );
139 
140 public: // these are intended to be readonly.
141 
142  GInt32 *panPolyIdMap;
143  float *pafPolyValue;
144 
145  int nNextPolygonId;
146  int nPolyAlloc;
147 
148  int nConnectedness;
149 
150 public:
151  GDALRasterFPolygonEnumerator( int nConnectedness=4 );
153 
154  void ProcessLine( float *pafLastLineVal, float *pafThisLineVal,
155  GInt32 *panLastLineId, GInt32 *panThisLineId,
156  int nXSize );
157 
158  void CompleteMerges();
159 
160  void Clear();
161 };
162 #endif
163 
164 typedef void* (*GDALTransformDeserializeFunc)( CPLXMLNode *psTree );
165 
166 void* GDALRegisterTransformDeserializer(const char* pszTransformName,
167  GDALTransformerFunc pfnTransformerFunc,
168  GDALTransformDeserializeFunc pfnDeserializeFunc);
169 void GDALUnregisterTransformDeserializer(void* pData);
170 
171 void GDALCleanupTransformDeserializerMutex();
172 
173 /* Transformer cloning */
174 
175 void* GDALCloneTPSTransformer( void *pTransformArg );
176 void* GDALCloneGenImgProjTransformer( void *pTransformArg );
177 void* GDALCloneApproxTransformer( void *pTransformArg );
178 /* TODO : GDALCloneGeoLocTransformer? , GDALCloneRPCTransformer? */
179 
180 void* GDALCreateTPSTransformerInt( int nGCPCount, const GDAL_GCP *pasGCPList,
181  int bReversed, char** papszOptions );
182 
183 void CPL_DLL * GDALCloneTransformer( void *pTranformerArg );
184 
185 /************************************************************************/
186 /* Float comparison function. */
187 /************************************************************************/
188 
195 #define MAX_ULPS 10
196 
197 GBool GDALFloatEquals(float A, float B);
198 
199 #endif /* ndef GDAL_ALG_PRIV_H_INCLUDED */
GDALDataType
Definition: gdal.h:55
Definition: gdal_alg_priv.h:51
Document node structure.
Definition: cpl_minixml.h:65
Definition: gdal_alg_priv.h:97
int(* GDALTransformerFunc)(void *pTransformerArg, int bDstToSrc, int nPointCount, double *x, double *y, double *z, int *panSuccess)
Definition: gdal_alg.h:114
Public (C callable) GDAL algorithm entry points, and definitions.
Definition: gdal_alg_priv.h:133
Ground Control Point.
Definition: gdal.h:255

Generated for GDAL by doxygen 1.8.11.