Blender
V5.0
source
blender
compositor
COM_conversion_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_input_descriptor.hh
"
9
#include "
COM_result.hh
"
10
#include "
COM_simple_operation.hh
"
11
12
namespace
blender::compositor
{
13
14
/* --------------------------------------------------------------------
15
* Conversion Operation
16
*
17
* A simple operation that converts a result from a certain type to another. See the derived
18
* classes for more details. */
19
class
ConversionOperation
:
public
SimpleOperation
{
20
public
:
21
ConversionOperation
(
Context
&
context
,
22
const
ResultType
input_type,
23
const
ResultType
expected_type);
24
25
/* If the input result is a single value, execute_single is called. Otherwise, the shader
26
* provided by get_conversion_shader is dispatched for GPU contexts or execute_cpu is called for
27
* CPU contexts. */
28
void
execute
()
override
;
29
30
/* Determine if a conversion operation is needed for the input with the given result and
31
* descriptor. If it is not needed, return a null pointer. If it is needed, return an instance of
32
* the appropriate conversion operation. */
33
static
SimpleOperation
*
construct_if_needed
(
Context
&
context
,
34
const
Result
&input_result,
35
const
InputDescriptor
&input_descriptor);
36
37
private
:
38
/* Convert the input single value result to the output single value result. */
39
void
execute_single(
const
Result
&
input
,
Result
&
output
);
40
41
/* Convert the input to the appropriate type and write the result to the output on the CPU. */
42
void
execute_cpu(
const
Result
&
input
,
Result
&
output
);
43
};
44
45
}
// namespace blender::compositor
COM_context.hh
COM_input_descriptor.hh
COM_result.hh
COM_simple_operation.hh
blender::compositor::Context
Definition
COM_context.hh:44
blender::compositor::ConversionOperation::execute
void execute() override
Definition
conversion_operation.cc:73
blender::compositor::ConversionOperation::construct_if_needed
static SimpleOperation * construct_if_needed(Context &context, const Result &input_result, const InputDescriptor &input_descriptor)
Definition
conversion_operation.cc:119
blender::compositor::ConversionOperation::ConversionOperation
ConversionOperation(Context &context, const ResultType input_type, const ResultType expected_type)
Definition
conversion_operation.cc:27
blender::compositor::InputDescriptor
Definition
COM_input_descriptor.hh:44
blender::compositor::Operation::context
Context & context() const
Definition
operation.cc:163
blender::compositor::Result
Definition
COM_result.hh:100
blender::compositor::SimpleOperation
Definition
COM_simple_operation.hh:21
input
#define input
Definition
gpu_shader_compat_cxx.hh:170
output
#define output
Definition
gpu_shader_compat_cxx.hh:171
blender::compositor
Definition
BKE_node.hh:77
blender::compositor::ResultType
ResultType
Definition
COM_result.hh:37
Generated on
for Blender by
doxygen
1.16.1