This patch adds initial support for implicit inputs in pixel operations. This is currently a non-functional change but will be used in the future to support implicit inputs in texture nodes or so. This works by exposing extra inputs to pixel operation for each of the supported implicit input types if needed, and linking those inputs to instances of the ImplicitInputOperation operation. Only a single implicit input exist for now and we do not differentiate between any of the implicit inputs type. In order to do that, we need to refactor how input declarations for implicit inputs happen, since they are now tied to the Geometry Nodes specifically.
38 lines
1.0 KiB
C++
38 lines
1.0 KiB
C++
/* SPDX-FileCopyrightText: 2025 Blender Authors
|
|
*
|
|
* SPDX-License-Identifier: GPL-2.0-or-later */
|
|
|
|
#pragma once
|
|
|
|
#include "BLI_string_ref.hh"
|
|
|
|
#include "COM_context.hh"
|
|
#include "COM_input_descriptor.hh"
|
|
#include "COM_operation.hh"
|
|
#include "COM_result.hh"
|
|
|
|
namespace blender::compositor {
|
|
|
|
/* ------------------------------------------------------------------------------------------------
|
|
* Implicit Input Operation
|
|
*
|
|
* An operation that outputs a result representing a specific implicit input. */
|
|
class ImplicitInputOperation : public Operation {
|
|
private:
|
|
/* The identifier of the output. */
|
|
static const StringRef output_identifier_;
|
|
/* The type of implicit input needed. */
|
|
ImplicitInput implicit_input_;
|
|
|
|
public:
|
|
ImplicitInputOperation(Context &context, const ImplicitInput implicit_input);
|
|
|
|
void execute() override;
|
|
|
|
/* Get a reference to the output result of the operation, this essentially calls the super
|
|
* get_result with the output identifier of the operation. */
|
|
Result &get_result();
|
|
};
|
|
|
|
} // namespace blender::compositor
|