babl r351 - in trunk: . extensions
- From: ok svn gnome org
- To: svn-commits-list gnome org
- Subject: babl r351 - in trunk: . extensions
- Date: Tue, 4 Nov 2008 00:04:23 +0000 (UTC)
Author: ok
Date: Tue Nov 4 00:04:23 2008
New Revision: 351
URL: http://svn.gnome.org/viewvc/babl?rev=351&view=rev
Log:
* extensions/gegl-fixups.c: (conv_rgbaF_rgbAF), (init): added missing,
needed conversion.
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 Tue Nov 4 00:04:23 2008
@@ -439,6 +439,30 @@
}
+static long
+conv_rgbaF_rgbAF (unsigned char *srcc,
+ unsigned char *dstc,
+ long samples)
+{
+ float *src = (void *) srcc;
+ float *dst = (void *) dstc;
+ long n = samples;
+
+ while (n--)
+ {
+ float alpha = src[3];
+ dst[0] = src[0] * alpha;
+ dst[1] = src[1] * alpha;
+ dst[2] = src[2] * alpha;
+ dst[3] = alpha;
+ src += 4;
+ dst += 4;
+ }
+ return samples;
+}
+
+
+
#define conv_rgb8_rgbAF conv_rgb8_rgbaF
int init (void);
@@ -501,6 +525,7 @@
#define o(src, dst) \
babl_conversion_new (src, dst, "linear", conv_ ## src ## _ ## dst, NULL)
+ o (rgbaF, rgbAF);
o (rgb8, rgbaF);
o (rgb8, rgbAF);
o (rgba8, rgbaF);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]