Blender V4.3
COM_FileOutputOperation.h
Go to the documentation of this file.
1/* SPDX-FileCopyrightText: 2011 Blender Authors
2 *
3 * SPDX-License-Identifier: GPL-2.0-or-later */
4
5#pragma once
6
7#include "BLI_vector.hh"
8
9#include "DNA_node_types.h"
10
12#include "COM_NodeOperation.h"
13
15class FileOutput;
16}
17
18namespace blender::compositor {
19
22
24 /* The internal data type of the input in the operation, which can be different from the UI type.
25 * See the get_input_data_type function in COM_FileOutputNode.cc for more information. */
27 /* Stores the original data type of socket in the UI, see data_type above for more information
28 * about the distinction. */
30
31 float *output_buffer = nullptr;
33};
34
36 private:
37 const CompositorContext *context_;
38 const NodeImageMultiFile *node_data_;
39 Vector<FileOutputInput> file_output_inputs_;
40
41 public:
43 const NodeImageMultiFile *node_data,
45
46 bool is_output_operation(bool /*rendering*/) const override
47 {
48 return true;
49 }
50 void init_execution() override;
51 void deinit_execution() override;
56
58 const rcti &area,
59 Span<MemoryBuffer *> inputs) override;
60
61 private:
62 void execute_single_layer();
63 void execute_single_layer_multi_view_exr(const FileOutputInput &input,
65 const char *base_path);
66 void execute_multi_layer();
67
68 /* Add a pass of the given name, view, and input buffer. The pass channel identifiers follows the
69 * EXR conventions. */
70 void add_pass_for_input(realtime_compositor::FileOutput &file_output,
71 const FileOutputInput &input,
72 const char *pass_name,
73 const char *view_name);
74
75 /* Add a view of the given name and input buffer. */
76 void add_view_for_input(realtime_compositor::FileOutput &file_output,
77 const FileOutputInput &input,
78 const char *view_name);
79
80 /* Get the base path of the image to be saved, based on the base path of the node. The base name
81 * is an optional initial name of the image, which will later be concatenated with other
82 * information like the frame number, view, and extension. If the base name is empty, then the
83 * base path represents a directory, so a trailing slash is ensured. */
84 void get_single_layer_image_base_path(const char *base_name, char *base_path);
85
86 /* Get the path of the image to be saved based on the given format. */
87 void get_single_layer_image_path(const char *base_path,
89 char *image_path);
90
91 /* Get the path of the EXR image to be saved. If the given view is not empty, its corresponding
92 * file suffix will be appended to the name. */
93 void get_multi_layer_exr_image_path(const char *base_path, const char *view, char *image_path);
94
95 bool is_multi_layer();
96
97 const char *get_base_path();
98
99 /* Add the file format extensions to the rendered file name. */
100 bool use_file_extension();
101
102 /* If true, save views in a multi-view EXR file, otherwise, save each view in its own file. */
103 bool is_multi_view_exr();
104
105 bool is_multi_view_scene();
106};
107
108} // namespace blender::compositor
Overall context of the compositor.
eCompositorPriority get_render_priority() const override
get the render priority of this node.
void update_memory_buffer(MemoryBuffer *output, const rcti &area, Span< MemoryBuffer * > inputs) override
bool is_output_operation(bool) const override
is_output_operation determines whether this operation is an output of the ExecutionSystem during rend...
FileOutputOperation(const CompositorContext *context, const NodeImageMultiFile *node_data, Vector< FileOutputInput > inputs)
a MemoryBuffer contains access to the data
NodeOperation contains calculation logic.
eCompositorPriority
Possible priority settings.
Definition COM_Enums.h:33
DataType
possible data types for sockets
Definition COM_defines.h:21
format
FileOutputInput(NodeImageMultiFileSocket *data, DataType data_type, DataType original_data_type)