diff options
author | Antony Riakiotakis <kalast@gmail.com> | 2015-03-17 17:20:33 +0300 |
---|---|---|
committer | Antony Riakiotakis <kalast@gmail.com> | 2015-03-17 17:20:33 +0300 |
commit | dd38dce7f0ae604396d1e96bc49500369fdedf29 (patch) | |
tree | 2b32e776f0bb972705d2c884cb6d5ec77deaf714 /source/blender/blenlib/intern/math_color_inline.c | |
parent | 42aac45d7f0e0f43725093e97ebb8175a95aa247 (diff) |
Part 2 of D1082 by Troy Sobotka, remove our functions that do luma
calculations and use the OCIO one instead.
Diffstat (limited to 'source/blender/blenlib/intern/math_color_inline.c')
-rw-r--r-- | source/blender/blenlib/intern/math_color_inline.c | 55 |
1 files changed, 0 insertions, 55 deletions
diff --git a/source/blender/blenlib/intern/math_color_inline.c b/source/blender/blenlib/intern/math_color_inline.c index dc62d04ad55..96aa4b55201 100644 --- a/source/blender/blenlib/intern/math_color_inline.c +++ b/source/blender/blenlib/intern/math_color_inline.c @@ -200,61 +200,6 @@ MINLINE void cpack_cpy_3ub(unsigned char r_col[3], const unsigned int pack) r_col[2] = ((pack) >> 16) & 0xFF; } -/* TODO: - * - * regarding #rgb_to_bw vs #rgb_to_grayscale, - * it seems nobody knows why we have both functions which convert color to grays - * but with different influences, this is quite stupid, and should be resolved - * by someone who knows this stuff: see this thread - * http://lists.blender.org/pipermail/bf-committers/2012-June/037180.html - * - * Only conclusion is that rgb_to_grayscale is used more for compositing. - */ -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]; -} - -MINLINE unsigned char rgb_to_grayscale_byte(const unsigned char rgb[3]) -{ - return (unsigned char)(((76 * (unsigned short)rgb[0]) + - (148 * (unsigned short)rgb[1]) + - (31 * (unsigned short)rgb[2])) / 255); -} - -/* luma from defined by 'YCC_JFIF', see #rgb_to_ycc */ -MINLINE float rgb_to_luma(const float rgb[3]) -{ - return 0.299f * rgb[0] + 0.587f * rgb[1] + 0.114f * rgb[2]; -} - -MINLINE unsigned char rgb_to_luma_byte(const unsigned char rgb[3]) -{ - return (unsigned char)(((76 * (unsigned short)rgb[0]) + - (150 * (unsigned short)rgb[1]) + - (29 * (unsigned short)rgb[2])) / 255); -} - -/* gamma-corrected RGB --> CIE XYZ - * for this function we only get the Y component - * see: http://software.intel.com/sites/products/documentation/hpc/ipp/ippi/ippi_ch6/ch6_color_models.html - * - * also known as: - * luminance rec. 709 */ -MINLINE float rgb_to_luma_y(const float rgb[3]) -{ - return 0.212671f * rgb[0] + 0.71516f * rgb[1] + 0.072169f * rgb[2]; -} - MINLINE int compare_rgb_uchar(const unsigned char col_a[3], const unsigned char col_b[3], const int limit) { const int r = (int)col_a[0] - (int)col_b[0]; |