[mapserver-commits] r10906 - trunk/mapserver

svn at osgeo.org svn at osgeo.org
Tue Jan 25 12:02:02 EST 2011


Author: tbonfort
Date: 2011-01-25 09:02:02 -0800 (Tue, 25 Jan 2011)
New Revision: 10906

Modified:
   trunk/mapserver/mapagg.cpp
Log:
implement offset and width/height when merging agg rasterbuffers


Modified: trunk/mapserver/mapagg.cpp
===================================================================
--- trunk/mapserver/mapagg.cpp	2011-01-24 20:53:33 UTC (rev 10905)
+++ trunk/mapserver/mapagg.cpp	2011-01-25 17:02:02 UTC (rev 10906)
@@ -622,12 +622,14 @@
 
 
 
-int agg2MergeRasterBuffer(imageObj *dest, rasterBufferObj *overlay, double opacity, int srcX, int srcY, int dstX, int dstY, int width, int height) {
+int agg2MergeRasterBuffer(imageObj *dest, rasterBufferObj *overlay, double opacity, int srcX, int srcY,
+      int dstX, int dstY, int width, int height) {
 	assert(overlay->type == MS_BUFFER_BYTE_RGBA);
 	rendering_buffer b(overlay->data.rgba.pixels, overlay->width, overlay->height, overlay->data.rgba.row_step);
 	pixel_format pf(b);
 	AGG2Renderer *r = AGG_RENDERER(dest);
-	r->m_renderer_base.blend_from(pf,0, dstX, dstY,unsigned(opacity * 255));
+   mapserver::rect_base<int> src_rect(srcX,srcY,srcX+width,srcY+height);
+	r->m_renderer_base.blend_from(pf,&src_rect, dstX, dstY,unsigned(opacity * 255));
 	return MS_FAILURE;
 }
 



More information about the mapserver-commits mailing list