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