merge r1492 from 0.7 branch into trunk

This commit is contained in:
Dane Springmeyer 2009-12-15 22:16:39 +00:00
parent f60fa76242
commit 0ccdac028e

View file

@ -369,13 +369,12 @@ namespace mapnik
unsigned g0 = (rgba0 >> 16 ) & 0xff;
unsigned b0 = (rgba0 >> 8) & 0xff;
unsigned a = (a1 * 255 + (255 - a1) * a0 + 127)/255;
r0 = uint8_t(((r1 - r0) * a1 + (r0 << 8)) >> 8);
g0 = uint8_t(((g1 - g0) * a1 + (g0 << 8)) >> 8);
b0 = uint8_t(((b1 - b0) * a1 + (b0 << 8)) >> 8);
a0 = uint8_t((a1 + a0) - ((a1 * a0 + 255) >> 8));
r0 = (r1*a1 + (((255 - a1) * a0 + 127)/255) * r0 + 127)/a;
g0 = (g1*a1 + (((255 - a1) * a0 + 127)/255) * g0 + 127)/a;
b0 = (b1*a1 + (((255 - a1) * a0 + 127)/255) * b0 + 127)/a;
row_to[x] = (a)| (b0 << 8) | (g0 << 16) | (r0 << 24) ;
row_to[x] = (a0)| (b0 << 8) | (g0 << 16) | (r0 << 24) ;
#else
unsigned a1 = int( ((rgba1 >> 24) & 0xff) * opacity );
if (a1 == 0) continue;
@ -388,13 +387,12 @@ namespace mapnik
unsigned g0 = (rgba0 >> 8 ) & 0xff;
unsigned b0 = (rgba0 >> 16) & 0xff;
unsigned a = (a1 * 255 + (255 - a1) * a0 + 127)/255;
r0 = (r1*a1 + (((255 - a1) * a0 + 127)/255) * r0 + 127)/a;
g0 = (g1*a1 + (((255 - a1) * a0 + 127)/255) * g0 + 127)/a;
b0 = (b1*a1 + (((255 - a1) * a0 + 127)/255) * b0 + 127)/a;
row_to[x] = (a << 24)| (b0 << 16) | (g0 << 8) | (r0) ;
r0 = uint8_t(((r1 - r0) * a1 + (r0 << 8)) >> 8);
g0 = uint8_t(((g1 - g0) * a1 + (g0 << 8)) >> 8);
b0 = uint8_t(((b1 - b0) * a1 + (b0 << 8)) >> 8);
a0 = uint8_t((a1 + a0) - ((a1 * a0 + 255) >> 8));
row_to[x] = (a0 << 24)| (b0 << 16) | (g0 << 8) | (r0) ;
#endif
}
}