[Bf-blender-cvs] [685b92e7edc] temp-explicit-colors: Cleanup: to_premultiplied_alpha => premultiply_alpha.

Jeroen Bakker noreply at git.blender.org
Tue May 25 08:56:14 CEST 2021


Commit: 685b92e7edcbfec6c49ca90ebecdb733131a16e4
Author: Jeroen Bakker
Date:   Tue May 25 08:14:48 2021 +0200
Branches: temp-explicit-colors
https://developer.blender.org/rB685b92e7edcbfec6c49ca90ebecdb733131a16e4

Cleanup: to_premultiplied_alpha => premultiply_alpha.

===================================================================

M	release/scripts/addons
M	source/blender/blenlib/BLI_color.hh
M	source/blender/blenlib/tests/BLI_color_test.cc
M	source/tools

===================================================================

diff --git a/release/scripts/addons b/release/scripts/addons
index 4fcdbfe7c20..b2948ae5fa0 160000
--- a/release/scripts/addons
+++ b/release/scripts/addons
@@ -1 +1 @@
-Subproject commit 4fcdbfe7c20edfc1204c0aa46c98ea25354abcd9
+Subproject commit b2948ae5fa060f6891d7edfefbee3c9f37394027
diff --git a/source/blender/blenlib/BLI_color.hh b/source/blender/blenlib/BLI_color.hh
index c8af6ce8128..c9f962e0398 100644
--- a/source/blender/blenlib/BLI_color.hh
+++ b/source/blender/blenlib/BLI_color.hh
@@ -37,7 +37,7 @@ namespace blender {
  * ```
  * ColorTheme4b theme_color;
  * ColorSceneLinear4f<eAlpha::Premultiplied> linearrgb_color =
- *     BLI_color_convert_to_linear(theme_color).to_premultiplied_alpha();
+ *     BLI_color_convert_to_linear(theme_color).premultiply_alpha();
  * ```
  *
  * The API is structured to make most use of inlining. Most notable are space
@@ -193,7 +193,7 @@ class ColorSceneLinear4f final : public ColorRGBA<float, eSpace::SceneLinear, Al
    *
    * Will assert when called on a color premultiplied with alpha.
    */
-  ColorSceneLinear4f<eAlpha::Premultiplied> to_premultiplied_alpha() const
+  ColorSceneLinear4f<eAlpha::Premultiplied> premultiply_alpha() const
   {
     BLI_assert(Alpha == eAlpha::Straight);
     ColorSceneLinear4f<eAlpha::Premultiplied> premultiplied;
diff --git a/source/blender/blenlib/tests/BLI_color_test.cc b/source/blender/blenlib/tests/BLI_color_test.cc
index 75cba87a28e..88d188cf13f 100644
--- a/source/blender/blenlib/tests/BLI_color_test.cc
+++ b/source/blender/blenlib/tests/BLI_color_test.cc
@@ -36,7 +36,7 @@ TEST(color, SrgbStraightToSceneLinearPremultiplied)
 
   ColorTheme4b theme(192, 128, 64, 128);
   ColorSceneLinear4f<eAlpha::Premultiplied> linear =
-      BLI_color_convert_to_scene_linear(theme).to_premultiplied_alpha();
+      BLI_color_convert_to_scene_linear(theme).premultiply_alpha();
   EXPECT_NEAR(0.26f, linear.r, 0.01f);
   EXPECT_NEAR(0.11f, linear.g, 0.01f);
   EXPECT_NEAR(0.02f, linear.b, 0.01f);
@@ -46,7 +46,7 @@ TEST(color, SrgbStraightToSceneLinearPremultiplied)
 TEST(color, SceneLinearStraightToPremultiplied)
 {
   ColorSceneLinear4f<eAlpha::Straight> straight(0.75f, 0.5f, 0.25f, 0.5f);
-  ColorSceneLinear4f<eAlpha::Premultiplied> premultiplied = straight.to_premultiplied_alpha();
+  ColorSceneLinear4f<eAlpha::Premultiplied> premultiplied = straight.premultiply_alpha();
   EXPECT_NEAR(0.37f, premultiplied.r, 0.01f);
   EXPECT_NEAR(0.25f, premultiplied.g, 0.01f);
   EXPECT_NEAR(0.12f, premultiplied.b, 0.01f);
diff --git a/source/tools b/source/tools
index f99d29ae3e6..5fdcb9fed44 160000
--- a/source/tools
+++ b/source/tools
@@ -1 +1 @@
-Subproject commit f99d29ae3e6ad44d45d79309454c45f8088781a4
+Subproject commit 5fdcb9fed44fff7a5965cc6d12d8fefba6d16e4e



More information about the Bf-blender-cvs mailing list