[mapserver-commits] r12148 - trunk/mapserver/mapcache/src

svn at osgeo.org svn at osgeo.org
Fri Aug 26 07:01:54 EDT 2011


Author: tbonfort
Date: 2011-08-26 04:01:54 -0700 (Fri, 26 Aug 2011)
New Revision: 12148

Modified:
   trunk/mapserver/mapcache/src/image.c
   trunk/mapserver/mapcache/src/imageio_png.c
Log:
add preliminary fastcgi implementation
thomas.bonfort | 2010-11-03 19:25:09 +0100 (Wed, 03 Nov 2010)

Modified: trunk/mapserver/mapcache/src/image.c
===================================================================
--- trunk/mapserver/mapcache/src/image.c	2011-08-26 11:01:49 UTC (rev 12147)
+++ trunk/mapserver/mapcache/src/image.c	2011-08-26 11:01:54 UTC (rev 12148)
@@ -49,7 +49,7 @@
                bptr[0] = (unsigned char)(((or - br)*oa + (br << 8)) >> 8);
                bptr[1] = (unsigned char)(((og - bg)*oa + (bg << 8)) >> 8);
                bptr[2] = (unsigned char)(((ob - bb)*oa + (bb << 8)) >> 8);
-               bptr[3] = (unsigned char)((oa + ba) - ((oa * ba + 255) >> 8));                        
+               bptr[3] = (ba==255)?255:(unsigned char)((oa + ba) - ((oa * ba + 255) >> 8));                        
             }
          }
          bptr+=4;optr+=4;

Modified: trunk/mapserver/mapcache/src/imageio_png.c
===================================================================
--- trunk/mapserver/mapcache/src/imageio_png.c	2011-08-26 11:01:49 UTC (rev 12147)
+++ trunk/mapserver/mapcache/src/imageio_png.c	2011-08-26 11:01:54 UTC (rev 12148)
@@ -975,16 +975,9 @@
 
    for (x = 0; x < numPaletteEntries; ++x) {
       a[remap[x]] = palette[x].a;
-      if(a[remap[x]] == 255) {
-         rgb[remap[x]].r = palette[x].r;
-         rgb[remap[x]].g = palette[x].g;
-         rgb[remap[x]].b = palette[x].b;
-      } else {
-         double da = a[remap[x]]/255.0;
-         rgb[remap[x]].r = palette[x].r / da;
-         rgb[remap[x]].g = palette[x].g / da;
-         rgb[remap[x]].b = palette[x].b / da;
-      }
+      rgb[remap[x]].r = palette[x].r;
+      rgb[remap[x]].g = palette[x].g;
+      rgb[remap[x]].b = palette[x].b;
    }
 
    return GEOCACHE_SUCCESS;



More information about the mapserver-commits mailing list