[babl] babl: replace premultiplied with associated in BablModelFlags



commit 2c6b794fa6e2af6e55e25451d27938da2a6c3df9
Author: Øyvind Kolås <pippin gimp org>
Date:   Mon Jul 22 15:29:33 2019 +0200

    babl: replace premultiplied with associated in BablModelFlags
    
    The terminology that babl has settled for - for the different types
    of alpha is associated- and separate- alpha.

 babl/babl-model.c      | 10 +++++-----
 babl/babl.h            |  6 ++++--
 babl/base/model-cmyk.c |  4 ++--
 babl/base/model-gray.c |  6 +++---
 babl/base/model-rgb.c  |  6 +++---
 5 files changed, 17 insertions(+), 15 deletions(-)
---
diff --git a/babl/babl-model.c b/babl/babl-model.c
index 727e6d6..44481ac 100644
--- a/babl/babl-model.c
+++ b/babl/babl-model.c
@@ -85,9 +85,9 @@ model_new (const char     *name,
 }
 
 static int
-is_model_duplicate (Babl           *babl, 
-                    const Babl     *space, 
-                    int             components, 
+is_model_duplicate (Babl           *babl,
+                    const Babl     *space,
+                    int             components,
                     BablComponent **component)
 {
   int   i;
@@ -161,9 +161,9 @@ babl_model_new (void *first_argument,
         {
           flags |= BABL_MODEL_FLAG_INVERTED;
         }
-      else if (!strcmp (arg, "premultiplied"))
+      else if (!strcmp (arg, "associated"))
         {
-          flags |= BABL_MODEL_FLAG_PREMULTIPLIED;
+          flags |= BABL_MODEL_FLAG_ASSOCIATED;
         }
       else if (!strcmp (arg, "alpha"))
         {
diff --git a/babl/babl.h b/babl/babl.h
index b4b9464..b32817f 100644
--- a/babl/babl.h
+++ b/babl/babl.h
@@ -289,9 +289,8 @@ const Babl * babl_format_get_model             (const Babl *format);
 enum _BablModelFlag
 {
   BABL_MODEL_FLAG_ALPHA         = 1<<1,
-  BABL_MODEL_FLAG_PREMULTIPLIED = 1<<2,
+  BABL_MODEL_FLAG_ASSOCIATED    = 1<<2,
   BABL_MODEL_FLAG_INVERTED      = 1<<3,
-  /* BABL_MODEL_FLAG_ALPHA_ENCODED = 1<<4, NYI */
 
   BABL_MODEL_FLAG_LINEAR        = 1<<10,
   BABL_MODEL_FLAG_NONLINEAR     = 1<<11,
@@ -305,6 +304,9 @@ enum _BablModelFlag
   /* BABL_MODEL_FLAG_LUZ        = 1<<25, NYI */
 };
 
+// XXX : should warn when used
+#define BABL_MODEL_FLAG_PREMULTIPLIED BABL_MODEL_FLAG_ASSOCIATED
+
 typedef enum _BablModelFlag BablModelFlag;
 
 /* linear, nonlinear and perceptual could occupy two bits with a decidated 0,
diff --git a/babl/base/model-cmyk.c b/babl/base/model-cmyk.c
index fac82c9..13fdedf 100644
--- a/babl/base/model-cmyk.c
+++ b/babl/base/model-cmyk.c
@@ -648,7 +648,7 @@ babl_base_model_cmyk (void)
     "cmyk",
     "inverted",
     "alpha",
-    "premultiplied",
+    "associated",
     NULL
   );
 
@@ -684,7 +684,7 @@ babl_base_model_cmyk (void)
     babl_component ("A"),
     "cmyk",
     "alpha",
-    "premultiplied",
+    "associated",
     NULL
   );
 
diff --git a/babl/base/model-gray.c b/babl/base/model-gray.c
index cfc251e..814aa1b 100644
--- a/babl/base/model-gray.c
+++ b/babl/base/model-gray.c
@@ -106,7 +106,7 @@ models (void)
     babl_component_from_id (BABL_ALPHA),
     "gray",
     "linear",
-    "premultiplied",
+    "associated",
     "alpha",
     NULL);
 
@@ -132,7 +132,7 @@ models (void)
     babl_component_from_id (BABL_ALPHA),
     "gray",
     "nonlinear",
-    "premultiplied",
+    "associated",
     "alpha",
     NULL);
 
@@ -158,7 +158,7 @@ models (void)
     babl_component_from_id (BABL_ALPHA),
     "gray",
     "perceptual",
-    "premultiplied",
+    "associated",
     "alpha",
     NULL);
 
diff --git a/babl/base/model-rgb.c b/babl/base/model-rgb.c
index cdf628e..c9843ea 100644
--- a/babl/base/model-rgb.c
+++ b/babl/base/model-rgb.c
@@ -171,7 +171,7 @@ models (void)
     babl_component_from_id (BABL_ALPHA),
     "rgb",
     "linear",
-    "premultiplied",
+    "associated",
     "alpha",
     NULL);
 
@@ -223,7 +223,7 @@ models (void)
     babl_component_from_id (BABL_ALPHA),
     "rgb",
     "nonlinear",
-    "premultiplied",
+    "associated",
     "alpha",
     NULL);
 
@@ -235,7 +235,7 @@ models (void)
     babl_component_from_id (BABL_ALPHA),
     "rgb",
     "perceptual",
-    "premultiplied",
+    "associated",
     "alpha",
     NULL);
 }


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