32 b.add_input<
decl::Color>(
"Image"_ustr).default_value({1.0f, 1.0f, 1.0f, 1.0f});
34 switch (node_storage(
node).mode) {
47 switch (node_storage(
node).mode) {
53 return IFACE_(
"Saturation");
61 switch (node_storage(
node).mode) {
68 return IFACE_(
"Lightness");
84 switch (node_storage(*node).mode) {
86 return GPU_stack_link(material,
node,
"node_composite_separate_rgba", inputs, outputs);
88 return GPU_stack_link(material,
node,
"node_composite_separate_hsva", inputs, outputs);
90 return GPU_stack_link(material,
node,
"node_composite_separate_hsla", inputs, outputs);
93 material,
node,
"node_composite_separate_yuva_itu_709", inputs, outputs);
95 switch (node_storage(*node).ycc_mode) {
98 material,
node,
"node_composite_separate_ycca_itu_601", inputs, outputs);
101 material,
node,
"node_composite_separate_ycca_itu_709", inputs, outputs);
104 material,
node,
"node_composite_separate_ycca_jpeg", inputs, outputs);
115 static auto rgba_function = mf::build::SI1_SO4<Color, float, float, float, float>(
116 "Separate Color RGBA",
117 [](
const Color &
color,
float &r,
float &g,
float &
b,
float &a) ->
void {
123 mf::build::exec_presets::AllSpanOrSingle());
125 static auto hsva_function = mf::build::SI1_SO4<Color, float, float, float, float>(
126 "Separate Color HSVA",
127 [](
const Color &
color,
float &h,
float &s,
float &
v,
float &a) ->
void {
131 mf::build::exec_presets::AllSpanOrSingle());
133 static auto hsla_function = mf::build::SI1_SO4<Color, float, float, float, float>(
134 "Separate Color HSLA",
135 [](
const Color &
color,
float &h,
float &s,
float &
l,
float &a) ->
void {
139 mf::build::exec_presets::AllSpanOrSingle());
141 static auto yuva_function = mf::build::SI1_SO4<Color, float, float, float, float>(
142 "Separate Color YUVA",
143 [](
const Color &
color,
float &
y,
float &u,
float &
v,
float &a) ->
void {
147 mf::build::exec_presets::AllSpanOrSingle());
149 static auto ycca_itu_601_function = mf::build::SI1_SO4<Color, float, float, float, float>(
150 "Separate Color YCCA ITU 601",
151 [](
const Color &
color,
float &
y,
float &cb,
float &cr,
float &a) ->
void {
158 mf::build::exec_presets::AllSpanOrSingle());
160 static auto ycca_itu_709_function = mf::build::SI1_SO4<Color, float, float, float, float>(
161 "Separate Color YCCA ITU 709",
162 [](
const Color &
color,
float &
y,
float &cb,
float &cr,
float &a) ->
void {
169 mf::build::exec_presets::AllSpanOrSingle());
171 static auto ycca_jpeg_function = mf::build::SI1_SO4<Color, float, float, float, float>(
172 "Separate Color YCCA JPEG",
173 [](
const Color &
color,
float &
y,
float &cb,
float &cr,
float &a) ->
void {
180 mf::build::exec_presets::AllSpanOrSingle());
182 switch (node_storage(builder.
node()).mode) {
196 switch (node_storage(builder.
node()).ycc_mode) {
215 ntype.
ui_name =
"Separate Color";
216 ntype.
ui_description =
"Split an image into its composite color channels";
#define NODE_CLASS_CONVERTER
#define NODE_STORAGE_FUNCS(StorageT)
#define CMP_NODE_SEPARATE_COLOR
#define BLI_YUV_ITU_BT709
#define BLI_YCC_JFIF_0_255
#define BLI_YCC_ITU_BT601
#define BLI_YCC_ITU_BT709
#define CTX_IFACE_(context, msgid)
#define BLT_I18NCONTEXT_COLOR
#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 int node_gpu_material(GPUMaterial *material, bNode *node, bNodeExecData *, GPUNodeStack *inputs, GPUNodeStack *outputs)
static void node_init(bNodeTree *, bNode *node)
static void node_build_multi_function(nodes::NodeMultiFunctionBuilder &builder)
static void node_declare(NodeDeclarationBuilder &b)
static void node_register()
bool GPU_stack_link(GPUMaterial *mat, const bNode *node, const char *name, GPUNodeStack *in, GPUNodeStack *out,...)
ATTR_WARN_UNUSED_RESULT const BMLoop * l
void rgb_to_hsl(float r, float g, float b, float *r_h, float *r_s, float *r_l)
@ CMP_NODE_COMBSEP_COLOR_HSL
@ CMP_NODE_COMBSEP_COLOR_YCC
@ CMP_NODE_COMBSEP_COLOR_YUV
@ CMP_NODE_COMBSEP_COLOR_HSV
@ CMP_NODE_COMBSEP_COLOR_RGB
void rgb_to_hsv(float r, float g, float b, float *r_h, float *r_s, float *r_v)
ATTR_WARN_UNUSED_RESULT const BMVert * v
void rgb_to_ycc(float r, float g, float b, float *r_y, float *r_cb, float *r_cr, int colorspace)
BMesh const char void * data
void rgb_to_yuv(float r, float g, float b, float *r_y, float *r_u, float *r_v, int colorspace)
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