diff options
author | Manuel Castilla <manzanillawork@gmail.com> | 2021-07-05 22:00:53 +0300 |
---|---|---|
committer | Manuel Castilla <manzanillawork@gmail.com> | 2021-07-06 00:36:43 +0300 |
commit | bf75106ae98206795818d702102c94a94bfe32a6 (patch) | |
tree | 44422d90e8443a96ef8d50498a603dc18e8f2498 /source | |
parent | c94877ae3d38f2bd0a772caa09ad84647641b7f3 (diff) |
Compositor: Full frame Exposure node
Adds full frame implementation to this node operation.
No functional changes.
1.7x faster than tiled fallback.
Reviewed By: jbakker
Differential Revision: https://developer.blender.org/D11766
Diffstat (limited to 'source')
-rw-r--r-- | source/blender/compositor/operations/COM_ColorExposureOperation.cc | 13 | ||||
-rw-r--r-- | source/blender/compositor/operations/COM_ColorExposureOperation.h | 6 |
2 files changed, 17 insertions, 2 deletions
diff --git a/source/blender/compositor/operations/COM_ColorExposureOperation.cc b/source/blender/compositor/operations/COM_ColorExposureOperation.cc index 1512ff87658..9e527f269cf 100644 --- a/source/blender/compositor/operations/COM_ColorExposureOperation.cc +++ b/source/blender/compositor/operations/COM_ColorExposureOperation.cc @@ -52,6 +52,19 @@ void ExposureOperation::executePixelSampled(float output[4], output[3] = inputValue[3]; } +void ExposureOperation::update_memory_buffer_row(PixelCursor &p) +{ + for (; p.out < p.row_end; p.next()) { + const float *in_value = p.ins[0]; + const float *in_exposure = p.ins[1]; + const float exposure = pow(2, in_exposure[0]); + p.out[0] = in_value[0] * exposure; + p.out[1] = in_value[1] * exposure; + p.out[2] = in_value[2] * exposure; + p.out[3] = in_value[3]; + } +} + void ExposureOperation::deinitExecution() { this->m_inputProgram = nullptr; diff --git a/source/blender/compositor/operations/COM_ColorExposureOperation.h b/source/blender/compositor/operations/COM_ColorExposureOperation.h index 0cfaa059e41..1eb790e8d52 100644 --- a/source/blender/compositor/operations/COM_ColorExposureOperation.h +++ b/source/blender/compositor/operations/COM_ColorExposureOperation.h @@ -18,11 +18,11 @@ #pragma once -#include "COM_NodeOperation.h" +#include "COM_MultiThreadedRowOperation.h" namespace blender::compositor { -class ExposureOperation : public NodeOperation { +class ExposureOperation : public MultiThreadedRowOperation { private: /** * Cached reference to the inputProgram @@ -47,6 +47,8 @@ class ExposureOperation : public NodeOperation { * Deinitialize the execution */ void deinitExecution() override; + + void update_memory_buffer_row(PixelCursor &p) override; }; } // namespace blender::compositor |