babl: replace premultiplied with associated in BablModelFlags
authorØyvind Kolås <pippin@gimp.org>
Mon, 22 Jul 2019 13:29:33 +0000 (15:29 +0200)
committerØyvind Kolås <pippin@gimp.org>
Mon, 22 Jul 2019 13:34:35 +0000 (15:34 +0200)
The terminology that babl has settled for - for the different types
of alpha is associated- and separate- alpha.

babl/babl-model.c
babl/babl.h
babl/base/model-cmyk.c
babl/base/model-gray.c
babl/base/model-rgb.c

index 727e6d66b7d1e8b0b62297d6a45751f85ce2c392..44481acc85994a61f02835e0bf5d23fa29315c96 100644 (file)
@@ -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"))
         {
index b4b9464936f54ab2a808832978786c53f951642c..b32817fc78c12c4141304cf670ebe3c272bcbcff 100644 (file)
@@ -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,
index fac82c9e1b82645fb7da636e5ff8afe80b2e7fa6..13fdedf87adfa973be052358c7d2700ed5ef2cd5 100644 (file)
@@ -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
   );
 
index cfc251e405a449234128e9949aeaa470446d1862..814aa1b905bc8176a87528b8b6afba924e75c61a 100644 (file)
@@ -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);
 
index cdf628ea8f5f7f89baac8ce89a00c3cd63427d5c..c9843eab6cf6c984ffe72e3424bc09a402cd655d 100644 (file)
@@ -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);
 }