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_BlurBaseOperation.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_BlurBaseOperation.h')
-rw-r--r--source/blender/compositor/operations/COM_BlurBaseOperation.h22
1 files changed, 18 insertions, 4 deletions
diff --git a/source/blender/compositor/operations/COM_BlurBaseOperation.h b/source/blender/compositor/operations/COM_BlurBaseOperation.h
index 7937ebd69dc..78b1e919aa6 100644
--- a/source/blender/compositor/operations/COM_BlurBaseOperation.h
+++ b/source/blender/compositor/operations/COM_BlurBaseOperation.h
@@ -18,7 +18,7 @@
#pragma once
-#include "COM_NodeOperation.h"
+#include "COM_MultiThreadedOperation.h"
#include "COM_QualityStepHelper.h"
#define MAX_GAUSSTAB_RADIUS 30000
@@ -27,10 +27,16 @@
namespace blender::compositor {
-class BlurBaseOperation : public NodeOperation, public QualityStepHelper {
+class BlurBaseOperation : public MultiThreadedOperation, public QualityStepHelper {
private:
+ bool m_extend_bounds;
+
+ protected:
+ static constexpr int IMAGE_INPUT_INDEX = 0;
+ static constexpr int SIZE_INPUT_INDEX = 1;
+
protected:
- BlurBaseOperation(DataType data_type);
+ BlurBaseOperation(DataType data_type8);
float *make_gausstab(float rad, int size);
#ifdef BLI_HAVE_SSE2
__m128 *convert_gausstab_sse(const float *gausstab, int size);
@@ -49,9 +55,11 @@ class BlurBaseOperation : public NodeOperation, public QualityStepHelper {
float m_size;
bool m_sizeavailable;
- bool m_extend_bounds;
+ /* Flags for inheriting classes. */
+ bool use_variable_size_;
public:
+ virtual void init_data() override;
/**
* Initialize the execution
*/
@@ -75,8 +83,14 @@ class BlurBaseOperation : public NodeOperation, public QualityStepHelper {
this->m_extend_bounds = extend_bounds;
}
+ int get_blur_size(eDimension dim) const;
+
void determineResolution(unsigned int resolution[2],
unsigned int preferredResolution[2]) override;
+
+ virtual void get_area_of_interest(int input_idx,
+ const rcti &output_area,
+ rcti &r_input_area) override;
};
} // namespace blender::compositor