36 .compositor_domain_priority(1);
37 b.add_output<
decl::Color>(
"Image").compositor_domain_priority(0);
66 mul_bias[0] = 1.0f / (color_band->
data[1].
pos - color_band->
data[0].
pos);
67 mul_bias[1] = -mul_bias[0] * color_band->
data[0].
pos;
70 "valtorgb_opti_linear",
80 "valtorgb_opti_constant",
87 mul_bias[0] = 1.0f / (color_band->
data[1].
pos - color_band->
data[0].
pos);
88 mul_bias[1] = -mul_bias[0] * color_band->
data[0].
pos;
121 return mf::build::SI1_SO2<float, float4, float>(
123 [=](
const float factor,
float4 &
color,
float &alpha) ->
void {
127 mf::build::exec_presets::AllSpanOrSingle());
141 ntype.
ui_description =
"Map values to colors with the use of a gradient";
144 ntype.
declare = file_ns::cmp_node_valtorgb_declare;
146 ntype.
initfunc = file_ns::node_composit_init_valtorgb;
149 ntype.
gpu_fn = file_ns::node_gpu_material;
163 .default_value({0.8f, 0.8f, 0.8f, 1.0f})
164 .compositor_domain_priority(0);
176 float luminance_coefficients[3];
185 float3 luminance_coefficients;
189 return mf::build::SI1_SO<float4, float>(
194 mf::build::exec_presets::AllSpanOrSingle());
208 ntype.
ui_description =
"Convert RGB input into grayscale using luminance";
211 ntype.
declare = file_ns::cmp_node_rgbtobw_declare;
213 ntype.
gpu_fn = file_ns::node_gpu_material;
void BKE_colorband_evaluate_table_rgba(const ColorBand *coba, float **array, int *size)
bool BKE_colorband_evaluate(const ColorBand *coba, float in, float out[4])
ColorBand * BKE_colorband_add(bool rangetype)
#define NODE_CLASS_CONVERTER
#define CMP_NODE_VALTORGB
MINLINE float max_ff(float a, float b)
@ COLBAND_INTERP_CONSTANT
@ COLBAND_INTERP_B_SPLINE
@ COLBAND_INTERP_CARDINAL
bool GPU_stack_link(GPUMaterial *mat, const bNode *node, const char *name, GPUNodeStack *in, GPUNodeStack *out,...)
GPUNodeLink * GPU_constant(const float *num)
GPUNodeLink * GPU_color_band(GPUMaterial *mat, int size, float *pixels, float *r_row)
GPUNodeLink * GPU_uniform(const float *num)
BLI_INLINE void IMB_colormanagement_get_luminance_coefficients(float r_rgb[3])
#define NOD_REGISTER_NODE(REGISTER_FUNC)
static DBVT_INLINE btScalar size(const btDbvtVolume &a)
void construct_and_set_matching_fn_cb(Fn &&create_multi_function)
void node_type_size(bNodeType &ntype, int width, int minwidth, int maxwidth)
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))
void node_type_size_preset(bNodeType &ntype, eNodeSizePreset size)
T dot(const QuaternionBase< T > &a, const QuaternionBase< T > &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_valtorgb_declare(NodeDeclarationBuilder &b)
static ColorBand * get_color_band(const bNode &node)
static void node_composit_init_valtorgb(bNodeTree *, bNode *node)
static void cmp_node_rgbtobw_declare(NodeDeclarationBuilder &b)
static void node_build_multi_function(blender::nodes::NodeMultiFunctionBuilder &builder)
static int node_gpu_material(GPUMaterial *material, bNode *node, bNodeExecData *, GPUNodeStack *inputs, GPUNodeStack *outputs)
VecBase< float, 4 > float4
VecBase< float, 3 > float3
void cmp_node_type_base(blender::bke::bNodeType *ntype, std::string idname, const std::optional< int16_t > legacy_type)
static void register_node_type_cmp_valtorgb()
static void register_node_type_cmp_rgbtobw()
static blender::bke::bNodeSocketTemplate outputs[]
static blender::bke::bNodeSocketTemplate inputs[]
void node_free_standard_storage(bNode *node)
void node_copy_standard_storage(bNodeTree *, bNode *dest_node, const bNode *src_node)
std::string ui_description
void(* initfunc)(bNodeTree *ntree, bNode *node)
NodeGPUExecFunction gpu_fn
NodeMultiFunctionBuildFunction build_multi_function
const char * enum_name_legacy
NodeDeclareFunction declare