Changeset View
Changeset View
Standalone View
Standalone View
source/blender/compositor/nodes/COM_DistanceMatteNode.cpp
| Show All 15 Lines | |||||
| * Copyright 2011, Blender Foundation. | * Copyright 2011, Blender Foundation. | ||||
| */ | */ | ||||
| #include "COM_DistanceMatteNode.h" | #include "COM_DistanceMatteNode.h" | ||||
| #include "BKE_node.h" | #include "BKE_node.h" | ||||
| #include "COM_ConvertOperation.h" | #include "COM_ConvertOperation.h" | ||||
| #include "COM_DistanceRGBMatteOperation.h" | #include "COM_DistanceRGBMatteOperation.h" | ||||
| #include "COM_DistanceYCCMatteOperation.h" | #include "COM_DistanceYCCMatteOperation.h" | ||||
| #include "COM_SetAlphaOperation.h" | #include "COM_SetAlphaMultiplyOperation.h" | ||||
| DistanceMatteNode::DistanceMatteNode(bNode *editorNode) : Node(editorNode) | DistanceMatteNode::DistanceMatteNode(bNode *editorNode) : Node(editorNode) | ||||
| { | { | ||||
| /* pass */ | /* pass */ | ||||
| } | } | ||||
| void DistanceMatteNode::convertToOperations(NodeConverter &converter, | void DistanceMatteNode::convertToOperations(NodeConverter &converter, | ||||
| const CompositorContext & /*context*/) const | const CompositorContext & /*context*/) const | ||||
| { | { | ||||
| bNode *editorsnode = getbNode(); | bNode *editorsnode = getbNode(); | ||||
| NodeChroma *storage = (NodeChroma *)editorsnode->storage; | NodeChroma *storage = (NodeChroma *)editorsnode->storage; | ||||
| NodeInput *inputSocketImage = this->getInputSocket(0); | NodeInput *inputSocketImage = this->getInputSocket(0); | ||||
| NodeInput *inputSocketKey = this->getInputSocket(1); | NodeInput *inputSocketKey = this->getInputSocket(1); | ||||
| NodeOutput *outputSocketImage = this->getOutputSocket(0); | NodeOutput *outputSocketImage = this->getOutputSocket(0); | ||||
| NodeOutput *outputSocketMatte = this->getOutputSocket(1); | NodeOutput *outputSocketMatte = this->getOutputSocket(1); | ||||
| SetAlphaOperation *operationAlpha = new SetAlphaOperation(); | SetAlphaMultiplyOperation *operationAlpha = new SetAlphaMultiplyOperation(); | ||||
| converter.addOperation(operationAlpha); | converter.addOperation(operationAlpha); | ||||
| /* work in RGB color space */ | /* work in RGB color space */ | ||||
| NodeOperation *operation; | NodeOperation *operation; | ||||
| if (storage->channel == 1) { | if (storage->channel == 1) { | ||||
| DistanceRGBMatteOperation *matte = new DistanceRGBMatteOperation(); | DistanceRGBMatteOperation *matte = new DistanceRGBMatteOperation(); | ||||
| matte->setSettings(storage); | matte->setSettings(storage); | ||||
| converter.addOperation(matte); | converter.addOperation(matte); | ||||
| ▲ Show 20 Lines • Show All 48 Lines • Show Last 20 Lines | |||||