diff options
author | Manuel Castilla <manzanillawork@gmail.com> | 2021-09-28 20:33:26 +0300 |
---|---|---|
committer | Manuel Castilla <manzanillawork@gmail.com> | 2021-09-28 23:00:17 +0300 |
commit | 283d76a70dba69665d08039a0a7c675c9efc7110 (patch) | |
tree | 1536dd01699558f7924e110fded3e56bd303d719 /source/blender/compositor/operations/COM_GlareThresholdOperation.cc | |
parent | 0830211c952983075f420175904fa10edf7b7f08 (diff) |
Compositor: Full frame Glare node
Part of T88150.
Diffstat (limited to 'source/blender/compositor/operations/COM_GlareThresholdOperation.cc')
-rw-r--r-- | source/blender/compositor/operations/COM_GlareThresholdOperation.cc | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/source/blender/compositor/operations/COM_GlareThresholdOperation.cc b/source/blender/compositor/operations/COM_GlareThresholdOperation.cc index f8da0b9a102..1bf7cf5ae07 100644 --- a/source/blender/compositor/operations/COM_GlareThresholdOperation.cc +++ b/source/blender/compositor/operations/COM_GlareThresholdOperation.cc @@ -71,4 +71,24 @@ void GlareThresholdOperation::deinitExecution() this->m_inputProgram = nullptr; } +void GlareThresholdOperation::update_memory_buffer_partial(MemoryBuffer *output, + const rcti &area, + Span<MemoryBuffer *> inputs) +{ + const float threshold = this->m_settings->threshold; + for (BuffersIterator<float> it = output->iterate_with(inputs, area); !it.is_end(); ++it) { + const float *color = it.in(0); + if (IMB_colormanagement_get_luminance(color) >= threshold) { + it.out[0] = color[0] - threshold; + it.out[1] = color[1] - threshold; + it.out[2] = color[2] - threshold; + + CLAMP3_MIN(it.out, 0.0f); + } + else { + zero_v3(it.out); + } + } +} + } // namespace blender::compositor |