Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorManuel Castilla <manzanillawork@gmail.com>2021-08-23 16:30:31 +0300
committerManuel Castilla <manzanillawork@gmail.com>2021-08-23 18:08:45 +0300
commitdaa7c59e38c8fe464004b3becd6956b880c38c92 (patch)
treec579e1eb7908bc24429fad527b9ae58fda4c67d7 /source/blender/compositor/operations/COM_VariableSizeBokehBlurOperation.h
parent344aca3b1bf2718904455ea6cef1ffd8bedf51a6 (diff)
Compositor: Full frame Bokeh Blur and Blur nodes
Adds full frame implementation to these nodes operations. When enabling "extend bounds" node option, tiled implementation result is slightly different because it's using `TranslateOperation` with bilinear sampling for centering. Full frame always uses nearest to don't lose image quality. It has the disadvantage of causing image jiggling on backdrop when switching size values as it's not pixel perfect. This is fixed by rounding to even. No functional changes. Part of T88150. Reviewed By: jbakker Differential Revision: https://developer.blender.org/D12167
Diffstat (limited to 'source/blender/compositor/operations/COM_VariableSizeBokehBlurOperation.h')
-rw-r--r--source/blender/compositor/operations/COM_VariableSizeBokehBlurOperation.h17
1 files changed, 15 insertions, 2 deletions
diff --git a/source/blender/compositor/operations/COM_VariableSizeBokehBlurOperation.h b/source/blender/compositor/operations/COM_VariableSizeBokehBlurOperation.h
index baeab6a646e..d6df9f5b858 100644
--- a/source/blender/compositor/operations/COM_VariableSizeBokehBlurOperation.h
+++ b/source/blender/compositor/operations/COM_VariableSizeBokehBlurOperation.h
@@ -18,15 +18,22 @@
#pragma once
-#include "COM_NodeOperation.h"
+#include "COM_MultiThreadedOperation.h"
#include "COM_QualityStepHelper.h"
namespace blender::compositor {
//#define COM_DEFOCUS_SEARCH
-class VariableSizeBokehBlurOperation : public NodeOperation, public QualityStepHelper {
+class VariableSizeBokehBlurOperation : public MultiThreadedOperation, public QualityStepHelper {
private:
+ static constexpr int IMAGE_INPUT_INDEX = 0;
+ static constexpr int BOKEH_INPUT_INDEX = 1;
+ static constexpr int SIZE_INPUT_INDEX = 2;
+#ifdef COM_DEFOCUS_SEARCH
+ static constexpr int DEFOCUS_INPUT_INDEX = 3;
+#endif
+
int m_maxBlur;
float m_threshold;
bool m_do_size_scale; /* scale size, matching 'BokehBlurNode' */
@@ -84,8 +91,14 @@ class VariableSizeBokehBlurOperation : public NodeOperation, public QualityStepH
MemoryBuffer **inputMemoryBuffers,
std::list<cl_mem> *clMemToCleanUp,
std::list<cl_kernel> *clKernelsToCleanUp) override;
+
+ void get_area_of_interest(int input_idx, const rcti &output_area, rcti &r_input_area) override;
+ void update_memory_buffer_partial(MemoryBuffer *output,
+ const rcti &area,
+ Span<MemoryBuffer *> inputs) override;
};
+/* Currently unused. If ever used, it needs fullframe implementation. */
#ifdef COM_DEFOCUS_SEARCH
class InverseSearchRadiusOperation : public NodeOperation {
private: