114 "Generate a factor value (from 0.0 to 1.0) between scene start and end time, using a curve "
118 ntype.
declare = file_ns::cmp_node_time_declare;
120 ntype.
initfunc = file_ns::node_composit_init_curves_time;
135 .default_value({0.0f, 0.0f, 0.0f})
174 float start_slopes[
CM_TOT];
177 float range_minimums[
CM_TOT];
179 float range_dividers[
CM_TOT];
201 return mf::build::SI1_SO<float3, float3>(
206 return output_vector;
208 mf::build::exec_presets::AllSpanOrSingle());
221 ntype.
ui_name =
"Vector Curves";
225 ntype.
declare = file_ns::cmp_node_curve_vec_declare;
228 ntype.
initfunc = file_ns::node_composit_init_curve_vec;
230 ntype.
gpu_fn = file_ns::node_gpu_material;
249 .compositor_domain_priority(1)
250 .description(
"Amount of influence the node exerts on the image");
252 .default_value({1.0f, 1.0f, 1.0f, 1.0f})
253 .compositor_domain_priority(0)
254 .
description(
"Image/Color input on which RGB color transformation will be applied");
256 .default_value({0.0f, 0.0f, 0.0f, 1.0f})
257 .description(
"Input color that should be mapped to black");
259 .default_value({1.0f, 1.0f, 1.0f, 1.0f})
260 .description(
"Input color that should be mapped to white");
291 float start_slopes[
CM_TOT];
294 float range_minimums[
CM_TOT];
296 float range_dividers[
CM_TOT];
313 const float min = 0.0f;
314 const float max = 1.0f;
329 "curves_combined_only",
342 "curves_combined_rgb",
360 return mf::build::SI4_SO<float, float4, float4, float4, float4>(
369 curve_mapping,
result,
color, black, black_white_scale);
373 mf::build::exec_presets::SomeSpanOrSingle<1>());
387 ntype.
ui_description =
"Perform level adjustments on each color channel of an image";
390 ntype.
declare = file_ns::cmp_node_rgbcurves_declare;
392 ntype.
initfunc = file_ns::node_composit_init_curve_rgb;
394 ntype.
gpu_fn = file_ns::node_gpu_material;
#define NODE_CLASS_OP_VECTOR
#define NODE_CLASS_OP_COLOR
#define CMP_NODE_CURVE_RGB
#define CMP_NODE_CURVE_VEC
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)
bool GPU_link(GPUMaterial *mat, const char *name,...)
GPUNodeLink * GPU_uniform(const float *num)
#define NOD_REGISTER_NODE(REGISTER_FUNC)
void uiTemplateCurveMapping(uiLayout *layout, PointerRNA *ptr, blender::StringRefNull propname, int type, bool levels, bool brush, bool neg_slope, bool tone)
int get_frame_number() const
const bNode & bnode() const
NodeOperation(Context &context, DNode node)
Result & get_result(StringRef identifier)
Context & context() const
Result & get_input(StringRef identifier) const
T get_single_value_default(const T &default_value) const
void set_single_value(const T &value)
void allocate_single_value()
void construct_and_set_matching_fn_cb(Fn &&create_multi_function)
int compositor_domain_priority() const
bool compositor_expects_single_value() const
const CurveMapping * get_curve_mapping()
float compute_normalized_time()
NodeOperation(Context &context, DNode node)
VecBase< float, 4 > float4
VecBase< float, 3 > float3
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))
GPUNodeStack & get_shader_node_input(const bNode &node, GPUNodeStack inputs[], StringRef identifier)
GPUNodeLink * get_shader_node_input_link(const bNode &node, GPUNodeStack inputs[], StringRef identifier)
T clamp(const T &a, const T &min, const T &max)
T interpolate(const T &a, const T &b, const FactorT &t)
static CurveMapping * get_curve_mapping(const bNode &node)
static void cmp_node_rgbcurves_declare(NodeDeclarationBuilder &b)
static void node_build_multi_function(blender::nodes::NodeMultiFunctionBuilder &builder)
static void node_composit_init_curve_rgb(bNodeTree *, bNode *node)
static int node_gpu_material(GPUMaterial *material, bNode *node, bNodeExecData *, GPUNodeStack *inputs, GPUNodeStack *outputs)
static NodeOperation * get_compositor_operation(Context &context, DNode node)
static void cmp_node_time_declare(NodeDeclarationBuilder &b)
static void node_composit_init_curves_time(bNodeTree *, bNode *node)
static CurveMapping * get_curve_mapping(const bNode &node)
static void node_buts_curvevec(uiLayout *layout, bContext *, PointerRNA *ptr)
static void node_composit_init_curve_vec(bNodeTree *, bNode *node)
static void node_build_multi_function(blender::nodes::NodeMultiFunctionBuilder &builder)
static void cmp_node_curve_vec_declare(NodeDeclarationBuilder &b)
static int node_gpu_material(GPUMaterial *material, bNode *node, bNodeExecData *, GPUNodeStack *inputs, GPUNodeStack *outputs)
VecBase< float, 4 > float4
VecBase< float, 3 > float3
static void register_node_type_cmp_curve_vec()
static void register_node_type_cmp_curve_time()
static void register_node_type_cmp_curve_rgb()
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_copy_curves(bNodeTree *, bNode *dest_node, const bNode *src_node)
void node_free_curves(bNode *node)
std::string ui_description
NodeGetCompositorOperationFunction get_compositor_operation
void(* initfunc)(bNodeTree *ntree, bNode *node)
NodeGPUExecFunction gpu_fn
NodeMultiFunctionBuildFunction build_multi_function
const char * enum_name_legacy
void(* draw_buttons)(uiLayout *, bContext *C, PointerRNA *ptr)
NodeGatherSocketLinkOperationsFunction gather_link_search_ops
NodeDeclareFunction declare