[babl] babl: rename functions that used to refer to specific gamma



commit 747caef2272317a10f33ad06094a7b82a17c8e6d
Author: Øyvind Kolås <pippin gimp org>
Date:   Tue Jun 19 19:29:48 2018 +0200

    babl: rename functions that used to refer to specific gamma
    
    The definitions of components and formats for linear and nonlinear formats in
    model-rgb and model-gray are now using the TRC of a BablSpace, thus in the
    format syntax ' now means nonlinear, not sRGB / 2.2 gamma - even though it ends
    up meaning that for formats create without specifying the space.

 babl/babl-ids.h        |  24 +++----
 babl/base/formats.c    |  98 ++++++++++++++--------------
 babl/base/model-gray.c |  84 ++++++++++++------------
 babl/base/model-rgb.c  | 174 ++++++++++++++++++++++++-------------------------
 4 files changed, 190 insertions(+), 190 deletions(-)
---
diff --git a/babl/babl-ids.h b/babl/babl-ids.h
index a42d09b..48e8da1 100644
--- a/babl/babl-ids.h
+++ b/babl/babl-ids.h
@@ -45,12 +45,12 @@ enum {
   BABL_RGB,
   BABL_RGBA,
   BABL_RGBA_PREMULTIPLIED,
-  BABL_GRAY_GAMMA_2_2,
-  BABL_GRAY_GAMMA_2_2_ALPHA,
-  BABL_GRAY_GAMMA_2_2_ALPHA_PREMULTIPLIED,
-  BABL_RGB_GAMMA_2_2,
-  BABL_RGBA_GAMMA_2_2,
-  BABL_RGBA_GAMMA_2_2_PREMULTIPLIED,
+  BABL_GRAY_NONLINEAR,
+  BABL_GRAY_NONLINEAR_ALPHA,
+  BABL_GRAY_NONLINEAR_ALPHA_PREMULTIPLIED,
+  BABL_RGB_NONLINEAR,
+  BABL_RGBA_NONLINEAR,
+  BABL_RGBA_NONLINEAR_PREMULTIPLIED,
   BABL_YCBCR,
   BABL_YCBCR_ALPHA,
   BABL_CIE_LAB,
@@ -69,12 +69,12 @@ enum {
   BABL_BLUE_MUL_ALPHA,
   BABL_LUMA,
   BABL_LUMA_MUL_ALPHA,
-  BABL_RED_GAMMA_2_2,
-  BABL_GREEN_GAMMA_2_2,
-  BABL_BLUE_GAMMA_2_2,
-  BABL_RED_GAMMA_2_2_MUL_ALPHA,
-  BABL_GREEN_GAMMA_2_2_MUL_ALPHA,
-  BABL_BLUE_GAMMA_2_2_MUL_ALPHA,
+  BABL_RED_NONLINEAR,
+  BABL_GREEN_NONLINEAR,
+  BABL_BLUE_NONLINEAR,
+  BABL_RED_NONLINEAR_MUL_ALPHA,
+  BABL_GREEN_NONLINEAR_MUL_ALPHA,
+  BABL_BLUE_NONLINEAR_MUL_ALPHA,
 
 
   BABL_X,
diff --git a/babl/base/formats.c b/babl/base/formats.c
index 65b3d77..dc9f423 100644
--- a/babl/base/formats.c
+++ b/babl/base/formats.c
@@ -28,130 +28,130 @@ void
 babl_formats_init (void)
 {
   babl_format_new (
-    babl_model_from_id (BABL_RGBA_GAMMA_2_2),
+    babl_model_from_id (BABL_RGBA_NONLINEAR),
     babl_type_from_id (BABL_DOUBLE),
-    babl_component_from_id (BABL_RED_GAMMA_2_2),
-    babl_component_from_id (BABL_GREEN_GAMMA_2_2),
-    babl_component_from_id (BABL_BLUE_GAMMA_2_2),
+    babl_component_from_id (BABL_RED_NONLINEAR),
+    babl_component_from_id (BABL_GREEN_NONLINEAR),
+    babl_component_from_id (BABL_BLUE_NONLINEAR),
     babl_component_from_id (BABL_ALPHA),
     NULL);
   babl_format_new (
-    babl_model_from_id (BABL_RGBA_GAMMA_2_2),
+    babl_model_from_id (BABL_RGBA_NONLINEAR),
     babl_type_from_id (BABL_FLOAT),
-    babl_component_from_id (BABL_RED_GAMMA_2_2),
-    babl_component_from_id (BABL_GREEN_GAMMA_2_2),
-    babl_component_from_id (BABL_BLUE_GAMMA_2_2),
+    babl_component_from_id (BABL_RED_NONLINEAR),
+    babl_component_from_id (BABL_GREEN_NONLINEAR),
+    babl_component_from_id (BABL_BLUE_NONLINEAR),
     babl_component_from_id (BABL_ALPHA),
     NULL);
   babl_format_new (
-    babl_model_from_id (BABL_RGBA_GAMMA_2_2),
+    babl_model_from_id (BABL_RGBA_NONLINEAR),
     babl_type_from_id (BABL_U16),
-    babl_component_from_id (BABL_RED_GAMMA_2_2),
-    babl_component_from_id (BABL_GREEN_GAMMA_2_2),
-    babl_component_from_id (BABL_BLUE_GAMMA_2_2),
+    babl_component_from_id (BABL_RED_NONLINEAR),
+    babl_component_from_id (BABL_GREEN_NONLINEAR),
+    babl_component_from_id (BABL_BLUE_NONLINEAR),
     babl_component_from_id (BABL_ALPHA),
     NULL);
   babl_format_new (
-    babl_model_from_id (BABL_RGBA_GAMMA_2_2),
+    babl_model_from_id (BABL_RGBA_NONLINEAR),
     babl_type_from_id (BABL_U8),
-    babl_component_from_id (BABL_RED_GAMMA_2_2),
-    babl_component_from_id (BABL_GREEN_GAMMA_2_2),
-    babl_component_from_id (BABL_BLUE_GAMMA_2_2),
+    babl_component_from_id (BABL_RED_NONLINEAR),
+    babl_component_from_id (BABL_GREEN_NONLINEAR),
+    babl_component_from_id (BABL_BLUE_NONLINEAR),
     babl_component_from_id (BABL_ALPHA),
     NULL);
   babl_format_new (
-    babl_model_from_id (BABL_RGBA_GAMMA_2_2_PREMULTIPLIED),
+    babl_model_from_id (BABL_RGBA_NONLINEAR_PREMULTIPLIED),
     babl_type_from_id (BABL_FLOAT),
-    babl_component_from_id (BABL_RED_GAMMA_2_2_MUL_ALPHA),
-    babl_component_from_id (BABL_GREEN_GAMMA_2_2_MUL_ALPHA),
-    babl_component_from_id (BABL_BLUE_GAMMA_2_2_MUL_ALPHA),
+    babl_component_from_id (BABL_RED_NONLINEAR_MUL_ALPHA),
+    babl_component_from_id (BABL_GREEN_NONLINEAR_MUL_ALPHA),
+    babl_component_from_id (BABL_BLUE_NONLINEAR_MUL_ALPHA),
     babl_component_from_id (BABL_ALPHA),
     NULL);
   babl_format_new (
-    babl_model_from_id (BABL_RGBA_GAMMA_2_2_PREMULTIPLIED),
+    babl_model_from_id (BABL_RGBA_NONLINEAR_PREMULTIPLIED),
     babl_type_from_id (BABL_U16),
-    babl_component_from_id (BABL_RED_GAMMA_2_2_MUL_ALPHA),
-    babl_component_from_id (BABL_GREEN_GAMMA_2_2_MUL_ALPHA),
-    babl_component_from_id (BABL_BLUE_GAMMA_2_2_MUL_ALPHA),
+    babl_component_from_id (BABL_RED_NONLINEAR_MUL_ALPHA),
+    babl_component_from_id (BABL_GREEN_NONLINEAR_MUL_ALPHA),
+    babl_component_from_id (BABL_BLUE_NONLINEAR_MUL_ALPHA),
     babl_component_from_id (BABL_ALPHA),
     NULL);
   babl_format_new (
-    babl_model_from_id (BABL_RGBA_GAMMA_2_2_PREMULTIPLIED),
+    babl_model_from_id (BABL_RGBA_NONLINEAR_PREMULTIPLIED),
     babl_type_from_id (BABL_U8),
-    babl_component_from_id (BABL_RED_GAMMA_2_2_MUL_ALPHA),
-    babl_component_from_id (BABL_GREEN_GAMMA_2_2_MUL_ALPHA),
-    babl_component_from_id (BABL_BLUE_GAMMA_2_2_MUL_ALPHA),
+    babl_component_from_id (BABL_RED_NONLINEAR_MUL_ALPHA),
+    babl_component_from_id (BABL_GREEN_NONLINEAR_MUL_ALPHA),
+    babl_component_from_id (BABL_BLUE_NONLINEAR_MUL_ALPHA),
     babl_component_from_id (BABL_ALPHA),
     NULL);
   babl_format_new (
-    babl_model_from_id (BABL_RGB_GAMMA_2_2),
+    babl_model_from_id (BABL_RGB_NONLINEAR),
     babl_type_from_id (BABL_FLOAT),
-    babl_component_from_id (BABL_RED_GAMMA_2_2),
-    babl_component_from_id (BABL_GREEN_GAMMA_2_2),
-    babl_component_from_id (BABL_BLUE_GAMMA_2_2),
+    babl_component_from_id (BABL_RED_NONLINEAR),
+    babl_component_from_id (BABL_GREEN_NONLINEAR),
+    babl_component_from_id (BABL_BLUE_NONLINEAR),
     NULL);
   babl_format_new (
-    babl_model_from_id (BABL_RGB_GAMMA_2_2),
+    babl_model_from_id (BABL_RGB_NONLINEAR),
     babl_type_from_id (BABL_U16),
-    babl_component_from_id (BABL_RED_GAMMA_2_2),
-    babl_component_from_id (BABL_GREEN_GAMMA_2_2),
-    babl_component_from_id (BABL_BLUE_GAMMA_2_2),
+    babl_component_from_id (BABL_RED_NONLINEAR),
+    babl_component_from_id (BABL_GREEN_NONLINEAR),
+    babl_component_from_id (BABL_BLUE_NONLINEAR),
     NULL);
   babl_format_new (
-    babl_model_from_id (BABL_RGB_GAMMA_2_2),
+    babl_model_from_id (BABL_RGB_NONLINEAR),
     babl_type_from_id (BABL_U8),
-    babl_component_from_id (BABL_RED_GAMMA_2_2),
-    babl_component_from_id (BABL_GREEN_GAMMA_2_2),
-    babl_component_from_id (BABL_BLUE_GAMMA_2_2),
+    babl_component_from_id (BABL_RED_NONLINEAR),
+    babl_component_from_id (BABL_GREEN_NONLINEAR),
+    babl_component_from_id (BABL_BLUE_NONLINEAR),
     NULL);
   babl_format_new (
-    babl_model_from_id (BABL_GRAY_GAMMA_2_2_ALPHA),
+    babl_model_from_id (BABL_GRAY_NONLINEAR_ALPHA),
     babl_type_from_id (BABL_FLOAT),
     babl_component_from_id (BABL_LUMA),
     babl_component_from_id (BABL_ALPHA),
     NULL);
   babl_format_new (
-    babl_model_from_id (BABL_GRAY_GAMMA_2_2_ALPHA_PREMULTIPLIED),
+    babl_model_from_id (BABL_GRAY_NONLINEAR_ALPHA_PREMULTIPLIED),
     babl_type_from_id (BABL_FLOAT),
     babl_component_from_id (BABL_LUMA_MUL_ALPHA),
     babl_component_from_id (BABL_ALPHA),
     NULL);
   babl_format_new (
-    babl_model_from_id (BABL_GRAY_GAMMA_2_2),
+    babl_model_from_id (BABL_GRAY_NONLINEAR),
     babl_type_from_id (BABL_FLOAT),
     babl_component_from_id (BABL_LUMA),
     NULL);
   babl_format_new (
-    babl_model_from_id (BABL_GRAY_GAMMA_2_2_ALPHA),
+    babl_model_from_id (BABL_GRAY_NONLINEAR_ALPHA),
     babl_type_from_id (BABL_U16),
     babl_component_from_id (BABL_LUMA),
     babl_component_from_id (BABL_ALPHA),
     NULL);
   babl_format_new (
-    babl_model_from_id (BABL_GRAY_GAMMA_2_2_ALPHA_PREMULTIPLIED),
+    babl_model_from_id (BABL_GRAY_NONLINEAR_ALPHA_PREMULTIPLIED),
     babl_type_from_id (BABL_U16),
     babl_component_from_id (BABL_LUMA_MUL_ALPHA),
     babl_component_from_id (BABL_ALPHA),
     NULL);
   babl_format_new (
-    babl_model_from_id (BABL_GRAY_GAMMA_2_2),
+    babl_model_from_id (BABL_GRAY_NONLINEAR),
     babl_type_from_id (BABL_U16),
     babl_component_from_id (BABL_LUMA),
     NULL);
   babl_format_new (
-    babl_model_from_id (BABL_GRAY_GAMMA_2_2_ALPHA),
+    babl_model_from_id (BABL_GRAY_NONLINEAR_ALPHA),
     babl_type_from_id (BABL_U8),
     babl_component_from_id (BABL_LUMA),
     babl_component_from_id (BABL_ALPHA),
     NULL);
   babl_format_new (
-    babl_model_from_id (BABL_GRAY_GAMMA_2_2_ALPHA_PREMULTIPLIED),
+    babl_model_from_id (BABL_GRAY_NONLINEAR_ALPHA_PREMULTIPLIED),
     babl_type_from_id (BABL_U8),
     babl_component_from_id (BABL_LUMA_MUL_ALPHA),
     babl_component_from_id (BABL_ALPHA),
     NULL);
   babl_format_new (
-    babl_model_from_id (BABL_GRAY_GAMMA_2_2),
+    babl_model_from_id (BABL_GRAY_NONLINEAR),
     babl_type_from_id (BABL_U8),
     babl_component_from_id (BABL_LUMA),
     NULL);
diff --git a/babl/base/model-gray.c b/babl/base/model-gray.c
index 6a2764e..5449a4f 100644
--- a/babl/base/model-gray.c
+++ b/babl/base/model-gray.c
@@ -89,18 +89,18 @@ models (void)
 
 
   babl_model_new (
-    "id", BABL_GRAY_GAMMA_2_2,
+    "id", BABL_GRAY_NONLINEAR,
     babl_component_from_id (BABL_LUMA),
     NULL);
 
   babl_model_new (
-    "id", BABL_GRAY_GAMMA_2_2_ALPHA,
+    "id", BABL_GRAY_NONLINEAR_ALPHA,
     babl_component_from_id (BABL_LUMA),
     babl_component_from_id (BABL_ALPHA),
     NULL);
 
   babl_model_new (
-    "id", BABL_GRAY_GAMMA_2_2_ALPHA_PREMULTIPLIED,
+    "id", BABL_GRAY_NONLINEAR_ALPHA_PREMULTIPLIED,
     babl_component_from_id (BABL_LUMA_MUL_ALPHA),
     babl_component_from_id (BABL_ALPHA),
     NULL);
@@ -172,14 +172,14 @@ rgba_to_gray (Babl *conversion,
 }
 
 static void
-rgb_to_gray_2_2 (Babl  *conversion,
-                 int    src_bands,
-                 char **src,
-                 int   *src_pitch,
-                 int    dst_bands,
-                 char **dst,
-                 int   *dst_pitch,
-                 long   n)
+rgb_to_gray_nonlinear (Babl  *conversion,
+                       int    src_bands,
+                       char **src,
+                       int   *src_pitch,
+                       int    dst_bands,
+                       char **dst,
+                       int   *dst_pitch,
+                       long   n)
 {
   const Babl *space = babl_conversion_get_destination_space (conversion);
   const Babl *trc = space->space.trc[0];
@@ -215,14 +215,14 @@ rgb_to_gray_2_2 (Babl  *conversion,
 
 
 static void
-gray_2_2_to_rgb (Babl *conversion,
-                 int    src_bands,
-                 char **src,
-                 int   *src_pitch,
-                 int    dst_bands,
-                 char **dst,
-                 int   *dst_pitch,
-                 long   n)
+gray_nonlinear_to_rgb (Babl *conversion,
+                       int    src_bands,
+                       char **src,
+                       int   *src_pitch,
+                       int    dst_bands,
+                       char **dst,
+                       int   *dst_pitch,
+                       long   n)
 {
   const Babl *space = babl_conversion_get_source_space (conversion);
   const Babl *trc = space->space.trc[0];
@@ -449,7 +449,7 @@ premultiplied_to_non_premultiplied (Babl  *conversion,
 }
 
 static void
-rgba2gray_gamma_2_2_premultiplied (Babl *conversion,
+rgba2gray_nonlinear_premultiplied (Babl *conversion,
                                    char *src,
                                    char *dst,
                                    long  n)
@@ -485,7 +485,7 @@ rgba2gray_gamma_2_2_premultiplied (Babl *conversion,
 
 
 static void
-gray_gamma_2_2_premultiplied2rgba (Babl *conversion,
+gray_nonlinear_premultiplied2rgba (Babl *conversion,
                                    char *src,
                                    char *dst,
                                    long  n)
@@ -521,45 +521,45 @@ static void
 conversions (void)
 {
   babl_conversion_new (
-    babl_model_from_id (BABL_GRAY_GAMMA_2_2),
+    babl_model_from_id (BABL_GRAY_NONLINEAR),
     babl_model_from_id (BABL_RGBA),
-    "planar", gray_2_2_to_rgb,
+    "planar", gray_nonlinear_to_rgb,
     NULL
   );
 
   babl_conversion_new (
     babl_model_from_id (BABL_RGBA),
-    babl_model_from_id (BABL_GRAY_GAMMA_2_2),
-    "planar", rgb_to_gray_2_2,
+    babl_model_from_id (BABL_GRAY_NONLINEAR),
+    "planar", rgb_to_gray_nonlinear,
     NULL
   );
 
   babl_conversion_new (
-    babl_model_from_id (BABL_GRAY_GAMMA_2_2_ALPHA),
+    babl_model_from_id (BABL_GRAY_NONLINEAR_ALPHA),
     babl_model_from_id (BABL_RGBA),
-    "planar", gray_2_2_to_rgb,
+    "planar", gray_nonlinear_to_rgb,
     NULL
   );
 
   babl_conversion_new (
     babl_model_from_id (BABL_RGBA),
-    babl_model_from_id (BABL_GRAY_GAMMA_2_2_ALPHA),
-    "planar", rgb_to_gray_2_2,
+    babl_model_from_id (BABL_GRAY_NONLINEAR_ALPHA),
+    "planar", rgb_to_gray_nonlinear,
     NULL
   );
 
 
   babl_conversion_new (
-    babl_model_from_id (BABL_GRAY_GAMMA_2_2_ALPHA_PREMULTIPLIED),
+    babl_model_from_id (BABL_GRAY_NONLINEAR_ALPHA_PREMULTIPLIED),
     babl_model_from_id (BABL_RGBA),
-    "linear", gray_gamma_2_2_premultiplied2rgba,
+    "linear", gray_nonlinear_premultiplied2rgba,
     NULL
   );
 
   babl_conversion_new (
     babl_model_from_id (BABL_RGBA),
-    babl_model_from_id (BABL_GRAY_GAMMA_2_2_ALPHA_PREMULTIPLIED),
-    "linear", rgba2gray_gamma_2_2_premultiplied,
+    babl_model_from_id (BABL_GRAY_NONLINEAR_ALPHA_PREMULTIPLIED),
+    "linear", rgba2gray_nonlinear_premultiplied,
     NULL
   );
 
@@ -641,19 +641,19 @@ formats (void)
     babl_component_from_id (BABL_LUMINANCE),
     NULL);
   babl_format_new (
-    babl_model_from_id (BABL_GRAY_GAMMA_2_2_ALPHA),
+    babl_model_from_id (BABL_GRAY_NONLINEAR_ALPHA),
     babl_type_from_id (BABL_HALF),
     babl_component_from_id (BABL_LUMA),
     babl_component_from_id (BABL_ALPHA),
     NULL);
   babl_format_new (
-    babl_model_from_id (BABL_GRAY_GAMMA_2_2_ALPHA_PREMULTIPLIED),
+    babl_model_from_id (BABL_GRAY_NONLINEAR_ALPHA_PREMULTIPLIED),
     babl_type_from_id (BABL_HALF),
     babl_component_from_id (BABL_LUMA_MUL_ALPHA),
     babl_component_from_id (BABL_ALPHA),
     NULL);
   babl_format_new (
-    babl_model_from_id (BABL_GRAY_GAMMA_2_2),
+    babl_model_from_id (BABL_GRAY_NONLINEAR),
     babl_type_from_id (BABL_HALF),
     babl_component_from_id (BABL_LUMA),
     NULL);
@@ -677,19 +677,19 @@ formats (void)
     babl_component_from_id (BABL_LUMINANCE),
     NULL);
   babl_format_new (
-    babl_model_from_id (BABL_GRAY_GAMMA_2_2_ALPHA),
+    babl_model_from_id (BABL_GRAY_NONLINEAR_ALPHA),
     babl_type ("u15"),
     babl_component_from_id (BABL_LUMA),
     babl_component_from_id (BABL_ALPHA),
     NULL);
   babl_format_new (
-    babl_model_from_id (BABL_GRAY_GAMMA_2_2_ALPHA_PREMULTIPLIED),
+    babl_model_from_id (BABL_GRAY_NONLINEAR_ALPHA_PREMULTIPLIED),
     babl_type ("u15"),
     babl_component_from_id (BABL_LUMA_MUL_ALPHA),
     babl_component_from_id (BABL_ALPHA),
     NULL);
   babl_format_new (
-    babl_model_from_id (BABL_GRAY_GAMMA_2_2),
+    babl_model_from_id (BABL_GRAY_NONLINEAR),
     babl_type ("u15"),
     babl_component_from_id (BABL_LUMA),
     NULL);
@@ -712,19 +712,19 @@ formats (void)
     babl_component_from_id (BABL_LUMINANCE),
     NULL);
   babl_format_new (
-    babl_model_from_id (BABL_GRAY_GAMMA_2_2_ALPHA),
+    babl_model_from_id (BABL_GRAY_NONLINEAR_ALPHA),
     babl_type_from_id (BABL_U32),
     babl_component_from_id (BABL_LUMA),
     babl_component_from_id (BABL_ALPHA),
     NULL);
   babl_format_new (
-    babl_model_from_id (BABL_GRAY_GAMMA_2_2_ALPHA_PREMULTIPLIED),
+    babl_model_from_id (BABL_GRAY_NONLINEAR_ALPHA_PREMULTIPLIED),
     babl_type_from_id (BABL_U32),
     babl_component_from_id (BABL_LUMA_MUL_ALPHA),
     babl_component_from_id (BABL_ALPHA),
     NULL);
   babl_format_new (
-    babl_model_from_id (BABL_GRAY_GAMMA_2_2),
+    babl_model_from_id (BABL_GRAY_NONLINEAR),
     babl_type_from_id (BABL_U32),
     babl_component_from_id (BABL_LUMA),
     NULL);
diff --git a/babl/base/model-rgb.c b/babl/base/model-rgb.c
index 7da204f..4c22d86 100644
--- a/babl/base/model-rgb.c
+++ b/babl/base/model-rgb.c
@@ -66,42 +66,42 @@ components (void)
 
   babl_component_new (
     "R'",
-    "id", BABL_RED_GAMMA_2_2,
+    "id", BABL_RED_NONLINEAR,
     "luma",
     "chroma",
     NULL);
 
   babl_component_new (
     "G'",
-    "id", BABL_GREEN_GAMMA_2_2,
+    "id", BABL_GREEN_NONLINEAR,
     "luma",
     "chroma",
     NULL);
 
   babl_component_new (
     "B'",
-    "id", BABL_BLUE_GAMMA_2_2,
+    "id", BABL_BLUE_NONLINEAR,
     "luma",
     "chroma",
     NULL);
 
   babl_component_new (
     "R'a",
-    "id", BABL_RED_GAMMA_2_2_MUL_ALPHA,
+    "id", BABL_RED_NONLINEAR_MUL_ALPHA,
     "luma",
     "chroma",
     NULL);
 
   babl_component_new (
     "G'a",
-    "id", BABL_GREEN_GAMMA_2_2_MUL_ALPHA,
+    "id", BABL_GREEN_NONLINEAR_MUL_ALPHA,
     "luma",
     "chroma",
     NULL);
 
   babl_component_new (
     "B'a",
-    "id", BABL_BLUE_GAMMA_2_2_MUL_ALPHA,
+    "id", BABL_BLUE_NONLINEAR_MUL_ALPHA,
     "luma",
     "chroma",
     NULL);
@@ -126,25 +126,25 @@ models (void)
     NULL);
 
   babl_model_new (
-    "id", BABL_RGB_GAMMA_2_2,
-    babl_component_from_id (BABL_RED_GAMMA_2_2),
-    babl_component_from_id (BABL_GREEN_GAMMA_2_2),
-    babl_component_from_id (BABL_BLUE_GAMMA_2_2),
+    "id", BABL_RGB_NONLINEAR,
+    babl_component_from_id (BABL_RED_NONLINEAR),
+    babl_component_from_id (BABL_GREEN_NONLINEAR),
+    babl_component_from_id (BABL_BLUE_NONLINEAR),
     NULL);
 
   babl_model_new (
-    "id", BABL_RGBA_GAMMA_2_2,
-    babl_component_from_id (BABL_RED_GAMMA_2_2),
-    babl_component_from_id (BABL_GREEN_GAMMA_2_2),
-    babl_component_from_id (BABL_BLUE_GAMMA_2_2),
+    "id", BABL_RGBA_NONLINEAR,
+    babl_component_from_id (BABL_RED_NONLINEAR),
+    babl_component_from_id (BABL_GREEN_NONLINEAR),
+    babl_component_from_id (BABL_BLUE_NONLINEAR),
     babl_component_from_id (BABL_ALPHA),
     NULL);
 
   babl_model_new (
-    "id", BABL_RGBA_GAMMA_2_2_PREMULTIPLIED,
-    babl_component_from_id (BABL_RED_GAMMA_2_2_MUL_ALPHA),
-    babl_component_from_id (BABL_GREEN_GAMMA_2_2_MUL_ALPHA),
-    babl_component_from_id (BABL_BLUE_GAMMA_2_2_MUL_ALPHA),
+    "id", BABL_RGBA_NONLINEAR_PREMULTIPLIED,
+    babl_component_from_id (BABL_RED_NONLINEAR_MUL_ALPHA),
+    babl_component_from_id (BABL_GREEN_NONLINEAR_MUL_ALPHA),
+    babl_component_from_id (BABL_BLUE_NONLINEAR_MUL_ALPHA),
     babl_component_from_id (BABL_ALPHA),
     NULL);
 }
@@ -181,14 +181,14 @@ copy_strip_1 (Babl  *conversion,
 }
 
 static void
-g3_gamma_2_2 (Babl  *conversion,
-              int    src_bands,
-              char **src,
-              int   *src_pitch,
-              int    dst_bands,
-              char **dst,
-              int   *dst_pitch,
-              long   samples)
+g3_from_linear (Babl  *conversion,
+                int    src_bands,
+                char **src,
+                int   *src_pitch,
+                int    dst_bands,
+                char **dst,
+                int   *dst_pitch,
+                long   samples)
 {
   const Babl *space = babl_conversion_get_destination_space (conversion);
   const Babl **trc  = (void*)space->space.trc;
@@ -210,7 +210,7 @@ g3_gamma_2_2 (Babl  *conversion,
 
 
 static void
-g3_inv_gamma_2_2 (Babl  *conversion,
+g3_to_linear (Babl  *conversion,
                   int    src_bands,
                   char **src,
                   int   *src_pitch,
@@ -309,7 +309,7 @@ premultiplied_to_non_premultiplied (Babl  *conversion,
 
 
 static void
-rgba2rgba_gamma_2_2_premultiplied (Babl *conversion,
+rgba2rgba_nonlinear_premultiplied (Babl *conversion,
                                    char *src,
                                    char *dst,
                                    long  samples)
@@ -332,7 +332,7 @@ rgba2rgba_gamma_2_2_premultiplied (Babl *conversion,
 
 
 static void
-rgba_gamma_2_2_premultiplied2rgba (Babl *conversion,
+rgba_nonlinear_premultiplied2rgba (Babl *conversion,
                                    char           *src,
                                    char           *dst,
                                    long            samples)
@@ -365,7 +365,7 @@ rgba_gamma_2_2_premultiplied2rgba (Babl *conversion,
 
 
 static void
-rgba2rgba_gamma_2_2 (Babl *conversion,
+rgba2rgba_nonlinear (Babl *conversion,
                      char *src,
                      char *dst,
                      long  samples)
@@ -388,7 +388,7 @@ rgba2rgba_gamma_2_2 (Babl *conversion,
 
 
 static void
-rgba_gamma_2_22rgba (Babl *conversion,
+rgba_nonlinear2rgba (Babl *conversion,
                      char *src,
                      char *dst,
                      long  samples)
@@ -451,37 +451,37 @@ conversions (void)
 
   babl_conversion_new (
     babl_model_from_id (BABL_RGBA),
-    babl_model_from_id (BABL_RGB_GAMMA_2_2),
-    "planar", g3_gamma_2_2,
+    babl_model_from_id (BABL_RGB_NONLINEAR),
+    "planar", g3_from_linear,
     NULL
   );
   babl_conversion_new (
-    babl_model_from_id (BABL_RGB_GAMMA_2_2),
+    babl_model_from_id (BABL_RGB_NONLINEAR),
     babl_model_from_id (BABL_RGBA),
-    "planar", g3_inv_gamma_2_2,
+    "planar", g3_to_linear,
     NULL
   );
 
   babl_conversion_new (
     babl_model_from_id (BABL_RGBA),
-    babl_model_from_id (BABL_RGBA_GAMMA_2_2),
-    "linear", rgba2rgba_gamma_2_2,
+    babl_model_from_id (BABL_RGBA_NONLINEAR),
+    "linear", rgba2rgba_nonlinear,
     NULL);
   babl_conversion_new (
-    babl_model_from_id (BABL_RGBA_GAMMA_2_2),
+    babl_model_from_id (BABL_RGBA_NONLINEAR),
     babl_model_from_id (BABL_RGBA),
-    "linear", rgba_gamma_2_22rgba,
+    "linear", rgba_nonlinear2rgba,
     NULL);
 
   babl_conversion_new (
     babl_model_from_id (BABL_RGBA),
-    babl_model_from_id (BABL_RGBA_GAMMA_2_2_PREMULTIPLIED),
-    "linear", rgba2rgba_gamma_2_2_premultiplied,
+    babl_model_from_id (BABL_RGBA_NONLINEAR_PREMULTIPLIED),
+    "linear", rgba2rgba_nonlinear_premultiplied,
     NULL);
   babl_conversion_new (
-    babl_model_from_id (BABL_RGBA_GAMMA_2_2_PREMULTIPLIED),
+    babl_model_from_id (BABL_RGBA_NONLINEAR_PREMULTIPLIED),
     babl_model_from_id (BABL_RGBA),
-    "linear", rgba_gamma_2_2_premultiplied2rgba,
+    "linear", rgba_nonlinear_premultiplied2rgba,
     NULL);
 }
 
@@ -490,20 +490,20 @@ formats (void)
 {
   babl_format_new (
     "id", BABL_SRGB,
-    babl_model_from_id (BABL_RGB_GAMMA_2_2),
+    babl_model_from_id (BABL_RGB_NONLINEAR),
     babl_type_from_id (BABL_U8),
-    babl_component_from_id (BABL_RED_GAMMA_2_2),
-    babl_component_from_id (BABL_GREEN_GAMMA_2_2),
-    babl_component_from_id (BABL_BLUE_GAMMA_2_2),
+    babl_component_from_id (BABL_RED_NONLINEAR),
+    babl_component_from_id (BABL_GREEN_NONLINEAR),
+    babl_component_from_id (BABL_BLUE_NONLINEAR),
     NULL);
 
   babl_format_new (
     "id", BABL_SRGBA,
-    babl_model_from_id (BABL_RGBA_GAMMA_2_2),
+    babl_model_from_id (BABL_RGBA_NONLINEAR),
     babl_type_from_id (BABL_U8),
-    babl_component_from_id (BABL_RED_GAMMA_2_2),
-    babl_component_from_id (BABL_GREEN_GAMMA_2_2),
-    babl_component_from_id (BABL_BLUE_GAMMA_2_2),
+    babl_component_from_id (BABL_RED_NONLINEAR),
+    babl_component_from_id (BABL_GREEN_NONLINEAR),
+    babl_component_from_id (BABL_BLUE_NONLINEAR),
     babl_component_from_id (BABL_ALPHA),
     NULL);
 
@@ -555,28 +555,28 @@ formats (void)
     NULL);
 
   babl_format_new (
-    babl_model_from_id (BABL_RGB_GAMMA_2_2),
+    babl_model_from_id (BABL_RGB_NONLINEAR),
     babl_type_from_id (BABL_HALF),
-    babl_component_from_id (BABL_RED_GAMMA_2_2),
-    babl_component_from_id (BABL_GREEN_GAMMA_2_2),
-    babl_component_from_id (BABL_BLUE_GAMMA_2_2),
+    babl_component_from_id (BABL_RED_NONLINEAR),
+    babl_component_from_id (BABL_GREEN_NONLINEAR),
+    babl_component_from_id (BABL_BLUE_NONLINEAR),
     NULL);
 
   babl_format_new (
-    babl_model_from_id (BABL_RGBA_GAMMA_2_2),
+    babl_model_from_id (BABL_RGBA_NONLINEAR),
     babl_type_from_id (BABL_HALF),
-    babl_component_from_id (BABL_RED_GAMMA_2_2),
-    babl_component_from_id (BABL_GREEN_GAMMA_2_2),
-    babl_component_from_id (BABL_BLUE_GAMMA_2_2),
+    babl_component_from_id (BABL_RED_NONLINEAR),
+    babl_component_from_id (BABL_GREEN_NONLINEAR),
+    babl_component_from_id (BABL_BLUE_NONLINEAR),
     babl_component_from_id (BABL_ALPHA),
     NULL);
 
   babl_format_new (
-    babl_model_from_id (BABL_RGBA_GAMMA_2_2_PREMULTIPLIED),
+    babl_model_from_id (BABL_RGBA_NONLINEAR_PREMULTIPLIED),
     babl_type_from_id (BABL_HALF),
-    babl_component_from_id (BABL_RED_GAMMA_2_2_MUL_ALPHA),
-    babl_component_from_id (BABL_GREEN_GAMMA_2_2_MUL_ALPHA),
-    babl_component_from_id (BABL_BLUE_GAMMA_2_2_MUL_ALPHA),
+    babl_component_from_id (BABL_RED_NONLINEAR_MUL_ALPHA),
+    babl_component_from_id (BABL_GREEN_NONLINEAR_MUL_ALPHA),
+    babl_component_from_id (BABL_BLUE_NONLINEAR_MUL_ALPHA),
     babl_component_from_id (BABL_ALPHA),
     NULL);
 
@@ -608,28 +608,28 @@ formats (void)
     NULL);
 
   babl_format_new (
-    babl_model_from_id (BABL_RGB_GAMMA_2_2),
+    babl_model_from_id (BABL_RGB_NONLINEAR),
     babl_type ("u15"),
-    babl_component_from_id (BABL_RED_GAMMA_2_2),
-    babl_component_from_id (BABL_GREEN_GAMMA_2_2),
-    babl_component_from_id (BABL_BLUE_GAMMA_2_2),
+    babl_component_from_id (BABL_RED_NONLINEAR),
+    babl_component_from_id (BABL_GREEN_NONLINEAR),
+    babl_component_from_id (BABL_BLUE_NONLINEAR),
     NULL);
 
   babl_format_new (
-    babl_model_from_id (BABL_RGBA_GAMMA_2_2),
+    babl_model_from_id (BABL_RGBA_NONLINEAR),
     babl_type ("u15"),
-    babl_component_from_id (BABL_RED_GAMMA_2_2),
-    babl_component_from_id (BABL_GREEN_GAMMA_2_2),
-    babl_component_from_id (BABL_BLUE_GAMMA_2_2),
+    babl_component_from_id (BABL_RED_NONLINEAR),
+    babl_component_from_id (BABL_GREEN_NONLINEAR),
+    babl_component_from_id (BABL_BLUE_NONLINEAR),
     babl_component_from_id (BABL_ALPHA),
     NULL);
 
   babl_format_new (
-    babl_model_from_id (BABL_RGBA_GAMMA_2_2_PREMULTIPLIED),
+    babl_model_from_id (BABL_RGBA_NONLINEAR_PREMULTIPLIED),
     babl_type ("u15"),
-    babl_component_from_id (BABL_RED_GAMMA_2_2_MUL_ALPHA),
-    babl_component_from_id (BABL_GREEN_GAMMA_2_2_MUL_ALPHA),
-    babl_component_from_id (BABL_BLUE_GAMMA_2_2_MUL_ALPHA),
+    babl_component_from_id (BABL_RED_NONLINEAR_MUL_ALPHA),
+    babl_component_from_id (BABL_GREEN_NONLINEAR_MUL_ALPHA),
+    babl_component_from_id (BABL_BLUE_NONLINEAR_MUL_ALPHA),
     babl_component_from_id (BABL_ALPHA),
     NULL);
 
@@ -661,28 +661,28 @@ formats (void)
     NULL);
 
   babl_format_new (
-    babl_model_from_id (BABL_RGB_GAMMA_2_2),
+    babl_model_from_id (BABL_RGB_NONLINEAR),
     babl_type_from_id (BABL_U32),
-    babl_component_from_id (BABL_RED_GAMMA_2_2),
-    babl_component_from_id (BABL_GREEN_GAMMA_2_2),
-    babl_component_from_id (BABL_BLUE_GAMMA_2_2),
+    babl_component_from_id (BABL_RED_NONLINEAR),
+    babl_component_from_id (BABL_GREEN_NONLINEAR),
+    babl_component_from_id (BABL_BLUE_NONLINEAR),
     NULL);
 
   babl_format_new (
-    babl_model_from_id (BABL_RGBA_GAMMA_2_2),
+    babl_model_from_id (BABL_RGBA_NONLINEAR),
     babl_type_from_id (BABL_U32),
-    babl_component_from_id (BABL_RED_GAMMA_2_2),
-    babl_component_from_id (BABL_GREEN_GAMMA_2_2),
-    babl_component_from_id (BABL_BLUE_GAMMA_2_2),
+    babl_component_from_id (BABL_RED_NONLINEAR),
+    babl_component_from_id (BABL_GREEN_NONLINEAR),
+    babl_component_from_id (BABL_BLUE_NONLINEAR),
     babl_component_from_id (BABL_ALPHA),
     NULL);
 
   babl_format_new (
-    babl_model_from_id (BABL_RGBA_GAMMA_2_2_PREMULTIPLIED),
+    babl_model_from_id (BABL_RGBA_NONLINEAR_PREMULTIPLIED),
     babl_type_from_id (BABL_U32),
-    babl_component_from_id (BABL_RED_GAMMA_2_2_MUL_ALPHA),
-    babl_component_from_id (BABL_GREEN_GAMMA_2_2_MUL_ALPHA),
-    babl_component_from_id (BABL_BLUE_GAMMA_2_2_MUL_ALPHA),
+    babl_component_from_id (BABL_RED_NONLINEAR_MUL_ALPHA),
+    babl_component_from_id (BABL_GREEN_NONLINEAR_MUL_ALPHA),
+    babl_component_from_id (BABL_BLUE_NONLINEAR_MUL_ALPHA),
     babl_component_from_id (BABL_ALPHA),
     NULL);
 


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