Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Newer
Older
100644 299 lines (256 sloc) 9.935 kB
14b2729 @tbonfort merge mapserver6 sandbox (rendering api) into trunk
tbonfort authored
1 /******************************************************************************
2 * $Id$
3 *
4 * Project: MapServer
5 * Purpose: Dummy functions to implement when using a pluggable renderer
6 * Author: Thomas Bonfort, thomas.bonfort@gmail.com
7 *
8 ******************************************************************************
9 * Copyright (c) 2010, Thomas Bonfort
10 *
11 * Permission is hereby granted, free of charge, to any person obtaining a
12 * copy of this software and associated documentation files (the "Software"),
13 * to deal in the Software without restriction, including without limitation
14 * the rights to use, copy, modify, merge, publish, distribute, sublicense,
15 * and/or sell copies of the Software, and to permit persons to whom the
16 * Software is furnished to do so, subject to the following conditions:
17 *
8853727 @tbonfort fix formatting as modified by astyle.sh
tbonfort authored
18 * The above copyright notice and this permission notice shall be included in
14b2729 @tbonfort merge mapserver6 sandbox (rendering api) into trunk
tbonfort authored
19 * all copies of this Software or works derived from this Software.
20 *
21 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
22 * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
23 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
24 * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
25 * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
26 * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
27 * DEALINGS IN THE SOFTWARE.
28 *****************************************************************************/
29
30 #include "mapserver.h"
31
8853727 @tbonfort fix formatting as modified by astyle.sh
tbonfort authored
32 int renderLineDummy(imageObj *img, shapeObj *p, strokeStyleObj *style)
33 {
34 msSetError(MS_RENDERERERR,"renderLine not implemented","renderLine()");
35 return MS_FAILURE;
14b2729 @tbonfort merge mapserver6 sandbox (rendering api) into trunk
tbonfort authored
36 }
37
8853727 @tbonfort fix formatting as modified by astyle.sh
tbonfort authored
38 int renderPolygonDummy(imageObj *img, shapeObj *p, colorObj *color)
39 {
40 msSetError(MS_RENDERERERR,"renderPolygon not implemented","renderPolygon()");
41 return MS_FAILURE;
14b2729 @tbonfort merge mapserver6 sandbox (rendering api) into trunk
tbonfort authored
42 }
43
8853727 @tbonfort fix formatting as modified by astyle.sh
tbonfort authored
44 int renderPolygonTiledDummy(imageObj *img, shapeObj *p, imageObj *tile)
45 {
46 msSetError(MS_RENDERERERR,"renderPolygonTiled not implemented","renderPolygonTiled()");
47 return MS_FAILURE;
14b2729 @tbonfort merge mapserver6 sandbox (rendering api) into trunk
tbonfort authored
48 }
49
8853727 @tbonfort fix formatting as modified by astyle.sh
tbonfort authored
50 int renderLineTiledDummy(imageObj *img, shapeObj *p, imageObj *tile)
51 {
52 msSetError(MS_RENDERERERR,"renderLineTiled not implemented","renderLineTiled()");
53 return MS_FAILURE;
14b2729 @tbonfort merge mapserver6 sandbox (rendering api) into trunk
tbonfort authored
54 }
55
56 int renderRasterGlyphsDummy(imageObj *img, double x, double y, int fontIndex,
8853727 @tbonfort fix formatting as modified by astyle.sh
tbonfort authored
57 colorObj *color, char* text)
58 {
59 msSetError(MS_RENDERERERR,"renderRasterGlyphs not implemented","renderRasterGlyphs()");
60 return MS_FAILURE;
14b2729 @tbonfort merge mapserver6 sandbox (rendering api) into trunk
tbonfort authored
61 }
62
63 int renderGlyphsDummy(imageObj *img, double x, double y,
8853727 @tbonfort fix formatting as modified by astyle.sh
tbonfort authored
64 labelStyleObj *style, char *text)
65 {
66 msSetError(MS_RENDERERERR,"renderGlyphs not implemented","renderGlyphs()");
67 return MS_FAILURE;
14b2729 @tbonfort merge mapserver6 sandbox (rendering api) into trunk
tbonfort authored
68 }
69
70 int renderGlyphsLineDummy(imageObj *img,labelPathObj *labelpath,
8853727 @tbonfort fix formatting as modified by astyle.sh
tbonfort authored
71 labelStyleObj *style, char *text)
72 {
73 msSetError(MS_RENDERERERR,"renderGlyphsLine not implemented","renderGlyphsLine()");
74 return MS_FAILURE;
14b2729 @tbonfort merge mapserver6 sandbox (rendering api) into trunk
tbonfort authored
75 }
76
77 int renderVectorSymbolDummy(imageObj *img, double x, double y,
8853727 @tbonfort fix formatting as modified by astyle.sh
tbonfort authored
78 symbolObj *symbol, symbolStyleObj *style)
79 {
80 msSetError(MS_RENDERERERR,"renderVectorSymbol not implemented","renderVectorSymbol()");
81 return MS_FAILURE;
14b2729 @tbonfort merge mapserver6 sandbox (rendering api) into trunk
tbonfort authored
82 }
83
84 void* createVectorSymbolTileDummy(int width, int height,
8853727 @tbonfort fix formatting as modified by astyle.sh
tbonfort authored
85 symbolObj *symbol, symbolStyleObj *style)
86 {
87 msSetError(MS_RENDERERERR,"createVectorSymbolTile not implemented","createVectorSymbolTile()");
88 return NULL;
14b2729 @tbonfort merge mapserver6 sandbox (rendering api) into trunk
tbonfort authored
89 }
90
91 int renderPixmapSymbolDummy(imageObj *img, double x, double y,
8853727 @tbonfort fix formatting as modified by astyle.sh
tbonfort authored
92 symbolObj *symbol, symbolStyleObj *style)
93 {
94 msSetError(MS_RENDERERERR,"renderLine not implemented","renderLine()");
95 return MS_FAILURE;
14b2729 @tbonfort merge mapserver6 sandbox (rendering api) into trunk
tbonfort authored
96 }
97
98 void* createPixmapSymbolTileDummy(int width, int height,
8853727 @tbonfort fix formatting as modified by astyle.sh
tbonfort authored
99 symbolObj *symbol, symbolStyleObj *style)
100 {
101 msSetError(MS_RENDERERERR,"renderLine not implemented","renderLine()");
102 return NULL;
14b2729 @tbonfort merge mapserver6 sandbox (rendering api) into trunk
tbonfort authored
103 }
104
8853727 @tbonfort fix formatting as modified by astyle.sh
tbonfort authored
105 int renderEllipseSymbolDummy(imageObj *image, double x, double y,
106 symbolObj *symbol, symbolStyleObj *style)
107 {
108 msSetError(MS_RENDERERERR,"renderLine not implemented","renderLine()");
109 return MS_FAILURE;
14b2729 @tbonfort merge mapserver6 sandbox (rendering api) into trunk
tbonfort authored
110 }
111
112 void* createEllipseSymbolTileDummy(int width, int height,
8853727 @tbonfort fix formatting as modified by astyle.sh
tbonfort authored
113 symbolObj *symbol, symbolStyleObj *style)
114 {
115 msSetError(MS_RENDERERERR,"renderLine not implemented","renderLine()");
116 return NULL;
14b2729 @tbonfort merge mapserver6 sandbox (rendering api) into trunk
tbonfort authored
117 }
118
119 int renderTruetypeSymbolDummy(imageObj *img, double x, double y,
8853727 @tbonfort fix formatting as modified by astyle.sh
tbonfort authored
120 symbolObj *symbol, symbolStyleObj *style)
121 {
122 msSetError(MS_RENDERERERR,"renderLine not implemented","renderLine()");
123 return MS_FAILURE;
14b2729 @tbonfort merge mapserver6 sandbox (rendering api) into trunk
tbonfort authored
124 }
125
126 void* createTruetypeSymbolTileDummy(int width, int height,
8853727 @tbonfort fix formatting as modified by astyle.sh
tbonfort authored
127 symbolObj *symbol, symbolStyleObj *style)
128 {
129 msSetError(MS_RENDERERERR,"renderLine not implemented","renderLine()");
130 return NULL;
14b2729 @tbonfort merge mapserver6 sandbox (rendering api) into trunk
tbonfort authored
131 }
132
8853727 @tbonfort fix formatting as modified by astyle.sh
tbonfort authored
133 int renderTileDummy(imageObj *img, imageObj *tile, double x, double y)
134 {
135 msSetError(MS_RENDERERERR,"renderLine not implemented","renderLine()");
136 return MS_FAILURE;
14b2729 @tbonfort merge mapserver6 sandbox (rendering api) into trunk
tbonfort authored
137 }
138
8853727 @tbonfort fix formatting as modified by astyle.sh
tbonfort authored
139 rasterBufferObj* loadImageFromFileDummy(char *path)
140 {
141 msSetError(MS_RENDERERERR,"loadImageFromFile not implemented","loadImageFromFile()");
142 return NULL;
14b2729 @tbonfort merge mapserver6 sandbox (rendering api) into trunk
tbonfort authored
143 }
144
145
8853727 @tbonfort fix formatting as modified by astyle.sh
tbonfort authored
146 int getRasterBufferHandleDummy(imageObj *img, rasterBufferObj *rb)
147 {
148 msSetError(MS_RENDERERERR,"renderLine not implemented","renderLine()");
149 return MS_FAILURE;
14b2729 @tbonfort merge mapserver6 sandbox (rendering api) into trunk
tbonfort authored
150 }
151
8853727 @tbonfort fix formatting as modified by astyle.sh
tbonfort authored
152 int getRasterBufferCopyDummy(imageObj *img, rasterBufferObj *rb)
153 {
154 msSetError(MS_RENDERERERR,"getRasterBufferCopy not implemented","getRasterBufferCopy()");
155 return MS_FAILURE;
14b2729 @tbonfort merge mapserver6 sandbox (rendering api) into trunk
tbonfort authored
156 }
157
8853727 @tbonfort fix formatting as modified by astyle.sh
tbonfort authored
158 rasterBufferObj* createRasterBufferDummy(int width, int height)
159 {
160 msSetError(MS_RENDERERERR,"createRasterBuffer not implemented","createRasterBuffer()");
161 return NULL;
14b2729 @tbonfort merge mapserver6 sandbox (rendering api) into trunk
tbonfort authored
162 }
163
8853727 @tbonfort fix formatting as modified by astyle.sh
tbonfort authored
164 int mergeRasterBufferDummy(imageObj *dest, rasterBufferObj *overlay, double opacity, int srcX, int srcY, int dstX, int dstY, int width, int height)
165 {
166 msSetError(MS_RENDERERERR,"mergeRasterBuffer not implemented","mergeRasterBuffer()");
167 return MS_FAILURE;
14b2729 @tbonfort merge mapserver6 sandbox (rendering api) into trunk
tbonfort authored
168 }
169
8853727 @tbonfort fix formatting as modified by astyle.sh
tbonfort authored
170 int initializeRasterBufferDummy(rasterBufferObj *rb, int width, int height, int mode)
171 {
172 msSetError(MS_RENDERERERR,"initializeRasterBuffer not implemented","initializeRasterBuffer()");
173 return MS_FAILURE;
14b2729 @tbonfort merge mapserver6 sandbox (rendering api) into trunk
tbonfort authored
174 }
175
176
177
178 /* image i/o */
8853727 @tbonfort fix formatting as modified by astyle.sh
tbonfort authored
179 imageObj* createImageDummy(int width, int height, outputFormatObj *format, colorObj* bg)
180 {
181 msSetError(MS_RENDERERERR,"createImage not implemented","createImage()");
182 return NULL;
14b2729 @tbonfort merge mapserver6 sandbox (rendering api) into trunk
tbonfort authored
183 }
184
8853727 @tbonfort fix formatting as modified by astyle.sh
tbonfort authored
185 int saveImageDummy(imageObj *img, mapObj *map, FILE *fp, outputFormatObj *format)
186 {
187 msSetError(MS_RENDERERERR,"saveImage not implemented","saveImage()");
188 return MS_FAILURE;
14b2729 @tbonfort merge mapserver6 sandbox (rendering api) into trunk
tbonfort authored
189 }
190 /*...*/
191
192 /* helper functions */
a06618e @tbonfort Only do baseline adjustment on text, not on truetype symbols
tbonfort authored
193 int getTruetypeTextBBoxDummy(rendererVTableObj *renderer, char **fonts, int numfonts, double size,
8853727 @tbonfort fix formatting as modified by astyle.sh
tbonfort authored
194 char *string,rectObj *rect, double **advances, int bAdjustBaseline)
195 {
196 msSetError(MS_RENDERERERR,"getTruetypeTextBBox not implemented","getTruetypeTextBBox()");
197 return MS_FAILURE;
198 }
199
200 int startLayerDummy(imageObj *img, mapObj *map, layerObj *layer)
201 {
202 msSetError(MS_RENDERERERR,"startLayer not implemented","startLayer()");
203 return MS_FAILURE;
204 }
205
206 int endLayerDummy(imageObj *img, mapObj *map, layerObj *layer)
207 {
208 msSetError(MS_RENDERERERR,"endLayer not implemented","endLayer()");
209 return MS_FAILURE;
210 }
211
212 int startShapeDummy(imageObj *img, shapeObj *shape)
213 {
214 msSetError(MS_RENDERERERR,"startShape not implemented","startShape()");
215 return MS_FAILURE;
216 }
217
218 int endShapeDummy(imageObj *img, shapeObj *shape)
219 {
220 msSetError(MS_RENDERERERR,"endShape not implemented","endShape()");
221 return MS_FAILURE;
222 }
223
224 int setClipDummy(imageObj *img, rectObj clipRect)
225 {
226 msSetError(MS_RENDERERERR,"renderLine not implemented","renderLine()");
227 return MS_FAILURE;
228 }
229 int resetClipDummy(imageObj *img)
230 {
231 msSetError(MS_RENDERERERR,"resetClip not implemented","resetClip()");
232 return MS_FAILURE;
233 }
234
235 int freeImageDummy(imageObj *image)
236 {
237 msSetError(MS_RENDERERERR,"freeImage not implemented","freeImage()");
238 return MS_FAILURE;
239 }
240
241 int freeTileDummy(imageObj *tile)
242 {
243 msSetError(MS_RENDERERERR,"freeTile not implemented","freeTile()");
244 return MS_FAILURE;
245 }
246
247 int freeSymbolDummy(symbolObj *symbol)
248 {
249 msSetError(MS_RENDERERERR,"freeSymbol not implemented","freeSymbol()");
250 return MS_FAILURE;
251 }
252
253 int cleanupDummy(void *renderer_data)
254 {
255 return MS_SUCCESS;
256 }
257
258 int msInitializeDummyRenderer(rendererVTableObj *renderer)
259 {
260
261 renderer->use_imagecache = 0;
262 renderer->supports_pixel_buffer = 0;
263 renderer->supports_transparent_layers = 0;
264 renderer->supports_clipping = 0;
265 renderer->supports_bitmap_fonts = 0;
266 renderer->supports_svg = 0;
267 renderer->renderer_data = NULL;
268 renderer->transform_mode = MS_TRANSFORM_SIMPLIFY;
269 renderer->startLayer = &startLayerDummy;
270 renderer->endLayer = &endLayerDummy;
271 renderer->renderLine=&renderLineDummy;
272 renderer->renderLineTiled = NULL;
273 renderer->createImage=&createImageDummy;
274 renderer->saveImage=&saveImageDummy;
275 renderer->getRasterBufferHandle=&getRasterBufferHandleDummy;
276 renderer->getRasterBufferCopy=getRasterBufferCopyDummy;
277 renderer->initializeRasterBuffer=initializeRasterBufferDummy;
278 renderer->renderPolygon=&renderPolygonDummy;
279 renderer->renderGlyphs=&renderGlyphsDummy;
280 renderer->renderGlyphsLine = NULL;
281 renderer->renderBitmapGlyphs = &renderGlyphsDummy;
282 renderer->freeImage=&freeImageDummy;
283 renderer->renderEllipseSymbol = &renderEllipseSymbolDummy;
284 renderer->renderVectorSymbol = &renderVectorSymbolDummy;
285 renderer->renderTruetypeSymbol = &renderTruetypeSymbolDummy;
286 renderer->renderPixmapSymbol = &renderPixmapSymbolDummy;
287 renderer->mergeRasterBuffer = &mergeRasterBufferDummy;
288 renderer->getTruetypeTextBBox = &getTruetypeTextBBoxDummy;
289 renderer->renderTile = &renderTileDummy;
290 renderer->renderPolygonTiled = &renderPolygonTiledDummy;
291 renderer->freeSymbol = &freeSymbolDummy;
292 renderer->cleanup = &cleanupDummy;
293 renderer->startShape = NULL;
294 renderer->endShape = NULL;
295 return MS_SUCCESS;
14b2729 @tbonfort merge mapserver6 sandbox (rendering api) into trunk
tbonfort authored
296 }
297
298
Something went wrong with that request. Please try again.