diff options
author | Campbell Barton <ideasman42@gmail.com> | 2012-06-13 19:05:42 +0400 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2012-06-13 19:05:42 +0400 |
commit | 1dec23d33a86c0412852ef510fc5b5b619284697 (patch) | |
tree | 22250958b09cf33ac1e6ea764709194da4307b13 /source/blender/compositor/operations/COM_ColorCorrectionOperation.cpp | |
parent | e22aa7bc38c5d38a0714bed8a2a1869383cd5e5a (diff) |
add rgb_to_luma_y(), was being done inline in many places.
Diffstat (limited to 'source/blender/compositor/operations/COM_ColorCorrectionOperation.cpp')
-rw-r--r-- | source/blender/compositor/operations/COM_ColorCorrectionOperation.cpp | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/source/blender/compositor/operations/COM_ColorCorrectionOperation.cpp b/source/blender/compositor/operations/COM_ColorCorrectionOperation.cpp index 82a71f6a7a8..8ff58be7980 100644 --- a/source/blender/compositor/operations/COM_ColorCorrectionOperation.cpp +++ b/source/blender/compositor/operations/COM_ColorCorrectionOperation.cpp @@ -89,12 +89,13 @@ void ColorCorrectionOperation::executePixel(float *output, float x, float y, Pix gain *= (levelShadows*this->data->shadows.gain)+(levelMidtones*this->data->midtones.gain)+(levelHighlights*this->data->highlights.gain); lift += (levelShadows*this->data->shadows.lift)+(levelMidtones*this->data->midtones.lift)+(levelHighlights*this->data->highlights.lift); + float invgamma = 1.0f / gamma; + float luma = rgb_to_luma_y(inputImageColor); + r = inputImageColor[0]; g = inputImageColor[1]; b = inputImageColor[2]; - - float invgamma = 1.0f / gamma; - float luma = 0.2126f * r + 0.7152f * g + 0.0722f * b; + r = (luma + saturation * (r - luma)); g = (luma + saturation * (g - luma)); b = (luma + saturation * (b - luma)); |