[mapserver-commits] r9881 - trunk/mapserver
svn at osgeo.org
svn at osgeo.org
Tue Feb 23 11:36:12 EST 2010
Author: sdlime
Date: 2010-02-23 11:36:12 -0500 (Tue, 23 Feb 2010)
New Revision: 9881
Modified:
trunk/mapserver/mapoutput.c
trunk/mapserver/mapserver.h
Log:
Added references to gd2 output format.
Modified: trunk/mapserver/mapoutput.c
===================================================================
--- trunk/mapserver/mapoutput.c 2010-02-23 16:21:17 UTC (rev 9880)
+++ trunk/mapserver/mapoutput.c 2010-02-23 16:36:12 UTC (rev 9881)
@@ -1,3 +1,4 @@
+
/******************************************************************************
* $Id$
*
@@ -152,6 +153,14 @@
format->extension = strdup("gif");
format->renderer = MS_RENDER_WITH_GD;
}
+ if( strcasecmp(driver,"GD2/GIF") == 0 )
+ {
+ format = msAllocOutputFormat( map, "gif2", driver );
+ format->mimetype = strdup("image/gif");
+ format->imagemode = MS_IMAGEMODE_PC256;
+ format->extension = strdup("gif");
+ format->renderer = MS_RENDER_WITH_GD2;
+ }
#endif
#ifdef USE_GD_PNG
@@ -163,9 +172,16 @@
format->extension = strdup("png");
format->renderer = MS_RENDER_WITH_GD;
}
+ if( strcasecmp(driver,"GD2/PNG") == 0 )
+ {
+ format = msAllocOutputFormat( map, "png2", driver );
+ format->mimetype = strdup("image/png");
+ format->imagemode = MS_IMAGEMODE_PC256;
+ format->extension = strdup("png");
+ format->renderer = MS_RENDER_WITH_GD2;
+ }
#endif /* USE_GD_PNG */
-
#if defined(USE_GD_PNG) && GD2_VERS > 1
if( strcasecmp(driver,"GD/PNG24") == 0 )
{
@@ -186,6 +202,14 @@
format->extension = strdup("jpg");
format->renderer = MS_RENDER_WITH_GD;
}
+ if( strcasecmp(driver,"GD2/JPEG") == 0 )
+ {
+ format = msAllocOutputFormat( map, "jpeg2", driver );
+ format->mimetype = strdup("image/jpeg");
+ format->imagemode = MS_IMAGEMODE_PC256; // ???
+ format->extension = strdup("jpg");
+ format->renderer = MS_RENDER_WITH_GD2;
+ }
#endif
#ifdef USE_GD_WBMP
if( strcasecmp(driver,"GD/WBMP") == 0 )
@@ -373,15 +397,21 @@
if( msSelectOutputFormat( map, "gif" ) == NULL )
msCreateDefaultOutputFormat( map, "GD/GIF" );
+ if( msSelectOutputFormat( map, "gif2" ) == NULL )
+ msCreateDefaultOutputFormat( map, "GD2/GIF" );
if( msSelectOutputFormat( map, "png" ) == NULL )
msCreateDefaultOutputFormat( map, "GD/PNG" );
+ if( msSelectOutputFormat( map, "png2" ) == NULL )
+ msCreateDefaultOutputFormat( map, "GD2/PNG" );
if( msSelectOutputFormat( map, "png24" ) == NULL )
msCreateDefaultOutputFormat( map, "GD/PNG24" );
if( msSelectOutputFormat( map, "jpeg" ) == NULL )
msCreateDefaultOutputFormat( map, "GD/JPEG" );
+ if( msSelectOutputFormat( map, "jpeg2" ) == NULL )
+ msCreateDefaultOutputFormat( map, "GD2/JPEG" );
if( msSelectOutputFormat( map, "wbmp" ) == NULL )
msCreateDefaultOutputFormat( map, "GD/WBMP" );
@@ -1065,6 +1095,8 @@
switch(format->renderer) {
case MS_RENDER_WITH_AGG2:
return msPopulateRendererVTableAGG(format->vtable);
+ case MS_RENDER_WITH_GD2:
+ return msPopulateRendererVTableGD(format->vtable);
case MS_RENDER_WITH_CAIRO_RASTER:
return msPopulateRendererVTableCairoRaster(format->vtable);
case MS_RENDER_WITH_CAIRO_PDF:
Modified: trunk/mapserver/mapserver.h
===================================================================
--- trunk/mapserver/mapserver.h 2010-02-23 16:21:17 UTC (rev 9880)
+++ trunk/mapserver/mapserver.h 2010-02-23 16:36:12 UTC (rev 9881)
@@ -323,6 +323,7 @@
#define MS_IMAGE_EXTENSION(format) (format->extension ? format->extension : "unknown")
#define MS_DRIVER_GD(format) (strncasecmp((format)->driver,"gd/",3)==0)
+#define MS_DRIVER_GD2(format) (strncasecmp((format)->driver,"gd2/",4)==0)
#define MS_DRIVER_SWF(format) (strncasecmp((format)->driver,"swf",3)==0)
#define MS_DRIVER_GDAL(format) (strncasecmp((format)->driver,"gdal/",5)==0)
#define MS_DRIVER_PDF(format) (strncasecmp((format)->driver,"pdf",3)==0)
@@ -347,6 +348,7 @@
#define MS_RENDER_WITH_CAIRO_SVG 11
#define MS_RENDER_WITH_OGL 12
#define MS_RENDER_WITH_AGG2 13
+#define MS_RENDER_WITH_GD2 14
#define MS_RENDERER_GD(format) ((format)->renderer == MS_RENDER_WITH_GD)
#define MS_RENDERER_SWF(format) ((format)->renderer == MS_RENDER_WITH_SWF)
@@ -2621,6 +2623,7 @@
MS_DLL_EXPORT int msPopulateRendererVTableCairoPDF( rendererVTableObj *renderer );
MS_DLL_EXPORT int msPopulateRendererVTableOGL( rendererVTableObj *renderer );
MS_DLL_EXPORT int msPopulateRendererVTableAGG( rendererVTableObj *renderer );
+MS_DLL_EXPORT int msPopulateRendererVTableGD( rendererVTableObj *renderer );
//allocate 50k for starters
#define MS_DEFAULT_BUFFER_ALLOC 50000
More information about the mapserver-commits
mailing list