1
/******************************************************************************
5
* Purpose: MapCache tile caching support file: Mapserver Mapfile datasource
6
* Author: Thomas Bonfort and the MapServer team.
8
******************************************************************************
9
* Copyright (c) 1996-2011 Regents of the University of Minnesota.
11
* Permission is hereby granted, free of charge, to any person obtaining a
12
* copy of this software and associated documentation files (the "Software"),
13
* to deal in the Software without restriction, including without limitation
14
* the rights to use, copy, modify, merge, publish, distribute, sublicense,
15
* and/or sell copies of the Software, and to permit persons to whom the
16
* Software is furnished to do so, subject to the following conditions:
18
* The above copyright notice and this permission notice shall be included in
19
* all copies of this Software or works derived from this Software.
21
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
22
* OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
23
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
24
* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
25
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
26
* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
27
* DEALINGS IN THE SOFTWARE.
28
*****************************************************************************/
33
#include <apr_tables.h>
34
#include <apr_strings.h>
37
* \private \memberof mapcache_source_dummy
38
* \sa mapcache_source::render_map()
40
void _mapcache_source_dummy_render_map(mapcache_context *ctx, mapcache_map *map)
42
map->raw_image = mapcache_image_create(ctx);
43
map->raw_image->w = map->width;
44
map->raw_image->h = map->height;
45
map->raw_image->stride = 4 * map->width;
46
map->raw_image->data = malloc(map->width*map->height*4);
47
memset(map->raw_image->data,255,map->width*map->height*4);
48
apr_pool_cleanup_register(ctx->pool, map->raw_image->data,(void*)free, apr_pool_cleanup_null);
51
void _mapcache_source_dummy_query(mapcache_context *ctx, mapcache_feature_info *fi)
53
ctx->set_error(ctx,500,"dummy source does not support queries");
57
* \private \memberof mapcache_source_dummy
58
* \sa mapcache_source::configuration_parse()
60
void _mapcache_source_dummy_configuration_parse_xml(mapcache_context *ctx, ezxml_t node, mapcache_source *source)
65
* \private \memberof mapcache_source_dummy
66
* \sa mapcache_source::configuration_check()
68
void _mapcache_source_dummy_configuration_check(mapcache_context *ctx, mapcache_cfg *cfg,
69
mapcache_source *source)
73
mapcache_source* mapcache_source_dummy_create(mapcache_context *ctx)
75
mapcache_source_dummy *source = apr_pcalloc(ctx->pool, sizeof(mapcache_source_dummy));
77
ctx->set_error(ctx, 500, "failed to allocate dummy source");
80
mapcache_source_init(ctx, &(source->source));
81
source->source.type = MAPCACHE_SOURCE_DUMMY;
82
source->source.render_map = _mapcache_source_dummy_render_map;
83
source->source.configuration_check = _mapcache_source_dummy_configuration_check;
84
source->source.configuration_parse_xml = _mapcache_source_dummy_configuration_parse_xml;
85
source->source.query_info = _mapcache_source_dummy_query;
86
return (mapcache_source*)source;
90
/* vim: ts=2 sts=2 et sw=2