[babl] extensions: add a Y' u8 to RGBA float conversion
- From: Øyvind "pippin" Kolås <ok src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [babl] extensions: add a Y' u8 to RGBA float conversion
- Date: Mon, 19 Aug 2019 01:20:06 +0000 (UTC)
commit c010010848fabb500e6a65af6be329b4c9482af3
Author: Øyvind Kolås <pippin gimp org>
Date: Mon Aug 19 03:19:39 2019 +0200
extensions: add a Y' u8 to RGBA float conversion
extensions/gegl-fixups.c | 35 +++++++++++++++++++++++++++++++++++
1 file changed, 35 insertions(+)
---
diff --git a/extensions/gegl-fixups.c b/extensions/gegl-fixups.c
index e38d73f6d..45888ce65 100644
--- a/extensions/gegl-fixups.c
+++ b/extensions/gegl-fixups.c
@@ -317,6 +317,34 @@ conv_rgba8_rgbaF (const Babl *conversion,
}
}
+static void
+conv_ga8_rgbaF (const Babl *conversion,
+ unsigned char *src,
+ unsigned char *dst,
+ long samples)
+{
+ long n = samples;
+
+ while (n--)
+ {
+ float gray = table_8g_F[*(unsigned char *) src];
+ (*(float *) dst) = gray;
+ dst += 4;
+ src += 1;
+
+ (*(float *) dst) = gray;
+ dst += 4;
+
+ (*(float *) dst) = gray;
+ dst += 4;
+
+ (*(float *) dst) = table_8_F[*(unsigned char *) src];
+ dst += 4;
+ src += 1;
+ }
+}
+
+
static void
conv_rgb8_rgbaF (const Babl *conversion,
unsigned char *src,
@@ -567,6 +595,12 @@ init (void)
babl_component ("G'"),
babl_component ("B'"),
NULL);
+ const Babl *ga8 = babl_format_new (
+ babl_model ("Y'A"),
+ babl_type ("u8"),
+ babl_component ("Y'"),
+ babl_component ("A"),
+ NULL);
table_init ();
@@ -585,6 +619,7 @@ init (void)
o (rgbAF, rgb8);
o (bgrA8, rgba8);
o (rgba8, rgb8);
+ o (ga8, rgbaF);
return 0;
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]