[babl] cairo: move CMYK extension formats here
- From: Øyvind "pippin" Kolås <ok src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [babl] cairo: move CMYK extension formats here
- Date: Mon, 3 Dec 2018 23:12:26 +0000 (UTC)
commit 690169bb68089247f0b096a431db891a1855e3ea
Author: Øyvind Kolås <pippin gimp org>
Date: Tue Dec 4 00:04:45 2018 +0100
cairo: move CMYK extension formats here
This adds new endian-aware formats cairo-ACMK32 and cairo-ACKY32 which are
derived from babl_format("camayakaA u8") - converting succesively with these
two formats to this format or other sharing the model permits rebuilding a
complete CMYKA image.
extensions/cairo.c | 66 +++++++++++++++++++++++++++++++++++++++++++++++++
extensions/naive-CMYK.c | 52 --------------------------------------
2 files changed, 66 insertions(+), 52 deletions(-)
---
diff --git a/extensions/cairo.c b/extensions/cairo.c
index 9a96fc3..e10f384 100644
--- a/extensions/cairo.c
+++ b/extensions/cairo.c
@@ -529,5 +529,71 @@ init (void)
NULL
);
+
+ /* formats that distribute different subset of the additive mixing variants
+ * of CMYK producing two syntetic RGB formats we run in parallel to derive
+ * a 4 instead of 3 component result, the same method could be used to
+ * extend processing/drawing with cairo to spectral data.
+ */
+ if (littleendian)
+ {
+ babl_format_new ("name", "cairo-ACMK32",
+ babl_model ("camayakaA"),
+ babl_type ("u8"),
+ babl_component ("ka"),
+ babl_component ("ma"),
+ babl_component ("ca"),
+ babl_component ("A"),
+ NULL);
+ babl_format_new ("name", "cairo-ACKY32",
+ babl_model ("camayakaA"),
+ babl_type ("u8"),
+ babl_component ("ya"),
+ babl_component ("ka"),
+ babl_component ("ca"),
+ babl_component ("A"),
+ NULL);
+ }
+ else
+ {
+ babl_format_new ("name", "cairo-ACMK32",
+ babl_model ("camayakaA"),
+ babl_type ("u8"),
+ babl_component ("A"),
+ babl_component ("ca"),
+ babl_component ("ma"),
+ babl_component ("ka"),
+ NULL);
+ babl_format_new ("name", "cairo-ACKY32",
+ babl_model ("camayakaA"),
+ babl_type ("u8"),
+ babl_component ("A"),
+ babl_component ("ca"),
+ babl_component ("ka"),
+ babl_component ("ya"),
+ NULL);
+ }
+
+ /* companion subset formats for setting pango u16 RGB color values from cmykA
+ * */
+ babl_format_new ("name", "ckyA u16",
+ babl_model ("cmykA"),
+ babl_type ("u16"),
+ babl_component ("cyan"),
+ babl_component ("key"),
+ babl_component ("yellow"),
+ babl_component ("A"),
+ NULL);
+ babl_format_new ("name", "cmkA u16",
+ babl_model ("cmykA"),
+ babl_type ("u16"),
+ babl_component ("cyan"),
+ babl_component ("magenta"),
+ babl_component ("key"),
+ babl_component ("A"),
+ NULL);
+
+
+
return 0;
}
diff --git a/extensions/naive-CMYK.c b/extensions/naive-CMYK.c
index 1e1c905..de93fa8 100644
--- a/extensions/naive-CMYK.c
+++ b/extensions/naive-CMYK.c
@@ -37,58 +37,6 @@ int init (void);
int
init (void)
{
- babl_format_new ("name", "ckyA u16",
- babl_model ("cmykA"),
- babl_type ("u16"),
- babl_component ("cyan"),
- babl_component ("key"),
- babl_component ("yellow"),
- babl_component ("A"),
- NULL);
- babl_format_new ("name", "cmkA u16",
- babl_model ("cmykA"),
- babl_type ("u16"),
- babl_component ("cyan"),
- babl_component ("magenta"),
- babl_component ("key"),
- babl_component ("A"),
- NULL);
-
- babl_format_new ("name", "camakaA u8",
- babl_model ("camayakaA"),
- babl_type ("u8"),
- babl_component ("ka"),
- babl_component ("ma"),
- babl_component ("ca"),
- babl_component ("A"),
- NULL);
- babl_format_new ("name", "cakayaA u8",
- babl_model ("camayakaA"),
- babl_type ("u8"),
- babl_component ("ya"),
- babl_component ("ka"),
- babl_component ("ca"),
- babl_component ("A"),
- NULL);
- babl_format_new ("name", "camaPadkaA u8",
- babl_model ("camayakaA"),
- babl_type ("u8"),
- babl_component ("ca"),
- babl_component ("ma"),
- babl_component ("PAD"),
- babl_component ("ka"),
- babl_component ("A"),
- NULL);
- babl_format_new ("name", "caPadyakaA u8",
- babl_model ("camayakaA"),
- babl_type ("u8"),
- babl_component ("ca"),
- babl_component ("PAD"),
- babl_component ("ya"),
- babl_component ("ka"),
- babl_component ("A"),
- NULL);
-
return 0;
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]