diff options
author | Campbell Barton <ideasman42@gmail.com> | 2012-06-13 19:13:19 +0400 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2012-06-13 19:13:19 +0400 |
commit | 0bed750c3a4f7b368c06d40847356451f51eced6 (patch) | |
tree | 768c667043cb7a7f686994151c11ea9a07986f12 /source/blender/blenlib/intern/math_color.c | |
parent | 1dec23d33a86c0412852ef510fc5b5b619284697 (diff) |
move one line color conversion functions to be inline.
Diffstat (limited to 'source/blender/blenlib/intern/math_color.c')
-rw-r--r-- | source/blender/blenlib/intern/math_color.c | 31 |
1 files changed, 0 insertions, 31 deletions
diff --git a/source/blender/blenlib/intern/math_color.c b/source/blender/blenlib/intern/math_color.c index f1529671492..c32f981396d 100644 --- a/source/blender/blenlib/intern/math_color.c +++ b/source/blender/blenlib/intern/math_color.c @@ -496,37 +496,6 @@ int constrain_rgb(float *r, float *g, float *b) return 0; /* Color within RGB gamut */ } -float rgb_to_grayscale(const float rgb[3]) -{ - return 0.3f * rgb[0] + 0.58f * rgb[1] + 0.12f * rgb[2]; -} - -unsigned char rgb_to_grayscale_byte(const unsigned char rgb[3]) -{ - return (76 * (unsigned short) rgb[0] + 148 * (unsigned short) rgb[1] + 31 * (unsigned short) rgb[2]) / 255; -} - -float rgb_to_luma(const float rgb[3]) -{ - return 0.299f * rgb[0] + 0.587f * rgb[1] + 0.114f * rgb[2]; -} - -unsigned char rgb_to_luma_byte(const unsigned char rgb[3]) -{ - return (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 */ -float rgb_to_luma_y(const float rgb[3]) -{ - return 0.212671f * rgb[0] + 0.71516f * rgb[1] + 0.072169f * rgb[2]; -} - /* ********************************* lift/gamma/gain / ASC-CDL conversion ********************************* */ void lift_gamma_gain_to_asc_cdl(float *lift, float *gamma, float *gain, float *offset, float *slope, float *power) |