Blender V5.3
compositor.hh
Go to the documentation of this file.
1/* SPDX-FileCopyrightText: 2026 Blender Authors
2 *
3 * SPDX-License-Identifier: GPL-2.0-or-later */
4
8
9#pragma once
10
12
13#include "COM_context.hh"
15#include "SEQ_render.hh"
16
17struct PointerRNA;
18struct bNodeTreeInterfaceSocket;
19enum eNodeSocketDatatype : short;
20
21namespace blender::seq {
22
26void set_input_result_from_rna(PointerRNA &inputs_ptr,
27 const bNodeTreeInterfaceSocket &socket,
28 eNodeSocketDatatype socket_type,
29 compositor::Result &result);
30
32 protected:
34 const Strip *strip_ = nullptr;
36
37 /* True if GPU compute is supported and can be used, if false, we fallback to CPU. */
38 bool gpu_supported_ = true;
39
40 public:
50 const Main &get_main() const override
51 {
52 return *render_data_.bmain;
53 }
54 const Scene &get_scene() const override
55 {
56 return *render_data_.scene;
57 }
58 const Strip *get_strip() const override
59 {
60 return strip_;
61 }
62
63 void set_gpu_supported(const bool supported)
64 {
65 gpu_supported_ = supported;
66 }
67
68 bool use_gpu() const override
69 {
70 return gpu_supported_ &&
72 }
73
81
83
88
89 protected:
93 void write_outputs(const bNodeTree &node_group,
94 compositor::NodeGroupOperation &node_group_operation,
95 ImBuf &output_image);
96 void set_output_refcount(const bNodeTree &node_group,
97 compositor::NodeGroupOperation &node_group_operation);
98};
99
100} // namespace blender::seq
Context(StaticCacheManager &cache_manager, bke::ComputeContextCache &compute_context_cache)
bke::ComputeContextCache & compute_context_cache() const
const RenderData & render_data_
Definition compositor.hh:33
bool use_gpu() const override
Definition compositor.hh:68
const Strip * get_strip() const override
Definition compositor.hh:58
void write_outputs(const bNodeTree &node_group, compositor::NodeGroupOperation &node_group_operation, ImBuf &output_image)
const Main & get_main() const override
Definition compositor.hh:50
void write_output(const compositor::Result &result, ImBuf &image)
compositor::SideEffectOutputTypes needed_side_effect_output_types() const override
Definition compositor.hh:74
const Scene & get_scene() const override
Definition compositor.hh:54
void set_gpu_supported(const bool supported)
Definition compositor.hh:63
float2 get_result_translation() const
Definition compositor.hh:84
void write_viewer_impl(const compositor::Result &result, ImBuf &image)
CompositorContext(compositor::StaticCacheManager &cache_manager, bke::ComputeContextCache &compute_context_cache, const RenderData &render_data, const Strip &strip)
Definition compositor.hh:41
void create_result_from_input(compositor::Result &result, ImBuf &input)
void set_output_refcount(const bNodeTree &node_group, compositor::NodeGroupOperation &node_group_operation)
compositor::ResultPrecision get_precision() const override
void set_input_result_from_rna(PointerRNA &inputs_ptr, const bNodeTreeInterfaceSocket &socket, const eNodeSocketDatatype socket_type, compositor::Result &result)
VecBase< float, 2 > float2
@ SCE_COMPOSITOR_DEVICE_GPU
eCompositorDevice compositor_device
struct RenderData r