[gimp] app: make masks use linear, not gamma corrected formats



commit 03da4fb28086ba45f26a69d550e4879ce1cd2fd6
Author: Michael Natterer <mitch gimp org>
Date:   Sat Apr 21 20:48:48 2012 +0200

    app: make masks use linear, not gamma corrected formats

 app/core/gimpimage-contiguous-region.c |    2 +-
 app/core/gimpimage-preview.c           |    4 ++++
 app/core/gimpimage.c                   |    2 +-
 app/gegl/gimp-gegl-utils.c             |    6 ++++--
 app/widgets/gimpcolorframe.c           |    3 ++-
 5 files changed, 12 insertions(+), 5 deletions(-)
---
diff --git a/app/core/gimpimage-contiguous-region.c b/app/core/gimpimage-contiguous-region.c
index e5b3e82..6784388 100644
--- a/app/core/gimpimage-contiguous-region.c
+++ b/app/core/gimpimage-contiguous-region.c
@@ -208,7 +208,7 @@ gimp_image_contiguous_region_by_color (GimpImage            *image,
   mask_buffer = gimp_drawable_get_buffer (GIMP_DRAWABLE (mask));
 
   gegl_buffer_iterator_add (iter, mask_buffer,
-                            NULL, 0, babl_format ("Y' u8"),
+                            NULL, 0, babl_format ("Y u8"),
                             GEGL_BUFFER_WRITE, GEGL_ABYSS_NONE);
 
   while (gegl_buffer_iterator_next (iter))
diff --git a/app/core/gimpimage-preview.c b/app/core/gimpimage-preview.c
index f28e041..60789bf 100644
--- a/app/core/gimpimage-preview.c
+++ b/app/core/gimpimage-preview.c
@@ -153,6 +153,10 @@ gimp_image_get_new_preview (GimpViewable *viewable,
         {
           buf->format = babl_format ("R'aG'aB'aA u8");
         }
+      else
+        {
+          g_warn_if_reached ();
+        }
     }
 
   return buf;
diff --git a/app/core/gimpimage.c b/app/core/gimpimage.c
index c49d0dc..b8e665c 100644
--- a/app/core/gimpimage.c
+++ b/app/core/gimpimage.c
@@ -1529,7 +1529,7 @@ gimp_image_get_mask_format (const GimpImage *image)
 {
   g_return_val_if_fail (GIMP_IS_IMAGE (image), NULL);
 
-  return babl_format ("Y' u8");
+  return babl_format ("Y u8");
 }
 
 gint
diff --git a/app/gegl/gimp-gegl-utils.c b/app/gegl/gimp-gegl-utils.c
index d65620b..f0501f4 100644
--- a/app/gegl/gimp-gegl-utils.c
+++ b/app/gegl/gimp-gegl-utils.c
@@ -37,7 +37,8 @@ gimp_babl_format_get_image_type (const Babl *format)
 {
   g_return_val_if_fail (format != NULL, -1);
 
-  if (format == babl_format ("Y' u8"))
+  if (format == babl_format ("Y u8") ||
+      format == babl_format ("Y' u8"))
     return GIMP_GRAY_IMAGE;
   else if (format == babl_format ("Y'A u8"))
     return GIMP_GRAYA_IMAGE;
@@ -61,7 +62,8 @@ gimp_babl_format_get_base_type (const Babl *format)
 {
   g_return_val_if_fail (format != NULL, -1);
 
-  if (format == babl_format ("Y' u8") ||
+  if (format == babl_format ("Y u8")  ||
+      format == babl_format ("Y' u8") ||
       format == babl_format ("Y'A u8"))
     {
       return GIMP_GRAY;
diff --git a/app/widgets/gimpcolorframe.c b/app/widgets/gimpcolorframe.c
index 68da1a5..337454b 100644
--- a/app/widgets/gimpcolorframe.c
+++ b/app/widgets/gimpcolorframe.c
@@ -504,7 +504,8 @@ gimp_color_frame_update (GimpColorFrame *frame)
   switch (frame->frame_mode)
     {
     case GIMP_COLOR_FRAME_MODE_PIXEL:
-      if (frame->sample_format == babl_format ("Y' u8") ||
+      if (frame->sample_format == babl_format ("Y u8")  ||
+          frame->sample_format == babl_format ("Y' u8") ||
           frame->sample_format == babl_format ("Y'A u8"))
         {
           names[0]  = _("Value:");



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