21 b.add_input<
decl::Color>(
"Color").default_value({1.0f, 1.0f, 1.0f, 1.0f});
54 builder.single_output<
float>(
"Red", mf::ParamFlag::SupportsUnusedOutput);
55 builder.single_output<
float>(
"Green", mf::ParamFlag::SupportsUnusedOutput);
56 builder.single_output<
float>(
"Blue", mf::ParamFlag::SupportsUnusedOutput);
57 builder.single_output<
float>(
"Alpha", mf::ParamFlag::SupportsUnusedOutput);
73 std::array<MutableSpan<float>, 4> outputs = {
red,
green, blue, alpha};
75 if (!
red.is_empty()) {
78 if (!green.is_empty()) {
81 if (!blue.is_empty()) {
84 if (!alpha.is_empty()) {
89 mask.foreach_segment_optimized([&](
const auto segment) {
90 const int used_outputs_num = used_outputs.
size();
91 const int *used_outputs_data = used_outputs.
data();
93 for (
const int64_t i : segment) {
95 for (
const int out_i :
IndexRange(used_outputs_num)) {
96 const int channel = used_outputs_data[out_i];
97 outputs[channel][i] = color[channel];
113 builder.single_output<
float>(
"Hue");
114 builder.single_output<
float>(
"Saturation");
115 builder.single_output<
float>(
"Value");
116 builder.single_output<
float>(
"Alpha", mf::ParamFlag::SupportsUnusedOutput);
132 rgb_to_hsv(colors[i].r, colors[i].g, colors[i].
b, &hue[i], &saturation[i], &value[i]);
135 if (!alpha.is_empty()) {
136 mask.foreach_index_optimized<
int64_t>([&](
const int64_t i) { alpha[i] = colors[i].a; });
149 builder.single_output<
float>(
"Hue");
150 builder.single_output<
float>(
"Saturation");
151 builder.single_output<
float>(
"Lightness");
152 builder.single_output<
float>(
"Alpha", mf::ParamFlag::SupportsUnusedOutput);
168 rgb_to_hsl(colors[i].r, colors[i].g, colors[i].
b, &hue[i], &saturation[i], &lightness[i]);
171 if (!alpha.is_empty()) {
172 mask.foreach_index_optimized<
int64_t>([&](
const int64_t i) { alpha[i] = colors[i].a; });
181 switch (storage.
mode) {
209 "Mode of color processing",
#define NODE_CLASS_CONVERTER
#define NODE_STORAGE_FUNCS(StorageT)
#define BLI_assert_unreachable()
void rgb_to_hsl(float r, float g, float b, float *r_h, float *r_s, float *r_l)
void rgb_to_hsv(float r, float g, float b, float *r_h, float *r_s, float *r_v)
#define NOD_REGISTER_NODE(REGISTER_FUNC)
#define NOD_storage_enum_accessors(member)
Group Output data from inside of a node group A color picker Mix two input colors RGB to Convert a color s luminance to a grayscale value Generate a normal vector and a dot product Brightness Control the brightness and contrast of the input color Vector Map input vector components with curves Camera Retrieve information about the camera and how it relates to the current shading point s position Clamp a value between a minimum and a maximum Vector Perform vector math operation Invert Invert a producing a negative Combine Generate a color from its red
Group Output data from inside of a node group A color picker Mix two input colors RGB to Convert a color s luminance to a grayscale value Generate a normal vector and a dot product Brightness Control the brightness and contrast of the input color Vector Map input vector components with curves Camera Retrieve information about the camera and how it relates to the current shading point s position Clamp a value between a minimum and a maximum Vector Perform vector math operation Invert Invert a producing a negative Combine Generate a color from its green
void uiItemR(uiLayout *layout, PointerRNA *ptr, const char *propname, eUI_Item_Flag flag, const char *name, int icon)
void append(const T &value)
const Signature & signature() const
void set_signature(const Signature *signature)
void set_matching_fn(const mf::MultiFunction *fn)
void call(const IndexMask &mask, mf::Params params, mf::Context) const override
void call(const IndexMask &mask, mf::Params params, mf::Context) const override
void call(const IndexMask &mask, mf::Params params, mf::Context) const override
local_group_size(16, 16) .push_constant(Type b
void node_type_storage(bNodeType *ntype, const char *storagename, void(*freefunc)(bNode *node), void(*copyfunc)(bNodeTree *dest_ntree, bNode *dest_node, const bNode *src_node))
void node_register_type(bNodeType *ntype)
static void node_rna(StructRNA *srna)
static void node_register()
static void node_build_multi_function(NodeMultiFunctionBuilder &builder)
static void node_init(bNodeTree *, bNode *node)
static void node_layout(uiLayout *layout, bContext *, PointerRNA *ptr)
static void node_declare(NodeDeclarationBuilder &b)
static void node_update(bNodeTree *, bNode *node)
PropertyRNA * RNA_def_node_enum(StructRNA *srna, const char *identifier, const char *ui_name, const char *ui_description, const EnumPropertyItem *static_items, const EnumRNAAccessors accessors, std::optional< int > default_value, const EnumPropertyItemFunc item_func, const bool allow_animation)
void devirtualize_varray(const VArray< T > &varray, const Func &func, bool enable=true)
void fn_node_type_base(blender::bke::bNodeType *ntype, int type, const char *name, short nclass)
void node_free_standard_storage(bNode *node)
void node_copy_standard_storage(bNodeTree *, bNode *dest_node, const bNode *src_node)
void node_combsep_color_label(const ListBase *sockets, NodeCombSepColorMode mode)
const EnumPropertyItem rna_enum_node_combsep_color_items[]
void(* initfunc)(bNodeTree *ntree, bNode *node)
NodeMultiFunctionBuildFunction build_multi_function
void(* draw_buttons)(uiLayout *, bContext *C, PointerRNA *ptr)
NodeDeclareFunction declare
void(* updatefunc)(bNodeTree *ntree, bNode *node)