[mapserver-commits] r10327 - sandbox/mapserver6

svn at osgeo.org svn at osgeo.org
Fri Jul 9 07:05:05 EDT 2010


Author: tbonfort
Date: 2010-07-09 11:05:04 +0000 (Fri, 09 Jul 2010)
New Revision: 10327

Modified:
   sandbox/mapserver6/mapcairo.c
   sandbox/mapserver6/mapresample.c
   sandbox/mapserver6/mapscale.c
Log:
resampled raster layers for vector (pdf,svg) renderers


Modified: sandbox/mapserver6/mapcairo.c
===================================================================
--- sandbox/mapserver6/mapcairo.c	2010-07-09 09:34:26 UTC (rev 10326)
+++ sandbox/mapserver6/mapcairo.c	2010-07-09 11:05:04 UTC (rev 10327)
@@ -826,12 +826,12 @@
 	rb->height = height;
 	rb->data.rgba.pixel_step = 4;
 	rb->data.rgba.row_step = width * 4;
-	rb->data.rgba.pixels = (unsigned char*)malloc(width*height*4);
+	rb->data.rgba.pixels = (unsigned char*)calloc(width*height*4,sizeof(unsigned char));
 	rb->data.rgba.r = &(rb->data.rgba.pixels[2]);
 	rb->data.rgba.g = &(rb->data.rgba.pixels[1]);
 	rb->data.rgba.b = &(rb->data.rgba.pixels[0]);
 	rb->data.rgba.a = &(rb->data.rgba.pixels[3]);
-    return MS_SUCCESS;
+   return MS_SUCCESS;
 }
 
 #endif /*USE_CAIRO*/

Modified: sandbox/mapserver6/mapresample.c
===================================================================
--- sandbox/mapserver6/mapresample.c	2010-07-09 09:34:26 UTC (rev 10326)
+++ sandbox/mapserver6/mapresample.c	2010-07-09 11:05:04 UTC (rev 10327)
@@ -1540,15 +1540,12 @@
 
     if( MS_RENDERER_PLUGIN( srcImage->format ) )
     {
-        if( srcImage->format->vtable->supports_pixel_buffer )
+        psrc_rb = &src_rb;
+        memset( psrc_rb, 0, sizeof(rasterBufferObj) ); if( srcImage->format->vtable->supports_pixel_buffer )
         {
-        	psrc_rb = &src_rb;
-        	memset( psrc_rb, 0, sizeof(rasterBufferObj) );
-            srcImage->format->vtable->getRasterBufferHandle( srcImage, psrc_rb );
+        	  srcImage->format->vtable->getRasterBufferHandle( srcImage, psrc_rb );
         } else {
-        	//FIXME: create temp rasterBuffer
-        	msSetError(MS_MISCERR,"msResampleGDALToMap not implemented for non raster renderers","msResampleGDALToMap()");
-        	return MS_FAILURE;
+           srcImage->format->vtable->initializeRasterBuffer(psrc_rb,nLoadImgXSize, nLoadImgYSize,MS_IMAGEMODE_RGBA);
         }
     }
 

Modified: sandbox/mapserver6/mapscale.c
===================================================================
--- sandbox/mapserver6/mapscale.c	2010-07-09 09:34:26 UTC (rev 10326)
+++ sandbox/mapserver6/mapscale.c	2010-07-09 11:05:04 UTC (rev 10327)
@@ -175,7 +175,7 @@
   }
 
   rendererVTableObj *renderer = MS_MAP_RENDERER(map);
-  if(!renderer) {
+  if(!renderer || !MS_MAP_RENDERER(map)->supports_pixel_buffer) {
 	msSetError(MS_MISCERR, "Outputformat not supported for scalebar", "msDrawScalebar()");
 	return(NULL);
   }



More information about the mapserver-commits mailing list