27 bNode * ,
float *out,
float hue,
float sat,
float val,
float *in,
float fac)
29 if (fac != 0 && (hue != 0.5f || sat != 1 || val != 1)) {
30 float col[3], hsv[3], mfac = 1.0f - fac;
32 rgb_to_hsv(in[0], in[1], in[2], hsv, hsv + 1, hsv + 2);
33 hsv[0] += (hue - 0.5f);
37 else if (hsv[0] < 0.0f) {
44 else if (hsv[1] < 0.0f) {
51 else if (hsv[2] < 0.0f) {
56 out[0] = mfac * in[0] + fac *
col[0];
57 out[1] = mfac * in[1] + fac *
col[1];
58 out[2] = mfac * in[2] + fac *
col[2];
82static void exec(
void *data,
#define NODE_CLASS_OP_COLOR
void rgb_to_hsv(float r, float g, float b, float *r_h, float *r_s, float *r_v)
void hsv_to_rgb(float h, float s, float v, float *r_r, float *r_g, float *r_b)
MINLINE void copy_v4_v4(float r[4], const float a[4])
void node_type_size_preset(bNodeType *ntype, eNodeSizePreset size)
void node_type_socket_templates(bNodeType *ntype, bNodeSocketTemplate *inputs, bNodeSocketTemplate *outputs)
void node_register_type(bNodeType *ntype)
static void exec(void *data, int, bNode *node, bNodeExecData *execdata, bNodeStack **in, bNodeStack **out)
static void do_hue_sat_fac(bNode *, float *out, float hue, float sat, float val, float *in, float fac)
static void colorfn(float *out, TexParams *p, bNode *node, bNodeStack **in, short thread)
void register_node_type_tex_hue_sat()
void tex_node_type_base(blender::bke::bNodeType *ntype, int type, const char *name, short nclass)
float tex_input_value(bNodeStack *in, TexParams *params, short thread)
void tex_input_rgba(float *out, bNodeStack *in, TexParams *params, short thread)
void tex_output(bNode *node, bNodeExecData *execdata, bNodeStack **in, bNodeStack *out, TexFn texfn, TexCallData *cdata)
Compact definition of a node socket.