31 b.add_output<
decl::Color>(
"Image"_ustr).structure_type(StructureType::Dynamic);
32 b.add_output<
decl::Float>(
"Alpha"_ustr).structure_type(StructureType::Dynamic);
38 b.add_output<
decl::Color>(
"Image"_ustr).structure_type(StructureType::Dynamic);
39 b.add_output<
decl::Float>(
"Alpha"_ustr).structure_type(StructureType::Dynamic);
49 .dimensions(dimensions)
51 .available(
output->is_available());
54 .structure_type(StructureType::Dynamic)
55 .available(
output->is_available());
75 b.add_output<
decl::Float>(name).structure_type(StructureType::Dynamic);
82 b.add_output<
decl::Color>(name).structure_type(StructureType::Dynamic);
89 b.add_output<
decl::Color>(name).structure_type(StructureType::Dynamic);
106 if (!render_result) {
118 bool has_alpha_pass =
false;
121 has_alpha_pass =
true;
128 const bool should_add_all_views = image_user->
view == 0;
131 const int selected_view = image_user->
view - 1;
135 if (should_add_all_views) {
143 if (pass.
view_id != selected_view) {
155 b.add_output<
decl::Float>(
"Alpha"_ustr).structure_type(StructureType::Dynamic);
171 ImageUser initial_frame_image_user = *image_user;
172 initial_frame_image_user.
framenr = image_start_frame_offset;
186 added_outputs_identifiers.
add_new(output_declaration->identifier);
189 const bNodeTree *node_tree =
b.tree_or_null();
191 node_tree->ensure_topology_cache();
193 if (added_outputs_identifiers.
contains(
output->identifier_ustr())) {
196 if (!
output->is_directly_linked()) {
211 const bNodeTree *node_tree =
b.tree_or_null();
221 if (!
image || !image_user) {
246 ImageUser *iuser = MEM_new<ImageUser>(__func__);
247 node->storage = iuser;
278 if (!
result.should_compute()) {
282 if (identifier ==
"Alpha") {
290 result.allocate_invalid();
296 result.share_data(cached_image);
309 result.allocate_invalid();
322 result.share_data(cached_alpha);
330 result.allocate_invalid();
#define BLI_SCOPED_DEFER(function_to_defer)
#define RE_PASSNAME_COMBINED
#define NOD_REGISTER_NODE(REGISTER_FUNC)
#define BLI_assert_unreachable()
bool contains(const Key &key) const
void add_new(const Key &key)
constexpr const char * data() const
Result & get(Context &context, Image &image, const ImageUser &image_user, const char *pass_name)
StaticCacheManager & cache_manager()
NodeOperation(Context &context, const bNode &node)
const bNode & node() const
Result & get_result(StringRef identifier)
void allocate_default_remaining_outputs()
Context & context() const
bool is_allocated() const
static ResultType type(gpu::TextureFormat format)
static ResultPrecision precision(gpu::TextureFormat format)
CachedImageContainer cached_images
BaseSocketDeclarationBuilder & available(bool value=true)
StructureType structure_type
NodeOperation(Context &context, const bNode &node)
ImageUser * get_image_user()
void compute_output(StringRef identifier)
void node_register_type(bNodeType &ntype)
void node_type_storage(bNodeType &ntype, std::optional< StringRefNull > storagename, void(*freefunc)(bNode *node), void(*copyfunc)(bNodeTree *dest_ntree, bNode *dest_node, const bNode *src_node))
void extract_alpha(Context &context, const Result &input, Result &output)
bool is_socket_available(const bNodeSocket *socket)
static void prepare_image(Image *image, const ImageUser *image_user)
static NodeOperation * get_compositor_operation(Context &context, const bNode &node)
static void node_init(bNodeTree *, bNode *node)
static void declare_default(NodeDeclarationBuilder &b)
static void node_register()
static void declare_single_layer(NodeDeclarationBuilder &b)
static void declare_old_linked_outputs(NodeDeclarationBuilder &b)
static void declare_existing(NodeDeclarationBuilder &b)
static void node_declare(NodeDeclarationBuilder &b)
static void node_declare_multi_layer(NodeDeclarationBuilder &b, Image *image, const ImageUser *image_user)
static BaseSocketDeclarationBuilder & declare_existing_output(NodeDeclarationBuilder &b, const bNodeSocket *output)
static void declare_pass(NodeDeclarationBuilder &b, const RenderPass &pass)
RenderResult * BKE_image_acquire_renderresult(Scene *scene, Image *ima)
void BKE_image_release_renderresult(Scene *scene, Image *ima, RenderResult *render_result)
void * BLI_findlink(const ListBase *listbase, int number) ATTR_WARN_UNUSED_RESULT ATTR_NONNULL(1)
ImBuf * BKE_image_acquire_ibuf(Image *ima, ImageUser *iuser, void **r_lock)
void node_copy_standard_storage(bNodeTree *, bNode *dest_node, const bNode *src_node)
void node_free_standard_storage(bNode *node)
int BKE_image_sequence_guess_offset(Image *image)
void node_image_label(const bNodeTree *, const bNode *node, char *label, int label_maxncpy)
bool BKE_image_is_multilayer(const Image *ima)
void BKE_image_release_ibuf(Image *ima, ImBuf *ibuf, void *lock)
void cmp_node_type_base(bke::bNodeType *ntype, UString idname, const std::optional< int16_t > legacy_type)
ListBaseT< RenderPass > passes
ListBaseT< RenderLayer > layers
std::string ui_description
void(*) labelfunc(const bNodeTree *ntree, const bNode *node, char *label, int label_maxncpy)
NodeGetCompositorOperationFunction get_compositor_operation
void(*) initfunc(bNodeTree *ntree, bNode *node)
const char * enum_name_legacy
NodeDeclareFunction declare