[mapserver-commits] r9254 - in sandbox/svgsymbols/mapserver: . renderers/agg/svg

svn at osgeo.org svn at osgeo.org
Fri Aug 14 13:12:55 EDT 2009


Author: kiranvarma
Date: 2009-08-14 13:12:55 -0400 (Fri, 14 Aug 2009)
New Revision: 9254

Added:
   sandbox/svgsymbols/mapserver/mapsymbolsvg.cpp
   sandbox/svgsymbols/mapserver/mapsymbolsvg.h
Modified:
   sandbox/svgsymbols/mapserver/Makefile.in
   sandbox/svgsymbols/mapserver/mapgd.c
   sandbox/svgsymbols/mapserver/renderers/agg/svg/agg_svg_path_renderer.h
Log:
Some more changes!


Modified: sandbox/svgsymbols/mapserver/Makefile.in
===================================================================
--- sandbox/svgsymbols/mapserver/Makefile.in	2009-08-14 16:09:30 UTC (rev 9253)
+++ sandbox/svgsymbols/mapserver/Makefile.in	2009-08-14 17:12:55 UTC (rev 9254)
@@ -267,7 +267,7 @@
 
 RM= /bin/rm -f
 
-OBJS= $(AGG_OBJ) mapogl.o mapoglrenderer.o mapoglcontext.o mapimageio.o mapcairo.o maprendering.o mapgeomtransform.o maprgbapng.o maptemplate.o mapbits.o maphash.o mapshape.o mapxbase.o mapparser.o maplexer.o maptree.o mapsearch.o mapstring.o mapsymbol.o mapfile.o maplegend.o maputil.o mapscale.o mapquery.o maplabel.o maperror.o mapprimitive.o mapproject.o mapraster.o mapsde.o mapogr.o mappostgis.o mapmygis.o maplayer.o mapresample.o mapwms.o mapwmslayer.o maporaclespatial.o mapgml.o mapprojhack.o mapthread.o mapdraw.o mapgd.o mapagg.o mapoutput.o mapgdal.o mapswf.o mapimagemap.o mapows.o mapwfs.o  mapwfs11.o mapwfslayer.o mapcontext.o maphttp.o mapdrawgdal.o mappdf.o mapjoin.o mapgraticule.o mapcopy.o mapogcfilter.o mapogcsld.o maptime.o mapwcs.o mapwcs11.o mapcpl.o cgiutil.o maprasterquery.o mapobject.o mapgeos.o classobject.o layerobject.o mapio.o mappool.o mapsvg.o mapregex.o mappluginlayer.o mapogcsos.o mappostgresql.o mapcrypto.o mapowscommon.o maplibxml2.o mapdebug.o mapchart.o maptclutf.o $(EPPL_OBJ) 
+OBJS= $(AGG_OBJ) mapogl.o mapoglrenderer.o mapoglcontext.o mapimageio.o mapcairo.o maprendering.o mapgeomtransform.o maprgbapng.o maptemplate.o mapbits.o maphash.o mapshape.o mapxbase.o mapparser.o maplexer.o maptree.o mapsearch.o mapstring.o mapsymbol.o mapfile.o maplegend.o maputil.o mapscale.o mapquery.o maplabel.o maperror.o mapprimitive.o mapproject.o mapraster.o mapsde.o mapogr.o mappostgis.o mapmygis.o maplayer.o mapresample.o mapwms.o mapwmslayer.o maporaclespatial.o mapgml.o mapprojhack.o mapthread.o mapdraw.o mapgd.o mapagg.o mapoutput.o mapgdal.o mapswf.o mapimagemap.o mapows.o mapwfs.o  mapwfs11.o mapwfslayer.o mapcontext.o maphttp.o mapdrawgdal.o mappdf.o mapjoin.o mapgraticule.o mapcopy.o mapogcfilter.o mapogcsld.o maptime.o mapwcs.o mapwcs11.o mapcpl.o cgiutil.o maprasterquery.o mapobject.o mapgeos.o classobject.o layerobject.o mapio.o mappool.o mapsvg.o mapregex.o mappluginlayer.o mapogcsos.o mappostgresql.o mapcrypto.o mapowscommon.o maplibxml2.o mapdebug.o mapchart.o maptclutf.o mapsymbolsvg.o $(EPPL_OBJ) 
 
 EXE_LIST = 	shp2img shp2pdf legend mapserv shptree shptreevis \
 		shptreetst scalebar sortshp mapscriptvars tile4ms \

Modified: sandbox/svgsymbols/mapserver/mapgd.c
===================================================================
--- sandbox/svgsymbols/mapserver/mapgd.c	2009-08-14 16:09:30 UTC (rev 9253)
+++ sandbox/svgsymbols/mapserver/mapgd.c	2009-08-14 17:12:55 UTC (rev 9254)
@@ -33,6 +33,7 @@
 
 #include "mapserver.h"
 #include "mapthread.h"
+#include "mapsymbolsvg.h"
 #include <time.h>
 
 #ifdef _WIN32
@@ -540,12 +541,6 @@
   return brush;
 }
 
-static gdImagePtr createBrushFromSVG(gdImagePtr img, int width, int height, styleObj *style, int *fgcolor, int *bgcolor)
-{
-    gdImagePtr brush;
-    return brush;
-}
-
 static gdImagePtr createBrush(gdImagePtr img, int width, int height, styleObj *style, int *fgcolor, int *bgcolor)
 {
   gdImagePtr brush;

Added: sandbox/svgsymbols/mapserver/mapsymbolsvg.cpp
===================================================================
--- sandbox/svgsymbols/mapserver/mapsymbolsvg.cpp	                        (rev 0)
+++ sandbox/svgsymbols/mapserver/mapsymbolsvg.cpp	2009-08-14 17:12:55 UTC (rev 9254)
@@ -0,0 +1,57 @@
+#include "mapsymbolsvg.h"
+#include "mapserver.h"
+#include "mapfile.h"
+#include "renderers/agg/svg/agg_svg_parser.h"
+
+#include "renderers/agg/include/agg_basics.h"
+#include "renderers/agg/include/agg_rendering_buffer.h"
+#include "renderers/agg/include/agg_rasterizer_scanline_aa.h"
+#include "renderers/agg/include/agg_scanline_p.h"
+#include "renderers/agg/include/agg_renderer_scanline.h"
+#include "renderers/agg/include/agg_pixfmt_rgba.h"
+
+gdImagePtr createBrushFromSVG(char *svgfile, int width, int height, styleObj *style, int *fgcolor, int *bgcolor)
+{
+	gdImagePtr brush;
+	/*
+	//Create an SVG parser object
+    mapserver::svg::path_renderer path;
+	mapserver::svg::parser p(path);
+	p.parse(svgfile);
+	path.arrange_orientations();
+	
+	
+    double min_x = 0;
+    double min_y = 0;
+    double max_x = width;
+    double max_y = height;
+	path.bounding_rect(&min_x, &min_y, &max_x, &max_y);
+	
+
+	typedef mapserver::pixfmt_bgra32 pixfmt;
+	typedef mapserver::renderer_base<pixfmt> renderer_base;
+	typedef mapserver::renderer_scanline_aa_solid<renderer_base> renderer_solid;
+
+	pixfmt pixf(rbuf_window());
+	renderer_base rb(pixf);
+	renderer_solid ren(rb);
+
+	rb.clear(mapserver::rgba(1,1,1));
+
+	mapserver::rasterizer_scanline_aa<> ras;
+	mapserver::scanline_p8 sl;
+	mapserver::trans_affine mtx;
+
+	mtx *= mapserver::trans_affine_translation((min_x + max_x) * -0.5, (min_y + max_y) * -0.5);
+
+	path.render(ras, sl, ren, mtx, rb.clip_box(), 1.0);
+
+	ras.gamma(mapserver::gamma_none());
+
+	ren.color(mapserver::rgba(0,0,0));
+	mapserver::render_scanlines(ras, sl, ren);
+	
+	*/
+	return(brush);
+}
+

Added: sandbox/svgsymbols/mapserver/mapsymbolsvg.h
===================================================================
--- sandbox/svgsymbols/mapserver/mapsymbolsvg.h	                        (rev 0)
+++ sandbox/svgsymbols/mapserver/mapsymbolsvg.h	2009-08-14 17:12:55 UTC (rev 9254)
@@ -0,0 +1,17 @@
+#ifndef MAP_SYMBOL_SVG_H
+#define MAP_SYMBOL_SVG_H
+
+#include "mapserver.h"
+#include "mapfile.h"
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+gdImagePtr createBrushFromSVG(char *svgfile, int width, int height, styleObj *style, int *fgcolor, int *bgcolor);
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif

Modified: sandbox/svgsymbols/mapserver/renderers/agg/svg/agg_svg_path_renderer.h
===================================================================
--- sandbox/svgsymbols/mapserver/renderers/agg/svg/agg_svg_path_renderer.h	2009-08-14 16:09:30 UTC (rev 9253)
+++ sandbox/svgsymbols/mapserver/renderers/agg/svg/agg_svg_path_renderer.h	2009-08-14 17:12:55 UTC (rev 9254)
@@ -19,15 +19,15 @@
 #ifndef AGG_SVG_PATH_RENDERER_INCLUDED
 #define AGG_SVG_PATH_RENDERER_INCLUDED
 
-#include "agg_path_storage.h"
-#include "agg_conv_transform.h"
-#include "agg_conv_stroke.h"
-#include "agg_conv_contour.h"
-#include "agg_conv_curve.h"
-#include "agg_color_rgba.h"
-#include "agg_renderer_scanline.h"
-#include "agg_bounding_rect.h"
-#include "agg_rasterizer_scanline_aa.h"
+#include "../include/agg_path_storage.h"
+#include "../include/agg_conv_transform.h"
+#include "../include/agg_conv_stroke.h"
+#include "../include/agg_conv_contour.h"
+#include "../include/agg_conv_curve.h"
+#include "../include/agg_color_rgba.h"
+#include "../include/agg_renderer_scanline.h"
+#include "../include/agg_bounding_rect.h"
+#include "../include/agg_rasterizer_scanline_aa.h"
 #include "agg_svg_path_tokenizer.h"
 
 namespace mapserver



More information about the mapserver-commits mailing list