24 N_(
"Multiply the input image's RGBA channels by the alpha input value")},
29 N_(
"Replace the input image's alpha channel by the alpha input value")},
30 {0,
nullptr, 0,
nullptr,
nullptr},
35 b.use_custom_socket_order();
36 b.allow_any_socket_order();
38 b.add_input<
decl::Color>(
"Image"_ustr).default_value({1.0f, 1.0f, 1.0f, 1.0f}).hide_value();
39 b.add_output<
decl::Color>(
"Image"_ustr).align_with_previous();
41 b.add_input<
decl::Float>(
"Alpha"_ustr).default_value(1.0f).min(0.0f).max(1.0f);
51 NodeSetAlpha *settings = MEM_new<NodeSetAlpha>(__func__);
52 node->storage = settings;
81 static auto function = mf::build::SI3_SO<Color, float, MenuValue, Color>(
86 mf::build::exec_presets::AllSpanOrSingle());
#define NODE_CLASS_CONVERTER
#define CMP_NODE_SETALPHA
#define NOD_REGISTER_NODE(REGISTER_FUNC)
void set_matching_fn(const mf::MultiFunction *fn)
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))
ColorSceneLinear4f< eAlpha::Premultiplied > Color
static void node_build_multi_function(nodes::NodeMultiFunctionBuilder &builder)
static float4 set_alpha(const float4 &color, const float alpha, const MenuValue &type)
static void node_register()
static const EnumPropertyItem type_items[]
static int node_gpu_material(GPUMaterial *material, bNode *node, bNodeExecData *, GPUNodeStack *inputs, GPUNodeStack *outputs)
static void node_declare(NodeDeclarationBuilder &b)
static void node_init(bNodeTree *, bNode *node)
bool GPU_stack_link(GPUMaterial *mat, const bNode *node, const char *name, GPUNodeStack *in, GPUNodeStack *out,...)
@ CMP_NODE_SETALPHA_MODE_REPLACE_ALPHA
@ CMP_NODE_SETALPHA_MODE_APPLY
void node_copy_standard_storage(bNodeTree *, bNode *dest_node, const bNode *src_node)
void node_free_standard_storage(bNode *node)
void cmp_node_type_base(bke::bNodeType *ntype, UString idname, const std::optional< int16_t > legacy_type)
std::string ui_description
NodeGPUExecFunction gpu_fn
NodeMultiFunctionBuildFunction build_multi_function
void(*) initfunc(bNodeTree *ntree, bNode *node)
const char * enum_name_legacy
NodeDeclareFunction declare