21 "STRAIGHT_TO_PREMULTIPLIED",
23 N_(
"To Premultiplied"),
24 N_(
"Convert straight to premultiplied")},
26 "PREMULTIPLIED_TO_STRAIGHT",
29 N_(
"Convert premultiplied to straight")},
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();
55 return GPU_stack_link(material,
node,
"node_composite_convert_alpha", inputs, outputs);
73 static auto function = mf::build::SI2_SO<Color, MenuValue, Color>(
78 mf::build::exec_presets::AllSpanOrSingle());
87 ntype.
ui_name =
"Alpha Convert";
88 ntype.
ui_description =
"Convert to and from premultiplied (associated) alpha";
#define NODE_CLASS_CONVERTER
#define CMP_NODE_PREMULKEY
#define NOD_REGISTER_NODE(REGISTER_FUNC)
void set_matching_fn(const mf::MultiFunction *fn)
void node_register_type(bNodeType &ntype)
ColorSceneLinear4f< eAlpha::Premultiplied > Color
static float4 convert_alpha(const float4 &color, const MenuValue &type)
static void node_build_multi_function(nodes::NodeMultiFunctionBuilder &builder)
static void node_declare(NodeDeclarationBuilder &b)
static const EnumPropertyItem type_items[]
static int node_gpu_material(GPUMaterial *material, bNode *node, bNodeExecData *, GPUNodeStack *inputs, GPUNodeStack *outputs)
static void node_register()
bool GPU_stack_link(GPUMaterial *mat, const bNode *node, const char *name, GPUNodeStack *in, GPUNodeStack *out,...)
@ CMP_NODE_ALPHA_CONVERT_PREMULTIPLY
@ CMP_NODE_ALPHA_CONVERT_UNPREMULTIPLY
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
const char * enum_name_legacy
NodeDeclareFunction declare