Blender V4.3
COM_GlareBaseOperation.cc
Go to the documentation of this file.
1/* SPDX-FileCopyrightText: 2011 Blender Authors
2 *
3 * SPDX-License-Identifier: GPL-2.0-or-later */
4
6
7namespace blender::compositor {
8
10{
13 settings_ = nullptr;
15 is_output_rendered_ = false;
16}
17
19 const rcti & /*output_area*/,
20 rcti &r_input_area)
21{
22 BLI_assert(input_idx == 0);
23 UNUSED_VARS_NDEBUG(input_idx);
24 r_input_area.xmin = 0;
25 r_input_area.xmax = this->get_width();
26 r_input_area.ymin = 0;
27 r_input_area.ymax = this->get_height();
28}
29
31 const rcti & /*area*/,
33{
34 if (!is_output_rendered_) {
35 MemoryBuffer *input = inputs[0];
36 if (input->is_a_single_elem()) {
37 copy_v4_v4(output->get_elem(0, 0), input->get_elem(0, 0));
38 is_output_rendered_ = true;
39 return;
40 }
41
42 this->generate_glare(output->get_buffer(), input, settings_);
43 is_output_rendered_ = true;
44 }
45}
46
47} // namespace blender::compositor
#define BLI_assert(a)
Definition BLI_assert.h:50
MINLINE void copy_v4_v4(float r[4], const float a[4])
#define UNUSED_VARS_NDEBUG(...)
virtual void generate_glare(float *data, MemoryBuffer *input_tile, const NodeGlare *settings)=0
void get_area_of_interest(int input_idx, const rcti &output_area, rcti &r_input_area) final
Get input operation area being read by this operation on rendering given output area.
void update_memory_buffer(MemoryBuffer *output, const rcti &area, Span< MemoryBuffer * > inputs) final
a MemoryBuffer contains access to the data
float * get_buffer()
get the data of this MemoryBuffer
void add_output_socket(DataType datatype)
void add_input_socket(DataType datatype, ResizeMode resize_mode=ResizeMode::Center)
int ymin
int ymax
int xmin
int xmax