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:
authorCampbell Barton <ideasman42@gmail.com>2012-06-22 11:49:44 +0400
committerCampbell Barton <ideasman42@gmail.com>2012-06-22 11:49:44 +0400
commit226c86ae58cdf292fd415db05c05fba46375738d (patch)
tree3f002f89da94cc0428529f469175c311d0341561 /source/blender/blenlib/intern/math_color_inline.c
parentec3399efa6882ea5a8fe023092c0918ee7b135d9 (diff)
use an inline function for rgb -> bw conversion.
Diffstat (limited to 'source/blender/blenlib/intern/math_color_inline.c')
-rw-r--r--source/blender/blenlib/intern/math_color_inline.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/source/blender/blenlib/intern/math_color_inline.c b/source/blender/blenlib/intern/math_color_inline.c
index 417c557af8a..f270a20003d 100644
--- a/source/blender/blenlib/intern/math_color_inline.c
+++ b/source/blender/blenlib/intern/math_color_inline.c
@@ -222,6 +222,12 @@ MINLINE void cpack_cpy_3ub(unsigned char r_col[3], const unsigned int pack)
r_col[2] = ((pack) >> 16) & 0xFF;
}
+/* XXX - investigate when/why rgb_to_bw & rgb_to_grayscale are different,
+ * and why we use both! whats the purpose of this? */
+MINLINE float rgb_to_bw(const float rgb[3])
+{
+ return 0.35f * rgb[0] + 0.45f * rgb[1] + 0.2f * rgb[2];
+}
MINLINE float rgb_to_grayscale(const float rgb[3])
{