Blender V4.3
COM_MapValueOperation.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
15
17 const rcti &area,
19{
20 for (BuffersIterator<float> it = output->iterate_with(inputs, area); !it.is_end(); ++it) {
21 const float input = *it.in(0);
22 const TexMapping *texmap = settings_;
23 float value = (input + texmap->loc[0]) * texmap->size[0];
24 if (texmap->flag & TEXMAP_CLIP_MIN) {
25 if (value < texmap->min[0]) {
26 value = texmap->min[0];
27 }
28 }
29 if (texmap->flag & TEXMAP_CLIP_MAX) {
30 if (value > texmap->max[0]) {
31 value = texmap->max[0];
32 }
33 }
34
35 it.out[0] = value;
36 }
37}
38
39} // namespace blender::compositor
@ TEXMAP_CLIP_MIN
@ TEXMAP_CLIP_MAX
void update_memory_buffer_partial(MemoryBuffer *output, const rcti &area, Span< MemoryBuffer * > inputs) override
a MemoryBuffer contains access to the data
void add_output_socket(DataType datatype)
void add_input_socket(DataType datatype, ResizeMode resize_mode=ResizeMode::Center)
typename BuffersIteratorBuilder< T >::Iterator BuffersIterator
#define min(a, b)
Definition sort.c:32