Cleanup: Use enum class for DataType.

This commit is contained in:
2021-03-19 14:26:24 +01:00
parent b5f70d92c2
commit e5ffefe606
111 changed files with 400 additions and 399 deletions

View File

@@ -22,14 +22,14 @@
* \brief possible data types for sockets
* \ingroup Model
*/
typedef enum DataType {
enum class DataType {
/** \brief Value data type */
COM_DT_VALUE = 1,
Value = 0,
/** \brief Vector data type */
COM_DT_VECTOR = 2,
Vector = 1,
/** \brief Color data type */
COM_DT_COLOR = 4,
} DataType;
Color = 2,
};
/**
* \brief Possible quality settings

View File

@@ -428,22 +428,22 @@ NodeOperation *COM_convert_data_type(const NodeOperationOutput &from, const Node
const DataType src_data_type = from.getDataType();
const DataType dst_data_type = to.getDataType();
if (src_data_type == COM_DT_VALUE && dst_data_type == COM_DT_COLOR) {
if (src_data_type == DataType::Value && dst_data_type == DataType::Color) {
return new ConvertValueToColorOperation();
}
if (src_data_type == COM_DT_VALUE && dst_data_type == COM_DT_VECTOR) {
if (src_data_type == DataType::Value && dst_data_type == DataType::Vector) {
return new ConvertValueToVectorOperation();
}
if (src_data_type == COM_DT_COLOR && dst_data_type == COM_DT_VALUE) {
if (src_data_type == DataType::Color && dst_data_type == DataType::Value) {
return new ConvertColorToValueOperation();
}
if (src_data_type == COM_DT_COLOR && dst_data_type == COM_DT_VECTOR) {
if (src_data_type == DataType::Color && dst_data_type == DataType::Vector) {
return new ConvertColorToVectorOperation();
}
if (src_data_type == COM_DT_VECTOR && dst_data_type == COM_DT_VALUE) {
if (src_data_type == DataType::Vector && dst_data_type == DataType::Value) {
return new ConvertVectorToValueOperation();
}
if (src_data_type == COM_DT_VECTOR && dst_data_type == COM_DT_COLOR) {
if (src_data_type == DataType::Vector && dst_data_type == DataType::Color) {
return new ConvertVectorToColorOperation();
}

View File

@@ -165,13 +165,13 @@ int DebugInfo::graphviz_operation(const ExecutionSystem *system,
}
len += snprintf(str + len, maxlen > len ? maxlen - len : 0, "<IN_%p>", socket);
switch (socket->getDataType()) {
case COM_DT_VALUE:
case DataType::Value:
len += snprintf(str + len, maxlen > len ? maxlen - len : 0, "Value");
break;
case COM_DT_VECTOR:
case DataType::Vector:
len += snprintf(str + len, maxlen > len ? maxlen - len : 0, "Vector");
break;
case COM_DT_COLOR:
case DataType::Color:
len += snprintf(str + len, maxlen > len ? maxlen - len : 0, "Color");
break;
}
@@ -203,13 +203,13 @@ int DebugInfo::graphviz_operation(const ExecutionSystem *system,
}
len += snprintf(str + len, maxlen > len ? maxlen - len : 0, "<OUT_%p>", socket);
switch (socket->getDataType()) {
case COM_DT_VALUE:
case DataType::Value:
len += snprintf(str + len, maxlen > len ? maxlen - len : 0, "Value");
break;
case COM_DT_VECTOR:
case DataType::Vector:
len += snprintf(str + len, maxlen > len ? maxlen - len : 0, "Vector");
break;
case COM_DT_COLOR:
case DataType::Color:
len += snprintf(str + len, maxlen > len ? maxlen - len : 0, "Color");
break;
}
@@ -390,13 +390,13 @@ bool DebugInfo::graphviz_system(const ExecutionSystem *system, char *str, int ma
std::string color;
switch (from->getDataType()) {
case COM_DT_VALUE:
case DataType::Value:
color = "gray";
break;
case COM_DT_VECTOR:
case DataType::Vector:
color = "blue";
break;
case COM_DT_COLOR:
case DataType::Color:
color = "orange";
break;
}

View File

@@ -64,8 +64,8 @@ class ExecutionGroup;
* \see NodeOperation base class for all operations in the system
*
* \section EM_Step3 Step3: add additional conversions to the operation system
* - Data type conversions: the system has 3 data types COM_DT_VALUE, COM_DT_VECTOR,
* COM_DT_COLOR. The user can connect a Value socket to a color socket. As values are ordered
* - Data type conversions: the system has 3 data types DataType::Value, DataType::Vector,
* DataType::Color. The user can connect a Value socket to a color socket. As values are ordered
* differently than colors a conversion happens.
*
* - Image size conversions: the system can automatically convert when resolutions do not match.

View File

@@ -23,11 +23,11 @@
static unsigned int determine_num_channels(DataType datatype)
{
switch (datatype) {
case COM_DT_VALUE:
case DataType::Value:
return COM_NUM_CHANNELS_VALUE;
case COM_DT_VECTOR:
case DataType::Vector:
return COM_NUM_CHANNELS_VECTOR;
case COM_DT_COLOR:
case DataType::Color:
default:
return COM_NUM_CHANNELS_COLOR;
}
@@ -204,7 +204,7 @@ static void read_ewa_pixel_sampled(void *userdata, int x, int y, float result[4]
void MemoryBuffer::readEWA(float *result, const float uv[2], const float derivatives[2][2])
{
BLI_assert(this->m_datatype == COM_DT_COLOR);
BLI_assert(this->m_datatype == DataType::Color);
float inv_width = 1.0f / (float)this->getWidth(), inv_height = 1.0f / (float)this->getHeight();
/* TODO(sergey): Render pipeline uses normalized coordinates and derivatives,
* but compositor uses pixel space. For now let's just divide the values and

View File

@@ -60,7 +60,7 @@ class MemoryBuffer {
MemoryProxy *m_memoryProxy;
/**
* \brief the type of buffer COM_DT_VALUE, COM_DT_VECTOR, COM_DT_COLOR
* \brief the type of buffer DataType::Value, DataType::Vector, DataType::Color
*/
DataType m_datatype;

View File

@@ -45,12 +45,12 @@ Node::Node(bNode *editorNode, bool create_sockets)
if (create_sockets) {
bNodeSocket *input = (bNodeSocket *)editorNode->inputs.first;
while (input != nullptr) {
DataType dt = COM_DT_VALUE;
DataType dt = DataType::Value;
if (input->type == SOCK_RGBA) {
dt = COM_DT_COLOR;
dt = DataType::Color;
}
if (input->type == SOCK_VECTOR) {
dt = COM_DT_VECTOR;
dt = DataType::Vector;
}
this->addInputSocket(dt, input);
@@ -58,12 +58,12 @@ Node::Node(bNode *editorNode, bool create_sockets)
}
bNodeSocket *output = (bNodeSocket *)editorNode->outputs.first;
while (output != nullptr) {
DataType dt = COM_DT_VALUE;
DataType dt = DataType::Value;
if (output->type == SOCK_RGBA) {
dt = COM_DT_COLOR;
dt = DataType::Color;
}
if (output->type == SOCK_VECTOR) {
dt = COM_DT_VECTOR;
dt = DataType::Vector;
}
this->addOutputSocket(dt, output);

View File

@@ -297,7 +297,7 @@ void NodeOperationBuilder::add_input_constant_value(NodeOperationInput *input,
const NodeInput *node_input)
{
switch (input->getDataType()) {
case COM_DT_VALUE: {
case DataType::Value: {
float value;
if (node_input && node_input->getbNodeSocket()) {
value = node_input->getEditorValueFloat();
@@ -312,7 +312,7 @@ void NodeOperationBuilder::add_input_constant_value(NodeOperationInput *input,
addLink(op->getOutputSocket(), input);
break;
}
case COM_DT_COLOR: {
case DataType::Color: {
float value[4];
if (node_input && node_input->getbNodeSocket()) {
node_input->getEditorValueColor(value);
@@ -327,7 +327,7 @@ void NodeOperationBuilder::add_input_constant_value(NodeOperationInput *input,
addLink(op->getOutputSocket(), input);
break;
}
case COM_DT_VECTOR: {
case DataType::Vector: {
float value[3];
if (node_input && node_input->getbNodeSocket()) {
node_input->getEditorValueVector(value);

View File

@@ -125,7 +125,7 @@ void CryptomatteNode::input_operations_from_render_source(
const std::string combined_name = combined_layer_pass_name(render_layer, render_pass);
if (blender::StringRef(combined_name).startswith(prefix)) {
RenderLayersProg *op = new RenderLayersProg(
render_pass->name, COM_DT_COLOR, render_pass->channels);
render_pass->name, DataType::Color, render_pass->channels);
op->setScene(scene);
op->setLayerId(cryptomatte_layer_id);
op->setRenderData(context.getRenderData());

View File

@@ -46,13 +46,13 @@ NodeOperation *ImageNode::doMultilayerCheck(NodeConverter &converter,
NodeOutput *outputSocket = this->getOutputSocket(outputsocketIndex);
MultilayerBaseOperation *operation = nullptr;
switch (datatype) {
case COM_DT_VALUE:
case DataType::Value:
operation = new MultilayerValueOperation(render_layer, render_pass, view);
break;
case COM_DT_VECTOR:
case DataType::Vector:
operation = new MultilayerVectorOperation(render_layer, render_pass, view);
break;
case COM_DT_COLOR:
case DataType::Color:
operation = new MultilayerColorOperation(render_layer, render_pass, view);
break;
default:
@@ -137,7 +137,7 @@ void ImageNode::convertToOperations(NodeConverter &converter,
framenumber,
index,
view,
COM_DT_VALUE);
DataType::Value);
break;
/* using image operations for both 3 and 4 channels (RGB and RGBA respectively) */
/* XXX any way to detect actual vector images? */
@@ -150,7 +150,7 @@ void ImageNode::convertToOperations(NodeConverter &converter,
framenumber,
index,
view,
COM_DT_VECTOR);
DataType::Vector);
break;
case 4:
operation = doMultilayerCheck(converter,
@@ -161,7 +161,7 @@ void ImageNode::convertToOperations(NodeConverter &converter,
framenumber,
index,
view,
COM_DT_COLOR);
DataType::Color);
break;
default:
/* dummy operation is added below */
@@ -263,13 +263,13 @@ void ImageNode::convertToOperations(NodeConverter &converter,
NodeOutput *output = this->getOutputSocket(i);
NodeOperation *operation = nullptr;
switch (output->getDataType()) {
case COM_DT_VALUE: {
case DataType::Value: {
SetValueOperation *valueoperation = new SetValueOperation();
valueoperation->setValue(0.0f);
operation = valueoperation;
break;
}
case COM_DT_VECTOR: {
case DataType::Vector: {
SetVectorOperation *vectoroperation = new SetVectorOperation();
vectoroperation->setX(0.0f);
vectoroperation->setY(0.0f);
@@ -277,7 +277,7 @@ void ImageNode::convertToOperations(NodeConverter &converter,
operation = vectoroperation;
break;
}
case COM_DT_COLOR: {
case DataType::Color: {
SetColorOperation *coloroperation = new SetColorOperation();
coloroperation->setChannel1(0.0f);
coloroperation->setChannel2(0.0f);

View File

@@ -86,28 +86,28 @@ void RenderLayersNode::testRenderLink(NodeConverter &converter,
bool is_preview;
if (STREQ(rpass->name, RE_PASSNAME_COMBINED) &&
STREQ(output->getbNodeSocket()->name, "Alpha")) {
operation = new RenderLayersAlphaProg(rpass->name, COM_DT_VALUE, rpass->channels);
operation = new RenderLayersAlphaProg(rpass->name, DataType::Value, rpass->channels);
is_preview = false;
}
else if (STREQ(rpass->name, RE_PASSNAME_Z)) {
operation = new RenderLayersDepthProg(rpass->name, COM_DT_VALUE, rpass->channels);
operation = new RenderLayersDepthProg(rpass->name, DataType::Value, rpass->channels);
is_preview = false;
}
else {
DataType type;
switch (rpass->channels) {
case 4:
type = COM_DT_COLOR;
type = DataType::Color;
break;
case 3:
type = COM_DT_VECTOR;
type = DataType::Vector;
break;
case 1:
type = COM_DT_VALUE;
type = DataType::Value;
break;
default:
BLI_assert(!"Unexpected number of channels for pass");
type = COM_DT_VALUE;
type = DataType::Value;
break;
}
operation = new RenderLayersProg(rpass->name, type, rpass->channels);
@@ -121,21 +121,21 @@ void RenderLayersNode::missingSocketLink(NodeConverter &converter, NodeOutput *o
{
NodeOperation *operation;
switch (output->getDataType()) {
case COM_DT_COLOR: {
case DataType::Color: {
const float color[4] = {0.0f, 0.0f, 0.0f, 0.0f};
SetColorOperation *color_operation = new SetColorOperation();
color_operation->setChannels(color);
operation = color_operation;
break;
}
case COM_DT_VECTOR: {
case DataType::Vector: {
const float vector[3] = {0.0f, 0.0f, 0.0f};
SetVectorOperation *vector_operation = new SetVectorOperation();
vector_operation->setVector(vector);
operation = vector_operation;
break;
}
case COM_DT_VALUE: {
case DataType::Value: {
SetValueOperation *value_operation = new SetValueOperation();
value_operation->setValue(0.0f);
operation = value_operation;

View File

@@ -33,21 +33,21 @@ SocketProxyNode::SocketProxyNode(bNode *editorNode,
{
DataType dt;
dt = COM_DT_VALUE;
dt = DataType::Value;
if (editorInput->type == SOCK_RGBA) {
dt = COM_DT_COLOR;
dt = DataType::Color;
}
if (editorInput->type == SOCK_VECTOR) {
dt = COM_DT_VECTOR;
dt = DataType::Vector;
}
this->addInputSocket(dt, editorInput);
dt = COM_DT_VALUE;
dt = DataType::Value;
if (editorOutput->type == SOCK_RGBA) {
dt = COM_DT_COLOR;
dt = DataType::Color;
}
if (editorOutput->type == SOCK_VECTOR) {
dt = COM_DT_VECTOR;
dt = DataType::Vector;
}
this->addOutputSocket(dt, editorOutput);
}
@@ -66,21 +66,21 @@ SocketBufferNode::SocketBufferNode(bNode *editorNode,
{
DataType dt;
dt = COM_DT_VALUE;
dt = DataType::Value;
if (editorInput->type == SOCK_RGBA) {
dt = COM_DT_COLOR;
dt = DataType::Color;
}
if (editorInput->type == SOCK_VECTOR) {
dt = COM_DT_VECTOR;
dt = DataType::Vector;
}
this->addInputSocket(dt, editorInput);
dt = COM_DT_VALUE;
dt = DataType::Value;
if (editorOutput->type == SOCK_RGBA) {
dt = COM_DT_COLOR;
dt = DataType::Color;
}
if (editorOutput->type == SOCK_VECTOR) {
dt = COM_DT_VECTOR;
dt = DataType::Vector;
}
this->addOutputSocket(dt, editorOutput);
}

View File

@@ -55,8 +55,8 @@ void TranslateNode::convertToOperations(NodeConverter &converter,
converter.mapOutputSocket(outputSocket, operation->getOutputSocket(0));
if (data->wrap_axis) {
WriteBufferOperation *writeOperation = new WriteBufferOperation(COM_DT_COLOR);
WrapOperation *wrapOperation = new WrapOperation(COM_DT_COLOR);
WriteBufferOperation *writeOperation = new WriteBufferOperation(DataType::Color);
WrapOperation *wrapOperation = new WrapOperation(DataType::Color);
wrapOperation->setMemoryProxy(writeOperation->getMemoryProxy());
wrapOperation->setWrapping(data->wrap_axis);

View File

@@ -114,8 +114,8 @@ static int extrapolate9(float *E0,
AntiAliasOperation::AntiAliasOperation()
{
this->addInputSocket(COM_DT_VALUE);
this->addOutputSocket(COM_DT_VALUE);
this->addInputSocket(DataType::Value);
this->addOutputSocket(DataType::Value);
this->m_valueReader = nullptr;
this->setComplex(true);
}

View File

@@ -23,9 +23,9 @@
BilateralBlurOperation::BilateralBlurOperation()
{
this->addInputSocket(COM_DT_COLOR);
this->addInputSocket(COM_DT_COLOR);
this->addOutputSocket(COM_DT_COLOR);
this->addInputSocket(DataType::Color);
this->addInputSocket(DataType::Color);
this->addOutputSocket(DataType::Color);
this->setComplex(true);
this->m_inputColorProgram = nullptr;

View File

@@ -24,9 +24,9 @@
BlurBaseOperation::BlurBaseOperation(DataType data_type)
{
/* data_type is almost always COM_DT_COLOR except for alpha-blur */
/* data_type is almost always DataType::Color except for alpha-blur */
this->addInputSocket(data_type);
this->addInputSocket(COM_DT_VALUE);
this->addInputSocket(DataType::Value);
this->addOutputSocket(data_type);
this->setComplex(true);
this->m_inputProgram = nullptr;

View File

@@ -24,11 +24,11 @@
BokehBlurOperation::BokehBlurOperation()
{
this->addInputSocket(COM_DT_COLOR);
this->addInputSocket(COM_DT_COLOR, COM_SC_NO_RESIZE);
this->addInputSocket(COM_DT_VALUE);
this->addInputSocket(COM_DT_VALUE);
this->addOutputSocket(COM_DT_COLOR);
this->addInputSocket(DataType::Color);
this->addInputSocket(DataType::Color, COM_SC_NO_RESIZE);
this->addInputSocket(DataType::Value);
this->addInputSocket(DataType::Value);
this->addOutputSocket(DataType::Color);
this->setComplex(true);
this->setOpenCL(true);

View File

@@ -21,7 +21,7 @@
BokehImageOperation::BokehImageOperation()
{
this->addOutputSocket(COM_DT_COLOR);
this->addOutputSocket(DataType::Color);
this->m_deleteData = false;
}
void BokehImageOperation::initExecution()

View File

@@ -22,9 +22,9 @@
BoxMaskOperation::BoxMaskOperation()
{
this->addInputSocket(COM_DT_VALUE);
this->addInputSocket(COM_DT_VALUE);
this->addOutputSocket(COM_DT_VALUE);
this->addInputSocket(DataType::Value);
this->addInputSocket(DataType::Value);
this->addOutputSocket(DataType::Value);
this->m_inputMask = nullptr;
this->m_inputValue = nullptr;
this->m_cosine = 0.0f;

View File

@@ -20,10 +20,10 @@
BrightnessOperation::BrightnessOperation()
{
this->addInputSocket(COM_DT_COLOR);
this->addInputSocket(COM_DT_VALUE);
this->addInputSocket(COM_DT_VALUE);
this->addOutputSocket(COM_DT_COLOR);
this->addInputSocket(DataType::Color);
this->addInputSocket(DataType::Value);
this->addInputSocket(DataType::Value);
this->addOutputSocket(DataType::Color);
this->m_inputProgram = nullptr;
this->m_use_premultiply = false;
}

View File

@@ -24,8 +24,8 @@
CalculateMeanOperation::CalculateMeanOperation()
{
this->addInputSocket(COM_DT_COLOR, COM_SC_NO_RESIZE);
this->addOutputSocket(COM_DT_VALUE);
this->addInputSocket(DataType::Color, COM_SC_NO_RESIZE);
this->addOutputSocket(DataType::Value);
this->m_imageReader = nullptr;
this->m_iscalculated = false;
this->m_setting = 1;

View File

@@ -20,11 +20,11 @@
ChangeHSVOperation::ChangeHSVOperation()
{
this->addInputSocket(COM_DT_COLOR);
this->addInputSocket(COM_DT_VALUE);
this->addInputSocket(COM_DT_VALUE);
this->addInputSocket(COM_DT_VALUE);
this->addOutputSocket(COM_DT_COLOR);
this->addInputSocket(DataType::Color);
this->addInputSocket(DataType::Value);
this->addInputSocket(DataType::Value);
this->addInputSocket(DataType::Value);
this->addOutputSocket(DataType::Color);
this->m_inputOperation = nullptr;
}

View File

@@ -21,8 +21,8 @@
ChannelMatteOperation::ChannelMatteOperation()
{
addInputSocket(COM_DT_COLOR);
addOutputSocket(COM_DT_VALUE);
addInputSocket(DataType::Color);
addOutputSocket(DataType::Value);
this->m_inputImageProgram = nullptr;
}

View File

@@ -21,9 +21,9 @@
ChromaMatteOperation::ChromaMatteOperation()
{
addInputSocket(COM_DT_COLOR);
addInputSocket(COM_DT_COLOR);
addOutputSocket(COM_DT_VALUE);
addInputSocket(DataType::Color);
addInputSocket(DataType::Color);
addOutputSocket(DataType::Value);
this->m_inputImageProgram = nullptr;
this->m_inputKeyProgram = nullptr;

View File

@@ -33,9 +33,9 @@ inline float colorbalance_cdl(float in, float offset, float power, float slope)
ColorBalanceASCCDLOperation::ColorBalanceASCCDLOperation()
{
this->addInputSocket(COM_DT_VALUE);
this->addInputSocket(COM_DT_COLOR);
this->addOutputSocket(COM_DT_COLOR);
this->addInputSocket(DataType::Value);
this->addInputSocket(DataType::Color);
this->addOutputSocket(DataType::Color);
this->m_inputValueOperation = nullptr;
this->m_inputColorOperation = nullptr;
this->setResolutionInputSocketIndex(1);

View File

@@ -38,9 +38,9 @@ inline float colorbalance_lgg(float in, float lift_lgg, float gamma_inv, float g
ColorBalanceLGGOperation::ColorBalanceLGGOperation()
{
this->addInputSocket(COM_DT_VALUE);
this->addInputSocket(COM_DT_COLOR);
this->addOutputSocket(COM_DT_COLOR);
this->addInputSocket(DataType::Value);
this->addInputSocket(DataType::Color);
this->addOutputSocket(DataType::Color);
this->m_inputValueOperation = nullptr;
this->m_inputColorOperation = nullptr;
this->setResolutionInputSocketIndex(1);

View File

@@ -23,9 +23,9 @@
ColorCorrectionOperation::ColorCorrectionOperation()
{
this->addInputSocket(COM_DT_COLOR);
this->addInputSocket(COM_DT_VALUE);
this->addOutputSocket(COM_DT_COLOR);
this->addInputSocket(DataType::Color);
this->addInputSocket(DataType::Value);
this->addOutputSocket(DataType::Color);
this->m_inputImage = nullptr;
this->m_inputMask = nullptr;
this->m_redChannelEnabled = true;

View File

@@ -24,11 +24,11 @@
ColorCurveOperation::ColorCurveOperation()
{
this->addInputSocket(COM_DT_VALUE);
this->addInputSocket(COM_DT_COLOR);
this->addInputSocket(COM_DT_COLOR);
this->addInputSocket(COM_DT_COLOR);
this->addOutputSocket(COM_DT_COLOR);
this->addInputSocket(DataType::Value);
this->addInputSocket(DataType::Color);
this->addInputSocket(DataType::Color);
this->addInputSocket(DataType::Color);
this->addOutputSocket(DataType::Color);
this->m_inputFacProgram = nullptr;
this->m_inputImageProgram = nullptr;
@@ -100,9 +100,9 @@ void ColorCurveOperation::deinitExecution()
ConstantLevelColorCurveOperation::ConstantLevelColorCurveOperation()
{
this->addInputSocket(COM_DT_VALUE);
this->addInputSocket(COM_DT_COLOR);
this->addOutputSocket(COM_DT_COLOR);
this->addInputSocket(DataType::Value);
this->addInputSocket(DataType::Color);
this->addOutputSocket(DataType::Color);
this->m_inputFacProgram = nullptr;
this->m_inputImageProgram = nullptr;

View File

@@ -20,9 +20,9 @@
ExposureOperation::ExposureOperation()
{
this->addInputSocket(COM_DT_COLOR);
this->addInputSocket(COM_DT_VALUE);
this->addOutputSocket(COM_DT_COLOR);
this->addInputSocket(DataType::Color);
this->addInputSocket(DataType::Value);
this->addOutputSocket(DataType::Color);
this->m_inputProgram = nullptr;
}

View File

@@ -21,9 +21,9 @@
ColorMatteOperation::ColorMatteOperation()
{
addInputSocket(COM_DT_COLOR);
addInputSocket(COM_DT_COLOR);
addOutputSocket(COM_DT_VALUE);
addInputSocket(DataType::Color);
addInputSocket(DataType::Color);
addOutputSocket(DataType::Value);
this->m_inputImageProgram = nullptr;
this->m_inputKeyProgram = nullptr;

View File

@@ -22,8 +22,8 @@
ColorRampOperation::ColorRampOperation()
{
this->addInputSocket(COM_DT_VALUE);
this->addOutputSocket(COM_DT_COLOR);
this->addInputSocket(DataType::Value);
this->addOutputSocket(DataType::Color);
this->m_inputProgram = nullptr;
this->m_colorBand = nullptr;

View File

@@ -22,9 +22,9 @@
ColorSpillOperation::ColorSpillOperation()
{
addInputSocket(COM_DT_COLOR);
addInputSocket(COM_DT_VALUE);
addOutputSocket(COM_DT_COLOR);
addInputSocket(DataType::Color);
addInputSocket(DataType::Value);
addOutputSocket(DataType::Color);
this->m_inputImageReader = nullptr;
this->m_inputFacReader = nullptr;

View File

@@ -33,9 +33,9 @@
CompositorOperation::CompositorOperation()
{
this->addInputSocket(COM_DT_COLOR);
this->addInputSocket(COM_DT_VALUE);
this->addInputSocket(COM_DT_VALUE);
this->addInputSocket(DataType::Color);
this->addInputSocket(DataType::Value);
this->addInputSocket(DataType::Value);
this->setRenderData(nullptr);
this->m_outputBuffer = nullptr;

View File

@@ -22,8 +22,8 @@
ConvertColorProfileOperation::ConvertColorProfileOperation()
{
this->addInputSocket(COM_DT_COLOR);
this->addOutputSocket(COM_DT_COLOR);
this->addInputSocket(DataType::Color);
this->addOutputSocket(DataType::Color);
this->m_inputOperation = nullptr;
this->m_predivided = false;
}

View File

@@ -23,8 +23,8 @@
ConvertDepthToRadiusOperation::ConvertDepthToRadiusOperation()
{
this->addInputSocket(COM_DT_VALUE);
this->addOutputSocket(COM_DT_VALUE);
this->addInputSocket(DataType::Value);
this->addOutputSocket(DataType::Value);
this->m_inputOperation = nullptr;
this->m_fStop = 128.0f;
this->m_cameraObject = nullptr;

View File

@@ -39,8 +39,8 @@ void ConvertBaseOperation::deinitExecution()
ConvertValueToColorOperation::ConvertValueToColorOperation() : ConvertBaseOperation()
{
this->addInputSocket(COM_DT_VALUE);
this->addOutputSocket(COM_DT_COLOR);
this->addInputSocket(DataType::Value);
this->addOutputSocket(DataType::Color);
}
void ConvertValueToColorOperation::executePixelSampled(float output[4],
@@ -58,8 +58,8 @@ void ConvertValueToColorOperation::executePixelSampled(float output[4],
ConvertColorToValueOperation::ConvertColorToValueOperation() : ConvertBaseOperation()
{
this->addInputSocket(COM_DT_COLOR);
this->addOutputSocket(COM_DT_VALUE);
this->addInputSocket(DataType::Color);
this->addOutputSocket(DataType::Value);
}
void ConvertColorToValueOperation::executePixelSampled(float output[4],
@@ -76,8 +76,8 @@ void ConvertColorToValueOperation::executePixelSampled(float output[4],
ConvertColorToBWOperation::ConvertColorToBWOperation() : ConvertBaseOperation()
{
this->addInputSocket(COM_DT_COLOR);
this->addOutputSocket(COM_DT_VALUE);
this->addInputSocket(DataType::Color);
this->addOutputSocket(DataType::Value);
}
void ConvertColorToBWOperation::executePixelSampled(float output[4],
@@ -94,8 +94,8 @@ void ConvertColorToBWOperation::executePixelSampled(float output[4],
ConvertColorToVectorOperation::ConvertColorToVectorOperation() : ConvertBaseOperation()
{
this->addInputSocket(COM_DT_COLOR);
this->addOutputSocket(COM_DT_VECTOR);
this->addInputSocket(DataType::Color);
this->addOutputSocket(DataType::Vector);
}
void ConvertColorToVectorOperation::executePixelSampled(float output[4],
@@ -112,8 +112,8 @@ void ConvertColorToVectorOperation::executePixelSampled(float output[4],
ConvertValueToVectorOperation::ConvertValueToVectorOperation() : ConvertBaseOperation()
{
this->addInputSocket(COM_DT_VALUE);
this->addOutputSocket(COM_DT_VECTOR);
this->addInputSocket(DataType::Value);
this->addOutputSocket(DataType::Vector);
}
void ConvertValueToVectorOperation::executePixelSampled(float output[4],
@@ -130,8 +130,8 @@ void ConvertValueToVectorOperation::executePixelSampled(float output[4],
ConvertVectorToColorOperation::ConvertVectorToColorOperation() : ConvertBaseOperation()
{
this->addInputSocket(COM_DT_VECTOR);
this->addOutputSocket(COM_DT_COLOR);
this->addInputSocket(DataType::Vector);
this->addOutputSocket(DataType::Color);
}
void ConvertVectorToColorOperation::executePixelSampled(float output[4],
@@ -147,8 +147,8 @@ void ConvertVectorToColorOperation::executePixelSampled(float output[4],
ConvertVectorToValueOperation::ConvertVectorToValueOperation() : ConvertBaseOperation()
{
this->addInputSocket(COM_DT_VECTOR);
this->addOutputSocket(COM_DT_VALUE);
this->addInputSocket(DataType::Vector);
this->addOutputSocket(DataType::Value);
}
void ConvertVectorToValueOperation::executePixelSampled(float output[4],
@@ -165,8 +165,8 @@ void ConvertVectorToValueOperation::executePixelSampled(float output[4],
ConvertRGBToYCCOperation::ConvertRGBToYCCOperation() : ConvertBaseOperation()
{
this->addInputSocket(COM_DT_COLOR);
this->addOutputSocket(COM_DT_COLOR);
this->addInputSocket(DataType::Color);
this->addOutputSocket(DataType::Color);
}
void ConvertRGBToYCCOperation::setMode(int mode)
@@ -207,8 +207,8 @@ void ConvertRGBToYCCOperation::executePixelSampled(float output[4],
ConvertYCCToRGBOperation::ConvertYCCToRGBOperation() : ConvertBaseOperation()
{
this->addInputSocket(COM_DT_COLOR);
this->addOutputSocket(COM_DT_COLOR);
this->addInputSocket(DataType::Color);
this->addOutputSocket(DataType::Color);
}
void ConvertYCCToRGBOperation::setMode(int mode)
@@ -253,8 +253,8 @@ void ConvertYCCToRGBOperation::executePixelSampled(float output[4],
ConvertRGBToYUVOperation::ConvertRGBToYUVOperation() : ConvertBaseOperation()
{
this->addInputSocket(COM_DT_COLOR);
this->addOutputSocket(COM_DT_COLOR);
this->addInputSocket(DataType::Color);
this->addOutputSocket(DataType::Color);
}
void ConvertRGBToYUVOperation::executePixelSampled(float output[4],
@@ -278,8 +278,8 @@ void ConvertRGBToYUVOperation::executePixelSampled(float output[4],
ConvertYUVToRGBOperation::ConvertYUVToRGBOperation() : ConvertBaseOperation()
{
this->addInputSocket(COM_DT_COLOR);
this->addOutputSocket(COM_DT_COLOR);
this->addInputSocket(DataType::Color);
this->addOutputSocket(DataType::Color);
}
void ConvertYUVToRGBOperation::executePixelSampled(float output[4],
@@ -303,8 +303,8 @@ void ConvertYUVToRGBOperation::executePixelSampled(float output[4],
ConvertRGBToHSVOperation::ConvertRGBToHSVOperation() : ConvertBaseOperation()
{
this->addInputSocket(COM_DT_COLOR);
this->addOutputSocket(COM_DT_COLOR);
this->addInputSocket(DataType::Color);
this->addOutputSocket(DataType::Color);
}
void ConvertRGBToHSVOperation::executePixelSampled(float output[4],
@@ -322,8 +322,8 @@ void ConvertRGBToHSVOperation::executePixelSampled(float output[4],
ConvertHSVToRGBOperation::ConvertHSVToRGBOperation() : ConvertBaseOperation()
{
this->addInputSocket(COM_DT_COLOR);
this->addOutputSocket(COM_DT_COLOR);
this->addInputSocket(DataType::Color);
this->addOutputSocket(DataType::Color);
}
void ConvertHSVToRGBOperation::executePixelSampled(float output[4],
@@ -344,8 +344,8 @@ void ConvertHSVToRGBOperation::executePixelSampled(float output[4],
ConvertPremulToStraightOperation::ConvertPremulToStraightOperation() : ConvertBaseOperation()
{
this->addInputSocket(COM_DT_COLOR);
this->addOutputSocket(COM_DT_COLOR);
this->addInputSocket(DataType::Color);
this->addOutputSocket(DataType::Color);
}
void ConvertPremulToStraightOperation::executePixelSampled(float output[4],
@@ -374,8 +374,8 @@ void ConvertPremulToStraightOperation::executePixelSampled(float output[4],
ConvertStraightToPremulOperation::ConvertStraightToPremulOperation() : ConvertBaseOperation()
{
this->addInputSocket(COM_DT_COLOR);
this->addOutputSocket(COM_DT_COLOR);
this->addInputSocket(DataType::Color);
this->addOutputSocket(DataType::Color);
}
void ConvertStraightToPremulOperation::executePixelSampled(float output[4],
@@ -399,8 +399,8 @@ void ConvertStraightToPremulOperation::executePixelSampled(float output[4],
SeparateChannelOperation::SeparateChannelOperation()
{
this->addInputSocket(COM_DT_COLOR);
this->addOutputSocket(COM_DT_VALUE);
this->addInputSocket(DataType::Color);
this->addOutputSocket(DataType::Value);
this->m_inputOperation = nullptr;
}
void SeparateChannelOperation::initExecution()
@@ -427,11 +427,11 @@ void SeparateChannelOperation::executePixelSampled(float output[4],
CombineChannelsOperation::CombineChannelsOperation()
{
this->addInputSocket(COM_DT_VALUE);
this->addInputSocket(COM_DT_VALUE);
this->addInputSocket(COM_DT_VALUE);
this->addInputSocket(COM_DT_VALUE);
this->addOutputSocket(COM_DT_COLOR);
this->addInputSocket(DataType::Value);
this->addInputSocket(DataType::Value);
this->addInputSocket(DataType::Value);
this->addInputSocket(DataType::Value);
this->addOutputSocket(DataType::Color);
this->setResolutionInputSocketIndex(0);
this->m_inputChannel1Operation = nullptr;
this->m_inputChannel2Operation = nullptr;

View File

@@ -24,9 +24,9 @@
ConvolutionFilterOperation::ConvolutionFilterOperation()
{
this->addInputSocket(COM_DT_COLOR);
this->addInputSocket(COM_DT_VALUE);
this->addOutputSocket(COM_DT_COLOR);
this->addInputSocket(DataType::Color);
this->addInputSocket(DataType::Value);
this->addOutputSocket(DataType::Color);
this->setResolutionInputSocketIndex(0);
this->m_inputOperation = nullptr;
this->setComplex(true);

View File

@@ -21,8 +21,8 @@
CropBaseOperation::CropBaseOperation()
{
this->addInputSocket(COM_DT_COLOR, COM_SC_NO_RESIZE);
this->addOutputSocket(COM_DT_COLOR);
this->addInputSocket(DataType::Color, COM_SC_NO_RESIZE);
this->addOutputSocket(DataType::Color);
this->m_inputOperation = nullptr;
this->m_settings = nullptr;
}

View File

@@ -21,10 +21,10 @@
CryptomatteOperation::CryptomatteOperation(size_t num_inputs)
{
for (size_t i = 0; i < num_inputs; i++) {
this->addInputSocket(COM_DT_COLOR);
this->addInputSocket(DataType::Color);
}
inputs.resize(num_inputs);
this->addOutputSocket(COM_DT_COLOR);
this->addOutputSocket(DataType::Color);
this->setComplex(true);
}

View File

@@ -28,10 +28,10 @@ static pthread_mutex_t oidn_lock = BLI_MUTEX_INITIALIZER;
DenoiseOperation::DenoiseOperation()
{
this->addInputSocket(COM_DT_COLOR);
this->addInputSocket(COM_DT_VECTOR);
this->addInputSocket(COM_DT_COLOR);
this->addOutputSocket(COM_DT_COLOR);
this->addInputSocket(DataType::Color);
this->addInputSocket(DataType::Vector);
this->addInputSocket(DataType::Color);
this->addOutputSocket(DataType::Color);
this->m_settings = nullptr;
}
void DenoiseOperation::initExecution()
@@ -60,7 +60,7 @@ MemoryBuffer *DenoiseOperation::createMemoryBuffer(rcti *rect2)
rect.ymin = 0;
rect.xmax = getWidth();
rect.ymax = getHeight();
MemoryBuffer *result = new MemoryBuffer(COM_DT_COLOR, &rect);
MemoryBuffer *result = new MemoryBuffer(DataType::Color, &rect);
float *data = result->getBuffer();
this->generateDenoise(data, tileColor, tileNormal, tileAlbedo, this->m_settings);
return result;

View File

@@ -24,9 +24,9 @@
DespeckleOperation::DespeckleOperation()
{
this->addInputSocket(COM_DT_COLOR);
this->addInputSocket(COM_DT_VALUE);
this->addOutputSocket(COM_DT_COLOR);
this->addInputSocket(DataType::Color);
this->addInputSocket(DataType::Value);
this->addOutputSocket(DataType::Color);
this->setResolutionInputSocketIndex(0);
this->m_inputOperation = nullptr;
this->setComplex(true);

View File

@@ -21,9 +21,9 @@
DifferenceMatteOperation::DifferenceMatteOperation()
{
addInputSocket(COM_DT_COLOR);
addInputSocket(COM_DT_COLOR);
addOutputSocket(COM_DT_VALUE);
addInputSocket(DataType::Color);
addInputSocket(DataType::Color);
addOutputSocket(DataType::Value);
this->m_inputImage1Program = nullptr;
this->m_inputImage2Program = nullptr;

View File

@@ -25,8 +25,8 @@
// DilateErode Distance Threshold
DilateErodeThresholdOperation::DilateErodeThresholdOperation()
{
this->addInputSocket(COM_DT_VALUE);
this->addOutputSocket(COM_DT_VALUE);
this->addInputSocket(DataType::Value);
this->addOutputSocket(DataType::Value);
this->setComplex(true);
this->m_inputProgram = nullptr;
this->m_inset = 0.0f;
@@ -161,8 +161,8 @@ bool DilateErodeThresholdOperation::determineDependingAreaOfInterest(
// Dilate Distance
DilateDistanceOperation::DilateDistanceOperation()
{
this->addInputSocket(COM_DT_VALUE);
this->addOutputSocket(COM_DT_VALUE);
this->addInputSocket(DataType::Value);
this->addOutputSocket(DataType::Value);
this->setComplex(true);
this->m_inputProgram = nullptr;
this->m_distance = 0.0f;
@@ -319,8 +319,8 @@ void ErodeDistanceOperation::executeOpenCL(OpenCLDevice *device,
// Dilate step
DilateStepOperation::DilateStepOperation()
{
this->addInputSocket(COM_DT_VALUE);
this->addOutputSocket(COM_DT_VALUE);
this->addInputSocket(DataType::Value);
this->addOutputSocket(DataType::Value);
this->setComplex(true);
this->m_inputProgram = nullptr;
}

View File

@@ -25,8 +25,8 @@
DirectionalBlurOperation::DirectionalBlurOperation()
{
this->addInputSocket(COM_DT_COLOR);
this->addOutputSocket(COM_DT_COLOR);
this->addInputSocket(DataType::Color);
this->addOutputSocket(DataType::Color);
this->setComplex(true);
this->setOpenCL(true);

View File

@@ -22,11 +22,11 @@
DisplaceOperation::DisplaceOperation()
{
this->addInputSocket(COM_DT_COLOR);
this->addInputSocket(COM_DT_VECTOR);
this->addInputSocket(COM_DT_VALUE);
this->addInputSocket(COM_DT_VALUE);
this->addOutputSocket(COM_DT_COLOR);
this->addInputSocket(DataType::Color);
this->addInputSocket(DataType::Vector);
this->addInputSocket(DataType::Value);
this->addInputSocket(DataType::Value);
this->addOutputSocket(DataType::Color);
this->setComplex(true);
this->m_inputColorProgram = nullptr;

View File

@@ -22,11 +22,11 @@
DisplaceSimpleOperation::DisplaceSimpleOperation()
{
this->addInputSocket(COM_DT_COLOR);
this->addInputSocket(COM_DT_VECTOR);
this->addInputSocket(COM_DT_VALUE);
this->addInputSocket(COM_DT_VALUE);
this->addOutputSocket(COM_DT_COLOR);
this->addInputSocket(DataType::Color);
this->addInputSocket(DataType::Vector);
this->addInputSocket(DataType::Value);
this->addInputSocket(DataType::Value);
this->addOutputSocket(DataType::Color);
this->m_inputColorProgram = nullptr;
this->m_inputVectorProgram = nullptr;

View File

@@ -21,9 +21,9 @@
DistanceRGBMatteOperation::DistanceRGBMatteOperation()
{
this->addInputSocket(COM_DT_COLOR);
this->addInputSocket(COM_DT_COLOR);
this->addOutputSocket(COM_DT_VALUE);
this->addInputSocket(DataType::Color);
this->addInputSocket(DataType::Color);
this->addOutputSocket(DataType::Value);
this->m_inputImageProgram = nullptr;
this->m_inputKeyProgram = nullptr;

View File

@@ -20,9 +20,9 @@
DotproductOperation::DotproductOperation()
{
this->addInputSocket(COM_DT_VECTOR);
this->addInputSocket(COM_DT_VECTOR);
this->addOutputSocket(COM_DT_VALUE);
this->addInputSocket(DataType::Vector);
this->addInputSocket(DataType::Vector);
this->addOutputSocket(DataType::Value);
this->setResolutionInputSocketIndex(0);
this->m_input1Operation = nullptr;
this->m_input2Operation = nullptr;

View File

@@ -1308,9 +1308,9 @@ void DoubleEdgeMaskOperation::doDoubleEdgeMask(float *imask, float *omask, float
DoubleEdgeMaskOperation::DoubleEdgeMaskOperation()
{
this->addInputSocket(COM_DT_VALUE);
this->addInputSocket(COM_DT_VALUE);
this->addOutputSocket(COM_DT_VALUE);
this->addInputSocket(DataType::Value);
this->addInputSocket(DataType::Value);
this->addOutputSocket(DataType::Value);
this->m_inputInnerMask = nullptr;
this->m_inputOuterMask = nullptr;
this->m_adjacentOnly = false;

View File

@@ -22,9 +22,9 @@
EllipseMaskOperation::EllipseMaskOperation()
{
this->addInputSocket(COM_DT_VALUE);
this->addInputSocket(COM_DT_VALUE);
this->addOutputSocket(COM_DT_VALUE);
this->addInputSocket(DataType::Value);
this->addInputSocket(DataType::Value);
this->addOutputSocket(DataType::Value);
this->m_inputMask = nullptr;
this->m_inputValue = nullptr;
this->m_cosine = 0.0f;

View File

@@ -22,7 +22,7 @@
#include "COM_FastGaussianBlurOperation.h"
#include "MEM_guardedalloc.h"
FastGaussianBlurOperation::FastGaussianBlurOperation() : BlurBaseOperation(COM_DT_COLOR)
FastGaussianBlurOperation::FastGaussianBlurOperation() : BlurBaseOperation(DataType::Color)
{
this->m_iirgaus = nullptr;
}
@@ -258,8 +258,8 @@ void FastGaussianBlurOperation::IIR_gauss(MemoryBuffer *src,
///
FastGaussianBlurValueOperation::FastGaussianBlurValueOperation()
{
this->addInputSocket(COM_DT_VALUE);
this->addOutputSocket(COM_DT_VALUE);
this->addInputSocket(DataType::Value);
this->addOutputSocket(DataType::Value);
this->m_iirgaus = nullptr;
this->m_inputprogram = nullptr;
this->m_sigma = 1.0f;

View File

@@ -20,8 +20,8 @@
FlipOperation::FlipOperation()
{
this->addInputSocket(COM_DT_COLOR);
this->addOutputSocket(COM_DT_COLOR);
this->addInputSocket(DataType::Color);
this->addOutputSocket(DataType::Color);
this->setResolutionInputSocketIndex(0);
this->m_inputOperation = nullptr;
this->m_flipX = true;

View File

@@ -21,8 +21,8 @@
GammaCorrectOperation::GammaCorrectOperation()
{
this->addInputSocket(COM_DT_COLOR);
this->addOutputSocket(COM_DT_COLOR);
this->addInputSocket(DataType::Color);
this->addOutputSocket(DataType::Color);
this->m_inputProgram = nullptr;
}
void GammaCorrectOperation::initExecution()
@@ -63,8 +63,8 @@ void GammaCorrectOperation::deinitExecution()
GammaUncorrectOperation::GammaUncorrectOperation()
{
this->addInputSocket(COM_DT_COLOR);
this->addOutputSocket(COM_DT_COLOR);
this->addInputSocket(DataType::Color);
this->addOutputSocket(DataType::Color);
this->m_inputProgram = nullptr;
}
void GammaUncorrectOperation::initExecution()

View File

@@ -21,9 +21,9 @@
GammaOperation::GammaOperation()
{
this->addInputSocket(COM_DT_COLOR);
this->addInputSocket(COM_DT_VALUE);
this->addOutputSocket(COM_DT_COLOR);
this->addInputSocket(DataType::Color);
this->addInputSocket(DataType::Value);
this->addOutputSocket(DataType::Color);
this->m_inputProgram = nullptr;
this->m_inputGammaProgram = nullptr;
}

View File

@@ -22,7 +22,7 @@
#include "RE_pipeline.h"
GaussianAlphaXBlurOperation::GaussianAlphaXBlurOperation() : BlurBaseOperation(COM_DT_VALUE)
GaussianAlphaXBlurOperation::GaussianAlphaXBlurOperation() : BlurBaseOperation(DataType::Value)
{
this->m_gausstab = nullptr;
this->m_filtersize = 0;

View File

@@ -22,7 +22,7 @@
#include "RE_pipeline.h"
GaussianAlphaYBlurOperation::GaussianAlphaYBlurOperation() : BlurBaseOperation(COM_DT_VALUE)
GaussianAlphaYBlurOperation::GaussianAlphaYBlurOperation() : BlurBaseOperation(DataType::Value)
{
this->m_gausstab = nullptr;
this->m_filtersize = 0;

View File

@@ -22,7 +22,7 @@
#include "RE_pipeline.h"
GaussianBokehBlurOperation::GaussianBokehBlurOperation() : BlurBaseOperation(COM_DT_COLOR)
GaussianBokehBlurOperation::GaussianBokehBlurOperation() : BlurBaseOperation(DataType::Color)
{
this->m_gausstab = nullptr;
}
@@ -195,7 +195,8 @@ bool GaussianBokehBlurOperation::determineDependingAreaOfInterest(
}
// reference image
GaussianBlurReferenceOperation::GaussianBlurReferenceOperation() : BlurBaseOperation(COM_DT_COLOR)
GaussianBlurReferenceOperation::GaussianBlurReferenceOperation()
: BlurBaseOperation(DataType::Color)
{
this->m_maintabs = nullptr;
}

View File

@@ -23,7 +23,7 @@
#include "RE_pipeline.h"
GaussianXBlurOperation::GaussianXBlurOperation() : BlurBaseOperation(COM_DT_COLOR)
GaussianXBlurOperation::GaussianXBlurOperation() : BlurBaseOperation(DataType::Color)
{
this->m_gausstab = nullptr;
#ifdef BLI_HAVE_SSE2

View File

@@ -23,7 +23,7 @@
#include "RE_pipeline.h"
GaussianYBlurOperation::GaussianYBlurOperation() : BlurBaseOperation(COM_DT_COLOR)
GaussianYBlurOperation::GaussianYBlurOperation() : BlurBaseOperation(DataType::Color)
{
this->m_gausstab = nullptr;
#ifdef BLI_HAVE_SSE2

View File

@@ -21,8 +21,8 @@
GlareBaseOperation::GlareBaseOperation()
{
this->addInputSocket(COM_DT_COLOR);
this->addOutputSocket(COM_DT_COLOR);
this->addInputSocket(DataType::Color);
this->addOutputSocket(DataType::Color);
this->m_settings = nullptr;
}
void GlareBaseOperation::initExecution()
@@ -45,7 +45,7 @@ MemoryBuffer *GlareBaseOperation::createMemoryBuffer(rcti *rect2)
rect.ymin = 0;
rect.xmax = getWidth();
rect.ymax = getHeight();
MemoryBuffer *result = new MemoryBuffer(COM_DT_COLOR, &rect);
MemoryBuffer *result = new MemoryBuffer(DataType::Color, &rect);
float *data = result->getBuffer();
this->generateGlare(data, tile, this->m_settings);
return result;

View File

@@ -268,7 +268,7 @@ static void convolve(float *dst, MemoryBuffer *in1, MemoryBuffer *in2)
float *kernelBuffer = in2->getBuffer();
float *imageBuffer = in1->getBuffer();
MemoryBuffer *rdst = new MemoryBuffer(COM_DT_COLOR, in1->getRect());
MemoryBuffer *rdst = new MemoryBuffer(DataType::Color, in1->getRect());
memset(rdst->getBuffer(),
0,
rdst->getWidth() * rdst->getHeight() * COM_NUM_CHANNELS_COLOR * sizeof(float));
@@ -417,7 +417,7 @@ void GlareFogGlowOperation::generateGlare(float *data,
// make the convolution kernel
rcti kernelRect;
BLI_rcti_init(&kernelRect, 0, sz, 0, sz);
ckrn = new MemoryBuffer(COM_DT_COLOR, &kernelRect);
ckrn = new MemoryBuffer(DataType::Color, &kernelRect);
scale = 0.25f * sqrtf((float)(sz * sz));

View File

@@ -34,7 +34,7 @@ void GlareStreaksOperation::generateGlare(float *data,
bool breaked = false;
MemoryBuffer *tsrc = inputTile->duplicate();
MemoryBuffer *tdst = new MemoryBuffer(COM_DT_COLOR, inputTile->getRect());
MemoryBuffer *tdst = new MemoryBuffer(DataType::Color, inputTile->getRect());
tdst->clear();
memset(data, 0, size4 * sizeof(float));

View File

@@ -23,8 +23,8 @@
GlareThresholdOperation::GlareThresholdOperation()
{
this->addInputSocket(COM_DT_COLOR, COM_SC_FIT);
this->addOutputSocket(COM_DT_COLOR);
this->addInputSocket(DataType::Color, COM_SC_FIT);
this->addOutputSocket(DataType::Color);
this->m_inputProgram = nullptr;
}

View File

@@ -24,8 +24,8 @@
HueSaturationValueCorrectOperation::HueSaturationValueCorrectOperation()
{
this->addInputSocket(COM_DT_COLOR);
this->addOutputSocket(COM_DT_COLOR);
this->addInputSocket(DataType::Color);
this->addOutputSocket(DataType::Color);
this->m_inputProgram = nullptr;
}

View File

@@ -20,8 +20,8 @@
IDMaskOperation::IDMaskOperation()
{
this->addInputSocket(COM_DT_VALUE);
this->addOutputSocket(COM_DT_VALUE);
this->addInputSocket(DataType::Value);
this->addOutputSocket(DataType::Value);
this->setComplex(true);
}

View File

@@ -48,15 +48,15 @@ BaseImageOperation::BaseImageOperation()
}
ImageOperation::ImageOperation() : BaseImageOperation()
{
this->addOutputSocket(COM_DT_COLOR);
this->addOutputSocket(DataType::Color);
}
ImageAlphaOperation::ImageAlphaOperation() : BaseImageOperation()
{
this->addOutputSocket(COM_DT_VALUE);
this->addOutputSocket(DataType::Value);
}
ImageDepthOperation::ImageDepthOperation() : BaseImageOperation()
{
this->addOutputSocket(COM_DT_VALUE);
this->addOutputSocket(DataType::Value);
}
ImBuf *BaseImageOperation::getImBuf()

View File

@@ -29,8 +29,8 @@
// Inpaint (simple convolve using average of known pixels)
InpaintSimpleOperation::InpaintSimpleOperation()
{
this->addInputSocket(COM_DT_COLOR);
this->addOutputSocket(COM_DT_COLOR);
this->addInputSocket(DataType::Color);
this->addOutputSocket(DataType::Color);
this->setComplex(true);
this->m_inputImageProgram = nullptr;
this->m_pixelorder = nullptr;

View File

@@ -20,9 +20,9 @@
InvertOperation::InvertOperation()
{
this->addInputSocket(COM_DT_VALUE);
this->addInputSocket(COM_DT_COLOR);
this->addOutputSocket(COM_DT_COLOR);
this->addInputSocket(DataType::Value);
this->addInputSocket(DataType::Color);
this->addOutputSocket(DataType::Color);
this->m_inputValueProgram = nullptr;
this->m_inputColorProgram = nullptr;
this->m_color = true;

View File

@@ -25,8 +25,8 @@
KeyingBlurOperation::KeyingBlurOperation()
{
this->addInputSocket(COM_DT_VALUE);
this->addOutputSocket(COM_DT_VALUE);
this->addInputSocket(DataType::Value);
this->addOutputSocket(DataType::Value);
this->m_size = 0;
this->m_axis = BLUR_AXIS_X;

View File

@@ -25,8 +25,8 @@
KeyingClipOperation::KeyingClipOperation()
{
this->addInputSocket(COM_DT_VALUE);
this->addOutputSocket(COM_DT_VALUE);
this->addInputSocket(DataType::Value);
this->addOutputSocket(DataType::Value);
this->m_kernelRadius = 3;
this->m_kernelTolerance = 0.1f;

View File

@@ -25,9 +25,9 @@
KeyingDespillOperation::KeyingDespillOperation()
{
this->addInputSocket(COM_DT_COLOR);
this->addInputSocket(COM_DT_COLOR);
this->addOutputSocket(COM_DT_COLOR);
this->addInputSocket(DataType::Color);
this->addInputSocket(DataType::Color);
this->addOutputSocket(DataType::Color);
this->m_despillFactor = 0.5f;
this->m_colorBalance = 0.5f;

View File

@@ -41,9 +41,9 @@ static float get_pixel_saturation(const float pixelColor[4],
KeyingOperation::KeyingOperation()
{
this->addInputSocket(COM_DT_COLOR);
this->addInputSocket(COM_DT_COLOR);
this->addOutputSocket(COM_DT_VALUE);
this->addInputSocket(DataType::Color);
this->addInputSocket(DataType::Color);
this->addOutputSocket(DataType::Value);
this->m_screenBalance = 0.5f;

View File

@@ -32,7 +32,7 @@
KeyingScreenOperation::KeyingScreenOperation()
{
this->addOutputSocket(COM_DT_COLOR);
this->addOutputSocket(DataType::Color);
this->m_movieClip = nullptr;
this->m_framenumber = 0;
this->m_trackingObject[0] = 0;

View File

@@ -23,8 +23,8 @@
LuminanceMatteOperation::LuminanceMatteOperation()
{
addInputSocket(COM_DT_COLOR);
addOutputSocket(COM_DT_VALUE);
addInputSocket(DataType::Color);
addOutputSocket(DataType::Value);
this->m_inputImageProgram = nullptr;
}

View File

@@ -20,12 +20,12 @@
MapRangeOperation::MapRangeOperation()
{
this->addInputSocket(COM_DT_VALUE);
this->addInputSocket(COM_DT_VALUE);
this->addInputSocket(COM_DT_VALUE);
this->addInputSocket(COM_DT_VALUE);
this->addInputSocket(COM_DT_VALUE);
this->addOutputSocket(COM_DT_VALUE);
this->addInputSocket(DataType::Value);
this->addInputSocket(DataType::Value);
this->addInputSocket(DataType::Value);
this->addInputSocket(DataType::Value);
this->addInputSocket(DataType::Value);
this->addOutputSocket(DataType::Value);
this->m_inputOperation = nullptr;
this->m_useClamp = false;
}

View File

@@ -21,9 +21,9 @@
MapUVOperation::MapUVOperation()
{
this->addInputSocket(COM_DT_COLOR, COM_SC_NO_RESIZE);
this->addInputSocket(COM_DT_VECTOR);
this->addOutputSocket(COM_DT_COLOR);
this->addInputSocket(DataType::Color, COM_SC_NO_RESIZE);
this->addInputSocket(DataType::Vector);
this->addOutputSocket(DataType::Color);
this->m_alpha = 0.0f;
this->setComplex(true);
setResolutionInputSocketIndex(1);

View File

@@ -20,8 +20,8 @@
MapValueOperation::MapValueOperation()
{
this->addInputSocket(COM_DT_VALUE);
this->addOutputSocket(COM_DT_VALUE);
this->addInputSocket(DataType::Value);
this->addOutputSocket(DataType::Value);
this->m_inputOperation = nullptr;
}

View File

@@ -28,7 +28,7 @@
MaskOperation::MaskOperation()
{
this->addOutputSocket(COM_DT_VALUE);
this->addOutputSocket(DataType::Value);
this->m_mask = nullptr;
this->m_maskWidth = 0;
this->m_maskHeight = 0;

View File

@@ -22,10 +22,10 @@
MathBaseOperation::MathBaseOperation()
{
this->addInputSocket(COM_DT_VALUE);
this->addInputSocket(COM_DT_VALUE);
this->addInputSocket(COM_DT_VALUE);
this->addOutputSocket(COM_DT_VALUE);
this->addInputSocket(DataType::Value);
this->addInputSocket(DataType::Value);
this->addInputSocket(DataType::Value);
this->addOutputSocket(DataType::Value);
this->m_inputValue1Operation = nullptr;
this->m_inputValue2Operation = nullptr;
this->m_inputValue3Operation = nullptr;

View File

@@ -24,10 +24,10 @@
MixBaseOperation::MixBaseOperation()
{
this->addInputSocket(COM_DT_VALUE);
this->addInputSocket(COM_DT_COLOR);
this->addInputSocket(COM_DT_COLOR);
this->addOutputSocket(COM_DT_COLOR);
this->addInputSocket(DataType::Value);
this->addInputSocket(DataType::Color);
this->addInputSocket(DataType::Color);
this->addOutputSocket(DataType::Color);
this->m_inputValueOperation = nullptr;
this->m_inputColor1Operation = nullptr;
this->m_inputColor2Operation = nullptr;

View File

@@ -23,7 +23,7 @@
MovieClipAttributeOperation::MovieClipAttributeOperation()
{
this->addOutputSocket(COM_DT_VALUE);
this->addOutputSocket(DataType::Value);
this->m_framenumber = 0;
this->m_attribute = MCA_X;
this->m_invert = false;

View File

@@ -116,12 +116,12 @@ void MovieClipBaseOperation::executePixelSampled(float output[4],
MovieClipOperation::MovieClipOperation() : MovieClipBaseOperation()
{
this->addOutputSocket(COM_DT_COLOR);
this->addOutputSocket(DataType::Color);
}
MovieClipAlphaOperation::MovieClipAlphaOperation() : MovieClipBaseOperation()
{
this->addOutputSocket(COM_DT_VALUE);
this->addOutputSocket(DataType::Value);
}
void MovieClipAlphaOperation::executePixelSampled(float output[4],

View File

@@ -25,8 +25,8 @@
MovieDistortionOperation::MovieDistortionOperation(bool distortion)
{
this->addInputSocket(COM_DT_COLOR);
this->addOutputSocket(COM_DT_COLOR);
this->addInputSocket(DataType::Color);
this->addOutputSocket(DataType::Color);
this->setResolutionInputSocketIndex(0);
this->m_inputOperation = nullptr;
this->m_movieClip = nullptr;

View File

@@ -42,7 +42,7 @@ class MultilayerColorOperation : public MultilayerBaseOperation {
MultilayerColorOperation(RenderLayer *render_layer, RenderPass *render_pass, int view)
: MultilayerBaseOperation(render_layer, render_pass, view)
{
this->addOutputSocket(COM_DT_COLOR);
this->addOutputSocket(DataType::Color);
}
void executePixelSampled(float output[4], float x, float y, PixelSampler sampler) override;
std::unique_ptr<MetaData> getMetaData() const override;
@@ -53,7 +53,7 @@ class MultilayerValueOperation : public MultilayerBaseOperation {
MultilayerValueOperation(RenderLayer *render_layer, RenderPass *render_pass, int view)
: MultilayerBaseOperation(render_layer, render_pass, view)
{
this->addOutputSocket(COM_DT_VALUE);
this->addOutputSocket(DataType::Value);
}
void executePixelSampled(float output[4], float x, float y, PixelSampler sampler) override;
};
@@ -63,7 +63,7 @@ class MultilayerVectorOperation : public MultilayerBaseOperation {
MultilayerVectorOperation(RenderLayer *render_layer, RenderPass *render_pass, int view)
: MultilayerBaseOperation(render_layer, render_pass, view)
{
this->addOutputSocket(COM_DT_VECTOR);
this->addOutputSocket(DataType::Vector);
}
void executePixelSampled(float output[4], float x, float y, PixelSampler sampler) override;
};

View File

@@ -20,8 +20,8 @@
NormalizeOperation::NormalizeOperation()
{
this->addInputSocket(COM_DT_VALUE);
this->addOutputSocket(COM_DT_VALUE);
this->addInputSocket(DataType::Value);
this->addOutputSocket(DataType::Value);
this->m_imageReader = nullptr;
this->m_cachedInstance = nullptr;
this->setComplex(true);

View File

@@ -50,11 +50,11 @@ void add_exr_channels(void *exrhandle,
{
/* create channels */
switch (datatype) {
case COM_DT_VALUE:
case DataType::Value:
IMB_exr_add_channel(
exrhandle, layerName, "V", viewName, 1, width, buf ? buf : nullptr, use_half_float);
break;
case COM_DT_VECTOR:
case DataType::Vector:
IMB_exr_add_channel(
exrhandle, layerName, "X", viewName, 3, 3 * width, buf ? buf : nullptr, use_half_float);
IMB_exr_add_channel(exrhandle,
@@ -74,7 +74,7 @@ void add_exr_channels(void *exrhandle,
buf ? buf + 2 : nullptr,
use_half_float);
break;
case COM_DT_COLOR:
case DataType::Color:
IMB_exr_add_channel(
exrhandle, layerName, "R", viewName, 4, 4 * width, buf ? buf : nullptr, use_half_float);
IMB_exr_add_channel(exrhandle,
@@ -124,13 +124,13 @@ void free_exr_channels(void *exrhandle,
/* the pointer is stored in the first channel of each datatype */
switch (datatype) {
case COM_DT_VALUE:
case DataType::Value:
rect = IMB_exr_channel_rect(exrhandle, layerName, "V", srv->name);
break;
case COM_DT_VECTOR:
case DataType::Vector:
rect = IMB_exr_channel_rect(exrhandle, layerName, "X", srv->name);
break;
case COM_DT_COLOR:
case DataType::Color:
rect = IMB_exr_channel_rect(exrhandle, layerName, "R", srv->name);
break;
default:
@@ -145,11 +145,11 @@ void free_exr_channels(void *exrhandle,
int get_datatype_size(DataType datatype)
{
switch (datatype) {
case COM_DT_VALUE:
case DataType::Value:
return 1;
case COM_DT_VECTOR:
case DataType::Vector:
return 3;
case COM_DT_COLOR:
case DataType::Color:
return 4;
default:
return 0;

View File

@@ -89,10 +89,10 @@ static void readCornersFromSockets(rcti *rect, SocketReader *readers[4], float c
PlaneCornerPinMaskOperation::PlaneCornerPinMaskOperation() : m_corners_ready(false)
{
addInputSocket(COM_DT_VECTOR);
addInputSocket(COM_DT_VECTOR);
addInputSocket(COM_DT_VECTOR);
addInputSocket(COM_DT_VECTOR);
addInputSocket(DataType::Vector);
addInputSocket(DataType::Vector);
addInputSocket(DataType::Vector);
addInputSocket(DataType::Vector);
/* XXX this is stupid: we need to make this "complex",
* so we can use the initializeTileData function
@@ -153,10 +153,10 @@ void PlaneCornerPinMaskOperation::determineResolution(unsigned int resolution[2]
PlaneCornerPinWarpImageOperation::PlaneCornerPinWarpImageOperation() : m_corners_ready(false)
{
addInputSocket(COM_DT_VECTOR);
addInputSocket(COM_DT_VECTOR);
addInputSocket(COM_DT_VECTOR);
addInputSocket(COM_DT_VECTOR);
addInputSocket(DataType::Vector);
addInputSocket(DataType::Vector);
addInputSocket(DataType::Vector);
addInputSocket(DataType::Vector);
}
void PlaneCornerPinWarpImageOperation::initExecution()

View File

@@ -46,8 +46,8 @@ BLI_INLINE void warpCoord(float x, float y, float matrix[3][3], float uv[2], flo
PlaneDistortWarpImageOperation::PlaneDistortWarpImageOperation()
{
this->addInputSocket(COM_DT_COLOR, COM_SC_NO_RESIZE);
this->addOutputSocket(COM_DT_COLOR);
this->addInputSocket(DataType::Color, COM_SC_NO_RESIZE);
this->addOutputSocket(DataType::Color);
this->m_pixelReader = nullptr;
this->m_motion_blur_samples = 1;
this->m_motion_blur_shutter = 0.5f;
@@ -147,7 +147,7 @@ bool PlaneDistortWarpImageOperation::determineDependingAreaOfInterest(
PlaneDistortMaskOperation::PlaneDistortMaskOperation()
{
addOutputSocket(COM_DT_VALUE);
addOutputSocket(DataType::Value);
/* Currently hardcoded to 8 samples. */
m_osa = 8;

View File

@@ -37,7 +37,7 @@ PreviewOperation::PreviewOperation(const ColorManagedViewSettings *viewSettings,
const ColorManagedDisplaySettings *displaySettings)
{
this->addInputSocket(COM_DT_COLOR, COM_SC_NO_RESIZE);
this->addInputSocket(DataType::Color, COM_SC_NO_RESIZE);
this->m_preview = nullptr;
this->m_outputBuffer = nullptr;
this->m_input = nullptr;

View File

@@ -22,9 +22,9 @@
ProjectorLensDistortionOperation::ProjectorLensDistortionOperation()
{
this->addInputSocket(COM_DT_COLOR);
this->addInputSocket(COM_DT_VALUE);
this->addOutputSocket(COM_DT_COLOR);
this->addInputSocket(DataType::Color);
this->addInputSocket(DataType::Value);
this->addOutputSocket(DataType::Color);
this->setComplex(true);
this->m_inputProgram = nullptr;
this->m_dispersionAvailable = false;

View File

@@ -146,13 +146,13 @@ void RenderLayersProg::executePixelSampled(float output[4], float x, float y, Pi
const DataType data_type = this->getOutputSocket()->getDataType();
int actual_element_size = this->m_elementsize;
int expected_element_size;
if (data_type == COM_DT_VALUE) {
if (data_type == DataType::Value) {
expected_element_size = 1;
}
else if (data_type == COM_DT_VECTOR) {
else if (data_type == DataType::Vector) {
expected_element_size = 3;
}
else if (data_type == COM_DT_COLOR) {
else if (data_type == DataType::Color) {
expected_element_size = 4;
}
else {

View File

@@ -21,9 +21,9 @@
RotateOperation::RotateOperation()
{
this->addInputSocket(COM_DT_COLOR);
this->addInputSocket(COM_DT_VALUE);
this->addOutputSocket(COM_DT_COLOR);
this->addInputSocket(DataType::Color);
this->addInputSocket(DataType::Value);
this->addOutputSocket(DataType::Color);
this->setResolutionInputSocketIndex(0);
this->m_imageSocket = nullptr;
this->m_degreeSocket = nullptr;

View File

@@ -37,10 +37,10 @@ BaseScaleOperation::BaseScaleOperation()
ScaleOperation::ScaleOperation() : BaseScaleOperation()
{
this->addInputSocket(COM_DT_COLOR);
this->addInputSocket(COM_DT_VALUE);
this->addInputSocket(COM_DT_VALUE);
this->addOutputSocket(COM_DT_COLOR);
this->addInputSocket(DataType::Color);
this->addInputSocket(DataType::Value);
this->addInputSocket(DataType::Value);
this->addOutputSocket(DataType::Color);
this->setResolutionInputSocketIndex(0);
this->m_inputOperation = nullptr;
this->m_inputXOperation = nullptr;
@@ -112,10 +112,10 @@ bool ScaleOperation::determineDependingAreaOfInterest(rcti *input,
// SCALE ABSOLUTE
ScaleAbsoluteOperation::ScaleAbsoluteOperation() : BaseScaleOperation()
{
this->addInputSocket(COM_DT_COLOR);
this->addInputSocket(COM_DT_VALUE);
this->addInputSocket(COM_DT_VALUE);
this->addOutputSocket(COM_DT_COLOR);
this->addInputSocket(DataType::Color);
this->addInputSocket(DataType::Value);
this->addInputSocket(DataType::Value);
this->addOutputSocket(DataType::Color);
this->setResolutionInputSocketIndex(0);
this->m_inputOperation = nullptr;
this->m_inputXOperation = nullptr;
@@ -203,8 +203,8 @@ bool ScaleAbsoluteOperation::determineDependingAreaOfInterest(rcti *input,
// Absolute fixed size
ScaleFixedSizeOperation::ScaleFixedSizeOperation() : BaseScaleOperation()
{
this->addInputSocket(COM_DT_COLOR, COM_SC_NO_RESIZE);
this->addOutputSocket(COM_DT_COLOR);
this->addInputSocket(DataType::Color, COM_SC_NO_RESIZE);
this->addOutputSocket(DataType::Color);
this->setResolutionInputSocketIndex(0);
this->m_inputOperation = nullptr;
this->m_is_offset = false;

View File

@@ -26,10 +26,10 @@
ScreenLensDistortionOperation::ScreenLensDistortionOperation()
{
this->addInputSocket(COM_DT_COLOR);
this->addInputSocket(COM_DT_VALUE);
this->addInputSocket(COM_DT_VALUE);
this->addOutputSocket(COM_DT_COLOR);
this->addInputSocket(DataType::Color);
this->addInputSocket(DataType::Value);
this->addInputSocket(DataType::Value);
this->addOutputSocket(DataType::Color);
this->setComplex(true);
this->m_inputProgram = nullptr;
this->m_distortion = 0.0f;

View File

@@ -20,9 +20,9 @@
SetAlphaMultiplyOperation::SetAlphaMultiplyOperation()
{
this->addInputSocket(COM_DT_COLOR);
this->addInputSocket(COM_DT_VALUE);
this->addOutputSocket(COM_DT_COLOR);
this->addInputSocket(DataType::Color);
this->addInputSocket(DataType::Value);
this->addOutputSocket(DataType::Color);
this->m_inputColor = nullptr;
this->m_inputAlpha = nullptr;

View File

@@ -20,9 +20,9 @@
SetAlphaReplaceOperation::SetAlphaReplaceOperation()
{
this->addInputSocket(COM_DT_COLOR);
this->addInputSocket(COM_DT_VALUE);
this->addOutputSocket(COM_DT_COLOR);
this->addInputSocket(DataType::Color);
this->addInputSocket(DataType::Value);
this->addOutputSocket(DataType::Color);
this->m_inputColor = nullptr;
this->m_inputAlpha = nullptr;

View File

@@ -20,7 +20,7 @@
SetColorOperation::SetColorOperation()
{
this->addOutputSocket(COM_DT_COLOR);
this->addOutputSocket(DataType::Color);
}
void SetColorOperation::executePixelSampled(float output[4],

View File

@@ -20,8 +20,8 @@
SetSamplerOperation::SetSamplerOperation()
{
this->addInputSocket(COM_DT_COLOR);
this->addOutputSocket(COM_DT_COLOR);
this->addInputSocket(DataType::Color);
this->addOutputSocket(DataType::Color);
}
void SetSamplerOperation::initExecution()

View File

@@ -20,7 +20,7 @@
SetValueOperation::SetValueOperation()
{
this->addOutputSocket(COM_DT_VALUE);
this->addOutputSocket(DataType::Value);
}
void SetValueOperation::executePixelSampled(float output[4],

View File

@@ -21,7 +21,7 @@
SetVectorOperation::SetVectorOperation()
{
this->addOutputSocket(COM_DT_VECTOR);
this->addOutputSocket(DataType::Vector);
}
void SetVectorOperation::executePixelSampled(float output[4],

Some files were not shown because too many files have changed in this diff Show More