diff options
author | Campbell Barton <ideasman42@gmail.com> | 2015-03-19 04:42:34 +0300 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2015-03-19 04:42:34 +0300 |
commit | ce11e1c878fa5fffb4ab0a5d0a4b453dc21b8c2e (patch) | |
tree | 50ed6c691dfbce22ce6e07b2db0035533cdda614 /source/blender/imbuf/intern | |
parent | c31aae04870013f5913e03d3a5f6b72c5fc142d9 (diff) |
Cleanup: better not pass function call to FTOCHAR
also use rgb_uchar_to_float
Diffstat (limited to 'source/blender/imbuf/intern')
-rw-r--r-- | source/blender/imbuf/intern/colormanagement.c | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/source/blender/imbuf/intern/colormanagement.c b/source/blender/imbuf/intern/colormanagement.c index 588d81f9a75..a1b7a14c9fe 100644 --- a/source/blender/imbuf/intern/colormanagement.c +++ b/source/blender/imbuf/intern/colormanagement.c @@ -1243,19 +1243,19 @@ const char *IMB_colormanagement_get_rect_colorspace(ImBuf *ibuf) float IMB_colormanagement_get_luminance(const float rgb[3]) { - return dot_v3v3(luma_coefficients, rgb); + return dot_v3v3(luma_coefficients, rgb); } /* Byte equivalent of IMB_colormanagement_get_luminance(). */ unsigned char IMB_colormanagement_get_luminance_byte(const unsigned char rgb[3]) { - float rgbf[3]; + float rgbf[3]; + float val; - rgbf[0] = (float) rgb[0] / 255.0f; - rgbf[1] = (float) rgb[1] / 255.0f; - rgbf[2] = (float) rgb[2] / 255.0f; + rgb_uchar_to_float(rgbf, rgb); + val = dot_v3v3(luma_coefficients, rgbf); - return FTOCHAR(dot_v3v3(luma_coefficients, rgbf)); + return FTOCHAR(val); } /*********************** Threaded display buffer transform routines *************************/ |