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:
authorJeroen Bakker <j.bakker@atmind.nl>2012-06-08 13:17:07 +0400
committerJeroen Bakker <j.bakker@atmind.nl>2012-06-08 13:17:07 +0400
commitde7fe937ff24121ce8c66af902639cd96244a55f (patch)
tree625821742e2a136e10fe1cd76a81303766b8633f /source/blender/compositor/nodes/COM_ColorCurveNode.cpp
parent95641388471d178552fea26bb477c13536bd58ef (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.cpp40
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);
+ }
}