Blender V4.3
COM_MaskOperation.h
Go to the documentation of this file.
1/* SPDX-FileCopyrightText: 2012 Blender Authors
2 *
3 * SPDX-License-Identifier: GPL-2.0-or-later */
4
5#pragma once
6
7#include "BLI_listbase.h"
9#include "DNA_mask_types.h"
10#include "IMB_imbuf_types.hh"
11
12/* Forward declarations. */
13struct MaskRasterHandle;
14
15namespace blender::compositor {
16
21 protected:
23
24 /* NOTE: these are used more like aspect,
25 * but they _do_ impact on mask detail */
28 float mask_width_inv_; /* `1 / mask_width_` */
29 float mask_height_inv_; /* `1 / mask_height_` */
30 float mask_px_ofs_[2];
31
34
36
39
43 void determine_canvas(const rcti &preferred_area, rcti &r_area) override;
44
45 public:
47
48 void init_execution() override;
49 void deinit_execution() override;
50
51 void set_mask(Mask *mask)
52 {
53 mask_ = mask;
54 }
55 void set_mask_width(int width)
56 {
57 mask_width_ = width;
58 mask_width_inv_ = 1.0f / (float)width;
59 mask_px_ofs_[0] = mask_width_inv_ * 0.5f;
60 }
61 void set_mask_height(int height)
62 {
63 mask_height_ = height;
64 mask_height_inv_ = 1.0f / (float)height;
66 }
68 {
69 return mask_width_;
70 }
72 {
73 return mask_height_;
74 }
75 void set_framenumber(int frame_number)
76 {
77 frame_number_ = frame_number;
78 }
79 void set_feather(bool feather)
80 {
81 do_feather_ = feather;
82 }
83
84 void set_motion_blur_samples(int samples)
85 {
86 raster_mask_handle_tot_ = std::min(std::max(1, samples), CMP_NODE_MASK_MBLUR_SAMPLES_MAX);
87 }
88 void set_motion_blur_shutter(float shutter)
89 {
90 frame_shutter_ = shutter;
91 }
92
94 const rcti &area,
95 Span<MemoryBuffer *> inputs) override;
96
97 private:
98 Vector<MaskRasterHandle *> get_non_null_handles() const;
99};
100
101} // namespace blender::compositor
#define CMP_NODE_MASK_MBLUR_SAMPLES_MAX
Contains defines and structs used throughout the imbuf module.
struct MaskRasterHandle * raster_mask_handles_[CMP_NODE_MASK_MBLUR_SAMPLES_MAX]
void set_motion_blur_shutter(float shutter)
void update_memory_buffer_partial(MemoryBuffer *output, const rcti &area, Span< MemoryBuffer * > inputs) override
void set_framenumber(int frame_number)
void determine_canvas(const rcti &preferred_area, rcti &r_area) override
a MemoryBuffer contains access to the data
draw_view in_light_buf[] float
ccl_device_inline float4 mask(const int4 mask, const float4 a)