[Bf-blender-cvs] [bf75106ae98] master: Compositor: Full frame Exposure node

Manuel Castilla noreply at git.blender.org
Mon Jul 5 23:51:56 CEST 2021


Commit: bf75106ae98206795818d702102c94a94bfe32a6
Author: Manuel Castilla
Date:   Mon Jul 5 21:00:53 2021 +0200
Branches: master
https://developer.blender.org/rBbf75106ae98206795818d702102c94a94bfe32a6

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

===================================================================

M	source/blender/compositor/operations/COM_ColorExposureOperation.cc
M	source/blender/compositor/operations/COM_ColorExposureOperation.h

===================================================================

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



More information about the Bf-blender-cvs mailing list