Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'source/blender/nodes/composite/nodes/node_composite_colorcorrection.cc')
-rw-r--r--source/blender/nodes/composite/nodes/node_composite_colorcorrection.cc53
1 files changed, 25 insertions, 28 deletions
diff --git a/source/blender/nodes/composite/nodes/node_composite_colorcorrection.cc b/source/blender/nodes/composite/nodes/node_composite_colorcorrection.cc
index f6bc3d1fdf2..92b10fc1877 100644
--- a/source/blender/nodes/composite/nodes/node_composite_colorcorrection.cc
+++ b/source/blender/nodes/composite/nodes/node_composite_colorcorrection.cc
@@ -20,6 +20,8 @@
namespace blender::nodes::node_composite_colorcorrection_cc {
+NODE_STORAGE_FUNCS(NodeColorCorrection)
+
static void cmp_node_colorcorrection_declare(NodeDeclarationBuilder &b)
{
b.add_input<decl::Color>(N_("Image"))
@@ -294,7 +296,7 @@ class ColorCorrectionShaderNode : public ShaderNode {
float luminance_coefficients[3];
IMB_colormanagement_get_luminance_coefficients(luminance_coefficients);
- const NodeColorCorrection *node_color_correction = get_node_color_correction();
+ const NodeColorCorrection &node_color_correction = node_storage(bnode());
GPU_stack_link(material,
&bnode(),
@@ -302,28 +304,28 @@ class ColorCorrectionShaderNode : public ShaderNode {
inputs,
outputs,
GPU_constant(enabled_channels),
- GPU_uniform(&node_color_correction->startmidtones),
- GPU_uniform(&node_color_correction->endmidtones),
- GPU_uniform(&node_color_correction->master.saturation),
- GPU_uniform(&node_color_correction->master.contrast),
- GPU_uniform(&node_color_correction->master.gamma),
- GPU_uniform(&node_color_correction->master.gain),
- GPU_uniform(&node_color_correction->master.lift),
- GPU_uniform(&node_color_correction->shadows.saturation),
- GPU_uniform(&node_color_correction->shadows.contrast),
- GPU_uniform(&node_color_correction->shadows.gamma),
- GPU_uniform(&node_color_correction->shadows.gain),
- GPU_uniform(&node_color_correction->shadows.lift),
- GPU_uniform(&node_color_correction->midtones.saturation),
- GPU_uniform(&node_color_correction->midtones.contrast),
- GPU_uniform(&node_color_correction->midtones.gamma),
- GPU_uniform(&node_color_correction->midtones.gain),
- GPU_uniform(&node_color_correction->midtones.lift),
- GPU_uniform(&node_color_correction->highlights.saturation),
- GPU_uniform(&node_color_correction->highlights.contrast),
- GPU_uniform(&node_color_correction->highlights.gamma),
- GPU_uniform(&node_color_correction->highlights.gain),
- GPU_uniform(&node_color_correction->highlights.lift),
+ GPU_uniform(&node_color_correction.startmidtones),
+ GPU_uniform(&node_color_correction.endmidtones),
+ GPU_uniform(&node_color_correction.master.saturation),
+ GPU_uniform(&node_color_correction.master.contrast),
+ GPU_uniform(&node_color_correction.master.gamma),
+ GPU_uniform(&node_color_correction.master.gain),
+ GPU_uniform(&node_color_correction.master.lift),
+ GPU_uniform(&node_color_correction.shadows.saturation),
+ GPU_uniform(&node_color_correction.shadows.contrast),
+ GPU_uniform(&node_color_correction.shadows.gamma),
+ GPU_uniform(&node_color_correction.shadows.gain),
+ GPU_uniform(&node_color_correction.shadows.lift),
+ GPU_uniform(&node_color_correction.midtones.saturation),
+ GPU_uniform(&node_color_correction.midtones.contrast),
+ GPU_uniform(&node_color_correction.midtones.gamma),
+ GPU_uniform(&node_color_correction.midtones.gain),
+ GPU_uniform(&node_color_correction.midtones.lift),
+ GPU_uniform(&node_color_correction.highlights.saturation),
+ GPU_uniform(&node_color_correction.highlights.contrast),
+ GPU_uniform(&node_color_correction.highlights.gamma),
+ GPU_uniform(&node_color_correction.highlights.gain),
+ GPU_uniform(&node_color_correction.highlights.lift),
GPU_constant(luminance_coefficients));
}
@@ -333,11 +335,6 @@ class ColorCorrectionShaderNode : public ShaderNode {
enabled_channels[i] = (bnode().custom1 & (1 << i)) ? 1.0f : 0.0f;
}
}
-
- const NodeColorCorrection *get_node_color_correction()
- {
- return static_cast<const NodeColorCorrection *>(bnode().storage);
- }
};
static ShaderNode *get_compositor_shader_node(DNode node)