Blender V4.3
COM_reduce_to_single_value_operation.hh
Go to the documentation of this file.
1/* SPDX-FileCopyrightText: 2023 Blender Authors
2 *
3 * SPDX-License-Identifier: GPL-2.0-or-later */
4
5#pragma once
6
7#include "COM_context.hh"
8#include "COM_result.hh"
10
12
13/* ------------------------------------------------------------------------------------------------
14 * Reduce To Single Value Operation
15 *
16 * A simple operation that reduces its input result into a single value output result. The input is
17 * assumed to be a texture result of size 1x1, that is, a texture composed of a single pixel, the
18 * value of which shall serve as the single value of the output result. */
20 public:
22
23 /* Download the input pixel from the GPU texture and set its value to the value of the allocated
24 * single value output result. */
25 void execute() override;
26
27 /* Determine if a reduce to single value operation is needed for the input with the
28 * given result. If it is not needed, return a null pointer. If it is needed, return an instance
29 * of the operation. */
30 static SimpleOperation *construct_if_needed(Context &context, const Result &input_result);
31};
32
33} // namespace blender::realtime_compositor
static SimpleOperation * construct_if_needed(Context &context, const Result &input_result)