diff --git a/source/blender/compositor/nodes/COM_KuwaharaNode.cc b/source/blender/compositor/nodes/COM_KuwaharaNode.cc index fa4171f49d8..8219fa3b4fd 100644 --- a/source/blender/compositor/nodes/COM_KuwaharaNode.cc +++ b/source/blender/compositor/nodes/COM_KuwaharaNode.cc @@ -2,8 +2,6 @@ * * SPDX-License-Identifier: GPL-2.0-or-later */ -#define DNA_DEPRECATED_ALLOW /* For copy of deprecated NodeKuwaharaData members. */ - #include "DNA_node_types.h" #include "DNA_scene_types.h" @@ -26,7 +24,7 @@ void KuwaharaNode::convert_to_operations(NodeConverter &converter, switch (data->variation) { case CMP_NODE_KUWAHARA_CLASSIC: { KuwaharaClassicOperation *kuwahara_classic = new KuwaharaClassicOperation(); - kuwahara_classic->set_data(data); + kuwahara_classic->set_high_precision(data->high_precision); converter.add_operation(kuwahara_classic); converter.map_input_socket(get_input_socket(0), kuwahara_classic->get_input_socket(0)); converter.map_input_socket(get_input_socket(1), kuwahara_classic->get_input_socket(1)); @@ -78,7 +76,8 @@ void KuwaharaNode::convert_to_operations(NodeConverter &converter, KuwaharaAnisotropicOperation *kuwahara_anisotropic_operation = new KuwaharaAnisotropicOperation(); - kuwahara_anisotropic_operation->data = *data; + kuwahara_anisotropic_operation->set_sharpness(data->sharpness); + kuwahara_anisotropic_operation->set_eccentricity(data->eccentricity); converter.add_operation(kuwahara_anisotropic_operation); converter.map_input_socket(get_input_socket(0), diff --git a/source/blender/compositor/operations/COM_KuwaharaAnisotropicOperation.cc b/source/blender/compositor/operations/COM_KuwaharaAnisotropicOperation.cc index 85a17a28dbc..4e96041efe5 100644 --- a/source/blender/compositor/operations/COM_KuwaharaAnisotropicOperation.cc +++ b/source/blender/compositor/operations/COM_KuwaharaAnisotropicOperation.cc @@ -279,7 +279,7 @@ void KuwaharaAnisotropicOperation::update_memory_buffer_partial(MemoryBuffer *ou * zero to counter its exponential nature for more intuitive user control. */ float KuwaharaAnisotropicOperation::get_sharpness() { - return data.sharpness * data.sharpness * 16.0f; + return sharpness_ * sharpness_ * 16.0f; } /* The eccentricity controls how much the image anisotropy affects the eccentricity of the @@ -297,7 +297,17 @@ float KuwaharaAnisotropicOperation::get_sharpness() * that of infinity. */ float KuwaharaAnisotropicOperation::get_eccentricity() { - return 1.0f / math::max(0.01f, data.eccentricity); + return 1.0f / math::max(0.01f, eccentricity_); +} + +void KuwaharaAnisotropicOperation::set_sharpness(float sharpness) +{ + sharpness_ = sharpness; +} + +void KuwaharaAnisotropicOperation::set_eccentricity(float eccentricity) +{ + eccentricity_ = eccentricity; } } // namespace blender::compositor diff --git a/source/blender/compositor/operations/COM_KuwaharaAnisotropicOperation.h b/source/blender/compositor/operations/COM_KuwaharaAnisotropicOperation.h index 69175c26c77..5b52032975a 100644 --- a/source/blender/compositor/operations/COM_KuwaharaAnisotropicOperation.h +++ b/source/blender/compositor/operations/COM_KuwaharaAnisotropicOperation.h @@ -12,7 +12,8 @@ namespace blender::compositor { class KuwaharaAnisotropicOperation : public MultiThreadedOperation { public: - NodeKuwaharaData data; + float sharpness_; + float eccentricity_; KuwaharaAnisotropicOperation(); @@ -21,6 +22,8 @@ class KuwaharaAnisotropicOperation : public MultiThreadedOperation { Span inputs) override; float get_sharpness(); float get_eccentricity(); + void set_sharpness(float sharpness); + void set_eccentricity(float eccentricity); }; } // namespace blender::compositor diff --git a/source/blender/compositor/operations/COM_KuwaharaClassicOperation.cc b/source/blender/compositor/operations/COM_KuwaharaClassicOperation.cc index a325cd715e3..9dee9642ae9 100644 --- a/source/blender/compositor/operations/COM_KuwaharaClassicOperation.cc +++ b/source/blender/compositor/operations/COM_KuwaharaClassicOperation.cc @@ -52,7 +52,7 @@ void KuwaharaClassicOperation::update_memory_buffer_partial(MemoryBuffer *output /* For high radii, we accelerate the filter using a summed area table, making the filter * execute in constant time as opposed to having quadratic complexity. Except if high precision * is enabled, since summed area tables are less precise. */ - if (!data_->high_precision && size > 5.0f) { + if (!high_precision_ && size > 5.0f) { for (int q = 0; q < 4; q++) { /* A fancy expression to compute the sign of the quadrant q. */ int2 sign = int2((q % 2) * 2 - 1, ((q / 2) * 2 - 1)); diff --git a/source/blender/compositor/operations/COM_KuwaharaClassicOperation.h b/source/blender/compositor/operations/COM_KuwaharaClassicOperation.h index 2627ee0b15f..fb57c6990a7 100644 --- a/source/blender/compositor/operations/COM_KuwaharaClassicOperation.h +++ b/source/blender/compositor/operations/COM_KuwaharaClassicOperation.h @@ -9,14 +9,14 @@ namespace blender::compositor { class KuwaharaClassicOperation : public MultiThreadedOperation { - const NodeKuwaharaData *data_; + bool high_precision_; public: KuwaharaClassicOperation(); - void set_data(const NodeKuwaharaData *data) + void set_high_precision(bool high_precision) { - data_ = data; + high_precision_ = high_precision; } void update_memory_buffer_partial(MemoryBuffer *output,