Changeset View
Changeset View
Standalone View
Standalone View
source/blender/compositor/nodes/COM_ColorMatteNode.cpp
| Show All 14 Lines | |||||
| * | * | ||||
| * Copyright 2011, Blender Foundation. | * Copyright 2011, Blender Foundation. | ||||
| */ | */ | ||||
| #include "COM_ColorMatteNode.h" | #include "COM_ColorMatteNode.h" | ||||
| #include "BKE_node.h" | #include "BKE_node.h" | ||||
| #include "COM_ColorMatteOperation.h" | #include "COM_ColorMatteOperation.h" | ||||
| #include "COM_ConvertOperation.h" | #include "COM_ConvertOperation.h" | ||||
| #include "COM_SetAlphaOperation.h" | #include "COM_SetAlphaMultiplyOperation.h" | ||||
| ColorMatteNode::ColorMatteNode(bNode *editorNode) : Node(editorNode) | ColorMatteNode::ColorMatteNode(bNode *editorNode) : Node(editorNode) | ||||
| { | { | ||||
| /* pass */ | /* pass */ | ||||
| } | } | ||||
| void ColorMatteNode::convertToOperations(NodeConverter &converter, | void ColorMatteNode::convertToOperations(NodeConverter &converter, | ||||
| const CompositorContext & /*context*/) const | const CompositorContext & /*context*/) const | ||||
| Show All 9 Lines | void ColorMatteNode::convertToOperations(NodeConverter &converter, | ||||
| ConvertRGBToHSVOperation *operationRGBToHSV_Key = new ConvertRGBToHSVOperation(); | ConvertRGBToHSVOperation *operationRGBToHSV_Key = new ConvertRGBToHSVOperation(); | ||||
| converter.addOperation(operationRGBToHSV_Image); | converter.addOperation(operationRGBToHSV_Image); | ||||
| converter.addOperation(operationRGBToHSV_Key); | converter.addOperation(operationRGBToHSV_Key); | ||||
| ColorMatteOperation *operation = new ColorMatteOperation(); | ColorMatteOperation *operation = new ColorMatteOperation(); | ||||
| 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, operationRGBToHSV_Image->getInputSocket(0)); | converter.mapInputSocket(inputSocketImage, operationRGBToHSV_Image->getInputSocket(0)); | ||||
| converter.mapInputSocket(inputSocketKey, operationRGBToHSV_Key->getInputSocket(0)); | converter.mapInputSocket(inputSocketKey, operationRGBToHSV_Key->getInputSocket(0)); | ||||
| converter.addLink(operationRGBToHSV_Image->getOutputSocket(), operation->getInputSocket(0)); | converter.addLink(operationRGBToHSV_Image->getOutputSocket(), operation->getInputSocket(0)); | ||||
| converter.addLink(operationRGBToHSV_Key->getOutputSocket(), operation->getInputSocket(1)); | converter.addLink(operationRGBToHSV_Key->getOutputSocket(), operation->getInputSocket(1)); | ||||
| converter.mapOutputSocket(outputSocketMatte, operation->getOutputSocket(0)); | converter.mapOutputSocket(outputSocketMatte, operation->getOutputSocket(0)); | ||||
| 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()); | ||||
| } | } | ||||