20 this->
flags_.can_be_constant =
true;
40 for (const int y : range_y) {
41 float4 accumulated_color = float4(0.0f);
42 for (const int x : IndexRange(area.xmin, area.xmax - area.xmin)) {
43 const float4 color = float4(image->get_elem(x, y));
44 accumulated_color += mode_ == eMode::Squared ? color * color : color;
45 copy_v4_v4(output->get_elem(x, y), accumulated_color);
53 for (const int x : range_x) {
54 float4 accumulated_color = float4(0.0f);
55 for (const int y : IndexRange(area.ymin, area.ymax - area.ymin)) {
56 const float4 color = float4(output->get_elem(x, y));
57 accumulated_color += color;
58 copy_v4_v4(output->get_elem(x, y), accumulated_color);
97 int2 corrected_lower_bound = lower_bound -
int2(1, 1);
98 int2 corrected_upper_bound;
102 float4 a,
b, c, d, addend, substrahend;
103 buffer->
read_elem_checked(corrected_upper_bound[0], corrected_upper_bound[1], a);
104 buffer->
read_elem_checked(corrected_lower_bound[0], corrected_lower_bound[1], d);
108 buffer->
read_elem_checked(corrected_upper_bound[0], corrected_lower_bound[1], c);
static T sum(const btAlignedObjectArray< T > &items)
a MemoryBuffer contains access to the data
void read_elem_checked(int x, int y, float *out) const
const int get_width() const
get the width of this MemoryBuffer
const int get_height() const
get the height of this MemoryBuffer
void add_output_socket(DataType datatype)
NodeOperationFlags flags_
const rcti & get_canvas() const
NodeOperation * get_input_operation(int index)
void add_input_socket(DataType datatype, ResizeMode resize_mode=ResizeMode::Center)
void set_mode(const eMode mode)
SummedAreaTableOperation()
void update_memory_buffer(MemoryBuffer *output, const rcti &area, Span< MemoryBuffer * > inputs) override
void get_area_of_interest(int input_idx, const rcti &output_area, rcti &r_input_area) override
Get input operation area being read by this operation on rendering given output area.
input_tx image(0, GPU_RGBA16F, Qualifier::WRITE, ImageType::FLOAT_2D, "preview_img") .compute_source("compositor_compute_preview.glsl") .do_static_compilation(true)
local_group_size(16, 16) .push_constant(Type b
float4 summed_area_table_sum(MemoryBuffer *buffer, const rcti &area)
T min(const T &a, const T &b)
void parallel_for(const IndexRange range, const int64_t grain_size, const Function &function, const TaskSizeHints &size_hints=detail::TaskSizeHints_Static(1))
VecBase< float, 4 > float4
VecBase< int32_t, 2 > int2
static blender::bke::bNodeSocketTemplate inputs[]