Blender V5.3
COM_repeat_zone_operation.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
5#pragma once
6
8
9namespace blender {
10class ComputeContext;
11namespace bke {
12class bNodeTreeZone;
13}
14} // namespace blender
15
16namespace blender::compositor {
17
18class Context;
20
21/* ------------------------------------------------------------------------------------------------
22 * Repeat Zone Operation
23 *
24 * The repeat zone operation is a zone operation that evaluates a zone a certain number of times,
25 * with the output of one evaluation being the inputs of the next. */
27 public:
29
30 void execute() override;
31
32 private:
33 /* Sets the reference counts of the zone tree operation according to the needed status of the
34 * outputs of the zone output node. This is only called for the last iteration, since the other
35 * iterations supply their outputs back to the inputs of the next iteration. */
36 void set_reference_counts(ZoneTreeOperation &zone_tree_operation);
37
38 /* Maps the input results of the zone tree operation to the inputs of the repeat zone operation
39 * through temporary results that share their data. The given last_zone_tree_operation is the
40 * zone tree operation of the last iteration, which will be nullptr for the first iteration. For
41 * any iteration other than the first one, the inputs will be taken from the outputs of the last
42 * zone tree operation instead. */
43 Vector<std::unique_ptr<Result>> map_inputs(ZoneTreeOperation &zone_tree_operation,
44 ZoneTreeOperation *last_zone_tree_operation);
45
46 /* Maps the inputs that cross the border of the zone. */
47 Vector<std::unique_ptr<Result>> map_external_inputs(ZoneTreeOperation &zone_tree_operation);
48
49 /* Writes the output results of the zone tree operation of the last iteration to this repeat zone
50 * operation by sharing its data and freeing the results. */
51 void write_outputs(ZoneTreeOperation &zone_tree_operation);
52
53 /* Cancel evaluation by allocating default values for the outputs and freeing the results of the
54 * last zone tree operation. */
55 void cancel_evaluation(ZoneTreeOperation &last_zone_tree_operation);
56};
57
58} // namespace blender::compositor
ZoneOperation(Context &context, const bke::bNodeTreeZone &zone, const ComputeContext &compute_context)
ZoneOperation(Context &context, const bke::bNodeTreeZone &zone, const ComputeContext &compute_context)
BMesh Iterators.