28 b.add_input<
decl::Color>(
"Image"_ustr).default_value({1.0f, 1.0f, 1.0f, 1.0f});
45 for (
int c = 0; c < 3; c++) {
77 float range_minimums[
CM_TOT];
79 float range_dividers[
CM_TOT];
84 "node_composite_hue_correct",
99 float parameter = hsv.x;
129 return mf::build::SI2_SO<Color, float, Color>(
133 ->
Color { return Color(hue_correct(float4(color), factor, curve_mapping)); },
134 mf::build::exec_presets::SomeSpanOrSingle<0>());
144 ntype.
ui_description =
"Adjust hue, saturation, and value with a curve";
#define NODE_CLASS_OP_COLOR
#define CMP_NODE_HUECORRECT
#define NOD_REGISTER_NODE(REGISTER_FUNC)
void construct_and_set_matching_fn_cb(Fn &&create_multi_function)
const std::shared_ptr< const bNodeTree > & shared_tree()
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
T clamp(const T &a, const T &min, const T &max)
T interpolate(const T &a, const T &b, const FactorT &t)
T max(const T &a, const T &b)
static float4 hue_correct(const float4 &color, const float factor, const CurveMapping *curve_map)
static CurveMapping * get_curve_mapping(const bNode &node)
static void node_init(bNodeTree *, bNode *node)
static int node_gpu_material(GPUMaterial *material, bNode *node, bNodeExecData *, GPUNodeStack *inputs, GPUNodeStack *outputs)
static void node_register()
static void node_build_multi_function(nodes::NodeMultiFunctionBuilder &builder)
static void node_declare(NodeDeclarationBuilder &b)
CurveMapping * BKE_curvemapping_add(int tot, float minx, float miny, float maxx, float maxy)
bool GPU_stack_link(GPUMaterial *mat, const bNode *node, const char *name, GPUNodeStack *in, GPUNodeStack *out,...)
void rgb_to_hsv_v(const float rgb[3], float r_hsv[3])
GPUNodeLink * GPU_color_band(GPUMaterial *mat, int size, float *pixels, float *r_row)
GPUNodeLink * GPU_uniform(const float *num)
void BKE_curvemapping_init(CurveMapping *cumap)
GPUNodeLink * GPU_constant(const float *num)
void hsv_to_rgb_v(const float hsv[3], float r_rgb[3])
void node_free_curves(bNode *node)
void BKE_curvemap_reset(CurveMap *cuma, const rctf *clipr, int preset, CurveMapSlopeType slope)
void node_copy_curves(bNodeTree *, bNode *dest_node, const bNode *src_node)
void BKE_curvemapping_table_RGBA(const CurveMapping *cumap, float **array, int *size)
void BKE_curvemapping_compute_range_dividers(const CurveMapping *curve_mapping, float dividers[4])
void BKE_curvemapping_get_range_minimums(const CurveMapping *curve_mapping, float minimums[4])
float BKE_curvemapping_evaluateF(const CurveMapping *cumap, int cur, float value)
void cmp_node_type_base(bke::bNodeType *ntype, UString idname, const std::optional< int16_t > legacy_type)
eCurveMappingPreset preset
static constexpr int _320
std::string ui_description
NodeGPUExecFunction gpu_fn
NodeMultiFunctionBuildFunction build_multi_function
void(*) initfunc(bNodeTree *ntree, bNode *node)
const char * enum_name_legacy
NodeDeclareFunction declare