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-07-08 21:51:28 +0400
committerCampbell Barton <ideasman42@gmail.com>2012-07-08 21:51:28 +0400
commit2580575658c17538baf2770ef823cf21c7ec1710 (patch)
treee93e697cc7c2911229eec3003c3524b1db0f45a0 /source/blender/blenlib/intern/math_color_inline.c
parent063f78041af082222f8a5c6dc4fd3f6f956ae9fe (diff)
correct another case of nonnull (all should be correct now), and comment about color conversion.
Diffstat (limited to 'source/blender/blenlib/intern/math_color_inline.c')
-rw-r--r--source/blender/blenlib/intern/math_color_inline.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/source/blender/blenlib/intern/math_color_inline.c b/source/blender/blenlib/intern/math_color_inline.c
index a3835b5bb4a..6b90cbfe9c3 100644
--- a/source/blender/blenlib/intern/math_color_inline.c
+++ b/source/blender/blenlib/intern/math_color_inline.c
@@ -237,6 +237,10 @@ MINLINE float rgb_to_bw(const float rgb[3])
return 0.35f * rgb[0] + 0.45f * rgb[1] + 0.2f * rgb[2];
}
+/* non-linear luma from ITU-R BT.601-2
+ * see: http://www.poynton.com/notes/colour_and_gamma/ColorFAQ.html#RTFToC11
+ * note: the values used for are not exact matches to those documented above,
+ * but they are from the same */
MINLINE float rgb_to_grayscale(const float rgb[3])
{
return 0.3f * rgb[0] + 0.58f * rgb[1] + 0.12f * rgb[2];