babl r354 - in trunk: . extensions
- From: ok svn gnome org
- To: svn-commits-list gnome org
- Subject: babl r354 - in trunk: . extensions
- Date: Sat, 8 Nov 2008 23:20:29 +0000 (UTC)
Author: ok
Date: Sat Nov 8 23:20:29 2008
New Revision: 354
URL: http://svn.gnome.org/viewvc/babl?rev=354&view=rev
Log:
* extensions/gegl-fixups.c: (conv_rgbAF_lrgba8): use the lookup tables
to speed up the conversion 8still error of 0.002677 though).
Modified:
trunk/ChangeLog
trunk/extensions/gegl-fixups.c
Modified: trunk/extensions/gegl-fixups.c
==============================================================================
--- trunk/extensions/gegl-fixups.c (original)
+++ trunk/extensions/gegl-fixups.c Sat Nov 8 23:20:29 2008
@@ -488,6 +488,7 @@
}
+
static long
conv_rgbAF_lrgba8 (unsigned char *srcc,
unsigned char *dstc,
@@ -500,13 +501,18 @@
while (n--)
{
float alpha = src[3];
- float recip = (1.0/alpha)*255.0;
+ float recip = (1.0/alpha);
if (alpha < 0.00001)
- recip = 0.0;
- dst[0] = (src[0] * recip);
- dst[1] = (src[1] * recip);
- dst[2] = (src[2] * recip);
- dst[3] = alpha*255.0;
+ {
+ dst[0] = dst[1] = dst[2] = dst[3] = 0;
+ }
+ else
+ {
+ dst[0] = table_F_8[gggl_float_to_index16 (src[0] * recip)];
+ dst[1] = table_F_8[gggl_float_to_index16 (src[1] * recip)];
+ dst[2] = table_F_8[gggl_float_to_index16 (src[2] * recip)];
+ dst[3] = table_F_8[gggl_float_to_index16 (alpha)];
+ }
src += 4;
dst += 4;
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]