[gimp] libgimpcolor: support "CIE Lab (alpha)" in gimp_color_profile_get_format()



commit 0edecc8d56ad7e34c7030e3194d26006f651ff71
Author: Michael Natterer <mitch gimp org>
Date:   Fri Feb 24 12:50:57 2017 +0100

    libgimpcolor: support "CIE Lab (alpha)" in gimp_color_profile_get_format()
    
    Return "RGB(A) float", babl will do the needed conversions.

 libgimpcolor/gimpcolorprofile.c |   18 +++++++++++++++++-
 1 files changed, 17 insertions(+), 1 deletions(-)
---
diff --git a/libgimpcolor/gimpcolorprofile.c b/libgimpcolor/gimpcolorprofile.c
index 2983a10..76a948c 100644
--- a/libgimpcolor/gimpcolorprofile.c
+++ b/libgimpcolor/gimpcolorprofile.c
@@ -1472,7 +1472,7 @@ gimp_color_profile_new_d50_gray_lab_trc (void)
  * R'G'B'A, Y, YA, Y', Y'A and the cairo-RGB24 and cairo-ARGB32 formats.
  *
  * Return value: the #Babl format to be used instead of @format, or %NULL
- *               is the passed @format is not supported at all.
+ *               if the passed @format is not supported at all.
  *
  * Since: 2.10
  **/
@@ -1546,6 +1546,22 @@ gimp_color_profile_get_format (const Babl *format,
     {
       cmyk = TRUE;
     }
+  else if (model == babl_model ("CIE Lab") ||
+           model == babl_model ("CIE Lab alpha"))
+    {
+      if (has_alpha)
+        {
+          *lcms_format = TYPE_RGBA_FLT;
+
+          return babl_format ("RGBA float");
+        }
+      else
+        {
+          *lcms_format = TYPE_RGB_FLT;
+
+          return babl_format ("RGB float");
+        }
+    }
   else if (babl_format_is_palette (format))
     {
       if (has_alpha)


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