[mapserver-commits] r11440 - trunk/mapserver
svn at osgeo.org
svn at osgeo.org
Fri Apr 1 04:00:05 EDT 2011
Author: tbonfort
Date: 2011-04-01 01:00:05 -0700 (Fri, 01 Apr 2011)
New Revision: 11440
Modified:
trunk/mapserver/HISTORY.TXT
trunk/mapserver/mapagg.cpp
trunk/mapserver/mapcairo.c
trunk/mapserver/mapdummyrenderer.c
trunk/mapserver/mapgd.c
trunk/mapserver/mapkml.cpp
trunk/mapserver/maprendering.c
Log:
add brushed line support for agg renderer (#3792)
fix bug with marker symbols along offset line
Modified: trunk/mapserver/HISTORY.TXT
===================================================================
--- trunk/mapserver/HISTORY.TXT 2011-04-01 07:03:37 UTC (rev 11439)
+++ trunk/mapserver/HISTORY.TXT 2011-04-01 08:00:05 UTC (rev 11440)
@@ -14,6 +14,11 @@
Current Version (SVN trunk):
----------------------------
+
+- add brushed line support for agg renderer (#3792)
+
+- fix bug with marker symbols along offset line
+
- fix for the cluster layer returning invalid feature count (#3794)
- remove some compiler warnings
Modified: trunk/mapserver/mapagg.cpp
===================================================================
--- trunk/mapserver/mapagg.cpp 2011-04-01 07:03:37 UTC (rev 11439)
+++ trunk/mapserver/mapagg.cpp 2011-04-01 08:00:05 UTC (rev 11440)
@@ -53,6 +53,11 @@
#include "renderers/agg/include/agg_conv_contour.h"
#include "renderers/agg/include/agg_ellipse.h"
+#include "renderers/agg/include/agg_rasterizer_outline_aa.h"
+#include "renderers/agg/include/agg_renderer_outline_aa.h"
+#include "renderers/agg/include/agg_renderer_outline_image.h"
+#include "renderers/agg/include/agg_span_pattern_rgba.h"
+#include "renderers/agg/include/agg_span_image_filter_rgba.h"
#include "renderers/agg/include/agg_glyph_raster_bin.h"
#include "renderers/agg/include/agg_renderer_raster_text.h"
#include "renderers/agg/include/agg_embedded_raster_fonts.h"
@@ -189,8 +194,23 @@
}
int agg2RenderLineTiled(imageObj *img, shapeObj *p, imageObj * tile) {
- msSetError(MS_AGGERR, "renderLineTiled not implemented", "aggRenderLineTiled()");
- return MS_FAILURE;
+
+ mapserver::pattern_filter_bilinear_rgba8 fltr;
+ typedef mapserver::line_image_pattern<mapserver::pattern_filter_bilinear_rgba8> pattern_type;
+ typedef mapserver::renderer_outline_image<renderer_base, pattern_type> renderer_img_type;
+ typedef mapserver::rasterizer_outline_aa<renderer_img_type, mapserver::line_coord_sat> rasterizer_img_type;
+ pattern_type patt(fltr);
+
+ AGG2Renderer *r = AGG_RENDERER(img);
+ AGG2Renderer *tileRenderer = AGG_RENDERER(tile);
+
+ line_adaptor lines(p);
+
+ patt.create(tileRenderer->m_pixel_format);
+ renderer_img_type ren_img(r->m_renderer_base, patt);
+ rasterizer_img_type ras_img(ren_img);
+ ras_img.add_path(lines);
+ return MS_SUCCESS;
}
int agg2RenderPolygon(imageObj *img, shapeObj *p, colorObj * color) {
Modified: trunk/mapserver/mapcairo.c
===================================================================
--- trunk/mapserver/mapcairo.c 2011-04-01 07:03:37 UTC (rev 11439)
+++ trunk/mapserver/mapcairo.c 2011-04-01 08:00:05 UTC (rev 11440)
@@ -794,6 +794,7 @@
initializeCache(&MS_RENDERER_CACHE(renderer));
renderer->startLayer = startLayerRasterCairo;
renderer->endLayer = closeLayerRasterCairo;
+ renderer->renderLineTiled = NULL;
renderer->renderLine=&renderLineCairo;
renderer->createImage=&createImageCairo;
renderer->saveImage=&saveImageCairo;
@@ -831,6 +832,7 @@
renderer->startLayer = startLayerVectorCairo;
renderer->endLayer = closeLayerVectorCairo;
renderer->renderLine=&renderLineCairo;
+ renderer->renderLineTiled = NULL;
renderer->createImage=&createImageCairo;
renderer->saveImage=&saveImageCairo;
renderer->getRasterBufferHandle=&getRasterBufferHandleCairo;
Modified: trunk/mapserver/mapdummyrenderer.c
===================================================================
--- trunk/mapserver/mapdummyrenderer.c 2011-04-01 07:03:37 UTC (rev 11439)
+++ trunk/mapserver/mapdummyrenderer.c 2011-04-01 08:00:05 UTC (rev 11440)
@@ -231,6 +231,7 @@
renderer->startLayer = &startLayerDummy;
renderer->endLayer = &endLayerDummy;
renderer->renderLine=&renderLineDummy;
+ renderer->renderLineTiled = NULL;
renderer->createImage=&createImageDummy;
renderer->saveImage=&saveImageDummy;
renderer->getRasterBufferHandle=&getRasterBufferHandleDummy;
Modified: trunk/mapserver/mapgd.c
===================================================================
--- trunk/mapserver/mapgd.c 2011-04-01 07:03:37 UTC (rev 11439)
+++ trunk/mapserver/mapgd.c 2011-04-01 08:00:05 UTC (rev 11440)
@@ -924,6 +924,7 @@
renderer->startLayer = startNewLayerGD;
renderer->endLayer = closeNewLayerGD;
+ renderer->renderLineTiled = NULL;
renderer->renderLine = &renderLineGD;
renderer->createImage = &createImageGD;
renderer->saveImage = &saveImageGD;
Modified: trunk/mapserver/mapkml.cpp
===================================================================
--- trunk/mapserver/mapkml.cpp 2011-04-01 07:03:37 UTC (rev 11439)
+++ trunk/mapserver/mapkml.cpp 2011-04-01 08:00:05 UTC (rev 11440)
@@ -239,7 +239,7 @@
renderer->getTruetypeTextBBox = &msGetTruetypeTextBBoxKml;
renderer->renderTile = &msRenderTileKml;
renderer->renderPolygonTiled = &msRenderPolygonTiledKml;
- renderer->renderLineTiled = &msRenderLineTiledKml;
+ renderer->renderLineTiled = NULL;
renderer->freeSymbol = &msFreeSymbolKml;
renderer->freeImage=&msFreeImageKml;
renderer->mergeRasterBuffer = msMergeRasterBufferKml;
Modified: trunk/mapserver/maprendering.c
===================================================================
--- trunk/mapserver/maprendering.c 2011-04-01 07:03:37 UTC (rev 11439)
+++ trunk/mapserver/maprendering.c 2011-04-01 08:00:05 UTC (rev 11440)
@@ -445,13 +445,28 @@
//compute a markerStyle and use it on the line
if(style->gap<0) {
//special function that treats any other symbol used as a marker, not a brush
- msImagePolylineMarkers(image,p,symbol,&s,-s.gap,1);
+ msImagePolylineMarkers(image,offsetLine,symbol,&s,-s.gap,1);
}
else if(style->gap>0) {
- msImagePolylineMarkers(image,p,symbol,&s,s.gap,0);
+ msImagePolylineMarkers(image,offsetLine,symbol,&s,s.gap,0);
} else {
- //void* tile = getTile(image, symbolset, &s);
- //r->renderLineTiled(image, theShape, tile);
+ if(renderer->renderLineTiled != NULL) {
+ int pw,ph;
+ if(s.scale != 1) {
+ pw = MS_NINT(symbol->sizex * s.scale)+1;
+ ph = MS_NINT(symbol->sizey * s.scale)+1;
+ } else {
+ pw = symbol->sizex;
+ ph = symbol->sizey;
+ }
+ if(pw<1) pw=1;
+ if(ph<1) ph=1;
+ imageObj* tile = getTile(image, symbol,&s,pw,ph,0);
+ renderer->renderLineTiled(image, p, tile);
+ } else {
+ msSetError(MS_RENDERERERR, "renderer does not support brushed lines", "msDrawLineSymbol()");
+ return MS_FAILURE;
+ }
}
}
More information about the mapserver-commits
mailing list