Blender
V2.93
source
blender
compositor
nodes
COM_ColorCurveNode.cc
Go to the documentation of this file.
1
/*
2
* This program is free software; you can redistribute it and/or
3
* modify it under the terms of the GNU General Public License
4
* as published by the Free Software Foundation; either version 2
5
* of the License, or (at your option) any later version.
6
*
7
* This program is distributed in the hope that it will be useful,
8
* but WITHOUT ANY WARRANTY; without even the implied warranty of
9
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
10
* GNU General Public License for more details.
11
*
12
* You should have received a copy of the GNU General Public License
13
* along with this program; if not, write to the Free Software Foundation,
14
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
15
*
16
* Copyright 2011, Blender Foundation.
17
*/
18
19
#include "
COM_ColorCurveNode.h
"
20
#include "
COM_ColorCurveOperation.h
"
21
#include "
COM_ExecutionSystem.h
"
22
23
namespace
blender::compositor
{
24
25
ColorCurveNode::ColorCurveNode
(
bNode
*editorNode) :
Node
(editorNode)
26
{
27
/* pass */
28
}
29
30
void
ColorCurveNode::convertToOperations
(
NodeConverter
&converter,
31
const
CompositorContext
&
/*context*/
)
const
32
{
33
if
(this->
getInputSocket
(2)->isLinked() || this->
getInputSocket
(3)->isLinked()) {
34
ColorCurveOperation
*operation =
new
ColorCurveOperation
();
35
operation->
setCurveMapping
((
CurveMapping
*)this->
getbNode
()->storage);
36
converter.
addOperation
(operation);
37
38
converter.
mapInputSocket
(
getInputSocket
(0), operation->
getInputSocket
(0));
39
converter.
mapInputSocket
(
getInputSocket
(1), operation->
getInputSocket
(1));
40
converter.
mapInputSocket
(
getInputSocket
(2), operation->
getInputSocket
(2));
41
converter.
mapInputSocket
(
getInputSocket
(3), operation->
getInputSocket
(3));
42
43
converter.
mapOutputSocket
(
getOutputSocket
(0), operation->
getOutputSocket
());
44
}
45
else
{
46
ConstantLevelColorCurveOperation
*operation =
new
ConstantLevelColorCurveOperation
();
47
float
col
[4];
48
this->
getInputSocket
(2)->
getEditorValueColor
(col);
49
operation->
setBlackLevel
(
col
);
50
this->
getInputSocket
(3)->
getEditorValueColor
(col);
51
operation->
setWhiteLevel
(
col
);
52
operation->
setCurveMapping
((
CurveMapping
*)this->
getbNode
()->storage);
53
converter.
addOperation
(operation);
54
55
converter.
mapInputSocket
(
getInputSocket
(0), operation->
getInputSocket
(0));
56
converter.
mapInputSocket
(
getInputSocket
(1), operation->
getInputSocket
(1));
57
converter.
mapOutputSocket
(
getOutputSocket
(0), operation->
getOutputSocket
());
58
}
59
}
60
61
}
// namespace blender::compositor
COM_ColorCurveNode.h
COM_ColorCurveOperation.h
COM_ExecutionSystem.h
blender::compositor::ColorCurveNode::ColorCurveNode
ColorCurveNode(bNode *editorNode)
Definition:
COM_ColorCurveNode.cc:25
blender::compositor::ColorCurveNode::convertToOperations
void convertToOperations(NodeConverter &converter, const CompositorContext &context) const override
convert node to operation
Definition:
COM_ColorCurveNode.cc:30
blender::compositor::ColorCurveOperation
Definition:
COM_ColorCurveOperation.h:27
blender::compositor::CompositorContext
Overall context of the compositor.
Definition:
COM_CompositorContext.h:37
blender::compositor::ConstantLevelColorCurveOperation
Definition:
COM_ColorCurveOperation.h:56
blender::compositor::ConstantLevelColorCurveOperation::setWhiteLevel
void setWhiteLevel(float white[3])
Definition:
COM_ColorCurveOperation.h:88
blender::compositor::ConstantLevelColorCurveOperation::setBlackLevel
void setBlackLevel(float black[3])
Definition:
COM_ColorCurveOperation.h:84
blender::compositor::CurveBaseOperation::setCurveMapping
void setCurveMapping(CurveMapping *mapping)
Definition:
COM_CurveBaseOperation.cc:50
blender::compositor::NodeConverter
Definition:
COM_NodeConverter.h:43
blender::compositor::NodeConverter::mapInputSocket
void mapInputSocket(NodeInput *node_socket, NodeOperationInput *operation_socket)
Definition:
COM_NodeConverter.cc:43
blender::compositor::NodeConverter::addOperation
void addOperation(NodeOperation *operation)
Definition:
COM_NodeConverter.cc:38
blender::compositor::NodeConverter::mapOutputSocket
void mapOutputSocket(NodeOutput *node_socket, NodeOperationOutput *operation_socket)
Definition:
COM_NodeConverter.cc:48
blender::compositor::NodeInput::getEditorValueColor
void getEditorValueColor(float *value) const
Definition:
COM_Node.cc:166
blender::compositor::NodeOperation::getInputSocket
NodeOperationInput * getInputSocket(unsigned int index)
Definition:
COM_NodeOperation.cc:47
blender::compositor::NodeOperation::getOutputSocket
NodeOperationOutput * getOutputSocket(unsigned int index=0)
Definition:
COM_NodeOperation.cc:42
blender::compositor::Node
Definition:
COM_Node.h:42
blender::compositor::Node::getOutputSocket
NodeOutput * getOutputSocket(const unsigned int index=0) const
Definition:
COM_Node.cc:108
blender::compositor::Node::getbNode
bNode * getbNode() const
get the reference to the SDNA bNode struct
Definition:
COM_Node.h:82
blender::compositor::Node::getInputSocket
NodeInput * getInputSocket(const unsigned int index) const
Definition:
COM_Node.cc:113
col
uint col
Definition:
gpu_batch_presets.c:76
blender::compositor
Definition:
COM_defines.h:21
CurveMapping
Definition:
DNA_color_types.h:75
bNode
Definition:
DNA_node_types.h:212
Generated on Tue Jan 31 2023 14:37:24 for Blender by
doxygen
1.9.1