[gimp] app: use sRGB gamma in u16 precision



commit 594b4bcdefc3eada317600af2e48245c4372fd56
Author: Ãyvind KolÃs <pippin gimp org>
Date:   Sat Sep 22 17:47:43 2012 +0100

    app: use sRGB gamma in u16 precision
    
    This permits editing sRGB profile PNGs and other formats using sRGB storage,
    without this editing a 16bit bpc PNG in u16 mode would cause banding in the
    shadow areas on import. File that do not have an sRGB like gamma should be
    promoted to a higher bit-depth on import.

 app/gegl/gimp-babl.c |   47 ++++++++++++++++++++++++-----------------------
 1 files changed, 24 insertions(+), 23 deletions(-)
---
diff --git a/app/gegl/gimp-babl.c b/app/gegl/gimp-babl.c
index 55287e0..3910bc7 100644
--- a/app/gegl/gimp-babl.c
+++ b/app/gegl/gimp-babl.c
@@ -53,20 +53,20 @@ gimp_babl_init (void)
                    babl_component ("A"),
                    NULL);
 
-  babl_format_new ("name", "R u16",
-                   babl_model ("RGBA"),
+  babl_format_new ("name", "R' u16",
+                   babl_model ("R'G'B'A"),
                    babl_type ("u16"),
-                   babl_component ("R"),
+                   babl_component ("R'"),
                    NULL);
-  babl_format_new ("name", "G u16",
-                   babl_model ("RGBA"),
+  babl_format_new ("name", "G' u16",
+                   babl_model ("R'G'B'A"),
                    babl_type ("u16"),
-                   babl_component ("G"),
+                   babl_component ("G'"),
                    NULL);
-  babl_format_new ("name", "B u16",
-                   babl_model ("RGBA"),
+  babl_format_new ("name", "B' u16",
+                   babl_model ("R'G'B'A"),
                    babl_type ("u16"),
-                   babl_component ("B"),
+                   babl_component ("B'"),
                    NULL);
   babl_format_new ("name", "A u16",
                    babl_model ("RGBA"),
@@ -152,44 +152,45 @@ static const struct
 babl_descriptions[] =
 {
   { "R'G'B' u8",  N_("RGB") },
-  { "RGB u16",    N_("RGB") },
+  { "R'G'B' u16",    N_("RGB") },
   { "RGB u32",    N_("RGB") },
   { "RGB half",   N_("RGB") },
   { "RGB float",  N_("RGB") },
 
   { "R'G'B'A u8", N_("RGB-alpha") },
-  { "RGBA u16",   N_("RGB-alpha") },
+  { "R'G'B'A u16",   N_("RGB-alpha") },
   { "RGBA u32",   N_("RGB-alpha") },
   { "RGBA half",  N_("RGB-alpha") },
   { "RGBA float", N_("RGB-alpha") },
 
   { "Y' u8",      N_("Grayscale") },
   { "Y u8",       N_("Grayscale") },
+  { "Y' u16",     N_("Grayscale") },
   { "Y u16",      N_("Grayscale") },
   { "Y u32",      N_("Grayscale") },
   { "Y half",     N_("Grayscale") },
   { "Y float",    N_("Grayscale") },
 
   { "Y'A u8",     N_("Grayscale-alpha") },
-  { "YA u16",     N_("Grayscale-alpha") },
+  { "Y'A u16",    N_("Grayscale-alpha") },
   { "YA u32",     N_("Grayscale-alpha") },
   { "YA half",    N_("Grayscale-alpha") },
   { "YA float",   N_("Grayscale-alpha") },
 
   { "R' u8",      N_("Red component") },
-  { "R u16",      N_("Red component") },
+  { "R' u16",      N_("Red component") },
   { "R u32",      N_("Red component") },
   { "R half",     N_("Red component") },
   { "R float",    N_("Red component") },
 
   { "G' u8",      N_("Green component") },
-  { "G u16",      N_("Green component") },
+  { "G' u16",      N_("Green component") },
   { "G u32",      N_("Green component") },
   { "G half",     N_("Green component") },
   { "G float",    N_("Green component") },
 
   { "B' u8",      N_("Blue component") },
-  { "B u16",      N_("Blue component") },
+  { "B' u16",      N_("Blue component") },
   { "B u32",      N_("Blue component") },
   { "B half",     N_("Blue component") },
   { "B float",    N_("Blue component") },
@@ -314,9 +315,9 @@ gimp_babl_format (GimpImageBaseType  base_type,
 
         case GIMP_PRECISION_U16:
           if (with_alpha)
-            return babl_format ("RGBA u16");
+            return babl_format ("R'G'B'A u16");
           else
-            return babl_format ("RGB u16");
+            return babl_format ("R'G'B' u16");
 
         case GIMP_PRECISION_U32:
           if (with_alpha)
@@ -352,9 +353,9 @@ gimp_babl_format (GimpImageBaseType  base_type,
 
         case GIMP_PRECISION_U16:
           if (with_alpha)
-            return babl_format ("YA u16");
+            return babl_format ("Y'A u16");
           else
-            return babl_format ("Y u16");
+            return babl_format ("Y' u16");
 
         case GIMP_PRECISION_U32:
           if (with_alpha)
@@ -412,9 +413,9 @@ gimp_babl_component_format (GimpImageBaseType base_type,
         case GIMP_PRECISION_U16:
           switch (index)
             {
-            case 0: return babl_format ("R u16");
-            case 1: return babl_format ("G u16");
-            case 2: return babl_format ("B u16");
+            case 0: return babl_format ("R' u16");
+            case 1: return babl_format ("G' u16");
+            case 2: return babl_format ("B' u16");
             case 3: return babl_format ("A u16");
             default:
               break;
@@ -478,7 +479,7 @@ gimp_babl_component_format (GimpImageBaseType base_type,
         case GIMP_PRECISION_U16:
           switch (index)
             {
-            case 0: return babl_format ("Y u16");
+            case 0: return babl_format ("Y' u16");
             case 1: return babl_format ("A u16");
             default:
               break;



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