Blender V4.3
COM_IDMaskOperation.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 const MemoryBuffer *input = inputs[0];
21 const int width = BLI_rcti_size_x(&area);
22 for (int y = area.ymin; y < area.ymax; y++) {
23 float *out = output->get_elem(area.xmin, y);
24 const float *in = input->get_elem(area.xmin, y);
25 const float *row_end = out + width * output->elem_stride;
26 while (out < row_end) {
27 out[0] = (roundf(in[0]) == object_index_) ? 1.0f : 0.0f;
28 in += input->elem_stride;
29 out += output->elem_stride;
30 }
31 }
32}
33
34} // namespace blender::compositor
BLI_INLINE int BLI_rcti_size_x(const struct rcti *rct)
Definition BLI_rect.h:189
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)