97 switch (node_storage(*node).mode) {
106 material, node,
"node_composite_separate_yuva_itu_709",
inputs,
outputs);
108 switch (node_storage(*node).ycc_mode) {
111 material, node,
"node_composite_separate_ycca_itu_601",
inputs,
outputs);
114 material, node,
"node_composite_separate_ycca_itu_709",
inputs,
outputs);
117 material, node,
"node_composite_separate_ycca_jpeg",
inputs,
outputs);
126 static auto rgba_function = mf::build::SI1_SO4<float4, float, float, float, float>(
127 "Separate Color RGBA",
128 [](
const float4 &
color,
float &r,
float &g,
float &
b,
float &a) ->
void {
134 mf::build::exec_presets::AllSpanOrSingle());
136 static auto hsva_function = mf::build::SI1_SO4<float4, float, float, float, float>(
137 "Separate Color HSVA",
138 [](
const float4 &
color,
float &h,
float &s,
float &
v,
float &a) ->
void {
142 mf::build::exec_presets::AllSpanOrSingle());
144 static auto hsla_function = mf::build::SI1_SO4<float4, float, float, float, float>(
145 "Separate Color HSLA",
146 [](
const float4 &
color,
float &h,
float &s,
float &
l,
float &a) ->
void {
150 mf::build::exec_presets::AllSpanOrSingle());
152 static auto yuva_function = mf::build::SI1_SO4<float4, float, float, float, float>(
153 "Separate Color YUVA",
154 [](
const float4 &
color,
float &
y,
float &u,
float &
v,
float &a) ->
void {
158 mf::build::exec_presets::AllSpanOrSingle());
160 static auto ycca_itu_601_function = mf::build::SI1_SO4<float4, float, float, float, float>(
161 "Separate Color YCCA ITU 601",
162 [](
const float4 &
color,
float &
y,
float &cb,
float &cr,
float &a) ->
void {
169 mf::build::exec_presets::AllSpanOrSingle());
171 static auto ycca_itu_709_function = mf::build::SI1_SO4<float4, float, float, float, float>(
172 "Separate Color YCCA ITU 709",
173 [](
const float4 &
color,
float &
y,
float &cb,
float &cr,
float &a) ->
void {
180 mf::build::exec_presets::AllSpanOrSingle());
182 static auto ycca_jpeg_function = mf::build::SI1_SO4<float4, float, float, float, float>(
183 "Separate Color YCCA JPEG",
184 [](
const float4 &
color,
float &
y,
float &cb,
float &cr,
float &a) ->
void {
191 mf::build::exec_presets::AllSpanOrSingle());
193 switch (node_storage(builder.
node()).mode) {
207 switch (node_storage(builder.
node()).ycc_mode) {
230 ntype.
ui_name =
"Separate Color";
231 ntype.
ui_description =
"Split an image into its composite color channels";
234 ntype.
declare = file_ns::cmp_node_separate_color_declare;
238 ntype.
updatefunc = file_ns::cmp_node_separate_color_update;
239 ntype.
gpu_fn = file_ns::node_gpu_material;
254 b.is_function_node();
276 switch (node_storage(*node).mode) {
285 material, node,
"node_composite_combine_yuva_itu_709",
inputs,
outputs);
287 switch (node_storage(*node).ycc_mode) {
290 material, node,
"node_composite_combine_ycca_itu_601",
inputs,
outputs);
293 material, node,
"node_composite_combine_ycca_itu_709",
inputs,
outputs);
296 material, node,
"node_composite_combine_ycca_jpeg",
inputs,
outputs);
305 static auto rgba_function = mf::build::SI4_SO<float, float, float, float, float4>(
306 "Combine Color RGBA",
307 [](
const float r,
const float g,
const float b,
const float a) ->
float4 {
310 mf::build::exec_presets::Materialized());
312 static auto hsva_function = mf::build::SI4_SO<float, float, float, float, float4>(
313 "Combine Color HSVA",
314 [](
const float h,
const float s,
const float v,
const float a) ->
float4 {
320 mf::build::exec_presets::Materialized());
322 static auto hsla_function = mf::build::SI4_SO<float, float, float, float, float4>(
323 "Combine Color HSLA",
324 [](
const float h,
const float s,
const float l,
const float a) ->
float4 {
330 mf::build::exec_presets::Materialized());
332 static auto yuva_function = mf::build::SI4_SO<float, float, float, float, float4>(
333 "Combine Color YUVA",
334 [](
const float y,
const float u,
const float v,
const float a) ->
float4 {
340 mf::build::exec_presets::Materialized());
342 static auto ycca_itu_601_function = mf::build::SI4_SO<float, float, float, float, float4>(
343 "Combine Color YCCA ITU 601",
344 [](
const float y,
const float cb,
const float cr,
const float a) ->
float4 {
356 mf::build::exec_presets::Materialized());
358 static auto ycca_itu_709_function = mf::build::SI4_SO<float, float, float, float, float4>(
359 "Combine Color YCCA ITU 709",
360 [](
const float y,
const float cb,
const float cr,
const float a) ->
float4 {
372 mf::build::exec_presets::Materialized());
374 static auto ycca_jpeg_function = mf::build::SI4_SO<float, float, float, float, float4>(
375 "Combine Color YCCA JPEG",
376 [](
const float y,
const float cb,
const float cr,
const float a) ->
float4 {
388 mf::build::exec_presets::Materialized());
390 switch (node_storage(builder.
node()).mode) {
404 switch (node_storage(builder.
node()).ycc_mode) {
427 ntype.
ui_name =
"Combine Color";
428 ntype.
ui_description =
"Combine an image from its composite color channels";
431 ntype.
declare = file_ns::cmp_node_combine_color_declare;
435 ntype.
updatefunc = file_ns::cmp_node_combine_color_update;
436 ntype.
gpu_fn = file_ns::node_gpu_material;
#define NODE_CLASS_CONVERTER
#define NODE_STORAGE_FUNCS(StorageT)
#define CMP_NODE_SEPARATE_COLOR
#define CMP_NODE_COMBINE_COLOR
#define BLI_assert_unreachable()
#define BLI_YUV_ITU_BT709
void rgb_to_hsl(float r, float g, float b, float *r_h, float *r_s, float *r_l)
#define BLI_YCC_JFIF_0_255
void rgb_to_hsv(float r, float g, float b, float *r_h, float *r_s, float *r_v)
void ycc_to_rgb(float y, float cb, float cr, float *r_r, float *r_g, float *r_b, int colorspace)
void hsv_to_rgb(float h, float s, float v, float *r_r, float *r_g, float *r_b)
#define BLI_YCC_ITU_BT601
void rgb_to_ycc(float r, float g, float b, float *r_y, float *r_cb, float *r_cr, int colorspace)
void rgb_to_yuv(float r, float g, float b, float *r_y, float *r_u, float *r_v, int colorspace)
void hsl_to_rgb(float h, float s, float l, float *r_r, float *r_g, float *r_b)
void yuv_to_rgb(float y, float u, float v, float *r_r, float *r_g, float *r_b, int colorspace)
#define BLI_YCC_ITU_BT709
@ CMP_NODE_COMBSEP_COLOR_YCC
@ CMP_NODE_COMBSEP_COLOR_YUV
@ CMP_NODE_COMBSEP_COLOR_RGB
@ CMP_NODE_COMBSEP_COLOR_HSV
@ CMP_NODE_COMBSEP_COLOR_HSL
bool GPU_stack_link(GPUMaterial *mat, const bNode *node, const char *name, GPUNodeStack *in, GPUNodeStack *out,...)
#define NOD_REGISTER_NODE(REGISTER_FUNC)
BMesh const char void * data
ATTR_WARN_UNUSED_RESULT const BMLoop * l
ATTR_WARN_UNUSED_RESULT const BMVert * v
void set_matching_fn(const mf::MultiFunction *fn)
ColorGeometry4f default_value
VecBase< float, 4 > float4
void * MEM_callocN(size_t len, const char *str)
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))
static void cmp_node_combine_color_update(bNodeTree *, bNode *node)
static void node_build_multi_function(blender::nodes::NodeMultiFunctionBuilder &builder)
static void cmp_node_combine_color_declare(NodeDeclarationBuilder &b)
static int node_gpu_material(GPUMaterial *material, bNode *node, bNodeExecData *, GPUNodeStack *inputs, GPUNodeStack *outputs)
static void cmp_node_separate_color_declare(NodeDeclarationBuilder &b)
static int node_gpu_material(GPUMaterial *material, bNode *node, bNodeExecData *, GPUNodeStack *inputs, GPUNodeStack *outputs)
static void node_build_multi_function(blender::nodes::NodeMultiFunctionBuilder &builder)
static void cmp_node_separate_color_update(bNodeTree *, bNode *node)
VecBase< float, 4 > float4
static void node_cmp_combsep_color_label(const ListBase *sockets, CMPNodeCombSepColorMode mode)
static void register_node_type_cmp_combine_color()
static void register_node_type_cmp_separate_color()
static void node_cmp_combsep_color_init(bNodeTree *, bNode *node)
void cmp_node_type_base(blender::bke::bNodeType *ntype, std::string idname, const std::optional< int16_t > legacy_type)
static blender::bke::bNodeSocketTemplate outputs[]
static blender::bke::bNodeSocketTemplate inputs[]
void node_sock_label_clear(bNodeSocket *sock)
void node_sock_label(bNodeSocket *sock, const char *name)
void node_free_standard_storage(bNode *node)
void node_copy_standard_storage(bNodeTree *, bNode *dest_node, const bNode *src_node)
struct bNodeSocket * next
std::string ui_description
void(* initfunc)(bNodeTree *ntree, bNode *node)
NodeGPUExecFunction gpu_fn
NodeMultiFunctionBuildFunction build_multi_function
const char * enum_name_legacy
NodeDeclareFunction declare
void(* updatefunc)(bNodeTree *ntree, bNode *node)