Blender V4.3
COM_VariableSizeBokehBlurOperation.h
Go to the documentation of this file.
1/* SPDX-FileCopyrightText: 2011 Blender Authors
2 *
3 * SPDX-License-Identifier: GPL-2.0-or-later */
4
5#pragma once
6
8
9namespace blender::compositor {
10
11// #define COM_DEFOCUS_SEARCH
12
14 private:
15 static constexpr int IMAGE_INPUT_INDEX = 0;
16 static constexpr int BOKEH_INPUT_INDEX = 1;
17 static constexpr int SIZE_INPUT_INDEX = 2;
18 static constexpr int BOUNDING_BOX_INPUT_INDEX = 3;
19#ifdef COM_DEFOCUS_SEARCH
20 static constexpr int DEFOCUS_INPUT_INDEX = 4;
21#endif
22
23 int max_blur_;
24 float threshold_;
25 bool do_size_scale_; /* scale size, matching 'BokehBlurNode' */
26
27 public:
29
30 void set_max_blur(int max_radius)
31 {
32 max_blur_ = max_radius;
33 }
34
35 void set_threshold(float threshold)
36 {
37 threshold_ = threshold;
38 }
39
40 void set_do_scale_size(bool scale_size)
41 {
42 do_size_scale_ = scale_size;
43 }
44
45 void get_area_of_interest(int input_idx, const rcti &output_area, rcti &r_input_area) override;
47 const rcti &area,
48 Span<MemoryBuffer *> inputs) override;
49};
50
51/* Currently unused. If ever used, it needs full-frame implementation. */
52#ifdef COM_DEFOCUS_SEARCH
53class InverseSearchRadiusOperation : public NodeOperation {
54 private:
55 int max_blur_;
56
57 public:
58 static const int DIVIDER = 4;
59
60 InverseSearchRadiusOperation();
61
62 void determine_canvas(const rcti &preferred_area, rcti &r_area) override;
63
64 void set_max_blur(int max_radius)
65 {
66 max_blur_ = max_radius;
67 }
68};
69#endif
70
71} // namespace blender::compositor
a MemoryBuffer contains access to the data
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.
void update_memory_buffer_partial(MemoryBuffer *output, const rcti &area, Span< MemoryBuffer * > inputs) override