MCPcopy Index your code
hub / github.com/MapServer/MapServer / msCreateDefaultOutputFormat

Function msCreateDefaultOutputFormat

mapoutput.c:157–387  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

155/************************************************************************/
156
157outputFormatObj *msCreateDefaultOutputFormat( mapObj *map,
158 const char *driver,
159 const char *name )
160
161{
162 outputFormatObj *format = NULL;
163
164 if( strcasecmp(driver,"GD/PC256") == 0 )
165 {
166#ifdef USE_GD_GIF
167 return msCreateDefaultOutputFormat( map, "GD/GIF", "gif" );
168#elif defined(USE_GD_PNG)
169 return msCreateDefaultOutputFormat( map, "GD/PNG", "gdpng" );
170#else
171 return NULL;
172#endif
173 }
174
175#ifdef USE_GD_GIF
176 if( strcasecmp(driver,"GD/GIF") == 0 )
177 {
178 if(!name) name="gif";
179 format = msAllocOutputFormat( map, name, driver );
180 format->mimetype = msStrdup("image/gif");
181 format->imagemode = MS_IMAGEMODE_PC256;
182 format->extension = msStrdup("gif");
183 format->renderer = MS_RENDER_WITH_GD;
184 }
185#endif
186
187#ifdef USE_GD_PNG
188 if( strcasecmp(driver,"GD/PNG") == 0 )
189 {
190 if(!name) name="gdpng";
191 format = msAllocOutputFormat( map, name, driver );
192 format->mimetype = msStrdup("image/png");
193 format->imagemode = MS_IMAGEMODE_PC256;
194 format->extension = msStrdup("png");
195 format->renderer = MS_RENDER_WITH_GD;
196 }
197#endif /* USE_GD_PNG */
198
199 if( strcasecmp(driver,"AGG/PNG") == 0 )
200 {
201 if(!name) name="png24";
202 format = msAllocOutputFormat( map, name, driver );
203 format->mimetype = msStrdup("image/png");
204 format->imagemode = MS_IMAGEMODE_RGB;
205 format->extension = msStrdup("png");
206 format->renderer = MS_RENDER_WITH_AGG;
207 }
208
209 if( strcasecmp(driver,"AGG/PNG8") == 0 )
210 {
211 if(!name) name="png8";
212 format = msAllocOutputFormat( map, name, driver );
213 format->mimetype = msStrdup("image/png; mode=8bit");
214 format->imagemode = MS_IMAGEMODE_RGB;

Callers 4

msSelectOutputFormatFunction · 0.85
loadOutputFormatFunction · 0.85
msWriteErrorImageFunction · 0.85

Calls 9

strcasecmpFunction · 0.85
msAllocOutputFormatFunction · 0.85
msStrdupFunction · 0.85
msSetOutputFormatOptionFunction · 0.85
strdupFunction · 0.85
strncasecmpFunction · 0.85
msFreeOutputFormatFunction · 0.85

Tested by

no test coverage detected