Changeset View
Changeset View
Standalone View
Standalone View
source/blender/compositor/operations/COM_GlareThresholdOperation.cpp
| Context not available. | |||||
| #include "COM_GlareThresholdOperation.h" | #include "COM_GlareThresholdOperation.h" | ||||
| #include "BLI_math.h" | #include "BLI_math.h" | ||||
| extern "C" { | |||||
| #include "IMB_colormanagement.h" | |||||
| } | |||||
| GlareThresholdOperation::GlareThresholdOperation() : NodeOperation() | GlareThresholdOperation::GlareThresholdOperation() : NodeOperation() | ||||
| { | { | ||||
| this->addInputSocket(COM_DT_COLOR, COM_SC_FIT); | this->addInputSocket(COM_DT_COLOR, COM_SC_FIT); | ||||
| Context not available. | |||||
| const float threshold = this->m_settings->threshold; | const float threshold = this->m_settings->threshold; | ||||
| this->m_inputProgram->readSampled(output, x, y, sampler); | this->m_inputProgram->readSampled(output, x, y, sampler); | ||||
| if (rgb_to_luma_y(output) >= threshold) { | if (IMB_colormanagement_get_luminance(output) >= threshold) { | ||||
| output[0] -= threshold, output[1] -= threshold, output[2] -= threshold; | output[0] -= threshold, output[1] -= threshold, output[2] -= threshold; | ||||
| output[0] = max(output[0], 0.0f); | output[0] = max(output[0], 0.0f); | ||||
| output[1] = max(output[1], 0.0f); | output[1] = max(output[1], 0.0f); | ||||
| Context not available. | |||||