Changeset View
Changeset View
Standalone View
Standalone View
source/blender/compositor/nodes/COM_ChromaMatteNode.cpp
| Show All 14 Lines | |||||
| * | * | ||||
| * Copyright 2011, Blender Foundation. | * Copyright 2011, Blender Foundation. | ||||
| */ | */ | ||||
| #include "COM_ChromaMatteNode.h" | #include "COM_ChromaMatteNode.h" | ||||
| #include "BKE_node.h" | #include "BKE_node.h" | ||||
| #include "COM_ChromaMatteOperation.h" | #include "COM_ChromaMatteOperation.h" | ||||
| #include "COM_ConvertOperation.h" | #include "COM_ConvertOperation.h" | ||||
| #include "COM_SetAlphaOperation.h" | #include "COM_SetAlphaMultiplyOperation.h" | ||||
| ChromaMatteNode::ChromaMatteNode(bNode *editorNode) : Node(editorNode) | ChromaMatteNode::ChromaMatteNode(bNode *editorNode) : Node(editorNode) | ||||
| { | { | ||||
| /* pass */ | /* pass */ | ||||
| } | } | ||||
| void ChromaMatteNode::convertToOperations(NodeConverter &converter, | void ChromaMatteNode::convertToOperations(NodeConverter &converter, | ||||
| const CompositorContext & /*context*/) const | const CompositorContext & /*context*/) const | ||||
| Show All 11 Lines | void ChromaMatteNode::convertToOperations(NodeConverter &converter, | ||||
| operationRGBToYCC_Key->setMode(BLI_YCC_ITU_BT709); | operationRGBToYCC_Key->setMode(BLI_YCC_ITU_BT709); | ||||
| converter.addOperation(operationRGBToYCC_Image); | converter.addOperation(operationRGBToYCC_Image); | ||||
| converter.addOperation(operationRGBToYCC_Key); | converter.addOperation(operationRGBToYCC_Key); | ||||
| ChromaMatteOperation *operation = new ChromaMatteOperation(); | ChromaMatteOperation *operation = new ChromaMatteOperation(); | ||||
| operation->setSettings((NodeChroma *)editorsnode->storage); | operation->setSettings((NodeChroma *)editorsnode->storage); | ||||
| converter.addOperation(operation); | converter.addOperation(operation); | ||||
| SetAlphaOperation *operationAlpha = new SetAlphaOperation(); | SetAlphaMultiplyOperation *operationAlpha = new SetAlphaMultiplyOperation(); | ||||
| converter.addOperation(operationAlpha); | converter.addOperation(operationAlpha); | ||||
| converter.mapInputSocket(inputSocketImage, operationRGBToYCC_Image->getInputSocket(0)); | converter.mapInputSocket(inputSocketImage, operationRGBToYCC_Image->getInputSocket(0)); | ||||
| converter.mapInputSocket(inputSocketKey, operationRGBToYCC_Key->getInputSocket(0)); | converter.mapInputSocket(inputSocketKey, operationRGBToYCC_Key->getInputSocket(0)); | ||||
| converter.addLink(operationRGBToYCC_Image->getOutputSocket(), operation->getInputSocket(0)); | converter.addLink(operationRGBToYCC_Image->getOutputSocket(), operation->getInputSocket(0)); | ||||
| converter.addLink(operationRGBToYCC_Key->getOutputSocket(), operation->getInputSocket(1)); | converter.addLink(operationRGBToYCC_Key->getOutputSocket(), operation->getInputSocket(1)); | ||||
| converter.mapOutputSocket(outputSocketMatte, operation->getOutputSocket()); | converter.mapOutputSocket(outputSocketMatte, operation->getOutputSocket()); | ||||
| converter.mapInputSocket(inputSocketImage, operationAlpha->getInputSocket(0)); | converter.mapInputSocket(inputSocketImage, operationAlpha->getInputSocket(0)); | ||||
| converter.addLink(operation->getOutputSocket(), operationAlpha->getInputSocket(1)); | converter.addLink(operation->getOutputSocket(), operationAlpha->getInputSocket(1)); | ||||
| converter.mapOutputSocket(outputSocketImage, operationAlpha->getOutputSocket()); | converter.mapOutputSocket(outputSocketImage, operationAlpha->getOutputSocket()); | ||||
| converter.addPreview(operationAlpha->getOutputSocket()); | converter.addPreview(operationAlpha->getOutputSocket()); | ||||
| } | } | ||||