diff options
author | Jeroen Bakker <j.bakker@atmind.nl> | 2012-06-08 13:17:07 +0400 |
---|---|---|
committer | Jeroen Bakker <j.bakker@atmind.nl> | 2012-06-08 13:17:07 +0400 |
commit | de7fe937ff24121ce8c66af902639cd96244a55f (patch) | |
tree | 625821742e2a136e10fe1cd76a81303766b8633f /source/blender/compositor/nodes/COM_ColorCurveNode.cpp | |
parent | 95641388471d178552fea26bb477c13536bd58ef (diff) |
* Added OpenCL kernel for bokeh blur
* Uncomment COM_OPENCL_ENABLED from COM_defines.h to test
Diffstat (limited to 'source/blender/compositor/nodes/COM_ColorCurveNode.cpp')
-rw-r--r-- | source/blender/compositor/nodes/COM_ColorCurveNode.cpp | 40 |
1 files changed, 28 insertions, 12 deletions
diff --git a/source/blender/compositor/nodes/COM_ColorCurveNode.cpp b/source/blender/compositor/nodes/COM_ColorCurveNode.cpp index d7cde21a984..0d331ed9b05 100644 --- a/source/blender/compositor/nodes/COM_ColorCurveNode.cpp +++ b/source/blender/compositor/nodes/COM_ColorCurveNode.cpp @@ -31,16 +31,32 @@ ColorCurveNode::ColorCurveNode(bNode *editorNode): Node(editorNode) void ColorCurveNode::convertToOperations(ExecutionSystem *graph, CompositorContext * context) { - ColorCurveOperation *operation = new ColorCurveOperation(); - - this->getInputSocket(0)->relinkConnections(operation->getInputSocket(0), 0, graph); - this->getInputSocket(1)->relinkConnections(operation->getInputSocket(1), 1, graph); - this->getInputSocket(2)->relinkConnections(operation->getInputSocket(2), 2, graph); - this->getInputSocket(3)->relinkConnections(operation->getInputSocket(3), 3, graph); - - this->getOutputSocket(0)->relinkConnections(operation->getOutputSocket()); - - operation->setCurveMapping((CurveMapping*)this->getbNode()->storage); - - graph->addOperation(operation); + if (this->getInputSocket(2)->isConnected() || this->getInputSocket(3)->isConnected()) { + ColorCurveOperation *operation = new ColorCurveOperation(); + + this->getInputSocket(0)->relinkConnections(operation->getInputSocket(0), 0, graph); + this->getInputSocket(1)->relinkConnections(operation->getInputSocket(1), 1, graph); + this->getInputSocket(2)->relinkConnections(operation->getInputSocket(2), 2, graph); + this->getInputSocket(3)->relinkConnections(operation->getInputSocket(3), 3, graph); + + this->getOutputSocket(0)->relinkConnections(operation->getOutputSocket()); + + operation->setCurveMapping((CurveMapping*)this->getbNode()->storage); + + graph->addOperation(operation); + } else { + ConstantLevelColorCurveOperation *operation = new ConstantLevelColorCurveOperation(); + + this->getInputSocket(0)->relinkConnections(operation->getInputSocket(0), 0, graph); + this->getInputSocket(1)->relinkConnections(operation->getInputSocket(1), 1, graph); + bNodeSocketValueRGBA *val = (bNodeSocketValueRGBA*)this->getInputSocket(2)->getbNodeSocket()->default_value; + operation->setBlackLevel(val->value); + val = (bNodeSocketValueRGBA*)this->getInputSocket(3)->getbNodeSocket()->default_value; + operation->setWhiteLevel(val->value); + this->getOutputSocket(0)->relinkConnections(operation->getOutputSocket()); + + operation->setCurveMapping((CurveMapping*)this->getbNode()->storage); + + graph->addOperation(operation); + } } |