[gimp] libgimpcolor: gimp_color_profile_get_format: support premultiplied formats



commit 06aa05e422bf78f1f6a1168d91bbf72d86adf6ee
Author: Michael Natterer <mitch gimp org>
Date:   Wed Jun 8 00:00:36 2016 +0200

    libgimpcolor: gimp_color_profile_get_format: support premultiplied formats

 libgimpcolor/gimpcolorprofile.c |   29 ++++++++++++++++++-----------
 1 files changed, 18 insertions(+), 11 deletions(-)
---
diff --git a/libgimpcolor/gimpcolorprofile.c b/libgimpcolor/gimpcolorprofile.c
index 453b7f2..2983a10 100644
--- a/libgimpcolor/gimpcolorprofile.c
+++ b/libgimpcolor/gimpcolorprofile.c
@@ -1512,30 +1512,37 @@ gimp_color_profile_get_format (const Babl *format,
 
       return babl_format ("R'G'B'A u8");
     }
-  else if (model == babl_model ("RGB") ||
-           model == babl_model ("RGBA"))
+  else if (model == babl_model ("RGB")  ||
+           model == babl_model ("RGBA") ||
+           model == babl_model ("RaGaBaA"))
     {
       rgb    = TRUE;
       linear = TRUE;
     }
-  else if (model == babl_model ("R'G'B'") ||
-           model == babl_model ("R'G'B'A"))
+  else if (model == babl_model ("R'G'B'")  ||
+           model == babl_model ("R'G'B'A") ||
+           model == babl_model ("R'aG'aB'aA"))
     {
       rgb = TRUE;
     }
-  else if (model == babl_model ("Y") ||
-           model == babl_model ("YA"))
+  else if (model == babl_model ("Y")  ||
+           model == babl_model ("YA") ||
+           model == babl_model ("YaA"))
     {
       gray   = TRUE;
       linear = TRUE;
     }
-  else if (model == babl_model ("Y'") ||
-           model == babl_model ("Y'A"))
+  else if (model == babl_model ("Y'")  ||
+           model == babl_model ("Y'A") ||
+           model == babl_model ("Y'aA"))
     {
       gray = TRUE;
     }
-  else if (model == babl_model ("CMYK") ||
-           model == babl_model ("CMYKA"))
+  else if (model == babl_model ("CMYK"))
+#if 0
+    /* FIXME missing from babl */
+           || model == babl_model ("CMYKA"))
+#endif
     {
       cmyk = TRUE;
     }
@@ -1687,7 +1694,7 @@ gimp_color_profile_get_format (const Babl *format,
 
   if (*lcms_format == 0)
     {
-      g_printerr ("%s: layer format %s not supported, "
+      g_printerr ("%s: format %s not supported, "
                   "falling back to float\n",
                   G_STRFUNC, babl_get_name (format));
 


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]