Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'source/blender/blenlib/intern/math_color_inline.c')
-rw-r--r--source/blender/blenlib/intern/math_color_inline.c14
1 files changed, 12 insertions, 2 deletions
diff --git a/source/blender/blenlib/intern/math_color_inline.c b/source/blender/blenlib/intern/math_color_inline.c
index b8eeca50db6..c24da9fcf80 100644
--- a/source/blender/blenlib/intern/math_color_inline.c
+++ b/source/blender/blenlib/intern/math_color_inline.c
@@ -270,7 +270,7 @@ MINLINE int compare_rgb_uchar(const unsigned char col_a[3], const unsigned char
/**************** Alpha Transformations *****************/
-MINLINE void premul_to_straight_v4(float straight[4], const float premul[4])
+MINLINE void premul_to_straight_v4_v4(float straight[4], const float premul[4])
{
if (premul[3] == 0.0f || premul[3] == 1.0f) {
straight[0] = premul[0];
@@ -287,7 +287,12 @@ MINLINE void premul_to_straight_v4(float straight[4], const float premul[4])
}
}
-MINLINE void straight_to_premul_v4(float premul[4], const float straight[4])
+MINLINE void premul_to_straight_v4(float color[4])
+{
+ premul_to_straight_v4_v4(color, color);
+}
+
+MINLINE void straight_to_premul_v4_v4(float premul[4], const float straight[4])
{
float alpha = straight[3];
premul[0] = straight[0] * alpha;
@@ -296,6 +301,11 @@ MINLINE void straight_to_premul_v4(float premul[4], const float straight[4])
premul[3] = straight[3];
}
+MINLINE void straight_to_premul_v4(float color[4])
+{
+ straight_to_premul_v4_v4(color, color);
+}
+
MINLINE void straight_uchar_to_premul_float(float result[4], const unsigned char color[4])
{
float alpha = color[3] / 255.0f;