Changeset View
Changeset View
Standalone View
Standalone View
source/blender/compositor/operations/COM_ColorCorrectionOperation.cpp
| Show First 20 Lines • Show All 111 Lines • ▼ Show 20 Lines | #undef MARGIN_DIV | ||||
| r = (luma + saturation * (r - luma)); | r = (luma + saturation * (r - luma)); | ||||
| g = (luma + saturation * (g - luma)); | g = (luma + saturation * (g - luma)); | ||||
| b = (luma + saturation * (b - luma)); | b = (luma + saturation * (b - luma)); | ||||
| r = 0.5f + ((r - 0.5f) * contrast); | r = 0.5f + ((r - 0.5f) * contrast); | ||||
| g = 0.5f + ((g - 0.5f) * contrast); | g = 0.5f + ((g - 0.5f) * contrast); | ||||
| b = 0.5f + ((b - 0.5f) * contrast); | b = 0.5f + ((b - 0.5f) * contrast); | ||||
| r = powf(r * gain + lift, invgamma); | /* Check for negative values to avoid nan. */ | ||||
| g = powf(g * gain + lift, invgamma); | r = (r > 0.0f) ? powf(r * gain + lift, invgamma) : r; | ||||
| b = powf(b * gain + lift, invgamma); | g = (g > 0.0f) ? powf(g * gain + lift, invgamma) : g; | ||||
| b = (b > 0.0f) ? powf(b * gain + lift, invgamma) : b; | |||||
| // mix with mask | // mix with mask | ||||
| r = mvalue * inputImageColor[0] + value * r; | r = mvalue * inputImageColor[0] + value * r; | ||||
| g = mvalue * inputImageColor[1] + value * g; | g = mvalue * inputImageColor[1] + value * g; | ||||
| b = mvalue * inputImageColor[2] + value * b; | b = mvalue * inputImageColor[2] + value * b; | ||||
| if (this->m_redChannelEnabled) { | if (this->m_redChannelEnabled) { | ||||
| output[0] = r; | output[0] = r; | ||||
| Show All 24 Lines | |||||