[mapserver-commits] r12654 - trunk/mapserver/mapcache/src
svn at osgeo.org
svn at osgeo.org
Mon Oct 10 08:05:08 EDT 2011
Author: tbonfort
Date: 2011-10-10 05:05:08 -0700 (Mon, 10 Oct 2011)
New Revision: 12654
Modified:
trunk/mapserver/mapcache/src/imageio_png.c
Log:
shortcut png transform when alpha == 255
Modified: trunk/mapserver/mapcache/src/imageio_png.c
===================================================================
--- trunk/mapserver/mapcache/src/imageio_png.c 2011-10-10 10:09:51 UTC (rev 12653)
+++ trunk/mapserver/mapcache/src/imageio_png.c 2011-10-10 12:05:08 UTC (rev 12654)
@@ -183,6 +183,11 @@
alpha = (pixel & 0xff000000) >> 24;
if (alpha == 0) {
b[0] = b[1] = b[2] = b[3] = 0;
+ } else if (alpha == 255) {
+ b[0] = (pixel & 0xff0000) >> 16;
+ b[1] = (pixel & 0x00ff00) >> 8;
+ b[2] = (pixel & 0x0000ff) >> 0;
+ b[3] = 255;
} else {
b[0] = (((pixel & 0xff0000) >> 16) * 255 + alpha / 2) / alpha;
b[1] = (((pixel & 0x00ff00) >> 8) * 255 + alpha / 2) / alpha;
More information about the mapserver-commits
mailing list