[babl] extensions/double: adds some more paths
- From: Øyvind Kolås <ok src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [babl] extensions/double: adds some more paths
- Date: Sat, 7 Apr 2018 16:22:56 +0000 (UTC)
commit 01fa5373efab220e623b00639c8a7e682ab23485
Author: Øyvind Kolås <pippin gimp org>
Date: Sat Apr 7 17:52:02 2018 +0200
extensions/double: adds some more paths
extensions/double.c | 30 ++++++++++++++++++++++++++++++
1 files changed, 30 insertions(+), 0 deletions(-)
---
diff --git a/extensions/double.c b/extensions/double.c
index f592cb9..60765a9 100644
--- a/extensions/double.c
+++ b/extensions/double.c
@@ -195,6 +195,30 @@ conv_rgbD_gamma_rgbD_linear (const Babl *conversion,unsigned char *src,
}
}
+
+static INLINE void
+conv_rgbD_linear_rgbaD_linear (const Babl *conversion,unsigned char *src,
+ unsigned char *dst,
+ long samples)
+{
+ const Babl *space = babl_conversion_get_destination_space (conversion);
+ const Babl **trc = (void*)space->space.trc;
+ double *fsrc = (double *) src;
+ double *fdst = (double *) dst;
+ int n = samples;
+
+ while (n--)
+ {
+ *fdst++ = babl_trc_to_linear (trc[0], *fsrc++);
+ *fdst++ = babl_trc_to_linear (trc[1], *fsrc++);
+ *fdst++ = babl_trc_to_linear (trc[2], *fsrc++);
+ *fdst++ = 1.0;
+ }
+}
+
+
+#define conv_rgbD_gamma_rgbaD_gamma conv_rgbD_linear_rgbaD_linear
+
#define o(src, dst) \
babl_conversion_new (src, dst, "linear", conv_ ## src ## _ ## dst, NULL)
@@ -259,6 +283,12 @@ init (void)
o (rgbaD_linear, rgbD_linear);
o (rgbaD_gamma, rgbD_gamma);
+
+ o (rgbD_linear, rgbaD_linear);
+ o (rgbD_gamma, rgbaD_gamma);
+ o (rgbaD_linear, rgbD_linear);
+ o (rgbaD_gamma, rgbD_gamma);
+
return 0;
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]