Blender V4.3
COM_MapUVOperation.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
12 private:
13 static constexpr int IMAGE_INPUT_INDEX = 0;
14 static constexpr int UV_INPUT_INDEX = 1;
15
16 int uv_width_;
17 int uv_height_;
18 int image_width_;
19 int image_height_;
20
21 float alpha_;
22 bool nearest_neighbour_;
23 std::function<void(float x, float y, float *out)> uv_input_read_fn_;
24
25 public:
27
28 void pixel_transform(const float xy[2], float r_uv[2], float r_deriv[2][2], float &r_alpha);
29
30 void init_data() override;
31
32 void set_alpha(float alpha)
33 {
34 alpha_ = alpha;
35 }
36
37 void set_nearest_neighbour(bool nearest_neighbour)
38 {
39 nearest_neighbour_ = nearest_neighbour;
40 }
41
42 void get_area_of_interest(int input_idx, const rcti &output_area, rcti &r_input_area) override;
44 const rcti &area,
45 Span<MemoryBuffer *> inputs) override;
47 const rcti &area,
48 Span<MemoryBuffer *> inputs) override;
49
50 private:
51 bool read_uv(float x, float y, float &r_u, float &r_v, float &r_alpha);
52};
53
54} // namespace blender::compositor
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
void update_memory_buffer_started(MemoryBuffer *output, const rcti &area, Span< MemoryBuffer * > inputs) override
void pixel_transform(const float xy[2], float r_uv[2], float r_deriv[2][2], float &r_alpha)
void set_nearest_neighbour(bool nearest_neighbour)
a MemoryBuffer contains access to the data
int xy[2]
Definition wm_draw.cc:170