[mapserver-commits] r12254 - trunk/mapserver/mapcache/src
svn at osgeo.org
svn at osgeo.org
Fri Aug 26 07:11:20 EDT 2011
Author: tbonfort
Date: 2011-08-26 04:11:20 -0700 (Fri, 26 Aug 2011)
New Revision: 12254
Modified:
trunk/mapserver/mapcache/src/image.c
Log:
add TileMatrixSetLimits and ows:Boundingbox to wmts capabilities
thomas.bonfort | 2011-01-17 12:12:58 +0100 (Mon, 17 Jan 2011)
Modified: trunk/mapserver/mapcache/src/image.c
===================================================================
--- trunk/mapserver/mapcache/src/image.c 2011-08-26 11:11:17 UTC (rev 12253)
+++ trunk/mapserver/mapcache/src/image.c 2011-08-26 11:11:20 UTC (rev 12254)
@@ -23,18 +23,20 @@
}
void geocache_image_merge(geocache_context *ctx, geocache_image *base, geocache_image *overlay) {
- int i,j;
+ int i,j,starti,startj;
unsigned char *browptr, *orowptr, *bptr, *optr;
- if(base->w != overlay->w || base->h != overlay->h) {
- ctx->set_error(ctx, GEOCACHE_IMAGE_ERROR, "attempting to merge images with different sizes");
+ if(base->w < overlay->w || base->h < overlay->h) {
+ ctx->set_error(ctx, GEOCACHE_IMAGE_ERROR, "attempting to merge an larger image onto another");
return;
}
- browptr = base->data;
+ starti = (base->h - overlay->h)/2;
+ startj = (base->w - overlay->w)/2;
+ browptr = base->data + starti * base->stride + startj*4;
orowptr = overlay->data;
- for(i=0;i<base->h;i++) {
+ for(i=0;i<overlay->h;i++) {
bptr = browptr;
optr = orowptr;
- for(j=0;j<base->w;j++) {
+ for(j=0;j<overlay->w;j++) {
if(optr[3]) { /* if overlay is not completely transparent */
if(optr[3] == 255) {
bptr[0]=optr[0];
More information about the mapserver-commits
mailing list