Changeset View
Changeset View
Standalone View
Standalone View
source/blender/nodes/composite/nodes/node_composite_hueSatVal.c
| Show All 29 Lines | |||||
| */ | */ | ||||
| #include "node_composite_util.h" | #include "node_composite_util.h" | ||||
| /* **************** Hue Saturation ******************** */ | /* **************** Hue Saturation ******************** */ | ||||
| static bNodeSocketTemplate cmp_node_hue_sat_in[] = { | static bNodeSocketTemplate cmp_node_hue_sat_in[] = { | ||||
| { SOCK_FLOAT, 1, N_("Fac"), 1.0f, 0.0f, 0.0f, 0.0f, 0.0f, 1.0f, PROP_FACTOR}, | |||||
| { SOCK_RGBA, 1, N_("Image"), 1.0f, 1.0f, 1.0f, 1.0f}, | { SOCK_RGBA, 1, N_("Image"), 1.0f, 1.0f, 1.0f, 1.0f}, | ||||
| { SOCK_FLOAT, 1, N_("Hue"), 0.5f, 0.0f, 0.0f, 0.0f, 0.0f, 1.0f, PROP_FACTOR}, | |||||
| { SOCK_FLOAT, 1, N_("Saturation"), 1.0f, 0.0f, 0.0f, 0.0f, 0.0f, 1.0f, PROP_FACTOR}, | |||||
| { SOCK_FLOAT, 1, N_("Value"), 1.0f, 0.0f, 0.0f, 0.0f, 0.0f, 1.0f, PROP_FACTOR}, | |||||
| { SOCK_FLOAT, 1, N_("Fac"), 1.0f, 0.0f, 0.0f, 0.0f, 0.0f, 1.0f, PROP_FACTOR}, | |||||
| { -1, 0, "" } | { -1, 0, "" } | ||||
| }; | }; | ||||
| static bNodeSocketTemplate cmp_node_hue_sat_out[] = { | static bNodeSocketTemplate cmp_node_hue_sat_out[] = { | ||||
| { SOCK_RGBA, 0, N_("Image")}, | { SOCK_RGBA, 0, N_("Image")}, | ||||
| { -1, 0, "" } | { -1, 0, "" } | ||||
| }; | }; | ||||
| static void node_composit_init_hue_sat(bNodeTree *UNUSED(ntree), bNode *node) | |||||
| { | |||||
| NodeHueSat *nhs = MEM_callocN(sizeof(NodeHueSat), "node hue sat"); | |||||
| node->storage = nhs; | |||||
| nhs->hue = 0.5f; | |||||
| nhs->sat = 1.0f; | |||||
| nhs->val = 1.0f; | |||||
| } | |||||
| void register_node_type_cmp_hue_sat(void) | void register_node_type_cmp_hue_sat(void) | ||||
| { | { | ||||
| static bNodeType ntype; | static bNodeType ntype; | ||||
| cmp_node_type_base(&ntype, CMP_NODE_HUE_SAT, "Hue Saturation Value", NODE_CLASS_OP_COLOR, 0); | cmp_node_type_base(&ntype, CMP_NODE_HUE_SAT, "Hue Saturation Value", NODE_CLASS_OP_COLOR, 0); | ||||
| node_type_socket_templates(&ntype, cmp_node_hue_sat_in, cmp_node_hue_sat_out); | node_type_socket_templates(&ntype, cmp_node_hue_sat_in, cmp_node_hue_sat_out); | ||||
| node_type_init(&ntype, node_composit_init_hue_sat); | |||||
| node_type_storage(&ntype, "NodeHueSat", node_free_standard_storage, node_copy_standard_storage); | |||||
| nodeRegisterType(&ntype); | nodeRegisterType(&ntype); | ||||
| } | } | ||||