Cleanup: trailing space for compositor

This commit is contained in:
2018-06-17 17:05:29 +02:00
parent 410880552b
commit a262ea8c47
237 changed files with 1297 additions and 1297 deletions

View File

@@ -34,7 +34,7 @@ public:
ChunkOrder(); ChunkOrder();
void determineDistance(ChunkOrderHotspot **hotspots, unsigned int numberOfHotspots); void determineDistance(ChunkOrderHotspot **hotspots, unsigned int numberOfHotspots);
friend bool operator<(const ChunkOrder &a, const ChunkOrder &b); friend bool operator<(const ChunkOrder &a, const ChunkOrder &b);
void setChunkNumber(unsigned int chunknumber) { this->m_number = chunknumber; } void setChunkNumber(unsigned int chunknumber) { this->m_number = chunknumber; }
void setX(int x) { this->m_x = x; } void setX(int x) { this->m_x = x; }
void setY(int y) { this->m_y = y; } void setY(int y) { this->m_y = y; }

View File

@@ -126,7 +126,7 @@ public:
* @brief get the scene of the context * @brief get the scene of the context
*/ */
const RenderData *getRenderData() const { return this->m_rd; } const RenderData *getRenderData() const { return this->m_rd; }
void setScene(Scene *scene) { m_scene = scene; } void setScene(Scene *scene) { m_scene = scene; }
Scene *getScene() const { return m_scene; } Scene *getScene() const { return m_scene; }
@@ -196,7 +196,7 @@ public:
void setViewName(const char *viewName) { this->m_viewName = viewName; } void setViewName(const char *viewName) { this->m_viewName = viewName; }
int getChunksize() const { return this->getbNodeTree()->chunksize; } int getChunksize() const { return this->getbNodeTree()->chunksize; }
void setFastCalculation(bool fastCalculation) {this->m_fastCalculation = fastCalculation;} void setFastCalculation(bool fastCalculation) {this->m_fastCalculation = fastCalculation;}
bool isFastCalculation() const { return this->m_fastCalculation; } bool isFastCalculation() const { return this->m_fastCalculation; }
bool isGroupnodeBufferEnabled() const { return (this->getbNodeTree()->flag & NTREE_COM_GROUPNODE_BUFFER) != 0; } bool isGroupnodeBufferEnabled() const { return (this->getbNodeTree()->flag & NTREE_COM_GROUPNODE_BUFFER) != 0; }

View File

@@ -414,7 +414,7 @@ NodeOperation *Converter::convertDataType(NodeOperationOutput *from, NodeOperati
{ {
DataType fromDatatype = from->getDataType(); DataType fromDatatype = from->getDataType();
DataType toDatatype = to->getDataType(); DataType toDatatype = to->getDataType();
if (fromDatatype == COM_DT_VALUE && toDatatype == COM_DT_COLOR) { if (fromDatatype == COM_DT_VALUE && toDatatype == COM_DT_COLOR) {
return new ConvertValueToColorOperation(); return new ConvertValueToColorOperation();
} }
@@ -433,7 +433,7 @@ NodeOperation *Converter::convertDataType(NodeOperationOutput *from, NodeOperati
else if (fromDatatype == COM_DT_VECTOR && toDatatype == COM_DT_COLOR) { else if (fromDatatype == COM_DT_VECTOR && toDatatype == COM_DT_COLOR) {
return new ConvertVectorToColorOperation(); return new ConvertVectorToColorOperation();
} }
return NULL; return NULL;
} }

View File

@@ -50,14 +50,14 @@ public:
* @see Node * @see Node
*/ */
static Node *convert(bNode *b_node); static Node *convert(bNode *b_node);
/** /**
* @brief True if the node is considered 'fast'. * @brief True if the node is considered 'fast'.
* *
* Slow nodes will be skipped if fast execution is required. * Slow nodes will be skipped if fast execution is required.
*/ */
static bool is_fast_node(bNode *b_node); static bool is_fast_node(bNode *b_node);
/** /**
* @brief This method will add a datetype conversion rule when the to-socket does not support the from-socket actual data type. * @brief This method will add a datetype conversion rule when the to-socket does not support the from-socket actual data type.
* *
@@ -68,7 +68,7 @@ public:
* @see NodeLink - a link between two sockets * @see NodeLink - a link between two sockets
*/ */
static NodeOperation *convertDataType(NodeOperationOutput *from, NodeOperationInput *to); static NodeOperation *convertDataType(NodeOperationOutput *from, NodeOperationInput *to);
/** /**
* @brief This method will add a resolution rule based on the settings of the NodeInput. * @brief This method will add a resolution rule based on the settings of the NodeInput.
* *

View File

@@ -118,7 +118,7 @@ void DebugInfo::execution_group_finished(const ExecutionGroup *group)
int DebugInfo::graphviz_operation(const ExecutionSystem *system, const NodeOperation *operation, const ExecutionGroup *group, char *str, int maxlen) int DebugInfo::graphviz_operation(const ExecutionSystem *system, const NodeOperation *operation, const ExecutionGroup *group, char *str, int maxlen)
{ {
int len = 0; int len = 0;
std::string fillcolor = "gainsboro"; std::string fillcolor = "gainsboro";
if (operation->isViewerOperation()) { if (operation->isViewerOperation()) {
const ViewerOperation *viewer = (const ViewerOperation *)operation; const ViewerOperation *viewer = (const ViewerOperation *)operation;
@@ -141,14 +141,14 @@ int DebugInfo::graphviz_operation(const ExecutionSystem *system, const NodeOpera
else if (operation->isWriteBufferOperation()) { else if (operation->isWriteBufferOperation()) {
fillcolor = "darkorange"; fillcolor = "darkorange";
} }
len += snprintf(str + len, maxlen > len ? maxlen - len : 0, "// OPERATION: %p\r\n", operation); len += snprintf(str + len, maxlen > len ? maxlen - len : 0, "// OPERATION: %p\r\n", operation);
if (group) if (group)
len += snprintf(str + len, maxlen > len ? maxlen - len : 0, "\"O_%p_%p\"", operation, group); len += snprintf(str + len, maxlen > len ? maxlen - len : 0, "\"O_%p_%p\"", operation, group);
else else
len += snprintf(str + len, maxlen > len ? maxlen - len : 0, "\"O_%p\"", operation); len += snprintf(str + len, maxlen > len ? maxlen - len : 0, "\"O_%p\"", operation);
len += snprintf(str + len, maxlen > len ? maxlen - len : 0, " [fillcolor=%s,style=filled,shape=record,label=\"{", fillcolor.c_str()); len += snprintf(str + len, maxlen > len ? maxlen - len : 0, " [fillcolor=%s,style=filled,shape=record,label=\"{", fillcolor.c_str());
int totinputs = operation->getNumberOfInputSockets(); int totinputs = operation->getNumberOfInputSockets();
if (totinputs != 0) { if (totinputs != 0) {
len += snprintf(str + len, maxlen > len ? maxlen - len : 0, "{"); len += snprintf(str + len, maxlen > len ? maxlen - len : 0, "{");
@@ -173,11 +173,11 @@ int DebugInfo::graphviz_operation(const ExecutionSystem *system, const NodeOpera
len += snprintf(str + len, maxlen > len ? maxlen - len : 0, "}"); len += snprintf(str + len, maxlen > len ? maxlen - len : 0, "}");
len += snprintf(str + len, maxlen > len ? maxlen - len : 0, "|"); len += snprintf(str + len, maxlen > len ? maxlen - len : 0, "|");
} }
len += snprintf(str + len, maxlen > len ? maxlen - len : 0, "%s\\n(%s)", m_op_names[operation].c_str(), typeid(*operation).name()); len += snprintf(str + len, maxlen > len ? maxlen - len : 0, "%s\\n(%s)", m_op_names[operation].c_str(), typeid(*operation).name());
len += snprintf(str + len, maxlen > len ? maxlen - len : 0, " (%u,%u)", operation->getWidth(), operation->getHeight()); len += snprintf(str + len, maxlen > len ? maxlen - len : 0, " (%u,%u)", operation->getWidth(), operation->getHeight());
int totoutputs = operation->getNumberOfOutputSockets(); int totoutputs = operation->getNumberOfOutputSockets();
if (totoutputs != 0) { if (totoutputs != 0) {
len += snprintf(str + len, maxlen > len ? maxlen - len : 0, "|"); len += snprintf(str + len, maxlen > len ? maxlen - len : 0, "|");
@@ -204,7 +204,7 @@ int DebugInfo::graphviz_operation(const ExecutionSystem *system, const NodeOpera
} }
len += snprintf(str + len, maxlen > len ? maxlen - len : 0, "}\"]"); len += snprintf(str + len, maxlen > len ? maxlen - len : 0, "}\"]");
len += snprintf(str + len, maxlen > len ? maxlen - len : 0, "\r\n"); len += snprintf(str + len, maxlen > len ? maxlen - len : 0, "\r\n");
return len; return len;
} }
@@ -233,7 +233,7 @@ int DebugInfo::graphviz_legend_group(const char *name, const char *color, const
int DebugInfo::graphviz_legend(char *str, int maxlen) int DebugInfo::graphviz_legend(char *str, int maxlen)
{ {
int len = 0; int len = 0;
len += snprintf(str + len, maxlen > len ? maxlen - len : 0, "{\r\n"); len += snprintf(str + len, maxlen > len ? maxlen - len : 0, "{\r\n");
len += snprintf(str + len, maxlen > len ? maxlen - len : 0, "rank = sink;\r\n"); len += snprintf(str + len, maxlen > len ? maxlen - len : 0, "rank = sink;\r\n");
len += snprintf(str + len, maxlen > len ? maxlen - len : 0, "Legend [shape=none, margin=0, label=<\r\n"); len += snprintf(str + len, maxlen > len ? maxlen - len : 0, "Legend [shape=none, margin=0, label=<\r\n");
@@ -266,12 +266,12 @@ bool DebugInfo::graphviz_system(const ExecutionSystem *system, char *str, int ma
{ {
char strbuf[64]; char strbuf[64];
int len = 0; int len = 0;
len += snprintf(str + len, maxlen > len ? maxlen - len : 0, "digraph compositorexecution {\r\n"); len += snprintf(str + len, maxlen > len ? maxlen - len : 0, "digraph compositorexecution {\r\n");
len += snprintf(str + len, maxlen > len ? maxlen - len : 0, "ranksep=1.5\r\n"); len += snprintf(str + len, maxlen > len ? maxlen - len : 0, "ranksep=1.5\r\n");
len += snprintf(str + len, maxlen > len ? maxlen - len : 0, "rankdir=LR\r\n"); len += snprintf(str + len, maxlen > len ? maxlen - len : 0, "rankdir=LR\r\n");
len += snprintf(str + len, maxlen > len ? maxlen - len : 0, "splines=false\r\n"); len += snprintf(str + len, maxlen > len ? maxlen - len : 0, "splines=false\r\n");
#if 0 #if 0
for (ExecutionSystem::Operations::const_iterator it = system->m_operations.begin(); for (ExecutionSystem::Operations::const_iterator it = system->m_operations.begin();
it != system->m_operations.end(); ++it) { it != system->m_operations.end(); ++it) {
@@ -279,13 +279,13 @@ bool DebugInfo::graphviz_system(const ExecutionSystem *system, char *str, int ma
len += snprintf(str + len, maxlen > len ? maxlen - len : 0, "// OPERATION: %s\r\n", node->getbNode()->typeinfo->ui_name); len += snprintf(str + len, maxlen > len ? maxlen - len : 0, "// OPERATION: %s\r\n", node->getbNode()->typeinfo->ui_name);
} }
#endif #endif
int totops = system->m_operations.size(); int totops = system->m_operations.size();
int totgroups = system->m_groups.size(); int totgroups = system->m_groups.size();
std::map<NodeOperation *, std::vector<std::string> > op_groups; std::map<NodeOperation *, std::vector<std::string> > op_groups;
for (int i = 0; i < totgroups; ++i) { for (int i = 0; i < totgroups; ++i) {
const ExecutionGroup *group = system->m_groups[i]; const ExecutionGroup *group = system->m_groups[i];
len += snprintf(str + len, maxlen > len ? maxlen - len : 0, "// GROUP: %d\r\n", i); len += snprintf(str + len, maxlen > len ? maxlen - len : 0, "// GROUP: %d\r\n", i);
len += snprintf(str + len, maxlen > len ? maxlen - len : 0, "subgraph cluster_%d{\r\n", i); len += snprintf(str + len, maxlen > len ? maxlen - len : 0, "subgraph cluster_%d{\r\n", i);
/* used as a check for executing group */ /* used as a check for executing group */
@@ -302,41 +302,41 @@ bool DebugInfo::graphviz_system(const ExecutionSystem *system, char *str, int ma
len += snprintf(str + len, maxlen > len ? maxlen - len : 0, "color=black\r\n"); len += snprintf(str + len, maxlen > len ? maxlen - len : 0, "color=black\r\n");
len += snprintf(str + len, maxlen > len ? maxlen - len : 0, "fillcolor=chartreuse4\r\n"); len += snprintf(str + len, maxlen > len ? maxlen - len : 0, "fillcolor=chartreuse4\r\n");
} }
for (ExecutionGroup::Operations::const_iterator it = group->m_operations.begin(); it != group->m_operations.end(); ++it) { for (ExecutionGroup::Operations::const_iterator it = group->m_operations.begin(); it != group->m_operations.end(); ++it) {
NodeOperation *operation = *it; NodeOperation *operation = *it;
sprintf(strbuf, "_%p", group); sprintf(strbuf, "_%p", group);
op_groups[operation].push_back(std::string(strbuf)); op_groups[operation].push_back(std::string(strbuf));
len += graphviz_operation(system, operation, group, str + len, maxlen > len ? maxlen - len : 0); len += graphviz_operation(system, operation, group, str + len, maxlen > len ? maxlen - len : 0);
} }
// len += snprintf(str+len, maxlen>len ? maxlen-len : 0, "// OUTPUTOPERATION: %p\r\n", group->getOutputOperation()); // len += snprintf(str+len, maxlen>len ? maxlen-len : 0, "// OUTPUTOPERATION: %p\r\n", group->getOutputOperation());
// len += snprintf(str+len, maxlen>len ? maxlen-len : 0, " O_%p\r\n", group->getOutputOperation()); // len += snprintf(str+len, maxlen>len ? maxlen-len : 0, " O_%p\r\n", group->getOutputOperation());
len += snprintf(str + len, maxlen > len ? maxlen - len : 0, "}\r\n"); len += snprintf(str + len, maxlen > len ? maxlen - len : 0, "}\r\n");
} }
/* operations not included in any group */ /* operations not included in any group */
for (int j = 0; j < totops; ++j) { for (int j = 0; j < totops; ++j) {
NodeOperation *operation = system->m_operations[j]; NodeOperation *operation = system->m_operations[j];
if (op_groups.find(operation) != op_groups.end()) if (op_groups.find(operation) != op_groups.end())
continue; continue;
op_groups[operation].push_back(std::string("")); op_groups[operation].push_back(std::string(""));
len += graphviz_operation(system, operation, 0, str + len, maxlen > len ? maxlen - len : 0); len += graphviz_operation(system, operation, 0, str + len, maxlen > len ? maxlen - len : 0);
} }
for (int i = 0; i < totops; i++) { for (int i = 0; i < totops; i++) {
NodeOperation *operation = system->m_operations[i]; NodeOperation *operation = system->m_operations[i];
if (operation->isReadBufferOperation()) { if (operation->isReadBufferOperation()) {
ReadBufferOperation *read = (ReadBufferOperation *)operation; ReadBufferOperation *read = (ReadBufferOperation *)operation;
WriteBufferOperation *write = read->getMemoryProxy()->getWriteBufferOperation(); WriteBufferOperation *write = read->getMemoryProxy()->getWriteBufferOperation();
std::vector<std::string> &read_groups = op_groups[read]; std::vector<std::string> &read_groups = op_groups[read];
std::vector<std::string> &write_groups = op_groups[write]; std::vector<std::string> &write_groups = op_groups[write];
for (int k = 0; k < write_groups.size(); ++k) { for (int k = 0; k < write_groups.size(); ++k) {
for (int l = 0; l < read_groups.size(); ++l) { for (int l = 0; l < read_groups.size(); ++l) {
len += snprintf(str + len, maxlen > len ? maxlen - len : 0, "\"O_%p%s\" -> \"O_%p%s\" [style=dotted]\r\n", write, write_groups[k].c_str(), read, read_groups[l].c_str()); len += snprintf(str + len, maxlen > len ? maxlen - len : 0, "\"O_%p%s\" -> \"O_%p%s\" [style=dotted]\r\n", write, write_groups[k].c_str(), read, read_groups[l].c_str());
@@ -344,17 +344,17 @@ bool DebugInfo::graphviz_system(const ExecutionSystem *system, char *str, int ma
} }
} }
} }
for (int i = 0; i < totops; i++) { for (int i = 0; i < totops; i++) {
NodeOperation *op = system->m_operations[i]; NodeOperation *op = system->m_operations[i];
for (NodeOperation::Inputs::const_iterator it = op->m_inputs.begin(); it != op->m_inputs.end(); ++it) { for (NodeOperation::Inputs::const_iterator it = op->m_inputs.begin(); it != op->m_inputs.end(); ++it) {
NodeOperationInput *to = *it; NodeOperationInput *to = *it;
NodeOperationOutput *from = to->getLink(); NodeOperationOutput *from = to->getLink();
if (!from) if (!from)
continue; continue;
std::string color; std::string color;
switch (from->getDataType()) { switch (from->getDataType()) {
case COM_DT_VALUE: case COM_DT_VALUE:
@@ -367,12 +367,12 @@ bool DebugInfo::graphviz_system(const ExecutionSystem *system, char *str, int ma
color = "orange"; color = "orange";
break; break;
} }
NodeOperation *to_op = &to->getOperation(); NodeOperation *to_op = &to->getOperation();
NodeOperation *from_op = &from->getOperation(); NodeOperation *from_op = &from->getOperation();
std::vector<std::string> &from_groups = op_groups[from_op]; std::vector<std::string> &from_groups = op_groups[from_op];
std::vector<std::string> &to_groups = op_groups[to_op]; std::vector<std::string> &to_groups = op_groups[to_op];
len += snprintf(str + len, maxlen > len ? maxlen - len : 0, "// CONNECTION: %p.%p -> %p.%p\r\n", len += snprintf(str + len, maxlen > len ? maxlen - len : 0, "// CONNECTION: %p.%p -> %p.%p\r\n",
from_op, from, to_op, to); from_op, from, to_op, to);
for (int k = 0; k < from_groups.size(); ++k) { for (int k = 0; k < from_groups.size(); ++k) {
@@ -385,11 +385,11 @@ bool DebugInfo::graphviz_system(const ExecutionSystem *system, char *str, int ma
} }
} }
} }
len += graphviz_legend(str + len, maxlen > len ? maxlen - len : 0); len += graphviz_legend(str + len, maxlen > len ? maxlen - len : 0);
len += snprintf(str + len, maxlen > len ? maxlen - len : 0, "}\r\n"); len += snprintf(str + len, maxlen > len ? maxlen - len : 0, "}\r\n");
return (len < maxlen); return (len < maxlen);
} }
@@ -399,11 +399,11 @@ void DebugInfo::graphviz(const ExecutionSystem *system)
if (graphviz_system(system, str, sizeof(str) - 1)) { if (graphviz_system(system, str, sizeof(str) - 1)) {
char basename[FILE_MAX]; char basename[FILE_MAX];
char filename[FILE_MAX]; char filename[FILE_MAX];
BLI_snprintf(basename, sizeof(basename), "compositor_%d.dot", m_file_index); BLI_snprintf(basename, sizeof(basename), "compositor_%d.dot", m_file_index);
BLI_join_dirfile(filename, sizeof(filename), BKE_tempdir_session(), basename); BLI_join_dirfile(filename, sizeof(filename), BKE_tempdir_session(), basename);
++m_file_index; ++m_file_index;
FILE *fp = BLI_fopen(filename, "wb"); FILE *fp = BLI_fopen(filename, "wb");
fputs(str, fp); fputs(str, fp);
fclose(fp); fclose(fp);

View File

@@ -39,27 +39,27 @@ public:
EG_RUNNING, EG_RUNNING,
EG_FINISHED EG_FINISHED
} GroupState; } GroupState;
typedef std::map<const Node *, std::string> NodeNameMap; typedef std::map<const Node *, std::string> NodeNameMap;
typedef std::map<const NodeOperation *, std::string> OpNameMap; typedef std::map<const NodeOperation *, std::string> OpNameMap;
typedef std::map<const ExecutionGroup *, GroupState> GroupStateMap; typedef std::map<const ExecutionGroup *, GroupState> GroupStateMap;
static std::string node_name(const Node *node); static std::string node_name(const Node *node);
static std::string operation_name(const NodeOperation *op); static std::string operation_name(const NodeOperation *op);
static void convert_started(); static void convert_started();
static void execute_started(const ExecutionSystem *system); static void execute_started(const ExecutionSystem *system);
static void node_added(const Node *node); static void node_added(const Node *node);
static void node_to_operations(const Node *node); static void node_to_operations(const Node *node);
static void operation_added(const NodeOperation *operation); static void operation_added(const NodeOperation *operation);
static void operation_read_write_buffer(const NodeOperation *operation); static void operation_read_write_buffer(const NodeOperation *operation);
static void execution_group_started(const ExecutionGroup *group); static void execution_group_started(const ExecutionGroup *group);
static void execution_group_finished(const ExecutionGroup *group); static void execution_group_finished(const ExecutionGroup *group);
static void graphviz(const ExecutionSystem *system); static void graphviz(const ExecutionSystem *system);
#ifdef COM_DEBUG #ifdef COM_DEBUG
protected: protected:
static int graphviz_operation(const ExecutionSystem *system, const NodeOperation *operation, const ExecutionGroup *group, char *str, int maxlen); static int graphviz_operation(const ExecutionSystem *system, const NodeOperation *operation, const ExecutionGroup *group, char *str, int maxlen);
@@ -68,7 +68,7 @@ protected:
static int graphviz_legend_group(const char *name, const char *color, const char *style, char *str, int maxlen); static int graphviz_legend_group(const char *name, const char *color, const char *style, char *str, int maxlen);
static int graphviz_legend(char *str, int maxlen); static int graphviz_legend(char *str, int maxlen);
static bool graphviz_system(const ExecutionSystem *system, char *str, int maxlen); static bool graphviz_system(const ExecutionSystem *system, char *str, int maxlen);
private: private:
static int m_file_index; static int m_file_index;
static NodeNameMap m_node_names; /**< map nodes to usable names for debug output */ static NodeNameMap m_node_names; /**< map nodes to usable names for debug output */

View File

@@ -34,11 +34,11 @@ class Device {
public: public:
/** /**
* @brief Declaration of the virtual destructor * @brief Declaration of the virtual destructor
* @note resolve warning gcc 4.7 * @note resolve warning gcc 4.7
*/ */
virtual ~Device() {} virtual ~Device() {}
/** /**
* @brief initialize the device * @brief initialize the device
*/ */

View File

@@ -73,16 +73,16 @@ CompositorPriority ExecutionGroup::getRenderPriotrity()
bool ExecutionGroup::canContainOperation(NodeOperation *operation) bool ExecutionGroup::canContainOperation(NodeOperation *operation)
{ {
if (!this->m_initialized) { return true; } if (!this->m_initialized) { return true; }
if (operation->isReadBufferOperation()) { return true; } if (operation->isReadBufferOperation()) { return true; }
if (operation->isWriteBufferOperation()) { return false; } if (operation->isWriteBufferOperation()) { return false; }
if (operation->isSetOperation()) { return true; } if (operation->isSetOperation()) { return true; }
/* complex groups don't allow further ops (except read buffer and values, see above) */ /* complex groups don't allow further ops (except read buffer and values, see above) */
if (m_complex) { return false; } if (m_complex) { return false; }
/* complex ops can't be added to other groups (except their own, which they initialize, see above) */ /* complex ops can't be added to other groups (except their own, which they initialize, see above) */
if (operation->isComplex()) { return false; } if (operation->isComplex()) { return false; }
return true; return true;
} }
@@ -90,16 +90,16 @@ bool ExecutionGroup::addOperation(NodeOperation *operation)
{ {
if (!canContainOperation(operation)) if (!canContainOperation(operation))
return false; return false;
if (!operation->isReadBufferOperation() && !operation->isWriteBufferOperation()) { if (!operation->isReadBufferOperation() && !operation->isWriteBufferOperation()) {
m_complex = operation->isComplex(); m_complex = operation->isComplex();
m_openCL = operation->isOpenCL(); m_openCL = operation->isOpenCL();
m_singleThreaded = operation->isSingleThreaded(); m_singleThreaded = operation->isSingleThreaded();
m_initialized = true; m_initialized = true;
} }
m_operations.push_back(operation); m_operations.push_back(operation);
return true; return true;
} }
@@ -382,7 +382,7 @@ void ExecutionGroup::finalizeChunkExecution(int chunkNumber, MemoryBuffer **memo
{ {
if (this->m_chunkExecutionStates[chunkNumber] == COM_ES_SCHEDULED) if (this->m_chunkExecutionStates[chunkNumber] == COM_ES_SCHEDULED)
this->m_chunkExecutionStates[chunkNumber] = COM_ES_EXECUTED; this->m_chunkExecutionStates[chunkNumber] = COM_ES_EXECUTED;
atomic_add_and_fetch_u(&this->m_chunksFinished, 1); atomic_add_and_fetch_u(&this->m_chunksFinished, 1);
if (memoryBuffers) { if (memoryBuffers) {
for (unsigned int index = 0; index < this->m_cachedMaxReadBufferOffset; index++) { for (unsigned int index = 0; index < this->m_cachedMaxReadBufferOffset; index++) {

View File

@@ -65,89 +65,89 @@ typedef enum ChunkExecutionState {
class ExecutionGroup { class ExecutionGroup {
public: public:
typedef std::vector<NodeOperation*> Operations; typedef std::vector<NodeOperation*> Operations;
private: private:
// fields // fields
/** /**
* @brief list of operations in this ExecutionGroup * @brief list of operations in this ExecutionGroup
*/ */
Operations m_operations; Operations m_operations;
/** /**
* @brief is this ExecutionGroup an input ExecutionGroup * @brief is this ExecutionGroup an input ExecutionGroup
* an input execution group is a group that is at the end of the calculation (the output is important for the user) * an input execution group is a group that is at the end of the calculation (the output is important for the user)
*/ */
int m_isOutput; int m_isOutput;
/** /**
* @brief Width of the output * @brief Width of the output
*/ */
unsigned int m_width; unsigned int m_width;
/** /**
* @brief Height of the output * @brief Height of the output
*/ */
unsigned int m_height; unsigned int m_height;
/** /**
* @brief size of a single chunk, being Width or of height * @brief size of a single chunk, being Width or of height
* a chunk is always a square, except at the edges of the MemoryBuffer * a chunk is always a square, except at the edges of the MemoryBuffer
*/ */
unsigned int m_chunkSize; unsigned int m_chunkSize;
/** /**
* @brief number of chunks in the x-axis * @brief number of chunks in the x-axis
*/ */
unsigned int m_numberOfXChunks; unsigned int m_numberOfXChunks;
/** /**
* @brief number of chunks in the y-axis * @brief number of chunks in the y-axis
*/ */
unsigned int m_numberOfYChunks; unsigned int m_numberOfYChunks;
/** /**
* @brief total number of chunks * @brief total number of chunks
*/ */
unsigned int m_numberOfChunks; unsigned int m_numberOfChunks;
/** /**
* @brief contains this ExecutionGroup a complex NodeOperation. * @brief contains this ExecutionGroup a complex NodeOperation.
*/ */
bool m_complex; bool m_complex;
/** /**
* @brief can this ExecutionGroup be scheduled on an OpenCLDevice * @brief can this ExecutionGroup be scheduled on an OpenCLDevice
*/ */
bool m_openCL; bool m_openCL;
/** /**
* @brief Is this Execution group SingleThreaded * @brief Is this Execution group SingleThreaded
*/ */
bool m_singleThreaded; bool m_singleThreaded;
/** /**
* @brief what is the maximum number field of all ReadBufferOperation in this ExecutionGroup. * @brief what is the maximum number field of all ReadBufferOperation in this ExecutionGroup.
* @note this is used to construct the MemoryBuffers that will be passed during execution. * @note this is used to construct the MemoryBuffers that will be passed during execution.
*/ */
unsigned int m_cachedMaxReadBufferOffset; unsigned int m_cachedMaxReadBufferOffset;
/** /**
* @brief a cached vector of all read operations in the execution group. * @brief a cached vector of all read operations in the execution group.
*/ */
Operations m_cachedReadOperations; Operations m_cachedReadOperations;
/** /**
* @brief reference to the original bNodeTree, this field is only set for the 'top' execution group. * @brief reference to the original bNodeTree, this field is only set for the 'top' execution group.
* @note can only be used to call the callbacks for progress, status and break * @note can only be used to call the callbacks for progress, status and break
*/ */
const bNodeTree *m_bTree; const bNodeTree *m_bTree;
/** /**
* @brief total number of chunks that have been calculated for this ExecutionGroup * @brief total number of chunks that have been calculated for this ExecutionGroup
*/ */
unsigned int m_chunksFinished; unsigned int m_chunksFinished;
/** /**
* @brief the chunkExecutionStates holds per chunk the execution state. this state can be * @brief the chunkExecutionStates holds per chunk the execution state. this state can be
* - COM_ES_NOT_SCHEDULED: not scheduled * - COM_ES_NOT_SCHEDULED: not scheduled
@@ -155,7 +155,7 @@ private:
* - COM_ES_EXECUTED: executed * - COM_ES_EXECUTED: executed
*/ */
ChunkExecutionState *m_chunkExecutionStates; ChunkExecutionState *m_chunkExecutionStates;
/** /**
* @brief indicator when this ExecutionGroup has valid Operations in its vector for Execution * @brief indicator when this ExecutionGroup has valid Operations in its vector for Execution
* @note When building the ExecutionGroup Operations are added via recursion. First a WriteBufferOperations is added, then the * @note When building the ExecutionGroup Operations are added via recursion. First a WriteBufferOperations is added, then the
@@ -184,7 +184,7 @@ private:
* @param operation the operation to be added * @param operation the operation to be added
*/ */
bool canContainOperation(NodeOperation *operation); bool canContainOperation(NodeOperation *operation);
/** /**
* @brief calculate the actual chunk size of this execution group. * @brief calculate the actual chunk size of this execution group.
* @note A chunk size is an unsigned int that is both the height and width of a chunk. * @note A chunk size is an unsigned int that is both the height and width of a chunk.
@@ -192,21 +192,21 @@ private:
* @note by the calling method. * @note by the calling method.
*/ */
unsigned int determineChunkSize(); unsigned int determineChunkSize();
/** /**
* @brief Determine the rect (minx, maxx, miny, maxy) of a chunk at a position. * @brief Determine the rect (minx, maxx, miny, maxy) of a chunk at a position.
* @note Only gives useful results ater the determination of the chunksize * @note Only gives useful results ater the determination of the chunksize
* @see determineChunkSize() * @see determineChunkSize()
*/ */
void determineChunkRect(rcti *rect, const unsigned int xChunk, const unsigned int yChunk) const; void determineChunkRect(rcti *rect, const unsigned int xChunk, const unsigned int yChunk) const;
/** /**
* @brief determine the number of chunks, based on the chunkSize, width and height. * @brief determine the number of chunks, based on the chunkSize, width and height.
* @note The result are stored in the fields numberOfChunks, numberOfXChunks, numberOfYChunks * @note The result are stored in the fields numberOfChunks, numberOfXChunks, numberOfYChunks
*/ */
void determineNumberOfChunks(); void determineNumberOfChunks();
/** /**
* @brief try to schedule a specific chunk. * @brief try to schedule a specific chunk.
* @note scheduling succeeds when all input requirements are met and the chunks hasn't been scheduled yet. * @note scheduling succeeds when all input requirements are met and the chunks hasn't been scheduled yet.
@@ -236,7 +236,7 @@ private:
* @param chunknumber * @param chunknumber
*/ */
bool scheduleChunk(unsigned int chunkNumber); bool scheduleChunk(unsigned int chunkNumber);
/** /**
* @brief determine the area of interest of a certain input area * @brief determine the area of interest of a certain input area
* @note This method only evaluates a single ReadBufferOperation * @note This method only evaluates a single ReadBufferOperation
@@ -250,7 +250,7 @@ private:
public: public:
// constructors // constructors
ExecutionGroup(); ExecutionGroup();
// methods // methods
/** /**
* @brief add an operation to this ExecutionGroup * @brief add an operation to this ExecutionGroup
@@ -261,7 +261,7 @@ public:
* @return True if the operation was successfully added * @return True if the operation was successfully added
*/ */
bool addOperation(NodeOperation *operation); bool addOperation(NodeOperation *operation);
/** /**
* @brief is this ExecutionGroup an output ExecutionGroup * @brief is this ExecutionGroup an output ExecutionGroup
* @note An OutputExecution group are groups containing a * @note An OutputExecution group are groups containing a
@@ -281,47 +281,47 @@ public:
* @param resolution * @param resolution
*/ */
void determineResolution(unsigned int resolution[2]); void determineResolution(unsigned int resolution[2]);
/** /**
* @brief set the resolution of this executiongroup * @brief set the resolution of this executiongroup
* @param resolution * @param resolution
*/ */
void setResolution(unsigned int resolution[2]) { this->m_width = resolution[0]; this->m_height = resolution[1]; } void setResolution(unsigned int resolution[2]) { this->m_width = resolution[0]; this->m_height = resolution[1]; }
/** /**
* @brief get the width of this execution group * @brief get the width of this execution group
*/ */
unsigned int getWidth() const { return m_width; } unsigned int getWidth() const { return m_width; }
/** /**
* @brief get the height of this execution group * @brief get the height of this execution group
*/ */
unsigned int getHeight() const { return m_height; } unsigned int getHeight() const { return m_height; }
/** /**
* @brief does this ExecutionGroup contains a complex NodeOperation * @brief does this ExecutionGroup contains a complex NodeOperation
*/ */
bool isComplex() const { return m_complex; } bool isComplex() const { return m_complex; }
/** /**
* @brief get the output operation of this ExecutionGroup * @brief get the output operation of this ExecutionGroup
* @return NodeOperation *output operation * @return NodeOperation *output operation
*/ */
NodeOperation *getOutputOperation() const; NodeOperation *getOutputOperation() const;
/** /**
* @brief compose multiple chunks into a single chunk * @brief compose multiple chunks into a single chunk
* @return Memorybuffer *consolidated chunk * @return Memorybuffer *consolidated chunk
*/ */
MemoryBuffer *constructConsolidatedMemoryBuffer(MemoryProxy *memoryProxy, rcti *output); MemoryBuffer *constructConsolidatedMemoryBuffer(MemoryProxy *memoryProxy, rcti *output);
/** /**
* @brief initExecution is called just before the execution of the whole graph will be done. * @brief initExecution is called just before the execution of the whole graph will be done.
* @note The implementation will calculate the chunkSize of this execution group. * @note The implementation will calculate the chunkSize of this execution group.
*/ */
void initExecution(); void initExecution();
/** /**
* @brief get all inputbuffers needed to calculate an chunk * @brief get all inputbuffers needed to calculate an chunk
* @note all inputbuffers must be executed * @note all inputbuffers must be executed
@@ -352,14 +352,14 @@ public:
* @param memorybuffers * @param memorybuffers
*/ */
void finalizeChunkExecution(int chunkNumber, MemoryBuffer **memoryBuffers); void finalizeChunkExecution(int chunkNumber, MemoryBuffer **memoryBuffers);
/** /**
* @brief deinitExecution is called just after execution the whole graph. * @brief deinitExecution is called just after execution the whole graph.
* @note It will release all needed resources * @note It will release all needed resources
*/ */
void deinitExecution(); void deinitExecution();
/** /**
* @brief schedule an ExecutionGroup * @brief schedule an ExecutionGroup
* @note this method will return when all chunks have been calculated, or the execution has breaked (by user) * @note this method will return when all chunks have been calculated, or the execution has breaked (by user)
@@ -375,7 +375,7 @@ public:
* @param system * @param system
*/ */
void execute(ExecutionSystem *system); void execute(ExecutionSystem *system);
/** /**
* @brief this method determines the MemoryProxy's where this execution group depends on. * @brief this method determines the MemoryProxy's where this execution group depends on.
* @note After this method determineDependingAreaOfInterest can be called to determine * @note After this method determineDependingAreaOfInterest can be called to determine
@@ -383,7 +383,7 @@ public:
* @param memoryProxies result * @param memoryProxies result
*/ */
void determineDependingMemoryProxies(vector<MemoryProxy *> *memoryProxies); void determineDependingMemoryProxies(vector<MemoryProxy *> *memoryProxies);
/** /**
* @brief Determine the rect (minx, maxx, miny, maxy) of a chunk. * @brief Determine the rect (minx, maxx, miny, maxy) of a chunk.
* @note Only gives useful results ater the determination of the chunksize * @note Only gives useful results ater the determination of the chunksize

View File

@@ -132,7 +132,7 @@ void ExecutionSystem::execute()
editingtree->stats_draw(editingtree->sdh, IFACE_("Compositing | Initializing execution")); editingtree->stats_draw(editingtree->sdh, IFACE_("Compositing | Initializing execution"));
DebugInfo::execute_started(this); DebugInfo::execute_started(this);
unsigned int order = 0; unsigned int order = 0;
for (vector<NodeOperation *>::iterator iter = this->m_operations.begin(); iter != this->m_operations.end(); ++iter) { for (vector<NodeOperation *>::iterator iter = this->m_operations.begin(); iter != this->m_operations.end(); ++iter) {
NodeOperation *operation = *iter; NodeOperation *operation = *iter;

View File

@@ -114,7 +114,7 @@ class ExecutionSystem {
public: public:
typedef std::vector<NodeOperation*> Operations; typedef std::vector<NodeOperation*> Operations;
typedef std::vector<ExecutionGroup*> Groups; typedef std::vector<ExecutionGroup*> Groups;
private: private:
/** /**
* @brief the context used during execution * @brief the context used during execution
@@ -136,7 +136,7 @@ private: //methods
* find all execution group with output nodes * find all execution group with output nodes
*/ */
void findOutputExecutionGroup(vector<ExecutionGroup *> *result, CompositorPriority priority) const; void findOutputExecutionGroup(vector<ExecutionGroup *> *result, CompositorPriority priority) const;
/** /**
* find all execution group with output nodes * find all execution group with output nodes
*/ */

View File

@@ -64,29 +64,29 @@ private:
* @brief proxy of the memory (same for all chunks in the same buffer) * @brief proxy of the memory (same for all chunks in the same buffer)
*/ */
MemoryProxy *m_memoryProxy; MemoryProxy *m_memoryProxy;
/** /**
* @brief the type of buffer COM_DT_VALUE, COM_DT_VECTOR, COM_DT_COLOR * @brief the type of buffer COM_DT_VALUE, COM_DT_VECTOR, COM_DT_COLOR
*/ */
DataType m_datatype; DataType m_datatype;
/** /**
* @brief region of this buffer inside relative to the MemoryProxy * @brief region of this buffer inside relative to the MemoryProxy
*/ */
rcti m_rect; rcti m_rect;
/** /**
* brief refers to the chunknumber within the executiongroup where related to the MemoryProxy * brief refers to the chunknumber within the executiongroup where related to the MemoryProxy
* @see memoryProxy * @see memoryProxy
*/ */
unsigned int m_chunkNumber; unsigned int m_chunkNumber;
/** /**
* @brief state of the buffer * @brief state of the buffer
*/ */
MemoryBufferState m_state; MemoryBufferState m_state;
/** /**
* @brief the actual float buffer/data * @brief the actual float buffer/data
*/ */
@@ -106,7 +106,7 @@ public:
* @brief construct new MemoryBuffer for a chunk * @brief construct new MemoryBuffer for a chunk
*/ */
MemoryBuffer(MemoryProxy *memoryProxy, unsigned int chunkNumber, rcti *rect); MemoryBuffer(MemoryProxy *memoryProxy, unsigned int chunkNumber, rcti *rect);
/** /**
* @brief construct new temporarily MemoryBuffer for an area * @brief construct new temporarily MemoryBuffer for an area
*/ */
@@ -121,7 +121,7 @@ public:
* @brief destructor * @brief destructor
*/ */
~MemoryBuffer(); ~MemoryBuffer();
/** /**
* @brief read the ChunkNumber of this MemoryBuffer * @brief read the ChunkNumber of this MemoryBuffer
*/ */
@@ -134,7 +134,7 @@ public:
* @note buffer should already be available in memory * @note buffer should already be available in memory
*/ */
float *getBuffer() { return this->m_buffer; } float *getBuffer() { return this->m_buffer; }
/** /**
* @brief after execution the state will be set to available by calling this method * @brief after execution the state will be set to available by calling this method
*/ */
@@ -142,14 +142,14 @@ public:
{ {
this->m_state = COM_MB_AVAILABLE; this->m_state = COM_MB_AVAILABLE;
} }
inline void wrap_pixel(int &x, int &y, MemoryBufferExtend extend_x, MemoryBufferExtend extend_y) inline void wrap_pixel(int &x, int &y, MemoryBufferExtend extend_x, MemoryBufferExtend extend_y)
{ {
int w = this->m_width; int w = this->m_width;
int h = this->m_height; int h = this->m_height;
x = x - m_rect.xmin; x = x - m_rect.xmin;
y = y - m_rect.ymin; y = y - m_rect.ymin;
switch (extend_x) { switch (extend_x) {
case COM_MB_CLIP: case COM_MB_CLIP:
break; break;
@@ -161,7 +161,7 @@ public:
x = (x >= 0.0f ? (x % w) : (x % w) + w); x = (x >= 0.0f ? (x % w) : (x % w) + w);
break; break;
} }
switch (extend_y) { switch (extend_y) {
case COM_MB_CLIP: case COM_MB_CLIP:
break; break;
@@ -174,7 +174,7 @@ public:
break; break;
} }
} }
inline void wrap_pixel(float &x, float &y, MemoryBufferExtend extend_x, MemoryBufferExtend extend_y) inline void wrap_pixel(float &x, float &y, MemoryBufferExtend extend_x, MemoryBufferExtend extend_y)
{ {
float w = (float)this->m_width; float w = (float)this->m_width;
@@ -249,7 +249,7 @@ public:
float *buffer = &this->m_buffer[offset]; float *buffer = &this->m_buffer[offset];
memcpy(result, buffer, sizeof(float) * this->m_num_channels); memcpy(result, buffer, sizeof(float) * this->m_num_channels);
} }
void writePixel(int x, int y, const float color[4]); void writePixel(int x, int y, const float color[4]);
void addPixel(int x, int y, const float color[4]); void addPixel(int x, int y, const float color[4]);
inline void readBilinear(float *result, float x, float y, inline void readBilinear(float *result, float x, float y,
@@ -271,12 +271,12 @@ public:
} }
void readEWA(float *result, const float uv[2], const float derivatives[2][2]); void readEWA(float *result, const float uv[2], const float derivatives[2][2]);
/** /**
* @brief is this MemoryBuffer a temporarily buffer (based on an area, not on a chunk) * @brief is this MemoryBuffer a temporarily buffer (based on an area, not on a chunk)
*/ */
inline const bool isTemporarily() const { return this->m_state == COM_MB_TEMPORARILY; } inline const bool isTemporarily() const { return this->m_state == COM_MB_TEMPORARILY; }
/** /**
* @brief add the content from otherBuffer to this MemoryBuffer * @brief add the content from otherBuffer to this MemoryBuffer
* @param otherBuffer source buffer * @param otherBuffer source buffer
@@ -285,29 +285,29 @@ public:
* uninitialized values in areas where the buffers don't overlap. * uninitialized values in areas where the buffers don't overlap.
*/ */
void copyContentFrom(MemoryBuffer *otherBuffer); void copyContentFrom(MemoryBuffer *otherBuffer);
/** /**
* @brief get the rect of this MemoryBuffer * @brief get the rect of this MemoryBuffer
*/ */
rcti *getRect() { return &this->m_rect; } rcti *getRect() { return &this->m_rect; }
/** /**
* @brief get the width of this MemoryBuffer * @brief get the width of this MemoryBuffer
*/ */
int getWidth() const; int getWidth() const;
/** /**
* @brief get the height of this MemoryBuffer * @brief get the height of this MemoryBuffer
*/ */
int getHeight() const; int getHeight() const;
/** /**
* @brief clear the buffer. Make all pixels black transparent. * @brief clear the buffer. Make all pixels black transparent.
*/ */
void clear(); void clear();
MemoryBuffer *duplicate(); MemoryBuffer *duplicate();
float getMaximumValue(); float getMaximumValue();
float getMaximumValue(rcti *rect); float getMaximumValue(rcti *rect);
private: private:

View File

@@ -42,17 +42,17 @@ private:
* @brief reference to the ouput operation of the executiongroup * @brief reference to the ouput operation of the executiongroup
*/ */
WriteBufferOperation *m_writeBufferOperation; WriteBufferOperation *m_writeBufferOperation;
/** /**
* @brief reference to the executor. the Execution group that can fill a chunk * @brief reference to the executor. the Execution group that can fill a chunk
*/ */
ExecutionGroup *m_executor; ExecutionGroup *m_executor;
/** /**
* @brief datatype of this MemoryProxy * @brief datatype of this MemoryProxy
*/ */
/* DataType m_datatype; */ /* UNUSED */ /* DataType m_datatype; */ /* UNUSED */
/** /**
* @brief channel information of this buffer * @brief channel information of this buffer
*/ */
@@ -70,7 +70,7 @@ private:
public: public:
MemoryProxy(DataType type); MemoryProxy(DataType type);
/** /**
* @brief set the ExecutionGroup that can be scheduled to calculate a certain chunk. * @brief set the ExecutionGroup that can be scheduled to calculate a certain chunk.
* @param group the ExecutionGroup to set * @param group the ExecutionGroup to set

View File

@@ -54,7 +54,7 @@ Node::Node(bNode *editorNode, bool create_sockets) :
DataType dt = COM_DT_VALUE; DataType dt = COM_DT_VALUE;
if (input->type == SOCK_RGBA) dt = COM_DT_COLOR; if (input->type == SOCK_RGBA) dt = COM_DT_COLOR;
if (input->type == SOCK_VECTOR) dt = COM_DT_VECTOR; if (input->type == SOCK_VECTOR) dt = COM_DT_VECTOR;
this->addInputSocket(dt, input); this->addInputSocket(dt, input);
input = input->next; input = input->next;
} }
@@ -63,7 +63,7 @@ Node::Node(bNode *editorNode, bool create_sockets) :
DataType dt = COM_DT_VALUE; DataType dt = COM_DT_VALUE;
if (output->type == SOCK_RGBA) dt = COM_DT_COLOR; if (output->type == SOCK_RGBA) dt = COM_DT_COLOR;
if (output->type == SOCK_VECTOR) dt = COM_DT_VECTOR; if (output->type == SOCK_VECTOR) dt = COM_DT_VECTOR;
this->addOutputSocket(dt, output); this->addOutputSocket(dt, output);
output = output->next; output = output->next;
} }
@@ -96,7 +96,7 @@ void Node::addInputSocket(DataType datatype, bNodeSocket *bSocket)
void Node::addOutputSocket(DataType datatype) void Node::addOutputSocket(DataType datatype)
{ {
this->addOutputSocket(datatype, NULL); this->addOutputSocket(datatype, NULL);
} }
void Node::addOutputSocket(DataType datatype, bNodeSocket *bSocket) void Node::addOutputSocket(DataType datatype, bNodeSocket *bSocket)
{ {

View File

@@ -45,13 +45,13 @@ class Node {
public: public:
typedef std::vector<NodeInput *> Inputs; typedef std::vector<NodeInput *> Inputs;
typedef std::vector<NodeOutput *> Outputs; typedef std::vector<NodeOutput *> Outputs;
private: private:
/** /**
* @brief stores the reference to the SDNA bNode struct * @brief stores the reference to the SDNA bNode struct
*/ */
bNodeTree *m_editorNodeTree; bNodeTree *m_editorNodeTree;
/** /**
* @brief stores the reference to the SDNA bNode struct * @brief stores the reference to the SDNA bNode struct
*/ */
@@ -82,7 +82,7 @@ protected:
* @brief get access to the vector of input sockets * @brief get access to the vector of input sockets
*/ */
const Inputs &getInputSockets() const { return this->m_inputsockets; } const Inputs &getInputSockets() const { return this->m_inputsockets; }
/** /**
* @brief get access to the vector of input sockets * @brief get access to the vector of input sockets
*/ */
@@ -101,14 +101,14 @@ public:
* @brief get the reference to the SDNA bNodeTree struct * @brief get the reference to the SDNA bNodeTree struct
*/ */
bNodeTree *getbNodeTree() const {return m_editorNodeTree;} bNodeTree *getbNodeTree() const {return m_editorNodeTree;}
/** /**
* @brief set the reference to the bNode * @brief set the reference to the bNode
* @note used in Node instances to receive the storage/settings and complex node for highlight during execution * @note used in Node instances to receive the storage/settings and complex node for highlight during execution
* @param bNode * @param bNode
*/ */
void setbNode(bNode *node) {this->m_editorNode = node;} void setbNode(bNode *node) {this->m_editorNode = node;}
/** /**
* @brief set the reference to the bNodeTree * @brief set the reference to the bNodeTree
* @param bNodeTree * @param bNodeTree
@@ -131,35 +131,35 @@ public:
* the index of the needed outputsocket * the index of the needed outputsocket
*/ */
NodeOutput *getOutputSocket(const unsigned int index) const; NodeOutput *getOutputSocket(const unsigned int index) const;
/** /**
* get the reference to the first outputsocket * get the reference to the first outputsocket
* @param index * @param index
* the index of the needed outputsocket * the index of the needed outputsocket
*/ */
inline NodeOutput *getOutputSocket() const { return getOutputSocket(0); } inline NodeOutput *getOutputSocket() const { return getOutputSocket(0); }
/** /**
* get the reference to a certain inputsocket * get the reference to a certain inputsocket
* @param index * @param index
* the index of the needed inputsocket * the index of the needed inputsocket
*/ */
NodeInput *getInputSocket(const unsigned int index) const; NodeInput *getInputSocket(const unsigned int index) const;
/** Check if this is an input node /** Check if this is an input node
* An input node is a node that only has output sockets and no input sockets * An input node is a node that only has output sockets and no input sockets
*/ */
bool isInputNode() const { return m_inputsockets.empty(); } bool isInputNode() const { return m_inputsockets.empty(); }
/** /**
* @brief Is this node in the active group (the group that is being edited) * @brief Is this node in the active group (the group that is being edited)
* @param isInActiveGroup * @param isInActiveGroup
*/ */
void setIsInActiveGroup(bool value) { this->m_inActiveGroup = value; } void setIsInActiveGroup(bool value) { this->m_inActiveGroup = value; }
/** /**
* @brief Is this node part of the active group * @brief Is this node part of the active group
* the active group is the group that is currently being edited. When no group is edited, * the active group is the group that is currently being edited. When no group is edited,
* the active group will be the main tree (all nodes that are not part of a group will be active) * the active group will be the main tree (all nodes that are not part of a group will be active)
* @return bool [false:true] * @return bool [false:true]
*/ */
@@ -174,7 +174,7 @@ public:
* @param context reference to the CompositorContext * @param context reference to the CompositorContext
*/ */
virtual void convertToOperations(NodeConverter &converter, const CompositorContext &context) const = 0; virtual void convertToOperations(NodeConverter &converter, const CompositorContext &context) const = 0;
/** /**
* Create dummy warning operation, use when we can't get the source data. * Create dummy warning operation, use when we can't get the source data.
*/ */
@@ -185,10 +185,10 @@ public:
* into valid outputs, without this the compositor system gets confused and crashes, see [#32490] * into valid outputs, without this the compositor system gets confused and crashes, see [#32490]
*/ */
void convertToOperations_invalid(NodeConverter *compiler) const; void convertToOperations_invalid(NodeConverter *compiler) const;
void setInstanceKey(bNodeInstanceKey instance_key) { m_instanceKey = instance_key; } void setInstanceKey(bNodeInstanceKey instance_key) { m_instanceKey = instance_key; }
bNodeInstanceKey getInstanceKey() const { return m_instanceKey; } bNodeInstanceKey getInstanceKey() const { return m_instanceKey; }
protected: protected:
/** /**
* @brief add an NodeInput to the collection of inputsockets * @brief add an NodeInput to the collection of inputsockets
@@ -197,7 +197,7 @@ protected:
*/ */
void addInputSocket(DataType datatype); void addInputSocket(DataType datatype);
void addInputSocket(DataType datatype, bNodeSocket *socket); void addInputSocket(DataType datatype, bNodeSocket *socket);
/** /**
* @brief add an NodeOutput to the collection of outputsockets * @brief add an NodeOutput to the collection of outputsockets
* @note may only be called in an constructor * @note may only be called in an constructor
@@ -205,7 +205,7 @@ protected:
*/ */
void addOutputSocket(DataType datatype); void addOutputSocket(DataType datatype);
void addOutputSocket(DataType datatype, bNodeSocket *socket); void addOutputSocket(DataType datatype, bNodeSocket *socket);
bNodeSocket *getEditorInputSocket(int editorNodeInputSocketIndex); bNodeSocket *getEditorInputSocket(int editorNodeInputSocketIndex);
bNodeSocket *getEditorOutputSocket(int editorNodeOutputSocketIndex); bNodeSocket *getEditorOutputSocket(int editorNodeOutputSocketIndex);
}; };
@@ -219,26 +219,26 @@ class NodeInput {
private: private:
Node *m_node; Node *m_node;
bNodeSocket *m_editorSocket; bNodeSocket *m_editorSocket;
DataType m_datatype; DataType m_datatype;
/** /**
* @brief link connected to this NodeInput. * @brief link connected to this NodeInput.
* An input socket can only have a single link * An input socket can only have a single link
*/ */
NodeOutput *m_link; NodeOutput *m_link;
public: public:
NodeInput(Node *node, bNodeSocket *b_socket, DataType datatype); NodeInput(Node *node, bNodeSocket *b_socket, DataType datatype);
Node *getNode() const { return this->m_node; } Node *getNode() const { return this->m_node; }
DataType getDataType() const { return m_datatype; } DataType getDataType() const { return m_datatype; }
bNodeSocket *getbNodeSocket() const { return this->m_editorSocket; } bNodeSocket *getbNodeSocket() const { return this->m_editorSocket; }
void setLink(NodeOutput *link); void setLink(NodeOutput *link);
bool isLinked() const { return m_link; } bool isLinked() const { return m_link; }
NodeOutput *getLink() { return m_link; } NodeOutput *getLink() { return m_link; }
float getEditorValueFloat(); float getEditorValueFloat();
void getEditorValueColor(float *value); void getEditorValueColor(float *value);
void getEditorValueVector(float *value); void getEditorValueVector(float *value);
@@ -253,16 +253,16 @@ class NodeOutput {
private: private:
Node *m_node; Node *m_node;
bNodeSocket *m_editorSocket; bNodeSocket *m_editorSocket;
DataType m_datatype; DataType m_datatype;
public: public:
NodeOutput(Node *node, bNodeSocket *b_socket, DataType datatype); NodeOutput(Node *node, bNodeSocket *b_socket, DataType datatype);
Node *getNode() const { return this->m_node; } Node *getNode() const { return this->m_node; }
DataType getDataType() const { return m_datatype; } DataType getDataType() const { return m_datatype; }
bNodeSocket *getbNodeSocket() const { return this->m_editorSocket; } bNodeSocket *getbNodeSocket() const { return this->m_editorSocket; }
float getEditorValueFloat(); float getEditorValueFloat();
void getEditorValueColor(float *value); void getEditorValueColor(float *value);
void getEditorValueVector(float *value); void getEditorValueVector(float *value);

View File

@@ -73,13 +73,13 @@ NodeOperation *NodeConverter::setInvalidOutput(NodeOutput *output)
{ {
/* this is a really bad situation - bring on the pink! - so artists know this is bad */ /* this is a really bad situation - bring on the pink! - so artists know this is bad */
const float warning_color[4] = {1.0f, 0.0f, 1.0f, 1.0f}; const float warning_color[4] = {1.0f, 0.0f, 1.0f, 1.0f};
SetColorOperation *operation = new SetColorOperation(); SetColorOperation *operation = new SetColorOperation();
operation->setChannels(warning_color); operation->setChannels(warning_color);
m_builder->addOperation(operation); m_builder->addOperation(operation);
m_builder->mapOutputSocket(output, operation->getOutputSocket()); m_builder->mapOutputSocket(output, operation->getOutputSocket());
return operation; return operation;
} }
@@ -87,9 +87,9 @@ NodeOperationOutput *NodeConverter::addInputProxy(NodeInput *input, bool use_con
{ {
SocketProxyOperation *proxy = new SocketProxyOperation(input->getDataType(), use_conversion); SocketProxyOperation *proxy = new SocketProxyOperation(input->getDataType(), use_conversion);
m_builder->addOperation(proxy); m_builder->addOperation(proxy);
m_builder->mapInputSocket(input, proxy->getInputSocket(0)); m_builder->mapInputSocket(input, proxy->getInputSocket(0));
return proxy->getOutputSocket(); return proxy->getOutputSocket();
} }
@@ -97,9 +97,9 @@ NodeOperationInput *NodeConverter::addOutputProxy(NodeOutput *output, bool use_c
{ {
SocketProxyOperation *proxy = new SocketProxyOperation(output->getDataType(), use_conversion); SocketProxyOperation *proxy = new SocketProxyOperation(output->getDataType(), use_conversion);
m_builder->addOperation(proxy); m_builder->addOperation(proxy);
m_builder->mapOutputSocket(output, proxy->getOutputSocket()); m_builder->mapOutputSocket(output, proxy->getOutputSocket());
return proxy->getInputSocket(0); return proxy->getInputSocket(0);
} }
@@ -107,7 +107,7 @@ void NodeConverter::addInputValue(NodeOperationInput *input, float value)
{ {
SetValueOperation *operation = new SetValueOperation(); SetValueOperation *operation = new SetValueOperation();
operation->setValue(value); operation->setValue(value);
m_builder->addOperation(operation); m_builder->addOperation(operation);
m_builder->addLink(operation->getOutputSocket(), input); m_builder->addLink(operation->getOutputSocket(), input);
} }
@@ -116,7 +116,7 @@ void NodeConverter::addInputColor(NodeOperationInput *input, const float value[4
{ {
SetColorOperation *operation = new SetColorOperation(); SetColorOperation *operation = new SetColorOperation();
operation->setChannels(value); operation->setChannels(value);
m_builder->addOperation(operation); m_builder->addOperation(operation);
m_builder->addLink(operation->getOutputSocket(), input); m_builder->addLink(operation->getOutputSocket(), input);
} }
@@ -125,7 +125,7 @@ void NodeConverter::addInputVector(NodeOperationInput *input, const float value[
{ {
SetVectorOperation *operation = new SetVectorOperation(); SetVectorOperation *operation = new SetVectorOperation();
operation->setVector(value); operation->setVector(value);
m_builder->addOperation(operation); m_builder->addOperation(operation);
m_builder->addLink(operation->getOutputSocket(), input); m_builder->addLink(operation->getOutputSocket(), input);
} }
@@ -134,7 +134,7 @@ void NodeConverter::addOutputValue(NodeOutput *output, float value)
{ {
SetValueOperation *operation = new SetValueOperation(); SetValueOperation *operation = new SetValueOperation();
operation->setValue(value); operation->setValue(value);
m_builder->addOperation(operation); m_builder->addOperation(operation);
m_builder->mapOutputSocket(output, operation->getOutputSocket()); m_builder->mapOutputSocket(output, operation->getOutputSocket());
} }
@@ -143,7 +143,7 @@ void NodeConverter::addOutputColor(NodeOutput *output, const float value[4])
{ {
SetColorOperation *operation = new SetColorOperation(); SetColorOperation *operation = new SetColorOperation();
operation->setChannels(value); operation->setChannels(value);
m_builder->addOperation(operation); m_builder->addOperation(operation);
m_builder->mapOutputSocket(output, operation->getOutputSocket()); m_builder->mapOutputSocket(output, operation->getOutputSocket());
} }
@@ -152,7 +152,7 @@ void NodeConverter::addOutputVector(NodeOutput *output, const float value[3])
{ {
SetVectorOperation *operation = new SetVectorOperation(); SetVectorOperation *operation = new SetVectorOperation();
operation->setVector(value); operation->setVector(value);
m_builder->addOperation(operation); m_builder->addOperation(operation);
m_builder->mapOutputSocket(output, operation->getOutputSocket()); m_builder->mapOutputSocket(output, operation->getOutputSocket());
} }

View File

@@ -44,28 +44,28 @@ class ViewerOperation;
class NodeConverter { class NodeConverter {
public: public:
NodeConverter(NodeOperationBuilder *builder); NodeConverter(NodeOperationBuilder *builder);
/** Insert a new operation into the operations graph. /** Insert a new operation into the operations graph.
* The operation must be created by the node. * The operation must be created by the node.
*/ */
void addOperation(NodeOperation *operation); void addOperation(NodeOperation *operation);
/** Map input socket of the node to an operation socket. /** Map input socket of the node to an operation socket.
* Links between nodes will then generate equivalent links between * Links between nodes will then generate equivalent links between
* the mapped operation sockets. * the mapped operation sockets.
* *
* \note A \a Node input can be mapped to multiple \a NodeOperation inputs. * \note A \a Node input can be mapped to multiple \a NodeOperation inputs.
*/ */
void mapInputSocket(NodeInput *node_socket, NodeOperationInput *operation_socket); void mapInputSocket(NodeInput *node_socket, NodeOperationInput *operation_socket);
/** Map output socket of the node to an operation socket. /** Map output socket of the node to an operation socket.
* Links between nodes will then generate equivalent links between * Links between nodes will then generate equivalent links between
* the mapped operation sockets. * the mapped operation sockets.
* *
* \note A \a Node output can only be mapped to one \a NodeOperation output. * \note A \a Node output can only be mapped to one \a NodeOperation output.
* Any existing operation output mapping will be replaced. * Any existing operation output mapping will be replaced.
*/ */
void mapOutputSocket(NodeOutput *node_socket, NodeOperationOutput *operation_socket); void mapOutputSocket(NodeOutput *node_socket, NodeOperationOutput *operation_socket);
/** Create a proxy operation for a node input. /** Create a proxy operation for a node input.
* This operation will be removed later and replaced * This operation will be removed later and replaced
* by direct links between the connected operations. * by direct links between the connected operations.
@@ -76,39 +76,39 @@ public:
* by direct links between the connected operations. * by direct links between the connected operations.
*/ */
NodeOperationInput *addOutputProxy(NodeOutput *output, bool use_conversion); NodeOperationInput *addOutputProxy(NodeOutput *output, bool use_conversion);
/** Define a constant input value. */ /** Define a constant input value. */
void addInputValue(NodeOperationInput *input, float value); void addInputValue(NodeOperationInput *input, float value);
/** Define a constant input color. */ /** Define a constant input color. */
void addInputColor(NodeOperationInput *input, const float value[4]); void addInputColor(NodeOperationInput *input, const float value[4]);
/** Define a constant input vector. */ /** Define a constant input vector. */
void addInputVector(NodeOperationInput *input, const float value[3]); void addInputVector(NodeOperationInput *input, const float value[3]);
/** Define a constant output value. */ /** Define a constant output value. */
void addOutputValue(NodeOutput *output, float value); void addOutputValue(NodeOutput *output, float value);
/** Define a constant output color. */ /** Define a constant output color. */
void addOutputColor(NodeOutput *output, const float value[4]); void addOutputColor(NodeOutput *output, const float value[4]);
/** Define a constant output vector. */ /** Define a constant output vector. */
void addOutputVector(NodeOutput *output, const float value[3]); void addOutputVector(NodeOutput *output, const float value[3]);
/** Add an explicit link between two operations. */ /** Add an explicit link between two operations. */
void addLink(NodeOperationOutput *from, NodeOperationInput *to); void addLink(NodeOperationOutput *from, NodeOperationInput *to);
/** Add a preview operation for a operation output. */ /** Add a preview operation for a operation output. */
void addPreview(NodeOperationOutput *output); void addPreview(NodeOperationOutput *output);
/** Add a preview operation for a node input. */ /** Add a preview operation for a node input. */
void addNodeInputPreview(NodeInput *input); void addNodeInputPreview(NodeInput *input);
/** When a node has no valid data /** When a node has no valid data
* @note missing image / group pointer, or missing renderlayer from EXR * @note missing image / group pointer, or missing renderlayer from EXR
*/ */
NodeOperation *setInvalidOutput(NodeOutput *output); NodeOperation *setInvalidOutput(NodeOutput *output);
/** Define a viewer operation as the active output, if possible */ /** Define a viewer operation as the active output, if possible */
void registerViewer(ViewerOperation *viewer); void registerViewer(ViewerOperation *viewer);
/** The currently active viewer output operation */ /** The currently active viewer output operation */
ViewerOperation *active_viewer() const; ViewerOperation *active_viewer() const;
private: private:
/** The internal builder for storing the results of the graph construction. */ /** The internal builder for storing the results of the graph construction. */
NodeOperationBuilder *m_builder; NodeOperationBuilder *m_builder;

View File

@@ -82,16 +82,16 @@ void NodeGraph::add_node(Node *node, bNodeTree *b_ntree, bNodeInstanceKey key, b
node->setbNodeTree(b_ntree); node->setbNodeTree(b_ntree);
node->setInstanceKey(key); node->setInstanceKey(key);
node->setIsInActiveGroup(is_active_group); node->setIsInActiveGroup(is_active_group);
m_nodes.push_back(node); m_nodes.push_back(node);
DebugInfo::node_added(node); DebugInfo::node_added(node);
} }
void NodeGraph::add_link(NodeOutput *fromSocket, NodeInput *toSocket) void NodeGraph::add_link(NodeOutput *fromSocket, NodeInput *toSocket)
{ {
m_links.push_back(Link(fromSocket, toSocket)); m_links.push_back(Link(fromSocket, toSocket));
/* register with the input */ /* register with the input */
toSocket->setLink(fromSocket); toSocket->setLink(fromSocket);
} }
@@ -99,10 +99,10 @@ void NodeGraph::add_link(NodeOutput *fromSocket, NodeInput *toSocket)
void NodeGraph::add_bNodeTree(const CompositorContext &context, int nodes_start, bNodeTree *tree, bNodeInstanceKey parent_key) void NodeGraph::add_bNodeTree(const CompositorContext &context, int nodes_start, bNodeTree *tree, bNodeInstanceKey parent_key)
{ {
const bNodeTree *basetree = context.getbNodeTree(); const bNodeTree *basetree = context.getbNodeTree();
/* update viewers in the active edittree as well the base tree (for backdrop) */ /* update viewers in the active edittree as well the base tree (for backdrop) */
bool is_active_group = (parent_key.value == basetree->active_viewer_key.value); bool is_active_group = (parent_key.value == basetree->active_viewer_key.value);
/* add all nodes of the tree to the node list */ /* add all nodes of the tree to the node list */
for (bNode *node = (bNode *)tree->nodes.first; node; node = node->next) { for (bNode *node = (bNode *)tree->nodes.first; node; node = node->next) {
bNodeInstanceKey key = BKE_node_instance_key(parent_key, tree, node); bNodeInstanceKey key = BKE_node_instance_key(parent_key, tree, node);
@@ -123,13 +123,13 @@ void NodeGraph::add_bNode(const CompositorContext &context, bNodeTree *b_ntree,
add_proxies_mute(b_ntree, b_node, key, is_active_group); add_proxies_mute(b_ntree, b_node, key, is_active_group);
return; return;
} }
/* replace slow nodes with proxies for fast execution */ /* replace slow nodes with proxies for fast execution */
if (context.isFastCalculation() && !Converter::is_fast_node(b_node)) { if (context.isFastCalculation() && !Converter::is_fast_node(b_node)) {
add_proxies_skip(b_ntree, b_node, key, is_active_group); add_proxies_skip(b_ntree, b_node, key, is_active_group);
return; return;
} }
/* special node types */ /* special node types */
if (b_node->type == NODE_GROUP) { if (b_node->type == NODE_GROUP) {
add_proxies_group(context, b_node, key); add_proxies_group(context, b_node, key);
@@ -181,15 +181,15 @@ void NodeGraph::add_bNodeLink(const NodeRange &node_range, bNodeLink *b_nodelink
return; return;
if ((b_nodelink->fromsock->flag & SOCK_UNAVAIL) || (b_nodelink->tosock->flag & SOCK_UNAVAIL)) if ((b_nodelink->fromsock->flag & SOCK_UNAVAIL) || (b_nodelink->tosock->flag & SOCK_UNAVAIL))
return; return;
/* Note: a DNA input socket can have multiple NodeInput in the compositor tree! (proxies) /* Note: a DNA input socket can have multiple NodeInput in the compositor tree! (proxies)
* The output then gets linked to each one of them. * The output then gets linked to each one of them.
*/ */
NodeOutput *output = find_output(node_range, b_nodelink->fromsock); NodeOutput *output = find_output(node_range, b_nodelink->fromsock);
if (!output) if (!output)
return; return;
NodeInputs inputs = find_inputs(node_range, b_nodelink->tosock); NodeInputs inputs = find_inputs(node_range, b_nodelink->tosock);
for (NodeInputs::const_iterator it = inputs.begin(); it != inputs.end(); ++it) { for (NodeInputs::const_iterator it = inputs.begin(); it != inputs.end(); ++it) {
NodeInput *input = *it; NodeInput *input = *it;
@@ -213,13 +213,13 @@ void NodeGraph::add_proxies_skip(bNodeTree *b_ntree, bNode *b_node, bNodeInstanc
{ {
for (bNodeSocket *output = (bNodeSocket *)b_node->outputs.first; output; output = output->next) { for (bNodeSocket *output = (bNodeSocket *)b_node->outputs.first; output; output = output->next) {
bNodeSocket *input; bNodeSocket *input;
/* look for first input with matching datatype for each output */ /* look for first input with matching datatype for each output */
for (input = (bNodeSocket *)b_node->inputs.first; input; input = input->next) { for (input = (bNodeSocket *)b_node->inputs.first; input; input = input->next) {
if (input->type == output->type) if (input->type == output->type)
break; break;
} }
if (input) { if (input) {
SocketProxyNode *proxy = new SocketProxyNode(b_node, input, output, true); SocketProxyNode *proxy = new SocketProxyNode(b_node, input, output, true);
add_node(proxy, b_ntree, key, is_active_group); add_node(proxy, b_ntree, key, is_active_group);
@@ -231,11 +231,11 @@ void NodeGraph::add_proxies_group_inputs(bNode *b_node, bNode *b_node_io)
{ {
bNodeTree *b_group_tree = (bNodeTree *)b_node->id; bNodeTree *b_group_tree = (bNodeTree *)b_node->id;
BLI_assert(b_group_tree); /* should have been checked in advance */ BLI_assert(b_group_tree); /* should have been checked in advance */
/* not important for proxies */ /* not important for proxies */
bNodeInstanceKey key = NODE_INSTANCE_KEY_BASE; bNodeInstanceKey key = NODE_INSTANCE_KEY_BASE;
bool is_active_group = false; bool is_active_group = false;
for (bNodeSocket *b_sock_io = (bNodeSocket *)b_node_io->outputs.first; b_sock_io; b_sock_io = b_sock_io->next) { for (bNodeSocket *b_sock_io = (bNodeSocket *)b_node_io->outputs.first; b_sock_io; b_sock_io = b_sock_io->next) {
bNodeSocket *b_sock_group = find_b_node_input(b_node, b_sock_io->identifier); bNodeSocket *b_sock_group = find_b_node_input(b_node, b_sock_io->identifier);
if (b_sock_group) { if (b_sock_group) {
@@ -249,11 +249,11 @@ void NodeGraph::add_proxies_group_outputs(bNode *b_node, bNode *b_node_io, bool
{ {
bNodeTree *b_group_tree = (bNodeTree *)b_node->id; bNodeTree *b_group_tree = (bNodeTree *)b_node->id;
BLI_assert(b_group_tree); /* should have been checked in advance */ BLI_assert(b_group_tree); /* should have been checked in advance */
/* not important for proxies */ /* not important for proxies */
bNodeInstanceKey key = NODE_INSTANCE_KEY_BASE; bNodeInstanceKey key = NODE_INSTANCE_KEY_BASE;
bool is_active_group = false; bool is_active_group = false;
for (bNodeSocket *b_sock_io = (bNodeSocket *)b_node_io->inputs.first; b_sock_io; b_sock_io = b_sock_io->next) { for (bNodeSocket *b_sock_io = (bNodeSocket *)b_node_io->inputs.first; b_sock_io; b_sock_io = b_sock_io->next) {
bNodeSocket *b_sock_group = find_b_node_output(b_node, b_sock_io->identifier); bNodeSocket *b_sock_group = find_b_node_output(b_node, b_sock_io->identifier);
if (b_sock_group) { if (b_sock_group) {
@@ -286,11 +286,11 @@ void NodeGraph::add_proxies_group(const CompositorContext &context, bNode *b_nod
for (bNode *b_node_io = (bNode *)b_group_tree->nodes.first; b_node_io; b_node_io = b_node_io->next) { for (bNode *b_node_io = (bNode *)b_group_tree->nodes.first; b_node_io; b_node_io = b_node_io->next) {
if (b_node_io->type == NODE_GROUP_INPUT) if (b_node_io->type == NODE_GROUP_INPUT)
add_proxies_group_inputs(b_node, b_node_io); add_proxies_group_inputs(b_node, b_node_io);
if (b_node_io->type == NODE_GROUP_OUTPUT && (b_node_io->flag & NODE_DO_OUTPUT)) if (b_node_io->type == NODE_GROUP_OUTPUT && (b_node_io->flag & NODE_DO_OUTPUT))
add_proxies_group_outputs(b_node, b_node_io, context.isGroupnodeBufferEnabled()); add_proxies_group_outputs(b_node, b_node_io, context.isGroupnodeBufferEnabled());
} }
add_bNodeTree(context, nodes_start, b_group_tree, key); add_bNodeTree(context, nodes_start, b_group_tree, key);
} }

View File

@@ -48,66 +48,66 @@ public:
private: private:
NodeOutput *m_from; NodeOutput *m_from;
NodeInput *m_to; NodeInput *m_to;
public: public:
Link(NodeOutput *from, NodeInput *to) : Link(NodeOutput *from, NodeInput *to) :
m_from(from), m_from(from),
m_to(to) m_to(to)
{} {}
NodeOutput *getFromSocket() const { return m_from; } NodeOutput *getFromSocket() const { return m_from; }
NodeInput *getToSocket() const { return m_to; } NodeInput *getToSocket() const { return m_to; }
}; };
typedef std::vector<Node *> Nodes; typedef std::vector<Node *> Nodes;
typedef Nodes::iterator NodeIterator; typedef Nodes::iterator NodeIterator;
typedef std::vector<Link> Links; typedef std::vector<Link> Links;
private: private:
Nodes m_nodes; Nodes m_nodes;
Links m_links; Links m_links;
public: public:
NodeGraph(); NodeGraph();
~NodeGraph(); ~NodeGraph();
const Nodes &nodes() const { return m_nodes; } const Nodes &nodes() const { return m_nodes; }
const Links &links() const { return m_links; } const Links &links() const { return m_links; }
void from_bNodeTree(const CompositorContext &context, bNodeTree *tree); void from_bNodeTree(const CompositorContext &context, bNodeTree *tree);
protected: protected:
typedef std::pair<NodeIterator, NodeIterator> NodeRange; typedef std::pair<NodeIterator, NodeIterator> NodeRange;
typedef std::vector<NodeInput *> NodeInputs; typedef std::vector<NodeInput *> NodeInputs;
static bNodeSocket *find_b_node_input(bNode *b_node, const char *identifier); static bNodeSocket *find_b_node_input(bNode *b_node, const char *identifier);
static bNodeSocket *find_b_node_output(bNode *b_node, const char *identifier); static bNodeSocket *find_b_node_output(bNode *b_node, const char *identifier);
void add_node(Node *node, bNodeTree *b_ntree, bNodeInstanceKey key, bool is_active_group); void add_node(Node *node, bNodeTree *b_ntree, bNodeInstanceKey key, bool is_active_group);
void add_link(NodeOutput *fromSocket, NodeInput *toSocket); void add_link(NodeOutput *fromSocket, NodeInput *toSocket);
void add_bNodeTree(const CompositorContext &context, int nodes_start, bNodeTree *tree, bNodeInstanceKey parent_key); void add_bNodeTree(const CompositorContext &context, int nodes_start, bNodeTree *tree, bNodeInstanceKey parent_key);
void add_bNode(const CompositorContext &context, bNodeTree *b_ntree, bNode *b_node, bNodeInstanceKey key, bool is_active_group); void add_bNode(const CompositorContext &context, bNodeTree *b_ntree, bNode *b_node, bNodeInstanceKey key, bool is_active_group);
NodeInputs find_inputs(const NodeRange &node_range, bNodeSocket *b_socket); NodeInputs find_inputs(const NodeRange &node_range, bNodeSocket *b_socket);
NodeOutput *find_output(const NodeRange &node_range, bNodeSocket *b_socket); NodeOutput *find_output(const NodeRange &node_range, bNodeSocket *b_socket);
void add_bNodeLink(const NodeRange &node_range, bNodeLink *bNodeLink); void add_bNodeLink(const NodeRange &node_range, bNodeLink *bNodeLink);
/* **** Special proxy node type conversions **** */ /* **** Special proxy node type conversions **** */
/* These nodes are not represented in the node graph themselves, /* These nodes are not represented in the node graph themselves,
* but converted into a number of proxy links * but converted into a number of proxy links
*/ */
void add_proxies_mute(bNodeTree *b_ntree, bNode *b_node, bNodeInstanceKey key, bool is_active_group); void add_proxies_mute(bNodeTree *b_ntree, bNode *b_node, bNodeInstanceKey key, bool is_active_group);
void add_proxies_skip(bNodeTree *b_ntree, bNode *b_node, bNodeInstanceKey key, bool is_active_group); void add_proxies_skip(bNodeTree *b_ntree, bNode *b_node, bNodeInstanceKey key, bool is_active_group);
void add_proxies_group_inputs(bNode *b_node, bNode *b_node_io); void add_proxies_group_inputs(bNode *b_node, bNode *b_node_io);
void add_proxies_group_outputs(bNode *b_node, bNode *b_node_io, bool use_buffer); void add_proxies_group_outputs(bNode *b_node, bNode *b_node_io, bool use_buffer);
void add_proxies_group(const CompositorContext &context, bNode *b_node, bNodeInstanceKey key); void add_proxies_group(const CompositorContext &context, bNode *b_node, bNodeInstanceKey key);
void add_proxies_reroute(bNodeTree *b_ntree, bNode *b_node, bNodeInstanceKey key, bool is_active_group); void add_proxies_reroute(bNodeTree *b_ntree, bNode *b_node, bNodeInstanceKey key, bool is_active_group);
#ifdef WITH_CXX_GUARDEDALLOC #ifdef WITH_CXX_GUARDEDALLOC
MEM_CXX_CLASS_ALLOC_FUNCS("COM:NodeGraph") MEM_CXX_CLASS_ALLOC_FUNCS("COM:NodeGraph")
#endif #endif

View File

@@ -83,7 +83,7 @@ void NodeOperation::determineResolution(unsigned int resolution[2], unsigned int
{ {
unsigned int temp[2]; unsigned int temp[2];
unsigned int temp2[2]; unsigned int temp2[2];
for (unsigned int index = 0; index < m_inputs.size(); index++) { for (unsigned int index = 0; index < m_inputs.size(); index++) {
NodeOperationInput *input = m_inputs[index]; NodeOperationInput *input = m_inputs[index];
if (input->isConnected()) { if (input->isConnected()) {

View File

@@ -81,11 +81,11 @@ class NodeOperation : public SocketReader {
public: public:
typedef std::vector<NodeOperationInput*> Inputs; typedef std::vector<NodeOperationInput*> Inputs;
typedef std::vector<NodeOperationOutput*> Outputs; typedef std::vector<NodeOperationOutput*> Outputs;
private: private:
Inputs m_inputs; Inputs m_inputs;
Outputs m_outputs; Outputs m_outputs;
/** /**
* @brief the index of the input socket that will be used to determine the resolution * @brief the index of the input socket that will be used to determine the resolution
*/ */
@@ -115,7 +115,7 @@ private:
* @see NodeOperation.getMutex retrieve a pointer to this mutex. * @see NodeOperation.getMutex retrieve a pointer to this mutex.
*/ */
ThreadMutex m_mutex; ThreadMutex m_mutex;
/** /**
* @brief reference to the editing bNodeTree, used for break and update callback * @brief reference to the editing bNodeTree, used for break and update callback
*/ */
@@ -125,21 +125,21 @@ private:
* @brief set to truth when resolution for this operation is set * @brief set to truth when resolution for this operation is set
*/ */
bool m_isResolutionSet; bool m_isResolutionSet;
public: public:
virtual ~NodeOperation(); virtual ~NodeOperation();
unsigned int getNumberOfInputSockets() const { return m_inputs.size(); } unsigned int getNumberOfInputSockets() const { return m_inputs.size(); }
unsigned int getNumberOfOutputSockets() const { return m_outputs.size(); } unsigned int getNumberOfOutputSockets() const { return m_outputs.size(); }
NodeOperationOutput *getOutputSocket(unsigned int index) const; NodeOperationOutput *getOutputSocket(unsigned int index) const;
NodeOperationOutput *getOutputSocket() const { return getOutputSocket(0); } NodeOperationOutput *getOutputSocket() const { return getOutputSocket(0); }
NodeOperationInput *getInputSocket(unsigned int index) const; NodeOperationInput *getInputSocket(unsigned int index) const;
/** Check if this is an input operation /** Check if this is an input operation
* An input operation is an operation that only has output sockets and no input sockets * An input operation is an operation that only has output sockets and no input sockets
*/ */
bool isInputOperation() const { return m_inputs.empty(); } bool isInputOperation() const { return m_inputs.empty(); }
/** /**
* @brief determine the resolution of this node * @brief determine the resolution of this node
* @note this method will not set the resolution, this is the responsibility of the caller * @note this method will not set the resolution, this is the responsibility of the caller
@@ -167,7 +167,7 @@ public:
void setbNodeTree(const bNodeTree *tree) { this->m_btree = tree; } void setbNodeTree(const bNodeTree *tree) { this->m_btree = tree; }
virtual void initExecution(); virtual void initExecution();
/** /**
* @brief when a chunk is executed by a CPUDevice, this method is called * @brief when a chunk is executed by a CPUDevice, this method is called
* @ingroup execution * @ingroup execution
@@ -231,7 +231,7 @@ public:
this->m_isResolutionSet = true; this->m_isResolutionSet = true;
} }
} }
void getConnectedInputSockets(Inputs *sockets); void getConnectedInputSockets(Inputs *sockets);
@@ -288,14 +288,14 @@ public:
* @see ExecutionGroup.addOperation * @see ExecutionGroup.addOperation
*/ */
bool isOpenCL() const { return this->m_openCL; } bool isOpenCL() const { return this->m_openCL; }
virtual bool isViewerOperation() const { return false; } virtual bool isViewerOperation() const { return false; }
virtual bool isPreviewOperation() const { return false; } virtual bool isPreviewOperation() const { return false; }
virtual bool isFileOutputOperation() const { return false; } virtual bool isFileOutputOperation() const { return false; }
virtual bool isProxyOperation() const { return false; } virtual bool isProxyOperation() const { return false; }
virtual bool useDatatypeConversion() const { return true; } virtual bool useDatatypeConversion() const { return true; }
inline bool isBreaked() const { inline bool isBreaked() const {
return this->m_btree->test_break(this->m_btree->tbh); return this->m_btree->test_break(this->m_btree->tbh);
} }
@@ -319,7 +319,7 @@ protected:
void initMutex(); void initMutex();
void lockMutex(); void lockMutex();
void unlockMutex(); void unlockMutex();
/** /**
* @brief set whether this operation is complex * @brief set whether this operation is complex
* *
@@ -345,35 +345,35 @@ protected:
class NodeOperationInput { class NodeOperationInput {
private: private:
NodeOperation *m_operation; NodeOperation *m_operation;
/** Datatype of this socket. Is used for automatically data transformation. /** Datatype of this socket. Is used for automatically data transformation.
* @section data-conversion * @section data-conversion
*/ */
DataType m_datatype; DataType m_datatype;
/** Resize mode of this socket */ /** Resize mode of this socket */
InputResizeMode m_resizeMode; InputResizeMode m_resizeMode;
/** Connected output */ /** Connected output */
NodeOperationOutput *m_link; NodeOperationOutput *m_link;
public: public:
NodeOperationInput(NodeOperation *op, DataType datatype, InputResizeMode resizeMode = COM_SC_CENTER); NodeOperationInput(NodeOperation *op, DataType datatype, InputResizeMode resizeMode = COM_SC_CENTER);
NodeOperation &getOperation() const { return *m_operation; } NodeOperation &getOperation() const { return *m_operation; }
DataType getDataType() const { return m_datatype; } DataType getDataType() const { return m_datatype; }
void setLink(NodeOperationOutput *link) { m_link = link; } void setLink(NodeOperationOutput *link) { m_link = link; }
NodeOperationOutput *getLink() const { return m_link; } NodeOperationOutput *getLink() const { return m_link; }
bool isConnected() const { return m_link; } bool isConnected() const { return m_link; }
void setResizeMode(InputResizeMode resizeMode) { this->m_resizeMode = resizeMode; } void setResizeMode(InputResizeMode resizeMode) { this->m_resizeMode = resizeMode; }
InputResizeMode getResizeMode() const { return this->m_resizeMode; } InputResizeMode getResizeMode() const { return this->m_resizeMode; }
SocketReader *getReader(); SocketReader *getReader();
void determineResolution(unsigned int resolution[2], unsigned int preferredResolution[2]); void determineResolution(unsigned int resolution[2], unsigned int preferredResolution[2]);
#ifdef WITH_CXX_GUARDEDALLOC #ifdef WITH_CXX_GUARDEDALLOC
MEM_CXX_CLASS_ALLOC_FUNCS("COM:NodeOperation") MEM_CXX_CLASS_ALLOC_FUNCS("COM:NodeOperation")
#endif #endif
@@ -383,18 +383,18 @@ public:
class NodeOperationOutput { class NodeOperationOutput {
private: private:
NodeOperation *m_operation; NodeOperation *m_operation;
/** Datatype of this socket. Is used for automatically data transformation. /** Datatype of this socket. Is used for automatically data transformation.
* @section data-conversion * @section data-conversion
*/ */
DataType m_datatype; DataType m_datatype;
public: public:
NodeOperationOutput(NodeOperation *op, DataType datatype); NodeOperationOutput(NodeOperation *op, DataType datatype);
NodeOperation &getOperation() const { return *m_operation; } NodeOperation &getOperation() const { return *m_operation; }
DataType getDataType() const { return m_datatype; } DataType getDataType() const { return m_datatype; }
/** /**
* @brief determine the resolution of this data going through this socket * @brief determine the resolution of this data going through this socket
* @param resolution the result of this operation * @param resolution the result of this operation

View File

@@ -58,18 +58,18 @@ void NodeOperationBuilder::convertToOperations(ExecutionSystem *system)
{ {
/* interface handle for nodes */ /* interface handle for nodes */
NodeConverter converter(this); NodeConverter converter(this);
for (int index = 0; index < m_graph.nodes().size(); index++) { for (int index = 0; index < m_graph.nodes().size(); index++) {
Node *node = (Node *)m_graph.nodes()[index]; Node *node = (Node *)m_graph.nodes()[index];
m_current_node = node; m_current_node = node;
DebugInfo::node_to_operations(node); DebugInfo::node_to_operations(node);
node->convertToOperations(converter, *m_context); node->convertToOperations(converter, *m_context);
} }
m_current_node = NULL; m_current_node = NULL;
/* The input map constructed by nodes maps operation inputs to node inputs. /* The input map constructed by nodes maps operation inputs to node inputs.
* Inverting yields a map of node inputs to all connected operation inputs, * Inverting yields a map of node inputs to all connected operation inputs,
* so multiple operations can use the same node input. * so multiple operations can use the same node input.
@@ -77,12 +77,12 @@ void NodeOperationBuilder::convertToOperations(ExecutionSystem *system)
OpInputInverseMap inverse_input_map; OpInputInverseMap inverse_input_map;
for (InputSocketMap::const_iterator it = m_input_map.begin(); it != m_input_map.end(); ++it) for (InputSocketMap::const_iterator it = m_input_map.begin(); it != m_input_map.end(); ++it)
inverse_input_map[it->second].push_back(it->first); inverse_input_map[it->second].push_back(it->first);
for (NodeGraph::Links::const_iterator it = m_graph.links().begin(); it != m_graph.links().end(); ++it) { for (NodeGraph::Links::const_iterator it = m_graph.links().begin(); it != m_graph.links().end(); ++it) {
const NodeGraph::Link &link = *it; const NodeGraph::Link &link = *it;
NodeOutput *from = link.getFromSocket(); NodeOutput *from = link.getFromSocket();
NodeInput *to = link.getToSocket(); NodeInput *to = link.getToSocket();
NodeOperationOutput *op_from = find_operation_output(m_output_map, from); NodeOperationOutput *op_from = find_operation_output(m_output_map, from);
const OpInputs &op_to_list = find_operation_inputs(inverse_input_map, to); const OpInputs &op_to_list = find_operation_inputs(inverse_input_map, to);
if (!op_from || op_to_list.empty()) { if (!op_from || op_to_list.empty()) {
@@ -94,36 +94,36 @@ void NodeOperationBuilder::convertToOperations(ExecutionSystem *system)
*/ */
continue; continue;
} }
for (OpInputs::const_iterator it = op_to_list.begin(); it != op_to_list.end(); ++it) { for (OpInputs::const_iterator it = op_to_list.begin(); it != op_to_list.end(); ++it) {
NodeOperationInput *op_to = *it; NodeOperationInput *op_to = *it;
addLink(op_from, op_to); addLink(op_from, op_to);
} }
} }
add_operation_input_constants(); add_operation_input_constants();
resolve_proxies(); resolve_proxies();
add_datatype_conversions(); add_datatype_conversions();
determineResolutions(); determineResolutions();
/* surround complex ops with read/write buffer */ /* surround complex ops with read/write buffer */
add_complex_operation_buffers(); add_complex_operation_buffers();
/* links not available from here on */ /* links not available from here on */
/* XXX make m_links a local variable to avoid confusion! */ /* XXX make m_links a local variable to avoid confusion! */
m_links.clear(); m_links.clear();
prune_operations(); prune_operations();
/* ensure topological (link-based) order of nodes */ /* ensure topological (link-based) order of nodes */
/*sort_operations();*/ /* not needed yet */ /*sort_operations();*/ /* not needed yet */
/* create execution groups */ /* create execution groups */
group_operations(); group_operations();
/* transfer resulting operations to the system */ /* transfer resulting operations to the system */
system->set_operations(m_operations, m_groups); system->set_operations(m_operations, m_groups);
} }
@@ -137,7 +137,7 @@ void NodeOperationBuilder::mapInputSocket(NodeInput *node_socket, NodeOperationI
{ {
BLI_assert(m_current_node); BLI_assert(m_current_node);
BLI_assert(node_socket->getNode() == m_current_node); BLI_assert(node_socket->getNode() == m_current_node);
/* note: this maps operation sockets to node sockets. /* note: this maps operation sockets to node sockets.
* for resolving links the map will be inverted first in convertToOperations, * for resolving links the map will be inverted first in convertToOperations,
* to get a list of links for each node input socket. * to get a list of links for each node input socket.
@@ -149,7 +149,7 @@ void NodeOperationBuilder::mapOutputSocket(NodeOutput *node_socket, NodeOperatio
{ {
BLI_assert(m_current_node); BLI_assert(m_current_node);
BLI_assert(node_socket->getNode() == m_current_node); BLI_assert(node_socket->getNode() == m_current_node);
m_output_map[node_socket] = operation_socket; m_output_map[node_socket] = operation_socket;
} }
@@ -157,9 +157,9 @@ void NodeOperationBuilder::addLink(NodeOperationOutput *from, NodeOperationInput
{ {
if (to->isConnected()) if (to->isConnected())
return; return;
m_links.push_back(Link(from, to)); m_links.push_back(Link(from, to));
/* register with the input */ /* register with the input */
to->setLink(from); to->setLink(from);
} }
@@ -171,7 +171,7 @@ void NodeOperationBuilder::removeInputLink(NodeOperationInput *to)
if (link.to() == to) { if (link.to() == to) {
/* unregister with the input */ /* unregister with the input */
to->setLink(NULL); to->setLink(NULL);
m_links.erase(it); m_links.erase(it);
return; return;
} }
@@ -200,7 +200,7 @@ NodeOperationOutput *NodeOperationBuilder::find_operation_output(const OutputSoc
PreviewOperation *NodeOperationBuilder::make_preview_operation() const PreviewOperation *NodeOperationBuilder::make_preview_operation() const
{ {
BLI_assert(m_current_node); BLI_assert(m_current_node);
if (!(m_current_node->getbNode()->flag & NODE_PREVIEW)) if (!(m_current_node->getbNode()->flag & NODE_PREVIEW))
return NULL; return NULL;
/* previews only in the active group */ /* previews only in the active group */
@@ -209,7 +209,7 @@ PreviewOperation *NodeOperationBuilder::make_preview_operation() const
/* do not calculate previews of hidden nodes */ /* do not calculate previews of hidden nodes */
if (m_current_node->getbNode()->flag & NODE_HIDDEN) if (m_current_node->getbNode()->flag & NODE_HIDDEN)
return NULL; return NULL;
bNodeInstanceHash *previews = m_context->getPreviewHash(); bNodeInstanceHash *previews = m_context->getPreviewHash();
if (previews) { if (previews) {
PreviewOperation *operation = new PreviewOperation(m_context->getViewSettings(), m_context->getDisplaySettings()); PreviewOperation *operation = new PreviewOperation(m_context->getViewSettings(), m_context->getDisplaySettings());
@@ -217,7 +217,7 @@ PreviewOperation *NodeOperationBuilder::make_preview_operation() const
operation->verifyPreview(previews, m_current_node->getInstanceKey()); operation->verifyPreview(previews, m_current_node->getInstanceKey());
return operation; return operation;
} }
return NULL; return NULL;
} }
@@ -226,7 +226,7 @@ void NodeOperationBuilder::addPreview(NodeOperationOutput *output)
PreviewOperation *operation = make_preview_operation(); PreviewOperation *operation = make_preview_operation();
if (operation) { if (operation) {
addOperation(operation); addOperation(operation);
addLink(output, operation->getInputSocket(0)); addLink(output, operation->getInputSocket(0));
} }
} }
@@ -236,7 +236,7 @@ void NodeOperationBuilder::addNodeInputPreview(NodeInput *input)
PreviewOperation *operation = make_preview_operation(); PreviewOperation *operation = make_preview_operation();
if (operation) { if (operation) {
addOperation(operation); addOperation(operation);
mapInputSocket(input, operation->getInputSocket(0)); mapInputSocket(input, operation->getInputSocket(0));
} }
} }
@@ -247,7 +247,7 @@ void NodeOperationBuilder::registerViewer(ViewerOperation *viewer)
if (m_current_node->isInActiveGroup()) { if (m_current_node->isInActiveGroup()) {
/* deactivate previous viewer */ /* deactivate previous viewer */
m_active_viewer->setActive(false); m_active_viewer->setActive(false);
m_active_viewer = viewer; m_active_viewer = viewer;
viewer->setActive(true); viewer->setActive(true);
} }
@@ -269,13 +269,13 @@ void NodeOperationBuilder::add_datatype_conversions()
Links convert_links; Links convert_links;
for (Links::const_iterator it = m_links.begin(); it != m_links.end(); ++it) { for (Links::const_iterator it = m_links.begin(); it != m_links.end(); ++it) {
const Link &link = *it; const Link &link = *it;
/* proxy operations can skip data type conversion */ /* proxy operations can skip data type conversion */
NodeOperation *from_op = &link.from()->getOperation(); NodeOperation *from_op = &link.from()->getOperation();
NodeOperation *to_op = &link.to()->getOperation(); NodeOperation *to_op = &link.to()->getOperation();
if (!(from_op->useDatatypeConversion() || to_op->useDatatypeConversion())) if (!(from_op->useDatatypeConversion() || to_op->useDatatypeConversion()))
continue; continue;
if (link.from()->getDataType() != link.to()->getDataType()) if (link.from()->getDataType() != link.to()->getDataType())
convert_links.push_back(link); convert_links.push_back(link);
} }
@@ -284,7 +284,7 @@ void NodeOperationBuilder::add_datatype_conversions()
NodeOperation *converter = Converter::convertDataType(link.from(), link.to()); NodeOperation *converter = Converter::convertDataType(link.from(), link.to());
if (converter) { if (converter) {
addOperation(converter); addOperation(converter);
removeInputLink(link.to()); removeInputLink(link.to());
addLink(link.from(), converter->getInputSocket(0)); addLink(link.from(), converter->getInputSocket(0));
addLink(converter->getOutputSocket(0), link.to()); addLink(converter->getOutputSocket(0), link.to());
@@ -322,7 +322,7 @@ void NodeOperationBuilder::add_input_constant_value(NodeOperationInput *input, N
value = node_input->getEditorValueFloat(); value = node_input->getEditorValueFloat();
else else
value = 0.0f; value = 0.0f;
SetValueOperation *op = new SetValueOperation(); SetValueOperation *op = new SetValueOperation();
op->setValue(value); op->setValue(value);
addOperation(op); addOperation(op);
@@ -335,7 +335,7 @@ void NodeOperationBuilder::add_input_constant_value(NodeOperationInput *input, N
node_input->getEditorValueColor(value); node_input->getEditorValueColor(value);
else else
zero_v4(value); zero_v4(value);
SetColorOperation *op = new SetColorOperation(); SetColorOperation *op = new SetColorOperation();
op->setChannels(value); op->setChannels(value);
addOperation(op); addOperation(op);
@@ -348,7 +348,7 @@ void NodeOperationBuilder::add_input_constant_value(NodeOperationInput *input, N
node_input->getEditorValueVector(value); node_input->getEditorValueVector(value);
else else
zero_v3(value); zero_v3(value);
SetVectorOperation *op = new SetVectorOperation(); SetVectorOperation *op = new SetVectorOperation();
op->setVector(value); op->setVector(value);
addOperation(op); addOperation(op);
@@ -370,17 +370,17 @@ void NodeOperationBuilder::resolve_proxies()
proxy_links.push_back(link); proxy_links.push_back(link);
} }
} }
for (Links::const_iterator it = proxy_links.begin(); it != proxy_links.end(); ++it) { for (Links::const_iterator it = proxy_links.begin(); it != proxy_links.end(); ++it) {
const Link &link = *it; const Link &link = *it;
NodeOperationInput *to = link.to(); NodeOperationInput *to = link.to();
NodeOperationOutput *from = link.from(); NodeOperationOutput *from = link.from();
do { do {
/* walk upstream bypassing the proxy operation */ /* walk upstream bypassing the proxy operation */
from = from->getOperation().getInputSocket(0)->getLink(); from = from->getOperation().getInputSocket(0)->getLink();
} while (from && from->getOperation().isProxyOperation()); } while (from && from->getOperation().isProxyOperation());
removeInputLink(to); removeInputLink(to);
/* we may not have a final proxy input link, /* we may not have a final proxy input link,
* in that case it just gets dropped * in that case it just gets dropped
@@ -395,7 +395,7 @@ void NodeOperationBuilder::determineResolutions()
/* determine all resolutions of the operations (Width/Height) */ /* determine all resolutions of the operations (Width/Height) */
for (Operations::const_iterator it = m_operations.begin(); it != m_operations.end(); ++it) { for (Operations::const_iterator it = m_operations.begin(); it != m_operations.end(); ++it) {
NodeOperation *op = *it; NodeOperation *op = *it;
if (op->isOutputOperation(m_context->isRendering()) && !op->isPreviewOperation()) { if (op->isOutputOperation(m_context->isRendering()) && !op->isPreviewOperation()) {
unsigned int resolution[2] = {0, 0}; unsigned int resolution[2] = {0, 0};
unsigned int preferredResolution[2] = {0, 0}; unsigned int preferredResolution[2] = {0, 0};
@@ -403,10 +403,10 @@ void NodeOperationBuilder::determineResolutions()
op->setResolution(resolution); op->setResolution(resolution);
} }
} }
for (Operations::const_iterator it = m_operations.begin(); it != m_operations.end(); ++it) { for (Operations::const_iterator it = m_operations.begin(); it != m_operations.end(); ++it) {
NodeOperation *op = *it; NodeOperation *op = *it;
if (op->isOutputOperation(m_context->isRendering()) && op->isPreviewOperation()) { if (op->isOutputOperation(m_context->isRendering()) && op->isPreviewOperation()) {
unsigned int resolution[2] = {0, 0}; unsigned int resolution[2] = {0, 0};
unsigned int preferredResolution[2] = {0, 0}; unsigned int preferredResolution[2] = {0, 0};
@@ -414,13 +414,13 @@ void NodeOperationBuilder::determineResolutions()
op->setResolution(resolution); op->setResolution(resolution);
} }
} }
/* add convert resolution operations when needed */ /* add convert resolution operations when needed */
{ {
Links convert_links; Links convert_links;
for (Links::const_iterator it = m_links.begin(); it != m_links.end(); ++it) { for (Links::const_iterator it = m_links.begin(); it != m_links.end(); ++it) {
const Link &link = *it; const Link &link = *it;
if (link.to()->getResizeMode() != COM_SC_NO_RESIZE) { if (link.to()->getResizeMode() != COM_SC_NO_RESIZE) {
NodeOperation &from_op = link.from()->getOperation(); NodeOperation &from_op = link.from()->getOperation();
NodeOperation &to_op = link.to()->getOperation(); NodeOperation &to_op = link.to()->getOperation();
@@ -464,35 +464,35 @@ void NodeOperationBuilder::add_input_buffers(NodeOperation * /*operation*/,
{ {
if (!input->isConnected()) if (!input->isConnected())
return; return;
NodeOperationOutput *output = input->getLink(); NodeOperationOutput *output = input->getLink();
if (output->getOperation().isReadBufferOperation()) { if (output->getOperation().isReadBufferOperation()) {
/* input is already buffered, no need to add another */ /* input is already buffered, no need to add another */
return; return;
} }
/* this link will be replaced below */ /* this link will be replaced below */
removeInputLink(input); removeInputLink(input);
/* check of other end already has write operation, otherwise add a new one */ /* check of other end already has write operation, otherwise add a new one */
WriteBufferOperation *writeoperation = find_attached_write_buffer_operation(output); WriteBufferOperation *writeoperation = find_attached_write_buffer_operation(output);
if (!writeoperation) { if (!writeoperation) {
writeoperation = new WriteBufferOperation(output->getDataType()); writeoperation = new WriteBufferOperation(output->getDataType());
writeoperation->setbNodeTree(m_context->getbNodeTree()); writeoperation->setbNodeTree(m_context->getbNodeTree());
addOperation(writeoperation); addOperation(writeoperation);
addLink(output, writeoperation->getInputSocket(0)); addLink(output, writeoperation->getInputSocket(0));
writeoperation->readResolutionFromInputSocket(); writeoperation->readResolutionFromInputSocket();
} }
/* add readbuffer op for the input */ /* add readbuffer op for the input */
ReadBufferOperation *readoperation = new ReadBufferOperation(output->getDataType()); ReadBufferOperation *readoperation = new ReadBufferOperation(output->getDataType());
readoperation->setMemoryProxy(writeoperation->getMemoryProxy()); readoperation->setMemoryProxy(writeoperation->getMemoryProxy());
this->addOperation(readoperation); this->addOperation(readoperation);
addLink(readoperation->getOutputSocket(), input); addLink(readoperation->getOutputSocket(), input);
readoperation->readResolutionFromWriteBuffer(); readoperation->readResolutionFromWriteBuffer();
} }
@@ -502,11 +502,11 @@ void NodeOperationBuilder::add_output_buffers(NodeOperation *operation, NodeOper
OpInputs targets = cache_output_links(output); OpInputs targets = cache_output_links(output);
if (targets.empty()) if (targets.empty())
return; return;
WriteBufferOperation *writeOperation = NULL; WriteBufferOperation *writeOperation = NULL;
for (OpInputs::const_iterator it = targets.begin(); it != targets.end(); ++it) { for (OpInputs::const_iterator it = targets.begin(); it != targets.end(); ++it) {
NodeOperationInput *target = *it; NodeOperationInput *target = *it;
/* try to find existing write buffer operation */ /* try to find existing write buffer operation */
if (target->getOperation().isWriteBufferOperation()) { if (target->getOperation().isWriteBufferOperation()) {
BLI_assert(writeOperation == NULL); /* there should only be one write op connected */ BLI_assert(writeOperation == NULL); /* there should only be one write op connected */
@@ -517,30 +517,30 @@ void NodeOperationBuilder::add_output_buffers(NodeOperation *operation, NodeOper
removeInputLink(target); removeInputLink(target);
} }
} }
/* if no write buffer operation exists yet, create a new one */ /* if no write buffer operation exists yet, create a new one */
if (!writeOperation) { if (!writeOperation) {
writeOperation = new WriteBufferOperation(operation->getOutputSocket()->getDataType()); writeOperation = new WriteBufferOperation(operation->getOutputSocket()->getDataType());
writeOperation->setbNodeTree(m_context->getbNodeTree()); writeOperation->setbNodeTree(m_context->getbNodeTree());
addOperation(writeOperation); addOperation(writeOperation);
addLink(output, writeOperation->getInputSocket(0)); addLink(output, writeOperation->getInputSocket(0));
} }
writeOperation->readResolutionFromInputSocket(); writeOperation->readResolutionFromInputSocket();
/* add readbuffer op for every former connected input */ /* add readbuffer op for every former connected input */
for (OpInputs::const_iterator it = targets.begin(); it != targets.end(); ++it) { for (OpInputs::const_iterator it = targets.begin(); it != targets.end(); ++it) {
NodeOperationInput *target = *it; NodeOperationInput *target = *it;
if (&target->getOperation() == writeOperation) if (&target->getOperation() == writeOperation)
continue; /* skip existing write op links */ continue; /* skip existing write op links */
ReadBufferOperation *readoperation = new ReadBufferOperation(operation->getOutputSocket()->getDataType()); ReadBufferOperation *readoperation = new ReadBufferOperation(operation->getOutputSocket()->getDataType());
readoperation->setMemoryProxy(writeOperation->getMemoryProxy()); readoperation->setMemoryProxy(writeOperation->getMemoryProxy());
addOperation(readoperation); addOperation(readoperation);
addLink(readoperation->getOutputSocket(), target); addLink(readoperation->getOutputSocket(), target);
readoperation->readResolutionFromWriteBuffer(); readoperation->readResolutionFromWriteBuffer();
} }
} }
@@ -554,15 +554,15 @@ void NodeOperationBuilder::add_complex_operation_buffers()
for (Operations::const_iterator it = m_operations.begin(); it != m_operations.end(); ++it) for (Operations::const_iterator it = m_operations.begin(); it != m_operations.end(); ++it)
if ((*it)->isComplex()) if ((*it)->isComplex())
complex_ops.push_back(*it); complex_ops.push_back(*it);
for (Operations::const_iterator it = complex_ops.begin(); it != complex_ops.end(); ++it) { for (Operations::const_iterator it = complex_ops.begin(); it != complex_ops.end(); ++it) {
NodeOperation *op = *it; NodeOperation *op = *it;
DebugInfo::operation_read_write_buffer(op); DebugInfo::operation_read_write_buffer(op);
for (int index = 0; index < op->getNumberOfInputSockets(); index++) for (int index = 0; index < op->getNumberOfInputSockets(); index++)
add_input_buffers(op, op->getInputSocket(index)); add_input_buffers(op, op->getInputSocket(index));
for (int index = 0; index < op->getNumberOfOutputSockets(); index++) for (int index = 0; index < op->getNumberOfOutputSockets(); index++)
add_output_buffers(op, op->getOutputSocket(index)); add_output_buffers(op, op->getOutputSocket(index));
} }
@@ -575,13 +575,13 @@ static void find_reachable_operations_recursive(Tags &reachable, NodeOperation *
if (reachable.find(op) != reachable.end()) if (reachable.find(op) != reachable.end())
return; return;
reachable.insert(op); reachable.insert(op);
for (int i = 0; i < op->getNumberOfInputSockets(); ++i) { for (int i = 0; i < op->getNumberOfInputSockets(); ++i) {
NodeOperationInput *input = op->getInputSocket(i); NodeOperationInput *input = op->getInputSocket(i);
if (input->isConnected()) if (input->isConnected())
find_reachable_operations_recursive(reachable, &input->getLink()->getOperation()); find_reachable_operations_recursive(reachable, &input->getLink()->getOperation());
} }
/* associated write-buffer operations are executed as well */ /* associated write-buffer operations are executed as well */
if (op->isReadBufferOperation()) { if (op->isReadBufferOperation()) {
ReadBufferOperation *read_op = (ReadBufferOperation *)op; ReadBufferOperation *read_op = (ReadBufferOperation *)op;
@@ -595,17 +595,17 @@ void NodeOperationBuilder::prune_operations()
Tags reachable; Tags reachable;
for (Operations::const_iterator it = m_operations.begin(); it != m_operations.end(); ++it) { for (Operations::const_iterator it = m_operations.begin(); it != m_operations.end(); ++it) {
NodeOperation *op = *it; NodeOperation *op = *it;
/* output operations are primary executed operations */ /* output operations are primary executed operations */
if (op->isOutputOperation(m_context->isRendering())) if (op->isOutputOperation(m_context->isRendering()))
find_reachable_operations_recursive(reachable, op); find_reachable_operations_recursive(reachable, op);
} }
/* delete unreachable operations */ /* delete unreachable operations */
Operations reachable_ops; Operations reachable_ops;
for (Operations::const_iterator it = m_operations.begin(); it != m_operations.end(); ++it) { for (Operations::const_iterator it = m_operations.begin(); it != m_operations.end(); ++it) {
NodeOperation *op = *it; NodeOperation *op = *it;
if (reachable.find(op) != reachable.end()) if (reachable.find(op) != reachable.end())
reachable_ops.push_back(op); reachable_ops.push_back(op);
else else
@@ -621,13 +621,13 @@ static void sort_operations_recursive(NodeOperationBuilder::Operations &sorted,
if (visited.find(op) != visited.end()) if (visited.find(op) != visited.end())
return; return;
visited.insert(op); visited.insert(op);
for (int i = 0; i < op->getNumberOfInputSockets(); ++i) { for (int i = 0; i < op->getNumberOfInputSockets(); ++i) {
NodeOperationInput *input = op->getInputSocket(i); NodeOperationInput *input = op->getInputSocket(i);
if (input->isConnected()) if (input->isConnected())
sort_operations_recursive(sorted, visited, &input->getLink()->getOperation()); sort_operations_recursive(sorted, visited, &input->getLink()->getOperation());
} }
sorted.push_back(op); sorted.push_back(op);
} }
@@ -636,10 +636,10 @@ void NodeOperationBuilder::sort_operations()
Operations sorted; Operations sorted;
sorted.reserve(m_operations.size()); sorted.reserve(m_operations.size());
Tags visited; Tags visited;
for (Operations::const_iterator it = m_operations.begin(); it != m_operations.end(); ++it) for (Operations::const_iterator it = m_operations.begin(); it != m_operations.end(); ++it)
sort_operations_recursive(sorted, visited, *it); sort_operations_recursive(sorted, visited, *it);
m_operations = sorted; m_operations = sorted;
} }
@@ -648,10 +648,10 @@ static void add_group_operations_recursive(Tags &visited, NodeOperation *op, Exe
if (visited.find(op) != visited.end()) if (visited.find(op) != visited.end())
return; return;
visited.insert(op); visited.insert(op);
if (!group->addOperation(op)) if (!group->addOperation(op))
return; return;
/* add all eligible input ops to the group */ /* add all eligible input ops to the group */
for (int i = 0; i < op->getNumberOfInputSockets(); ++i) { for (int i = 0; i < op->getNumberOfInputSockets(); ++i) {
NodeOperationInput *input = op->getInputSocket(i); NodeOperationInput *input = op->getInputSocket(i);
@@ -664,10 +664,10 @@ ExecutionGroup *NodeOperationBuilder::make_group(NodeOperation *op)
{ {
ExecutionGroup *group = new ExecutionGroup(); ExecutionGroup *group = new ExecutionGroup();
m_groups.push_back(group); m_groups.push_back(group);
Tags visited; Tags visited;
add_group_operations_recursive(visited, op, group); add_group_operations_recursive(visited, op, group);
return group; return group;
} }
@@ -675,17 +675,17 @@ void NodeOperationBuilder::group_operations()
{ {
for (Operations::const_iterator it = m_operations.begin(); it != m_operations.end(); ++it) { for (Operations::const_iterator it = m_operations.begin(); it != m_operations.end(); ++it) {
NodeOperation *op = *it; NodeOperation *op = *it;
if (op->isOutputOperation(m_context->isRendering())) { if (op->isOutputOperation(m_context->isRendering())) {
ExecutionGroup *group = make_group(op); ExecutionGroup *group = make_group(op);
group->setOutputExecutionGroup(true); group->setOutputExecutionGroup(true);
} }
/* add new groups for associated memory proxies where needed */ /* add new groups for associated memory proxies where needed */
if (op->isReadBufferOperation()) { if (op->isReadBufferOperation()) {
ReadBufferOperation *read_op = (ReadBufferOperation *)op; ReadBufferOperation *read_op = (ReadBufferOperation *)op;
MemoryProxy *memproxy = read_op->getMemoryProxy(); MemoryProxy *memproxy = read_op->getMemoryProxy();
if (memproxy->getExecutor() == NULL) { if (memproxy->getExecutor() == NULL) {
ExecutionGroup *group = make_group(memproxy->getWriteBufferOperation()); ExecutionGroup *group = make_group(memproxy->getWriteBufferOperation());
memproxy->setExecutor(group); memproxy->setExecutor(group);

View File

@@ -52,48 +52,48 @@ public:
private: private:
NodeOperationOutput *m_from; NodeOperationOutput *m_from;
NodeOperationInput *m_to; NodeOperationInput *m_to;
public: public:
Link(NodeOperationOutput *from, NodeOperationInput *to) : Link(NodeOperationOutput *from, NodeOperationInput *to) :
m_from(from), m_from(from),
m_to(to) m_to(to)
{} {}
NodeOperationOutput *from() const { return m_from; } NodeOperationOutput *from() const { return m_from; }
NodeOperationInput *to() const { return m_to; } NodeOperationInput *to() const { return m_to; }
}; };
typedef std::vector<NodeOperation *> Operations; typedef std::vector<NodeOperation *> Operations;
typedef std::vector<Link> Links; typedef std::vector<Link> Links;
typedef std::vector<ExecutionGroup *> Groups; typedef std::vector<ExecutionGroup *> Groups;
typedef std::map<NodeOperationInput *, NodeInput *> InputSocketMap; typedef std::map<NodeOperationInput *, NodeInput *> InputSocketMap;
typedef std::map<NodeOutput *, NodeOperationOutput *> OutputSocketMap; typedef std::map<NodeOutput *, NodeOperationOutput *> OutputSocketMap;
typedef std::vector<NodeOperationInput *> OpInputs; typedef std::vector<NodeOperationInput *> OpInputs;
typedef std::map<NodeInput *, OpInputs> OpInputInverseMap; typedef std::map<NodeInput *, OpInputs> OpInputInverseMap;
private: private:
const CompositorContext *m_context; const CompositorContext *m_context;
NodeGraph m_graph; NodeGraph m_graph;
Operations m_operations; Operations m_operations;
Links m_links; Links m_links;
Groups m_groups; Groups m_groups;
/** Maps operation inputs to node inputs */ /** Maps operation inputs to node inputs */
InputSocketMap m_input_map; InputSocketMap m_input_map;
/** Maps node outputs to operation outputs */ /** Maps node outputs to operation outputs */
OutputSocketMap m_output_map; OutputSocketMap m_output_map;
Node *m_current_node; Node *m_current_node;
/** Operation that will be writing to the viewer image /** Operation that will be writing to the viewer image
* Only one operation can occupy this place at a time, * Only one operation can occupy this place at a time,
* to avoid race conditions * to avoid race conditions
*/ */
ViewerOperation *m_active_viewer; ViewerOperation *m_active_viewer;
public: public:
NodeOperationBuilder(const CompositorContext *context, bNodeTree *b_nodetree); NodeOperationBuilder(const CompositorContext *context, bNodeTree *b_nodetree);
~NodeOperationBuilder(); ~NodeOperationBuilder();
@@ -103,43 +103,43 @@ public:
void convertToOperations(ExecutionSystem *system); void convertToOperations(ExecutionSystem *system);
void addOperation(NodeOperation *operation); void addOperation(NodeOperation *operation);
/** Map input socket of the current node to an operation socket */ /** Map input socket of the current node to an operation socket */
void mapInputSocket(NodeInput *node_socket, NodeOperationInput *operation_socket); void mapInputSocket(NodeInput *node_socket, NodeOperationInput *operation_socket);
/** Map output socket of the current node to an operation socket */ /** Map output socket of the current node to an operation socket */
void mapOutputSocket(NodeOutput *node_socket, NodeOperationOutput *operation_socket); void mapOutputSocket(NodeOutput *node_socket, NodeOperationOutput *operation_socket);
void addLink(NodeOperationOutput *from, NodeOperationInput *to); void addLink(NodeOperationOutput *from, NodeOperationInput *to);
void removeInputLink(NodeOperationInput *to); void removeInputLink(NodeOperationInput *to);
/** Add a preview operation for a operation output */ /** Add a preview operation for a operation output */
void addPreview(NodeOperationOutput *output); void addPreview(NodeOperationOutput *output);
/** Add a preview operation for a node input */ /** Add a preview operation for a node input */
void addNodeInputPreview(NodeInput *input); void addNodeInputPreview(NodeInput *input);
/** Define a viewer operation as the active output, if possible */ /** Define a viewer operation as the active output, if possible */
void registerViewer(ViewerOperation *viewer); void registerViewer(ViewerOperation *viewer);
/** The currently active viewer output operation */ /** The currently active viewer output operation */
ViewerOperation *active_viewer() const { return m_active_viewer; } ViewerOperation *active_viewer() const { return m_active_viewer; }
protected: protected:
static NodeInput *find_node_input(const InputSocketMap &map, NodeOperationInput *op_input); static NodeInput *find_node_input(const InputSocketMap &map, NodeOperationInput *op_input);
static const OpInputs &find_operation_inputs(const OpInputInverseMap &map, NodeInput *node_input); static const OpInputs &find_operation_inputs(const OpInputInverseMap &map, NodeInput *node_input);
static NodeOperationOutput *find_operation_output(const OutputSocketMap &map, NodeOutput *node_output); static NodeOperationOutput *find_operation_output(const OutputSocketMap &map, NodeOutput *node_output);
/** Add datatype conversion where needed */ /** Add datatype conversion where needed */
void add_datatype_conversions(); void add_datatype_conversions();
/** Construct a constant value operation for every unconnected input */ /** Construct a constant value operation for every unconnected input */
void add_operation_input_constants(); void add_operation_input_constants();
void add_input_constant_value(NodeOperationInput *input, NodeInput *node_input); void add_input_constant_value(NodeOperationInput *input, NodeInput *node_input);
/** Replace proxy operations with direct links */ /** Replace proxy operations with direct links */
void resolve_proxies(); void resolve_proxies();
/** Calculate resolution for each operation */ /** Calculate resolution for each operation */
void determineResolutions(); void determineResolutions();
/** Helper function to store connected inputs for replacement */ /** Helper function to store connected inputs for replacement */
OpInputs cache_output_links(NodeOperationOutput *output) const; OpInputs cache_output_links(NodeOperationOutput *output) const;
/** Find a connected write buffer operation to an OpOutput */ /** Find a connected write buffer operation to an OpOutput */
@@ -148,17 +148,17 @@ protected:
void add_complex_operation_buffers(); void add_complex_operation_buffers();
void add_input_buffers(NodeOperation *operation, NodeOperationInput *input); void add_input_buffers(NodeOperation *operation, NodeOperationInput *input);
void add_output_buffers(NodeOperation *operation, NodeOperationOutput *output); void add_output_buffers(NodeOperation *operation, NodeOperationOutput *output);
/** Remove unreachable operations */ /** Remove unreachable operations */
void prune_operations(); void prune_operations();
/** Sort operations by link dependencies */ /** Sort operations by link dependencies */
void sort_operations(); void sort_operations();
/** Create execution groups */ /** Create execution groups */
void group_operations(); void group_operations();
ExecutionGroup *make_group(NodeOperation *op); ExecutionGroup *make_group(NodeOperation *op);
private: private:
PreviewOperation *make_preview_operation() const; PreviewOperation *make_preview_operation() const;

View File

@@ -74,7 +74,7 @@ void OpenCLDevice::execute(WorkPackage *work)
chunkNumber, inputBuffers, outputBuffer); chunkNumber, inputBuffers, outputBuffer);
delete outputBuffer; delete outputBuffer;
executionGroup->finalizeChunkExecution(chunkNumber, inputBuffers); executionGroup->finalizeChunkExecution(chunkNumber, inputBuffers);
} }
cl_mem OpenCLDevice::COM_clAttachMemoryBufferToKernelParameter(cl_kernel kernel, int parameterIndex, int offsetIndex, cl_mem OpenCLDevice::COM_clAttachMemoryBufferToKernelParameter(cl_kernel kernel, int parameterIndex, int offsetIndex,
@@ -106,7 +106,7 @@ cl_mem OpenCLDevice::COM_clAttachMemoryBufferToKernelParameter(cl_kernel kernel,
ReadBufferOperation *reader) ReadBufferOperation *reader)
{ {
cl_int error; cl_int error;
MemoryBuffer *result = reader->getInputMemoryBuffer(inputMemoryBuffers); MemoryBuffer *result = reader->getInputMemoryBuffer(inputMemoryBuffers);
const cl_image_format *imageFormat = determineImageFormat(result); const cl_image_format *imageFormat = determineImageFormat(result);

View File

@@ -42,17 +42,17 @@ private:
* @brief opencl context * @brief opencl context
*/ */
cl_context m_context; cl_context m_context;
/** /**
* @brief opencl device * @brief opencl device
*/ */
cl_device_id m_device; cl_device_id m_device;
/** /**
* @brief opencl program * @brief opencl program
*/ */
cl_program m_program; cl_program m_program;
/** /**
* @brief opencl command queue * @brief opencl command queue
*/ */
@@ -72,8 +72,8 @@ public:
* @param vendorID * @param vendorID
*/ */
OpenCLDevice(cl_context context, cl_device_id device, cl_program program, cl_int vendorId); OpenCLDevice(cl_context context, cl_device_id device, cl_program program, cl_int vendorId);
/** /**
* @brief initialize the device * @brief initialize the device
* During initialization the OpenCL cl_command_queue is created * During initialization the OpenCL cl_command_queue is created
@@ -81,13 +81,13 @@ public:
* @see queue * @see queue
*/ */
bool initialize(); bool initialize();
/** /**
* @brief deinitialize the device * @brief deinitialize the device
* During deintiialization the command queue is cleared * During deintiialization the command queue is cleared
*/ */
void deinitialize(); void deinitialize();
/** /**
* @brief execute a WorkPackage * @brief execute a WorkPackage
* @param work the WorkPackage to execute * @param work the WorkPackage to execute

View File

@@ -49,7 +49,7 @@ void SingleThreadedOperation::deinitExecution()
void *SingleThreadedOperation::initializeTileData(rcti *rect) void *SingleThreadedOperation::initializeTileData(rcti *rect)
{ {
if (this->m_cachedInstance) return this->m_cachedInstance; if (this->m_cachedInstance) return this->m_cachedInstance;
lockMutex(); lockMutex();
if (this->m_cachedInstance == NULL) { if (this->m_cachedInstance == NULL) {
// //

View File

@@ -27,7 +27,7 @@
class SingleThreadedOperation : public NodeOperation { class SingleThreadedOperation : public NodeOperation {
private: private:
MemoryBuffer *m_cachedInstance; MemoryBuffer *m_cachedInstance;
protected: protected:
inline bool isCached() { inline bool isCached() {
return this->m_cachedInstance != NULL; return this->m_cachedInstance != NULL;
@@ -35,17 +35,17 @@ protected:
public: public:
SingleThreadedOperation(); SingleThreadedOperation();
/** /**
* the inner loop of this program * the inner loop of this program
*/ */
void executePixel(float output[4], int x, int y, void *data); void executePixel(float output[4], int x, int y, void *data);
/** /**
* Initialize the execution * Initialize the execution
*/ */
void initExecution(); void initExecution();
/** /**
* Deinitialize the execution * Deinitialize the execution
*/ */
@@ -54,7 +54,7 @@ public:
void *initializeTileData(rcti *rect); void *initializeTileData(rcti *rect);
virtual MemoryBuffer *createMemoryBuffer(rcti *rect) = 0; virtual MemoryBuffer *createMemoryBuffer(rcti *rect) = 0;
int isSingleThreaded() { return true; } int isSingleThreaded() { return true; }
}; };
#endif #endif

View File

@@ -85,7 +85,7 @@ void *WorkScheduler::thread_execute_cpu(void *data)
device->execute(work); device->execute(work);
delete work; delete work;
} }
return NULL; return NULL;
} }
@@ -93,12 +93,12 @@ void *WorkScheduler::thread_execute_gpu(void *data)
{ {
Device *device = (Device *)data; Device *device = (Device *)data;
WorkPackage *work; WorkPackage *work;
while ((work = (WorkPackage *)BLI_thread_queue_pop(g_gpuqueue))) { while ((work = (WorkPackage *)BLI_thread_queue_pop(g_gpuqueue))) {
device->execute(work); device->execute(work);
delete work; delete work;
} }
return NULL; return NULL;
} }
#endif #endif

View File

@@ -53,7 +53,7 @@ class WorkScheduler {
* inside this loop new work is queried and being executed * inside this loop new work is queried and being executed
*/ */
static void *thread_execute_gpu(void *data); static void *thread_execute_gpu(void *data);
#endif #endif
public: public:
/** /**
* @brief schedule a chunk of a group to be calculated. * @brief schedule a chunk of a group to be calculated.

View File

@@ -94,7 +94,7 @@ void COM_execute(RenderData *rd, Scene *scene, bNodeTree *editingtree, int rende
ExecutionSystem *system = new ExecutionSystem(rd, scene, editingtree, rendering, twopass, viewSettings, displaySettings, viewName); ExecutionSystem *system = new ExecutionSystem(rd, scene, editingtree, rendering, twopass, viewSettings, displaySettings, viewName);
system->execute(); system->execute();
delete system; delete system;
if (editingtree->test_break(editingtree->tbh)) { if (editingtree->test_break(editingtree->tbh)) {
// during editing multiple calls to this method can be triggered. // during editing multiple calls to this method can be triggered.
// make sure one the last one will be doing the work. // make sure one the last one will be doing the work.

View File

@@ -35,14 +35,14 @@ void AlphaOverNode::convertToOperations(NodeConverter &converter, const Composit
NodeInput *color1Socket = this->getInputSocket(1); NodeInput *color1Socket = this->getInputSocket(1);
NodeInput *color2Socket = this->getInputSocket(2); NodeInput *color2Socket = this->getInputSocket(2);
bNode *editorNode = this->getbNode(); bNode *editorNode = this->getbNode();
MixBaseOperation *convertProg; MixBaseOperation *convertProg;
NodeTwoFloats *ntf = (NodeTwoFloats *)editorNode->storage; NodeTwoFloats *ntf = (NodeTwoFloats *)editorNode->storage;
if (ntf->x != 0.0f) { if (ntf->x != 0.0f) {
AlphaOverMixedOperation *mixOperation = new AlphaOverMixedOperation(); AlphaOverMixedOperation *mixOperation = new AlphaOverMixedOperation();
mixOperation->setX(ntf->x); mixOperation->setX(ntf->x);
convertProg = mixOperation; convertProg = mixOperation;
} }
else if (editorNode->custom1) { else if (editorNode->custom1) {
convertProg = new AlphaOverKeyOperation(); convertProg = new AlphaOverKeyOperation();
@@ -50,7 +50,7 @@ void AlphaOverNode::convertToOperations(NodeConverter &converter, const Composit
else { else {
convertProg = new AlphaOverPremultiplyOperation(); convertProg = new AlphaOverPremultiplyOperation();
} }
convertProg->setUseValueAlphaMultiply(false); convertProg->setUseValueAlphaMultiply(false);
if (color1Socket->isLinked()) { if (color1Socket->isLinked()) {
convertProg->setResolutionInputSocketIndex(1); convertProg->setResolutionInputSocketIndex(1);
@@ -61,7 +61,7 @@ void AlphaOverNode::convertToOperations(NodeConverter &converter, const Composit
else { else {
convertProg->setResolutionInputSocketIndex(0); convertProg->setResolutionInputSocketIndex(0);
} }
converter.addOperation(convertProg); converter.addOperation(convertProg);
converter.mapInputSocket(getInputSocket(0), convertProg->getInputSocket(0)); converter.mapInputSocket(getInputSocket(0), convertProg->getInputSocket(0));
converter.mapInputSocket(getInputSocket(1), convertProg->getInputSocket(1)); converter.mapInputSocket(getInputSocket(1), convertProg->getInputSocket(1));

View File

@@ -36,7 +36,7 @@ void BilateralBlurNode::convertToOperations(NodeConverter &converter, const Comp
BilateralBlurOperation *operation = new BilateralBlurOperation(); BilateralBlurOperation *operation = new BilateralBlurOperation();
operation->setQuality(context.getQuality()); operation->setQuality(context.getQuality());
operation->setData(data); operation->setData(data);
converter.addOperation(operation); converter.addOperation(operation);
converter.mapInputSocket(getInputSocket(0), operation->getInputSocket(0)); converter.mapInputSocket(getInputSocket(0), operation->getInputSocket(0));
converter.mapInputSocket(getInputSocket(1), operation->getInputSocket(1)); converter.mapInputSocket(getInputSocket(1), operation->getInputSocket(1));

View File

@@ -56,9 +56,9 @@ void BlurNode::convertToOperations(NodeConverter &converter, const CompositorCon
operationfgb->setData(data); operationfgb->setData(data);
operationfgb->setExtendBounds(extend_bounds); operationfgb->setExtendBounds(extend_bounds);
converter.addOperation(operationfgb); converter.addOperation(operationfgb);
converter.mapInputSocket(getInputSocket(1), operationfgb->getInputSocket(1)); converter.mapInputSocket(getInputSocket(1), operationfgb->getInputSocket(1));
input_operation = operationfgb; input_operation = operationfgb;
output_operation = operationfgb; output_operation = operationfgb;
} }
@@ -67,12 +67,12 @@ void BlurNode::convertToOperations(NodeConverter &converter, const CompositorCon
SetValueOperation *zero = new SetValueOperation(); SetValueOperation *zero = new SetValueOperation();
zero->setValue(0.0f); zero->setValue(0.0f);
clamp->setUseClamp(true); clamp->setUseClamp(true);
converter.addOperation(clamp); converter.addOperation(clamp);
converter.addOperation(zero); converter.addOperation(zero);
converter.mapInputSocket(getInputSocket(1), clamp->getInputSocket(0)); converter.mapInputSocket(getInputSocket(1), clamp->getInputSocket(0));
converter.addLink(zero->getOutputSocket(), clamp->getInputSocket(1)); converter.addLink(zero->getOutputSocket(), clamp->getInputSocket(1));
GaussianAlphaXBlurOperation *operationx = new GaussianAlphaXBlurOperation(); GaussianAlphaXBlurOperation *operationx = new GaussianAlphaXBlurOperation();
operationx->setData(data); operationx->setData(data);
operationx->setQuality(quality); operationx->setQuality(quality);
@@ -80,10 +80,10 @@ void BlurNode::convertToOperations(NodeConverter &converter, const CompositorCon
operationx->setFalloff(PROP_SMOOTH); operationx->setFalloff(PROP_SMOOTH);
operationx->setSubtract(false); operationx->setSubtract(false);
operationx->setExtendBounds(extend_bounds); operationx->setExtendBounds(extend_bounds);
converter.addOperation(operationx); converter.addOperation(operationx);
converter.addLink(clamp->getOutputSocket(), operationx->getInputSocket(0)); converter.addLink(clamp->getOutputSocket(), operationx->getInputSocket(0));
GaussianAlphaYBlurOperation *operationy = new GaussianAlphaYBlurOperation(); GaussianAlphaYBlurOperation *operationy = new GaussianAlphaYBlurOperation();
operationy->setData(data); operationy->setData(data);
operationy->setQuality(quality); operationy->setQuality(quality);
@@ -94,7 +94,7 @@ void BlurNode::convertToOperations(NodeConverter &converter, const CompositorCon
converter.addOperation(operationy); converter.addOperation(operationy);
converter.addLink(operationx->getOutputSocket(), operationy->getInputSocket(0)); converter.addLink(operationx->getOutputSocket(), operationy->getInputSocket(0));
GaussianBlurReferenceOperation *operation = new GaussianBlurReferenceOperation(); GaussianBlurReferenceOperation *operation = new GaussianBlurReferenceOperation();
operation->setData(data); operation->setData(data);
operation->setQuality(quality); operation->setQuality(quality);
@@ -102,7 +102,7 @@ void BlurNode::convertToOperations(NodeConverter &converter, const CompositorCon
converter.addOperation(operation); converter.addOperation(operation);
converter.addLink(operationy->getOutputSocket(), operation->getInputSocket(1)); converter.addLink(operationy->getOutputSocket(), operation->getInputSocket(1));
output_operation = operation; output_operation = operation;
input_operation = operation; input_operation = operation;
} }
@@ -115,7 +115,7 @@ void BlurNode::convertToOperations(NodeConverter &converter, const CompositorCon
converter.addOperation(operationx); converter.addOperation(operationx);
converter.mapInputSocket(getInputSocket(1), operationx->getInputSocket(1)); converter.mapInputSocket(getInputSocket(1), operationx->getInputSocket(1));
GaussianYBlurOperation *operationy = new GaussianYBlurOperation(); GaussianYBlurOperation *operationy = new GaussianYBlurOperation();
operationy->setData(data); operationy->setData(data);
operationy->setQuality(quality); operationy->setQuality(quality);
@@ -156,18 +156,18 @@ void BlurNode::convertToOperations(NodeConverter &converter, const CompositorCon
GammaUncorrectOperation *inverse = new GammaUncorrectOperation(); GammaUncorrectOperation *inverse = new GammaUncorrectOperation();
converter.addOperation(correct); converter.addOperation(correct);
converter.addOperation(inverse); converter.addOperation(inverse);
converter.mapInputSocket(getInputSocket(0), correct->getInputSocket(0)); converter.mapInputSocket(getInputSocket(0), correct->getInputSocket(0));
converter.addLink(correct->getOutputSocket(), input_operation->getInputSocket(0)); converter.addLink(correct->getOutputSocket(), input_operation->getInputSocket(0));
converter.addLink(output_operation->getOutputSocket(), inverse->getInputSocket(0)); converter.addLink(output_operation->getOutputSocket(), inverse->getInputSocket(0));
converter.mapOutputSocket(getOutputSocket(), inverse->getOutputSocket()); converter.mapOutputSocket(getOutputSocket(), inverse->getOutputSocket());
converter.addPreview(inverse->getOutputSocket()); converter.addPreview(inverse->getOutputSocket());
} }
else { else {
converter.mapInputSocket(getInputSocket(0), input_operation->getInputSocket(0)); converter.mapInputSocket(getInputSocket(0), input_operation->getInputSocket(0));
converter.mapOutputSocket(getOutputSocket(), output_operation->getOutputSocket()); converter.mapOutputSocket(getOutputSocket(), output_operation->getOutputSocket());
converter.addPreview(output_operation->getOutputSocket()); converter.addPreview(output_operation->getOutputSocket());
} }
} }

View File

@@ -49,7 +49,7 @@ void BokehBlurNode::convertToOperations(NodeConverter &converter, const Composit
operation->setThreshold(0.0f); operation->setThreshold(0.0f);
operation->setMaxBlur(b_node->custom4); operation->setMaxBlur(b_node->custom4);
operation->setDoScaleSize(true); operation->setDoScaleSize(true);
converter.addOperation(operation); converter.addOperation(operation);
converter.mapInputSocket(getInputSocket(0), operation->getInputSocket(0)); converter.mapInputSocket(getInputSocket(0), operation->getInputSocket(0));
converter.mapInputSocket(getInputSocket(1), operation->getInputSocket(1)); converter.mapInputSocket(getInputSocket(1), operation->getInputSocket(1));
@@ -60,7 +60,7 @@ void BokehBlurNode::convertToOperations(NodeConverter &converter, const Composit
BokehBlurOperation *operation = new BokehBlurOperation(); BokehBlurOperation *operation = new BokehBlurOperation();
operation->setQuality(context.getQuality()); operation->setQuality(context.getQuality());
operation->setExtendBounds(extend_bounds); operation->setExtendBounds(extend_bounds);
converter.addOperation(operation); converter.addOperation(operation);
converter.mapInputSocket(getInputSocket(0), operation->getInputSocket(0)); converter.mapInputSocket(getInputSocket(0), operation->getInputSocket(0));
converter.mapInputSocket(getInputSocket(1), operation->getInputSocket(1)); converter.mapInputSocket(getInputSocket(1), operation->getInputSocket(1));

View File

@@ -33,9 +33,9 @@ void BokehImageNode::convertToOperations(NodeConverter &converter, const Composi
{ {
BokehImageOperation *operation = new BokehImageOperation(); BokehImageOperation *operation = new BokehImageOperation();
operation->setData((NodeBokehImage *)this->getbNode()->storage); operation->setData((NodeBokehImage *)this->getbNode()->storage);
converter.addOperation(operation); converter.addOperation(operation);
converter.mapOutputSocket(getOutputSocket(0), operation->getOutputSocket(0)); converter.mapOutputSocket(getOutputSocket(0), operation->getOutputSocket(0));
converter.addPreview(operation->getOutputSocket(0)); converter.addPreview(operation->getOutputSocket(0));
} }

View File

@@ -36,13 +36,13 @@ void BoxMaskNode::convertToOperations(NodeConverter &converter, const Compositor
{ {
NodeInput *inputSocket = this->getInputSocket(0); NodeInput *inputSocket = this->getInputSocket(0);
NodeOutput *outputSocket = this->getOutputSocket(0); NodeOutput *outputSocket = this->getOutputSocket(0);
BoxMaskOperation *operation; BoxMaskOperation *operation;
operation = new BoxMaskOperation(); operation = new BoxMaskOperation();
operation->setData((NodeBoxMask *)this->getbNode()->storage); operation->setData((NodeBoxMask *)this->getbNode()->storage);
operation->setMaskType(this->getbNode()->custom1); operation->setMaskType(this->getbNode()->custom1);
converter.addOperation(operation); converter.addOperation(operation);
if (inputSocket->isLinked()) { if (inputSocket->isLinked()) {
converter.mapInputSocket(inputSocket, operation->getInputSocket(0)); converter.mapInputSocket(inputSocket, operation->getInputSocket(0));
converter.mapOutputSocket(outputSocket, operation->getOutputSocket()); converter.mapOutputSocket(outputSocket, operation->getOutputSocket());

View File

@@ -35,7 +35,7 @@ void BrightnessNode::convertToOperations(NodeConverter &converter, const Composi
BrightnessOperation *operation = new BrightnessOperation(); BrightnessOperation *operation = new BrightnessOperation();
operation->setUsePremultiply((bnode->custom1 & 1) != 0); operation->setUsePremultiply((bnode->custom1 & 1) != 0);
converter.addOperation(operation); converter.addOperation(operation);
converter.mapInputSocket(getInputSocket(0), operation->getInputSocket(0)); converter.mapInputSocket(getInputSocket(0), operation->getInputSocket(0));
converter.mapInputSocket(getInputSocket(1), operation->getInputSocket(1)); converter.mapInputSocket(getInputSocket(1), operation->getInputSocket(1));
converter.mapInputSocket(getInputSocket(2), operation->getInputSocket(2)); converter.mapInputSocket(getInputSocket(2), operation->getInputSocket(2));

View File

@@ -33,35 +33,35 @@ ChromaMatteNode::ChromaMatteNode(bNode *editorNode) : Node(editorNode)
void ChromaMatteNode::convertToOperations(NodeConverter &converter, const CompositorContext &/*context*/) const void ChromaMatteNode::convertToOperations(NodeConverter &converter, const CompositorContext &/*context*/) const
{ {
bNode *editorsnode = getbNode(); bNode *editorsnode = getbNode();
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);
ConvertRGBToYCCOperation *operationRGBToYCC_Image = new ConvertRGBToYCCOperation(); ConvertRGBToYCCOperation *operationRGBToYCC_Image = new ConvertRGBToYCCOperation();
ConvertRGBToYCCOperation *operationRGBToYCC_Key = new ConvertRGBToYCCOperation(); ConvertRGBToYCCOperation *operationRGBToYCC_Key = new ConvertRGBToYCCOperation();
operationRGBToYCC_Image->setMode(BLI_YCC_ITU_BT709); operationRGBToYCC_Image->setMode(BLI_YCC_ITU_BT709);
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(); SetAlphaOperation *operationAlpha = new SetAlphaOperation();
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());
} }

View File

@@ -36,11 +36,11 @@ void ColorBalanceNode::convertToOperations(NodeConverter &converter, const Compo
{ {
bNode *node = this->getbNode(); bNode *node = this->getbNode();
NodeColorBalance *n = (NodeColorBalance *)node->storage; NodeColorBalance *n = (NodeColorBalance *)node->storage;
NodeInput *inputSocket = this->getInputSocket(0); NodeInput *inputSocket = this->getInputSocket(0);
NodeInput *inputImageSocket = this->getInputSocket(1); NodeInput *inputImageSocket = this->getInputSocket(1);
NodeOutput *outputSocket = this->getOutputSocket(0); NodeOutput *outputSocket = this->getOutputSocket(0);
NodeOperation *operation; NodeOperation *operation;
if (node->custom1 == 0) { if (node->custom1 == 0) {
ColorBalanceLGGOperation *operationLGG = new ColorBalanceLGGOperation(); ColorBalanceLGGOperation *operationLGG = new ColorBalanceLGGOperation();
@@ -69,7 +69,7 @@ void ColorBalanceNode::convertToOperations(NodeConverter &converter, const Compo
operation = operationCDL; operation = operationCDL;
} }
converter.addOperation(operation); converter.addOperation(operation);
converter.mapInputSocket(inputSocket, operation->getInputSocket(0)); converter.mapInputSocket(inputSocket, operation->getInputSocket(0));
converter.mapInputSocket(inputImageSocket, operation->getInputSocket(1)); converter.mapInputSocket(inputImageSocket, operation->getInputSocket(1));
converter.mapOutputSocket(outputSocket, operation->getOutputSocket(0)); converter.mapOutputSocket(outputSocket, operation->getOutputSocket(0));

View File

@@ -32,14 +32,14 @@ ColorCorrectionNode::ColorCorrectionNode(bNode *editorNode) : Node(editorNode)
void ColorCorrectionNode::convertToOperations(NodeConverter &converter, const CompositorContext &/*context*/) const void ColorCorrectionNode::convertToOperations(NodeConverter &converter, const CompositorContext &/*context*/) const
{ {
bNode *editorNode = getbNode(); bNode *editorNode = getbNode();
ColorCorrectionOperation *operation = new ColorCorrectionOperation(); ColorCorrectionOperation *operation = new ColorCorrectionOperation();
operation->setData((NodeColorCorrection *)editorNode->storage); operation->setData((NodeColorCorrection *)editorNode->storage);
operation->setRedChannelEnabled((editorNode->custom1 & 1) > 0); operation->setRedChannelEnabled((editorNode->custom1 & 1) > 0);
operation->setGreenChannelEnabled((editorNode->custom1 & 2) > 0); operation->setGreenChannelEnabled((editorNode->custom1 & 2) > 0);
operation->setBlueChannelEnabled((editorNode->custom1 & 4) > 0); operation->setBlueChannelEnabled((editorNode->custom1 & 4) > 0);
converter.addOperation(operation); converter.addOperation(operation);
converter.mapInputSocket(getInputSocket(0), operation->getInputSocket(0)); converter.mapInputSocket(getInputSocket(0), operation->getInputSocket(0));
converter.mapInputSocket(getInputSocket(1), operation->getInputSocket(1)); converter.mapInputSocket(getInputSocket(1), operation->getInputSocket(1));
converter.mapOutputSocket(getOutputSocket(0), operation->getOutputSocket(0)); converter.mapOutputSocket(getOutputSocket(0), operation->getOutputSocket(0));

View File

@@ -35,12 +35,12 @@ void ColorCurveNode::convertToOperations(NodeConverter &converter, const Composi
ColorCurveOperation *operation = new ColorCurveOperation(); ColorCurveOperation *operation = new ColorCurveOperation();
operation->setCurveMapping((CurveMapping *)this->getbNode()->storage); operation->setCurveMapping((CurveMapping *)this->getbNode()->storage);
converter.addOperation(operation); converter.addOperation(operation);
converter.mapInputSocket(getInputSocket(0), operation->getInputSocket(0)); converter.mapInputSocket(getInputSocket(0), operation->getInputSocket(0));
converter.mapInputSocket(getInputSocket(1), operation->getInputSocket(1)); converter.mapInputSocket(getInputSocket(1), operation->getInputSocket(1));
converter.mapInputSocket(getInputSocket(2), operation->getInputSocket(2)); converter.mapInputSocket(getInputSocket(2), operation->getInputSocket(2));
converter.mapInputSocket(getInputSocket(3), operation->getInputSocket(3)); converter.mapInputSocket(getInputSocket(3), operation->getInputSocket(3));
converter.mapOutputSocket(getOutputSocket(0), operation->getOutputSocket()); converter.mapOutputSocket(getOutputSocket(0), operation->getOutputSocket());
} }
else { else {
@@ -52,7 +52,7 @@ void ColorCurveNode::convertToOperations(NodeConverter &converter, const Composi
operation->setWhiteLevel(col); operation->setWhiteLevel(col);
operation->setCurveMapping((CurveMapping *)this->getbNode()->storage); operation->setCurveMapping((CurveMapping *)this->getbNode()->storage);
converter.addOperation(operation); converter.addOperation(operation);
converter.mapInputSocket(getInputSocket(0), operation->getInputSocket(0)); converter.mapInputSocket(getInputSocket(0), operation->getInputSocket(0));
converter.mapInputSocket(getInputSocket(1), operation->getInputSocket(1)); converter.mapInputSocket(getInputSocket(1), operation->getInputSocket(1));
converter.mapOutputSocket(getOutputSocket(0), operation->getOutputSocket()); converter.mapOutputSocket(getOutputSocket(0), operation->getOutputSocket());

View File

@@ -33,33 +33,33 @@ ColorMatteNode::ColorMatteNode(bNode *editorNode) : Node(editorNode)
void ColorMatteNode::convertToOperations(NodeConverter &converter, const CompositorContext &/*context*/) const void ColorMatteNode::convertToOperations(NodeConverter &converter, const CompositorContext &/*context*/) const
{ {
bNode *editorsnode = getbNode(); bNode *editorsnode = getbNode();
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);
ConvertRGBToHSVOperation *operationRGBToHSV_Image = new ConvertRGBToHSVOperation(); ConvertRGBToHSVOperation *operationRGBToHSV_Image = new ConvertRGBToHSVOperation();
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(); SetAlphaOperation *operationAlpha = new SetAlphaOperation();
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());
} }

View File

@@ -37,6 +37,6 @@ void ColorNode::convertToOperations(NodeConverter &converter, const CompositorCo
output->getEditorValueColor(col); output->getEditorValueColor(col);
operation->setChannels(col); operation->setChannels(col);
converter.addOperation(operation); converter.addOperation(operation);
converter.mapOutputSocket(output, operation->getOutputSocket()); converter.mapOutputSocket(output, operation->getOutputSocket());
} }

View File

@@ -42,14 +42,14 @@ void ColorRampNode::convertToOperations(NodeConverter &converter, const Composit
ColorRampOperation *operation = new ColorRampOperation(); ColorRampOperation *operation = new ColorRampOperation();
operation->setColorBand((ColorBand *)editorNode->storage); operation->setColorBand((ColorBand *)editorNode->storage);
converter.addOperation(operation); converter.addOperation(operation);
converter.mapInputSocket(inputSocket, operation->getInputSocket(0)); converter.mapInputSocket(inputSocket, operation->getInputSocket(0));
converter.mapOutputSocket(outputSocket, operation->getOutputSocket(0)); converter.mapOutputSocket(outputSocket, operation->getOutputSocket(0));
SeparateChannelOperation *operation2 = new SeparateChannelOperation(); SeparateChannelOperation *operation2 = new SeparateChannelOperation();
operation2->setChannel(3); operation2->setChannel(3);
converter.addOperation(operation2); converter.addOperation(operation2);
converter.addLink(operation->getOutputSocket(), operation2->getInputSocket(0)); converter.addLink(operation->getOutputSocket(), operation2->getInputSocket(0));
converter.mapOutputSocket(outputSocketAlpha, operation2->getOutputSocket()); converter.mapOutputSocket(outputSocketAlpha, operation2->getOutputSocket());
} }

View File

@@ -32,18 +32,18 @@ ColorSpillNode::ColorSpillNode(bNode *editorNode) : Node(editorNode)
void ColorSpillNode::convertToOperations(NodeConverter &converter, const CompositorContext &/*context*/) const void ColorSpillNode::convertToOperations(NodeConverter &converter, const CompositorContext &/*context*/) const
{ {
bNode *editorsnode = getbNode(); bNode *editorsnode = getbNode();
NodeInput *inputSocketImage = this->getInputSocket(0); NodeInput *inputSocketImage = this->getInputSocket(0);
NodeInput *inputSocketFac = this->getInputSocket(1); NodeInput *inputSocketFac = this->getInputSocket(1);
NodeOutput *outputSocketImage = this->getOutputSocket(0); NodeOutput *outputSocketImage = this->getOutputSocket(0);
ColorSpillOperation *operation; ColorSpillOperation *operation;
operation = new ColorSpillOperation(); operation = new ColorSpillOperation();
operation->setSettings((NodeColorspill *)editorsnode->storage); operation->setSettings((NodeColorspill *)editorsnode->storage);
operation->setSpillChannel(editorsnode->custom1 - 1); // Channel for spilling operation->setSpillChannel(editorsnode->custom1 - 1); // Channel for spilling
operation->setSpillMethod(editorsnode->custom2); // Channel method operation->setSpillMethod(editorsnode->custom2); // Channel method
converter.addOperation(operation); converter.addOperation(operation);
converter.mapInputSocket(inputSocketImage, operation->getInputSocket(0)); converter.mapInputSocket(inputSocketImage, operation->getInputSocket(0));
converter.mapInputSocket(inputSocketFac, operation->getInputSocket(1)); converter.mapInputSocket(inputSocketFac, operation->getInputSocket(1));
converter.mapOutputSocket(outputSocketImage, operation->getOutputSocket()); converter.mapOutputSocket(outputSocketImage, operation->getOutputSocket());

View File

@@ -34,10 +34,10 @@ void ColorToBWNode::convertToOperations(NodeConverter &converter, const Composit
{ {
NodeInput *colorSocket = this->getInputSocket(0); NodeInput *colorSocket = this->getInputSocket(0);
NodeOutput *valueSocket = this->getOutputSocket(0); NodeOutput *valueSocket = this->getOutputSocket(0);
ConvertColorToBWOperation *convertProg = new ConvertColorToBWOperation(); ConvertColorToBWOperation *convertProg = new ConvertColorToBWOperation();
converter.addOperation(convertProg); converter.addOperation(convertProg);
converter.mapInputSocket(colorSocket, convertProg->getInputSocket(0)); converter.mapInputSocket(colorSocket, convertProg->getInputSocket(0));
converter.mapOutputSocket(valueSocket, convertProg->getOutputSocket(0)); converter.mapOutputSocket(valueSocket, convertProg->getOutputSocket(0));
} }

View File

@@ -38,7 +38,7 @@ void CombineColorNode::convertToOperations(NodeConverter &converter, const Compo
NodeInput *inputBSocket = this->getInputSocket(2); NodeInput *inputBSocket = this->getInputSocket(2);
NodeInput *inputASocket = this->getInputSocket(3); NodeInput *inputASocket = this->getInputSocket(3);
NodeOutput *outputSocket = this->getOutputSocket(0); NodeOutput *outputSocket = this->getOutputSocket(0);
CombineChannelsOperation *operation = new CombineChannelsOperation(); CombineChannelsOperation *operation = new CombineChannelsOperation();
if (inputRSocket->isLinked()) { if (inputRSocket->isLinked()) {
operation->setResolutionInputSocketIndex(0); operation->setResolutionInputSocketIndex(0);
@@ -53,16 +53,16 @@ void CombineColorNode::convertToOperations(NodeConverter &converter, const Compo
operation->setResolutionInputSocketIndex(3); operation->setResolutionInputSocketIndex(3);
} }
converter.addOperation(operation); converter.addOperation(operation);
converter.mapInputSocket(inputRSocket, operation->getInputSocket(0)); converter.mapInputSocket(inputRSocket, operation->getInputSocket(0));
converter.mapInputSocket(inputGSocket, operation->getInputSocket(1)); converter.mapInputSocket(inputGSocket, operation->getInputSocket(1));
converter.mapInputSocket(inputBSocket, operation->getInputSocket(2)); converter.mapInputSocket(inputBSocket, operation->getInputSocket(2));
converter.mapInputSocket(inputASocket, operation->getInputSocket(3)); converter.mapInputSocket(inputASocket, operation->getInputSocket(3));
NodeOperation *color_conv = getColorConverter(context); NodeOperation *color_conv = getColorConverter(context);
if (color_conv) { if (color_conv) {
converter.addOperation(color_conv); converter.addOperation(color_conv);
converter.addLink(operation->getOutputSocket(), color_conv->getInputSocket(0)); converter.addLink(operation->getOutputSocket(), color_conv->getInputSocket(0));
converter.mapOutputSocket(outputSocket, color_conv->getOutputSocket()); converter.mapOutputSocket(outputSocket, color_conv->getOutputSocket());
} }

View File

@@ -30,7 +30,7 @@ class CombineColorNode : public Node {
public: public:
CombineColorNode(bNode *editorNode); CombineColorNode(bNode *editorNode);
void convertToOperations(NodeConverter &converter, const CompositorContext &context) const; void convertToOperations(NodeConverter &converter, const CompositorContext &context) const;
protected: protected:
virtual NodeOperation *getColorConverter(const CompositorContext &context) const = 0; virtual NodeOperation *getColorConverter(const CompositorContext &context) const = 0;
}; };
@@ -40,7 +40,7 @@ public:
CombineRGBANode(bNode *editorNode) : CombineRGBANode(bNode *editorNode) :
CombineColorNode(editorNode) CombineColorNode(editorNode)
{} {}
NodeOperation *getColorConverter(const CompositorContext &context) const; NodeOperation *getColorConverter(const CompositorContext &context) const;
}; };
@@ -49,7 +49,7 @@ public:
CombineHSVANode(bNode *editorNode) : CombineHSVANode(bNode *editorNode) :
CombineColorNode(editorNode) CombineColorNode(editorNode)
{} {}
NodeOperation *getColorConverter(const CompositorContext &context) const; NodeOperation *getColorConverter(const CompositorContext &context) const;
}; };
@@ -58,7 +58,7 @@ public:
CombineYCCANode(bNode *editorNode) : CombineYCCANode(bNode *editorNode) :
CombineColorNode(editorNode) CombineColorNode(editorNode)
{} {}
NodeOperation *getColorConverter(const CompositorContext &context) const; NodeOperation *getColorConverter(const CompositorContext &context) const;
}; };
@@ -67,7 +67,7 @@ public:
CombineYUVANode(bNode *editorNode) : CombineYUVANode(bNode *editorNode) :
CombineColorNode(editorNode) CombineColorNode(editorNode)
{} {}
NodeOperation *getColorConverter(const CompositorContext &context) const; NodeOperation *getColorConverter(const CompositorContext &context) const;
}; };

View File

@@ -49,7 +49,7 @@ void CompositorNode::convertToOperations(NodeConverter &converter, const Composi
/* alpha socket gives either 1 or a custom alpha value if "use alpha" is enabled */ /* alpha socket gives either 1 or a custom alpha value if "use alpha" is enabled */
compositorOperation->setUseAlphaInput(ignore_alpha || alphaSocket->isLinked()); compositorOperation->setUseAlphaInput(ignore_alpha || alphaSocket->isLinked());
compositorOperation->setActive(is_active); compositorOperation->setActive(is_active);
converter.addOperation(compositorOperation); converter.addOperation(compositorOperation);
converter.mapInputSocket(imageSocket, compositorOperation->getInputSocket(0)); converter.mapInputSocket(imageSocket, compositorOperation->getInputSocket(0));
/* only use alpha link if "use alpha" is enabled */ /* only use alpha link if "use alpha" is enabled */
@@ -58,6 +58,6 @@ void CompositorNode::convertToOperations(NodeConverter &converter, const Composi
else else
converter.mapInputSocket(alphaSocket, compositorOperation->getInputSocket(1)); converter.mapInputSocket(alphaSocket, compositorOperation->getInputSocket(1));
converter.mapInputSocket(depthSocket, compositorOperation->getInputSocket(2)); converter.mapInputSocket(depthSocket, compositorOperation->getInputSocket(2));
converter.addNodeInputPreview(imageSocket); converter.addNodeInputPreview(imageSocket);
} }

View File

@@ -35,9 +35,9 @@ void ConvertAlphaNode::convertToOperations(NodeConverter &converter, const Compo
else { else {
operation = new ConvertStraightToPremulOperation(); operation = new ConvertStraightToPremulOperation();
} }
converter.addOperation(operation); converter.addOperation(operation);
converter.mapInputSocket(getInputSocket(0), operation->getInputSocket(0)); converter.mapInputSocket(getInputSocket(0), operation->getInputSocket(0));
converter.mapOutputSocket(getOutputSocket(0), operation->getOutputSocket()); converter.mapOutputSocket(getOutputSocket(0), operation->getOutputSocket());
} }

View File

@@ -46,7 +46,7 @@ void CornerPinNode::convertToOperations(NodeConverter &converter, const Composit
converter.addOperation(warp_image_operation); converter.addOperation(warp_image_operation);
PlaneCornerPinMaskOperation *plane_mask_operation = new PlaneCornerPinMaskOperation(); PlaneCornerPinMaskOperation *plane_mask_operation = new PlaneCornerPinMaskOperation();
converter.addOperation(plane_mask_operation); converter.addOperation(plane_mask_operation);
converter.mapInputSocket(input_image, warp_image_operation->getInputSocket(0)); converter.mapInputSocket(input_image, warp_image_operation->getInputSocket(0));
for (int i = 0; i < 4; ++i) { for (int i = 0; i < 4; ++i) {
NodeInput *corner_input = getInputSocket(node_corner_index[i]); NodeInput *corner_input = getInputSocket(node_corner_index[i]);

View File

@@ -45,7 +45,7 @@ void CropNode::convertToOperations(NodeConverter &converter, const CompositorCon
operation->setCropSettings(cropSettings); operation->setCropSettings(cropSettings);
operation->setRelative(relative); operation->setRelative(relative);
converter.addOperation(operation); converter.addOperation(operation);
converter.mapInputSocket(getInputSocket(0), operation->getInputSocket(0)); converter.mapInputSocket(getInputSocket(0), operation->getInputSocket(0));
converter.mapOutputSocket(getOutputSocket(), operation->getOutputSocket()); converter.mapOutputSocket(getOutputSocket(), operation->getOutputSocket());
} }

View File

@@ -54,17 +54,17 @@ void DefocusNode::convertToOperations(NodeConverter &converter, const Compositor
SetValueOperation *maxRadius = new SetValueOperation(); SetValueOperation *maxRadius = new SetValueOperation();
maxRadius->setValue(data->maxblur); maxRadius->setValue(data->maxblur);
MathMinimumOperation *minimize = new MathMinimumOperation(); MathMinimumOperation *minimize = new MathMinimumOperation();
converter.addOperation(multiply); converter.addOperation(multiply);
converter.addOperation(multiplier); converter.addOperation(multiplier);
converter.addOperation(maxRadius); converter.addOperation(maxRadius);
converter.addOperation(minimize); converter.addOperation(minimize);
converter.mapInputSocket(getInputSocket(1), multiply->getInputSocket(0)); converter.mapInputSocket(getInputSocket(1), multiply->getInputSocket(0));
converter.addLink(multiplier->getOutputSocket(), multiply->getInputSocket(1)); converter.addLink(multiplier->getOutputSocket(), multiply->getInputSocket(1));
converter.addLink(multiply->getOutputSocket(), minimize->getInputSocket(0)); converter.addLink(multiply->getOutputSocket(), minimize->getInputSocket(0));
converter.addLink(maxRadius->getOutputSocket(), minimize->getInputSocket(1)); converter.addLink(maxRadius->getOutputSocket(), minimize->getInputSocket(1));
radiusOperation = minimize; radiusOperation = minimize;
} }
else { else {
@@ -73,20 +73,20 @@ void DefocusNode::convertToOperations(NodeConverter &converter, const Compositor
radius_op->setfStop(data->fstop); radius_op->setfStop(data->fstop);
radius_op->setMaxRadius(data->maxblur); radius_op->setMaxRadius(data->maxblur);
converter.addOperation(radius_op); converter.addOperation(radius_op);
converter.mapInputSocket(getInputSocket(1), radius_op->getInputSocket(0)); converter.mapInputSocket(getInputSocket(1), radius_op->getInputSocket(0));
FastGaussianBlurValueOperation *blur = new FastGaussianBlurValueOperation(); FastGaussianBlurValueOperation *blur = new FastGaussianBlurValueOperation();
/* maintain close pixels so far Z values don't bleed into the foreground */ /* maintain close pixels so far Z values don't bleed into the foreground */
blur->setOverlay(FAST_GAUSS_OVERLAY_MIN); blur->setOverlay(FAST_GAUSS_OVERLAY_MIN);
converter.addOperation(blur); converter.addOperation(blur);
converter.addLink(radius_op->getOutputSocket(0), blur->getInputSocket(0)); converter.addLink(radius_op->getOutputSocket(0), blur->getInputSocket(0));
radius_op->setPostBlur(blur); radius_op->setPostBlur(blur);
radiusOperation = blur; radiusOperation = blur;
} }
NodeBokehImage *bokehdata = new NodeBokehImage(); NodeBokehImage *bokehdata = new NodeBokehImage();
bokehdata->angle = data->rotation; bokehdata->angle = data->rotation;
bokehdata->rounding = 0.0f; bokehdata->rounding = 0.0f;
@@ -97,20 +97,20 @@ void DefocusNode::convertToOperations(NodeConverter &converter, const Compositor
} }
bokehdata->catadioptric = 0.0f; bokehdata->catadioptric = 0.0f;
bokehdata->lensshift = 0.0f; bokehdata->lensshift = 0.0f;
BokehImageOperation *bokeh = new BokehImageOperation(); BokehImageOperation *bokeh = new BokehImageOperation();
bokeh->setData(bokehdata); bokeh->setData(bokehdata);
bokeh->deleteDataOnFinish(); bokeh->deleteDataOnFinish();
converter.addOperation(bokeh); converter.addOperation(bokeh);
#ifdef COM_DEFOCUS_SEARCH #ifdef COM_DEFOCUS_SEARCH
InverseSearchRadiusOperation *search = new InverseSearchRadiusOperation(); InverseSearchRadiusOperation *search = new InverseSearchRadiusOperation();
search->setMaxBlur(data->maxblur); search->setMaxBlur(data->maxblur);
converter.addOperation(search); converter.addOperation(search);
converter.addLink(radiusOperation->getOutputSocket(0), search->getInputSocket(0)); converter.addLink(radiusOperation->getOutputSocket(0), search->getInputSocket(0));
#endif #endif
VariableSizeBokehBlurOperation *operation = new VariableSizeBokehBlurOperation(); VariableSizeBokehBlurOperation *operation = new VariableSizeBokehBlurOperation();
if (data->preview) if (data->preview)
operation->setQuality(COM_QUALITY_LOW); operation->setQuality(COM_QUALITY_LOW);
@@ -119,19 +119,19 @@ void DefocusNode::convertToOperations(NodeConverter &converter, const Compositor
operation->setMaxBlur(data->maxblur); operation->setMaxBlur(data->maxblur);
operation->setThreshold(data->bthresh); operation->setThreshold(data->bthresh);
converter.addOperation(operation); converter.addOperation(operation);
converter.addLink(bokeh->getOutputSocket(), operation->getInputSocket(1)); converter.addLink(bokeh->getOutputSocket(), operation->getInputSocket(1));
converter.addLink(radiusOperation->getOutputSocket(), operation->getInputSocket(2)); converter.addLink(radiusOperation->getOutputSocket(), operation->getInputSocket(2));
#ifdef COM_DEFOCUS_SEARCH #ifdef COM_DEFOCUS_SEARCH
converter.addLink(search->getOutputSocket(), operation->getInputSocket(3)); converter.addLink(search->getOutputSocket(), operation->getInputSocket(3));
#endif #endif
if (data->gamco) { if (data->gamco) {
GammaCorrectOperation *correct = new GammaCorrectOperation(); GammaCorrectOperation *correct = new GammaCorrectOperation();
converter.addOperation(correct); converter.addOperation(correct);
GammaUncorrectOperation *inverse = new GammaUncorrectOperation(); GammaUncorrectOperation *inverse = new GammaUncorrectOperation();
converter.addOperation(inverse); converter.addOperation(inverse);
converter.mapInputSocket(getInputSocket(0), correct->getInputSocket(0)); converter.mapInputSocket(getInputSocket(0), correct->getInputSocket(0));
converter.addLink(correct->getOutputSocket(), operation->getInputSocket(0)); converter.addLink(correct->getOutputSocket(), operation->getInputSocket(0));
converter.addLink(operation->getOutputSocket(), inverse->getInputSocket(0)); converter.addLink(operation->getOutputSocket(), inverse->getInputSocket(0));

View File

@@ -35,15 +35,15 @@ void DespeckleNode::convertToOperations(NodeConverter &converter, const Composit
NodeInput *inputSocket = this->getInputSocket(0); NodeInput *inputSocket = this->getInputSocket(0);
NodeInput *inputImageSocket = this->getInputSocket(1); NodeInput *inputImageSocket = this->getInputSocket(1);
NodeOutput *outputSocket = this->getOutputSocket(0); NodeOutput *outputSocket = this->getOutputSocket(0);
DespeckleOperation *operation = new DespeckleOperation(); DespeckleOperation *operation = new DespeckleOperation();
operation->setThreshold(editorNode->custom3); operation->setThreshold(editorNode->custom3);
operation->setThresholdNeighbor(editorNode->custom4); operation->setThresholdNeighbor(editorNode->custom4);
converter.addOperation(operation); converter.addOperation(operation);
converter.mapInputSocket(inputImageSocket, operation->getInputSocket(0)); converter.mapInputSocket(inputImageSocket, operation->getInputSocket(0));
converter.mapInputSocket(inputSocket, operation->getInputSocket(1)); converter.mapInputSocket(inputSocket, operation->getInputSocket(1));
converter.mapOutputSocket(outputSocket, operation->getOutputSocket()); converter.mapOutputSocket(outputSocket, operation->getOutputSocket());
converter.addPreview(operation->getOutputSocket(0)); converter.addPreview(operation->getOutputSocket(0));
} }

View File

@@ -41,17 +41,17 @@ void DifferenceMatteNode::convertToOperations(NodeConverter &converter, const Co
DifferenceMatteOperation *operationSet = new DifferenceMatteOperation(); DifferenceMatteOperation *operationSet = new DifferenceMatteOperation();
operationSet->setSettings((NodeChroma *)editorNode->storage); operationSet->setSettings((NodeChroma *)editorNode->storage);
converter.addOperation(operationSet); converter.addOperation(operationSet);
converter.mapInputSocket(inputSocket, operationSet->getInputSocket(0)); converter.mapInputSocket(inputSocket, operationSet->getInputSocket(0));
converter.mapInputSocket(inputSocket2, operationSet->getInputSocket(1)); converter.mapInputSocket(inputSocket2, operationSet->getInputSocket(1));
converter.mapOutputSocket(outputSocketMatte, operationSet->getOutputSocket(0)); converter.mapOutputSocket(outputSocketMatte, operationSet->getOutputSocket(0));
SetAlphaOperation *operation = new SetAlphaOperation(); SetAlphaOperation *operation = new SetAlphaOperation();
converter.addOperation(operation); converter.addOperation(operation);
converter.mapInputSocket(inputSocket, operation->getInputSocket(0)); converter.mapInputSocket(inputSocket, operation->getInputSocket(0));
converter.addLink(operationSet->getOutputSocket(), operation->getInputSocket(1)); converter.addLink(operationSet->getOutputSocket(), operation->getInputSocket(1));
converter.mapOutputSocket(outputSocketImage, operation->getOutputSocket()); converter.mapOutputSocket(outputSocketImage, operation->getOutputSocket());
converter.addPreview(operation->getOutputSocket()); converter.addPreview(operation->getOutputSocket());
} }

View File

@@ -45,20 +45,20 @@ DilateErodeNode::DilateErodeNode(bNode *editorNode) : Node(editorNode)
void DilateErodeNode::convertToOperations(NodeConverter &converter, const CompositorContext &context) const void DilateErodeNode::convertToOperations(NodeConverter &converter, const CompositorContext &context) const
{ {
bNode *editorNode = this->getbNode(); bNode *editorNode = this->getbNode();
if (editorNode->custom1 == CMP_NODE_DILATEERODE_DISTANCE_THRESH) { if (editorNode->custom1 == CMP_NODE_DILATEERODE_DISTANCE_THRESH) {
DilateErodeThresholdOperation *operation = new DilateErodeThresholdOperation(); DilateErodeThresholdOperation *operation = new DilateErodeThresholdOperation();
operation->setDistance(editorNode->custom2); operation->setDistance(editorNode->custom2);
operation->setInset(editorNode->custom3); operation->setInset(editorNode->custom3);
converter.addOperation(operation); converter.addOperation(operation);
converter.mapInputSocket(getInputSocket(0), operation->getInputSocket(0)); converter.mapInputSocket(getInputSocket(0), operation->getInputSocket(0));
if (editorNode->custom3 < 2.0f) { if (editorNode->custom3 < 2.0f) {
AntiAliasOperation *antiAlias = new AntiAliasOperation(); AntiAliasOperation *antiAlias = new AntiAliasOperation();
converter.addOperation(antiAlias); converter.addOperation(antiAlias);
converter.addLink(operation->getOutputSocket(), antiAlias->getInputSocket(0)); converter.addLink(operation->getOutputSocket(), antiAlias->getInputSocket(0));
converter.mapOutputSocket(getOutputSocket(0), antiAlias->getOutputSocket(0)); converter.mapOutputSocket(getOutputSocket(0), antiAlias->getOutputSocket(0));
} }
@@ -71,7 +71,7 @@ void DilateErodeNode::convertToOperations(NodeConverter &converter, const Compos
DilateDistanceOperation *operation = new DilateDistanceOperation(); DilateDistanceOperation *operation = new DilateDistanceOperation();
operation->setDistance(editorNode->custom2); operation->setDistance(editorNode->custom2);
converter.addOperation(operation); converter.addOperation(operation);
converter.mapInputSocket(getInputSocket(0), operation->getInputSocket(0)); converter.mapInputSocket(getInputSocket(0), operation->getInputSocket(0));
converter.mapOutputSocket(getOutputSocket(0), operation->getOutputSocket(0)); converter.mapOutputSocket(getOutputSocket(0), operation->getOutputSocket(0));
} }
@@ -79,7 +79,7 @@ void DilateErodeNode::convertToOperations(NodeConverter &converter, const Compos
ErodeDistanceOperation *operation = new ErodeDistanceOperation(); ErodeDistanceOperation *operation = new ErodeDistanceOperation();
operation->setDistance(-editorNode->custom2); operation->setDistance(-editorNode->custom2);
converter.addOperation(operation); converter.addOperation(operation);
converter.mapInputSocket(getInputSocket(0), operation->getInputSocket(0)); converter.mapInputSocket(getInputSocket(0), operation->getInputSocket(0));
converter.mapOutputSocket(getOutputSocket(0), operation->getOutputSocket(0)); converter.mapOutputSocket(getOutputSocket(0), operation->getOutputSocket(0));
} }
@@ -93,20 +93,20 @@ void DilateErodeNode::convertToOperations(NodeConverter &converter, const Compos
operationx->setQuality(quality); operationx->setQuality(quality);
operationx->setFalloff(PROP_SMOOTH); operationx->setFalloff(PROP_SMOOTH);
converter.addOperation(operationx); converter.addOperation(operationx);
converter.mapInputSocket(getInputSocket(0), operationx->getInputSocket(0)); converter.mapInputSocket(getInputSocket(0), operationx->getInputSocket(0));
// converter.mapInputSocket(getInputSocket(1), operationx->getInputSocket(1)); // no size input yet // converter.mapInputSocket(getInputSocket(1), operationx->getInputSocket(1)); // no size input yet
GaussianAlphaYBlurOperation *operationy = new GaussianAlphaYBlurOperation(); GaussianAlphaYBlurOperation *operationy = new GaussianAlphaYBlurOperation();
operationy->setData(&m_alpha_blur); operationy->setData(&m_alpha_blur);
operationy->setQuality(quality); operationy->setQuality(quality);
operationy->setFalloff(PROP_SMOOTH); operationy->setFalloff(PROP_SMOOTH);
converter.addOperation(operationy); converter.addOperation(operationy);
converter.addLink(operationx->getOutputSocket(), operationy->getInputSocket(0)); converter.addLink(operationx->getOutputSocket(), operationy->getInputSocket(0));
// converter.mapInputSocket(getInputSocket(1), operationy->getInputSocket(1)); // no size input yet // converter.mapInputSocket(getInputSocket(1), operationy->getInputSocket(1)); // no size input yet
converter.mapOutputSocket(getOutputSocket(0), operationy->getOutputSocket()); converter.mapOutputSocket(getOutputSocket(0), operationy->getOutputSocket());
converter.addPreview(operationy->getOutputSocket()); converter.addPreview(operationy->getOutputSocket());
/* TODO? */ /* TODO? */
@@ -134,7 +134,7 @@ void DilateErodeNode::convertToOperations(NodeConverter &converter, const Compos
DilateStepOperation *operation = new DilateStepOperation(); DilateStepOperation *operation = new DilateStepOperation();
operation->setIterations(editorNode->custom2); operation->setIterations(editorNode->custom2);
converter.addOperation(operation); converter.addOperation(operation);
converter.mapInputSocket(getInputSocket(0), operation->getInputSocket(0)); converter.mapInputSocket(getInputSocket(0), operation->getInputSocket(0));
converter.mapOutputSocket(getOutputSocket(0), operation->getOutputSocket(0)); converter.mapOutputSocket(getOutputSocket(0), operation->getOutputSocket(0));
} }
@@ -142,7 +142,7 @@ void DilateErodeNode::convertToOperations(NodeConverter &converter, const Compos
ErodeStepOperation *operation = new ErodeStepOperation(); ErodeStepOperation *operation = new ErodeStepOperation();
operation->setIterations(-editorNode->custom2); operation->setIterations(-editorNode->custom2);
converter.addOperation(operation); converter.addOperation(operation);
converter.mapInputSocket(getInputSocket(0), operation->getInputSocket(0)); converter.mapInputSocket(getInputSocket(0), operation->getInputSocket(0));
converter.mapOutputSocket(getOutputSocket(0), operation->getOutputSocket(0)); converter.mapOutputSocket(getOutputSocket(0), operation->getOutputSocket(0));
} }

View File

@@ -37,7 +37,7 @@ void DirectionalBlurNode::convertToOperations(NodeConverter &converter, const Co
operation->setQuality(context.getQuality()); operation->setQuality(context.getQuality());
operation->setData(data); operation->setData(data);
converter.addOperation(operation); converter.addOperation(operation);
converter.mapInputSocket(getInputSocket(0), operation->getInputSocket(0)); converter.mapInputSocket(getInputSocket(0), operation->getInputSocket(0));
converter.mapOutputSocket(getOutputSocket(0), operation->getOutputSocket()); converter.mapOutputSocket(getOutputSocket(0), operation->getOutputSocket());
} }

View File

@@ -35,27 +35,27 @@ void DistanceMatteNode::convertToOperations(NodeConverter &converter, const Comp
{ {
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(); SetAlphaOperation *operationAlpha = new SetAlphaOperation();
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);
converter.mapInputSocket(inputSocketImage, matte->getInputSocket(0)); converter.mapInputSocket(inputSocketImage, matte->getInputSocket(0));
converter.mapInputSocket(inputSocketImage, operationAlpha->getInputSocket(0)); converter.mapInputSocket(inputSocketImage, operationAlpha->getInputSocket(0));
converter.mapInputSocket(inputSocketKey, matte->getInputSocket(1)); converter.mapInputSocket(inputSocketKey, matte->getInputSocket(1));
operation = matte; operation = matte;
} }
/* work in YCbCr color space */ /* work in YCbCr color space */
@@ -63,27 +63,27 @@ void DistanceMatteNode::convertToOperations(NodeConverter &converter, const Comp
DistanceYCCMatteOperation *matte = new DistanceYCCMatteOperation(); DistanceYCCMatteOperation *matte = new DistanceYCCMatteOperation();
matte->setSettings(storage); matte->setSettings(storage);
converter.addOperation(matte); converter.addOperation(matte);
ConvertRGBToYCCOperation *operationYCCImage = new ConvertRGBToYCCOperation(); ConvertRGBToYCCOperation *operationYCCImage = new ConvertRGBToYCCOperation();
ConvertRGBToYCCOperation *operationYCCMatte = new ConvertRGBToYCCOperation(); ConvertRGBToYCCOperation *operationYCCMatte = new ConvertRGBToYCCOperation();
operationYCCImage->setMode(BLI_YCC_ITU_BT709); operationYCCImage->setMode(BLI_YCC_ITU_BT709);
operationYCCMatte->setMode(BLI_YCC_ITU_BT709); operationYCCMatte->setMode(BLI_YCC_ITU_BT709);
converter.addOperation(operationYCCImage); converter.addOperation(operationYCCImage);
converter.addOperation(operationYCCMatte); converter.addOperation(operationYCCMatte);
converter.mapInputSocket(inputSocketImage, operationYCCImage->getInputSocket(0)); converter.mapInputSocket(inputSocketImage, operationYCCImage->getInputSocket(0));
converter.addLink(operationYCCImage->getOutputSocket(), matte->getInputSocket(0)); converter.addLink(operationYCCImage->getOutputSocket(), matte->getInputSocket(0));
converter.addLink(operationYCCImage->getOutputSocket(), operationAlpha->getInputSocket(0)); converter.addLink(operationYCCImage->getOutputSocket(), operationAlpha->getInputSocket(0));
converter.mapInputSocket(inputSocketKey, operationYCCMatte->getInputSocket(0)); converter.mapInputSocket(inputSocketKey, operationYCCMatte->getInputSocket(0));
converter.addLink(operationYCCMatte->getOutputSocket(), matte->getInputSocket(1)); converter.addLink(operationYCCMatte->getOutputSocket(), matte->getInputSocket(1));
operation = matte; operation = matte;
} }
converter.mapOutputSocket(outputSocketMatte, operation->getOutputSocket(0)); converter.mapOutputSocket(outputSocketMatte, operation->getOutputSocket(0));
converter.addLink(operation->getOutputSocket(), operationAlpha->getInputSocket(1)); converter.addLink(operation->getOutputSocket(), operationAlpha->getInputSocket(1));
if (storage->channel != 1) { if (storage->channel != 1) {
ConvertYCCToRGBOperation *inv_convert = new ConvertYCCToRGBOperation(); ConvertYCCToRGBOperation *inv_convert = new ConvertYCCToRGBOperation();
inv_convert->setMode(BLI_YCC_ITU_BT709); inv_convert->setMode(BLI_YCC_ITU_BT709);

View File

@@ -33,12 +33,12 @@ void DoubleEdgeMaskNode::convertToOperations(NodeConverter &converter, const Com
{ {
DoubleEdgeMaskOperation *operation; DoubleEdgeMaskOperation *operation;
bNode *bnode = this->getbNode(); bNode *bnode = this->getbNode();
operation = new DoubleEdgeMaskOperation(); operation = new DoubleEdgeMaskOperation();
operation->setAdjecentOnly(bnode->custom1); operation->setAdjecentOnly(bnode->custom1);
operation->setKeepInside(bnode->custom2); operation->setKeepInside(bnode->custom2);
converter.addOperation(operation); converter.addOperation(operation);
converter.mapInputSocket(getInputSocket(0), operation->getInputSocket(0)); converter.mapInputSocket(getInputSocket(0), operation->getInputSocket(0));
converter.mapInputSocket(getInputSocket(1), operation->getInputSocket(1)); converter.mapInputSocket(getInputSocket(1), operation->getInputSocket(1));
converter.mapOutputSocket(getOutputSocket(0), operation->getOutputSocket(0)); converter.mapOutputSocket(getOutputSocket(0), operation->getOutputSocket(0));

View File

@@ -36,13 +36,13 @@ void EllipseMaskNode::convertToOperations(NodeConverter &converter, const Compos
{ {
NodeInput *inputSocket = this->getInputSocket(0); NodeInput *inputSocket = this->getInputSocket(0);
NodeOutput *outputSocket = this->getOutputSocket(0); NodeOutput *outputSocket = this->getOutputSocket(0);
EllipseMaskOperation *operation; EllipseMaskOperation *operation;
operation = new EllipseMaskOperation(); operation = new EllipseMaskOperation();
operation->setData((NodeEllipseMask *)this->getbNode()->storage); operation->setData((NodeEllipseMask *)this->getbNode()->storage);
operation->setMaskType(this->getbNode()->custom1); operation->setMaskType(this->getbNode()->custom1);
converter.addOperation(operation); converter.addOperation(operation);
if (inputSocket->isLinked()) { if (inputSocket->isLinked()) {
converter.mapInputSocket(inputSocket, operation->getInputSocket(0)); converter.mapInputSocket(inputSocket, operation->getInputSocket(0));
converter.mapOutputSocket(outputSocket, operation->getOutputSocket()); converter.mapOutputSocket(outputSocket, operation->getOutputSocket());
@@ -68,6 +68,6 @@ void EllipseMaskNode::convertToOperations(NodeConverter &converter, const Compos
converter.addLink(scaleOperation->getOutputSocket(0), operation->getInputSocket(0)); converter.addLink(scaleOperation->getOutputSocket(0), operation->getInputSocket(0));
converter.mapOutputSocket(outputSocket, operation->getOutputSocket(0)); converter.mapOutputSocket(outputSocket, operation->getOutputSocket(0));
} }
converter.mapInputSocket(getInputSocket(1), operation->getInputSocket(1)); converter.mapInputSocket(getInputSocket(1), operation->getInputSocket(1));
} }

View File

@@ -38,7 +38,7 @@ void FilterNode::convertToOperations(NodeConverter &converter, const CompositorC
NodeInput *inputImageSocket = this->getInputSocket(1); NodeInput *inputImageSocket = this->getInputSocket(1);
NodeOutput *outputSocket = this->getOutputSocket(0); NodeOutput *outputSocket = this->getOutputSocket(0);
ConvolutionFilterOperation *operation = NULL; ConvolutionFilterOperation *operation = NULL;
switch (this->getbNode()->custom1) { switch (this->getbNode()->custom1) {
case CMP_FILT_SOFT: case CMP_FILT_SOFT:
operation = new ConvolutionFilterOperation(); operation = new ConvolutionFilterOperation();
@@ -74,10 +74,10 @@ void FilterNode::convertToOperations(NodeConverter &converter, const CompositorC
break; break;
} }
converter.addOperation(operation); converter.addOperation(operation);
converter.mapInputSocket(inputImageSocket, operation->getInputSocket(0)); converter.mapInputSocket(inputImageSocket, operation->getInputSocket(0));
converter.mapInputSocket(inputSocket, operation->getInputSocket(1)); converter.mapInputSocket(inputSocket, operation->getInputSocket(1));
converter.mapOutputSocket(outputSocket, operation->getOutputSocket()); converter.mapOutputSocket(outputSocket, operation->getOutputSocket());
converter.addPreview(operation->getOutputSocket(0)); converter.addPreview(operation->getOutputSocket(0));
} }

View File

@@ -49,7 +49,7 @@ void FlipNode::convertToOperations(NodeConverter &converter, const CompositorCon
operation->setFlipY(true); operation->setFlipY(true);
break; break;
} }
converter.addOperation(operation); converter.addOperation(operation);
converter.mapInputSocket(inputSocket, operation->getInputSocket(0)); converter.mapInputSocket(inputSocket, operation->getInputSocket(0));
converter.mapOutputSocket(outputSocket, operation->getOutputSocket(0)); converter.mapOutputSocket(outputSocket, operation->getOutputSocket(0));

View File

@@ -33,7 +33,7 @@ void GammaNode::convertToOperations(NodeConverter &converter, const CompositorCo
{ {
GammaOperation *operation = new GammaOperation(); GammaOperation *operation = new GammaOperation();
converter.addOperation(operation); converter.addOperation(operation);
converter.mapInputSocket(getInputSocket(0), operation->getInputSocket(0)); converter.mapInputSocket(getInputSocket(0), operation->getInputSocket(0));
converter.mapInputSocket(getInputSocket(1), operation->getInputSocket(1)); converter.mapInputSocket(getInputSocket(1), operation->getInputSocket(1));
converter.mapOutputSocket(getOutputSocket(0), operation->getOutputSocket(0)); converter.mapOutputSocket(getOutputSocket(0), operation->getOutputSocket(0));

View File

@@ -40,7 +40,7 @@ void GlareNode::convertToOperations(NodeConverter &converter, const CompositorCo
{ {
bNode *node = this->getbNode(); bNode *node = this->getbNode();
NodeGlare *glare = (NodeGlare *)node->storage; NodeGlare *glare = (NodeGlare *)node->storage;
GlareBaseOperation *glareoperation = NULL; GlareBaseOperation *glareoperation = NULL;
switch (glare->type) { switch (glare->type) {
default: default:
@@ -59,17 +59,17 @@ void GlareNode::convertToOperations(NodeConverter &converter, const CompositorCo
} }
BLI_assert(glareoperation); BLI_assert(glareoperation);
glareoperation->setGlareSettings(glare); glareoperation->setGlareSettings(glare);
GlareThresholdOperation *thresholdOperation = new GlareThresholdOperation(); GlareThresholdOperation *thresholdOperation = new GlareThresholdOperation();
thresholdOperation->setGlareSettings(glare); thresholdOperation->setGlareSettings(glare);
SetValueOperation *mixvalueoperation = new SetValueOperation(); SetValueOperation *mixvalueoperation = new SetValueOperation();
mixvalueoperation->setValue(0.5f + glare->mix * 0.5f); mixvalueoperation->setValue(0.5f + glare->mix * 0.5f);
MixGlareOperation *mixoperation = new MixGlareOperation(); MixGlareOperation *mixoperation = new MixGlareOperation();
mixoperation->setResolutionInputSocketIndex(1); mixoperation->setResolutionInputSocketIndex(1);
mixoperation->getInputSocket(2)->setResizeMode(COM_SC_FIT); mixoperation->getInputSocket(2)->setResizeMode(COM_SC_FIT);
converter.addOperation(glareoperation); converter.addOperation(glareoperation);
converter.addOperation(thresholdOperation); converter.addOperation(thresholdOperation);
converter.addOperation(mixvalueoperation); converter.addOperation(mixvalueoperation);
@@ -77,7 +77,7 @@ void GlareNode::convertToOperations(NodeConverter &converter, const CompositorCo
converter.mapInputSocket(getInputSocket(0), thresholdOperation->getInputSocket(0)); converter.mapInputSocket(getInputSocket(0), thresholdOperation->getInputSocket(0));
converter.addLink(thresholdOperation->getOutputSocket(), glareoperation->getInputSocket(0)); converter.addLink(thresholdOperation->getOutputSocket(), glareoperation->getInputSocket(0));
converter.addLink(mixvalueoperation->getOutputSocket(), mixoperation->getInputSocket(0)); converter.addLink(mixvalueoperation->getOutputSocket(), mixoperation->getInputSocket(0));
converter.mapInputSocket(getInputSocket(0), mixoperation->getInputSocket(1)); converter.mapInputSocket(getInputSocket(0), mixoperation->getInputSocket(1));
converter.addLink(glareoperation->getOutputSocket(), mixoperation->getInputSocket(2)); converter.addLink(glareoperation->getOutputSocket(), mixoperation->getInputSocket(2));

View File

@@ -42,17 +42,17 @@ void HueSaturationValueCorrectNode::convertToOperations(NodeConverter &converter
NodeOutput *outputSocket = this->getOutputSocket(0); NodeOutput *outputSocket = this->getOutputSocket(0);
bNode *editorsnode = getbNode(); bNode *editorsnode = getbNode();
CurveMapping *storage = (CurveMapping *)editorsnode->storage; CurveMapping *storage = (CurveMapping *)editorsnode->storage;
ConvertRGBToHSVOperation *rgbToHSV = new ConvertRGBToHSVOperation(); ConvertRGBToHSVOperation *rgbToHSV = new ConvertRGBToHSVOperation();
converter.addOperation(rgbToHSV); converter.addOperation(rgbToHSV);
ConvertHSVToRGBOperation *hsvToRGB = new ConvertHSVToRGBOperation(); ConvertHSVToRGBOperation *hsvToRGB = new ConvertHSVToRGBOperation();
converter.addOperation(hsvToRGB); converter.addOperation(hsvToRGB);
HueSaturationValueCorrectOperation *changeHSV = new HueSaturationValueCorrectOperation(); HueSaturationValueCorrectOperation *changeHSV = new HueSaturationValueCorrectOperation();
changeHSV->setCurveMapping(storage); changeHSV->setCurveMapping(storage);
converter.addOperation(changeHSV); converter.addOperation(changeHSV);
MixBlendOperation *blend = new MixBlendOperation(); MixBlendOperation *blend = new MixBlendOperation();
blend->setResolutionInputSocketIndex(1); blend->setResolutionInputSocketIndex(1);
converter.addOperation(blend); converter.addOperation(blend);

View File

@@ -46,16 +46,16 @@ void HueSaturationValueNode::convertToOperations(NodeConverter &converter, const
ConvertRGBToHSVOperation *rgbToHSV = new ConvertRGBToHSVOperation(); ConvertRGBToHSVOperation *rgbToHSV = new ConvertRGBToHSVOperation();
converter.addOperation(rgbToHSV); converter.addOperation(rgbToHSV);
ConvertHSVToRGBOperation *hsvToRGB = new ConvertHSVToRGBOperation(); ConvertHSVToRGBOperation *hsvToRGB = new ConvertHSVToRGBOperation();
converter.addOperation(hsvToRGB); converter.addOperation(hsvToRGB);
ChangeHSVOperation *changeHSV = new ChangeHSVOperation(); ChangeHSVOperation *changeHSV = new ChangeHSVOperation();
converter.mapInputSocket(hueSocket, changeHSV->getInputSocket(1)); converter.mapInputSocket(hueSocket, changeHSV->getInputSocket(1));
converter.mapInputSocket(saturationSocket, changeHSV->getInputSocket(2)); converter.mapInputSocket(saturationSocket, changeHSV->getInputSocket(2));
converter.mapInputSocket(valueSocket, changeHSV->getInputSocket(3)); converter.mapInputSocket(valueSocket, changeHSV->getInputSocket(3));
converter.addOperation(changeHSV); converter.addOperation(changeHSV);
MixBlendOperation *blend = new MixBlendOperation(); MixBlendOperation *blend = new MixBlendOperation();
blend->setResolutionInputSocketIndex(1); blend->setResolutionInputSocketIndex(1);
converter.addOperation(blend); converter.addOperation(blend);

View File

@@ -32,12 +32,12 @@ IDMaskNode::IDMaskNode(bNode *editorNode) : Node(editorNode)
void IDMaskNode::convertToOperations(NodeConverter &converter, const CompositorContext &context) const void IDMaskNode::convertToOperations(NodeConverter &converter, const CompositorContext &context) const
{ {
bNode *bnode = this->getbNode(); bNode *bnode = this->getbNode();
IDMaskOperation *operation; IDMaskOperation *operation;
operation = new IDMaskOperation(); operation = new IDMaskOperation();
operation->setObjectIndex(bnode->custom1); operation->setObjectIndex(bnode->custom1);
converter.addOperation(operation); converter.addOperation(operation);
converter.mapInputSocket(getInputSocket(0), operation->getInputSocket(0)); converter.mapInputSocket(getInputSocket(0), operation->getInputSocket(0));
if (bnode->custom2 == 0 || context.getRenderData()->scemode & R_FULL_SAMPLE) { if (bnode->custom2 == 0 || context.getRenderData()->scemode & R_FULL_SAMPLE) {
converter.mapOutputSocket(getOutputSocket(0), operation->getOutputSocket(0)); converter.mapOutputSocket(getOutputSocket(0), operation->getOutputSocket(0));
@@ -45,7 +45,7 @@ void IDMaskNode::convertToOperations(NodeConverter &converter, const CompositorC
else { else {
AntiAliasOperation *antiAliasOperation = new AntiAliasOperation(); AntiAliasOperation *antiAliasOperation = new AntiAliasOperation();
converter.addOperation(antiAliasOperation); converter.addOperation(antiAliasOperation);
converter.addLink(operation->getOutputSocket(), antiAliasOperation->getInputSocket(0)); converter.addLink(operation->getOutputSocket(), antiAliasOperation->getInputSocket(0));
converter.mapOutputSocket(getOutputSocket(0), antiAliasOperation->getOutputSocket(0)); converter.mapOutputSocket(getOutputSocket(0), antiAliasOperation->getOutputSocket(0));
} }

View File

@@ -61,10 +61,10 @@ NodeOperation *ImageNode::doMultilayerCheck(NodeConverter &converter, RenderLaye
operation->setRenderLayer(rl); operation->setRenderLayer(rl);
operation->setImageUser(user); operation->setImageUser(user);
operation->setFramenumber(framenumber); operation->setFramenumber(framenumber);
converter.addOperation(operation); converter.addOperation(operation);
converter.mapOutputSocket(outputSocket, operation->getOutputSocket()); converter.mapOutputSocket(outputSocket, operation->getOutputSocket());
return operation; return operation;
} }
@@ -189,10 +189,10 @@ void ImageNode::convertToOperations(NodeConverter &converter, const CompositorCo
operation->setRenderData(context.getRenderData()); operation->setRenderData(context.getRenderData());
operation->setViewName(context.getViewName()); operation->setViewName(context.getViewName());
converter.addOperation(operation); converter.addOperation(operation);
if (outputStraightAlpha) { if (outputStraightAlpha) {
NodeOperation *alphaConvertOperation = new ConvertPremulToStraightOperation(); NodeOperation *alphaConvertOperation = new ConvertPremulToStraightOperation();
converter.addOperation(alphaConvertOperation); converter.addOperation(alphaConvertOperation);
converter.mapOutputSocket(outputImage, alphaConvertOperation->getOutputSocket()); converter.mapOutputSocket(outputImage, alphaConvertOperation->getOutputSocket());
converter.addLink(operation->getOutputSocket(0), alphaConvertOperation->getInputSocket(0)); converter.addLink(operation->getOutputSocket(0), alphaConvertOperation->getInputSocket(0));
@@ -200,10 +200,10 @@ void ImageNode::convertToOperations(NodeConverter &converter, const CompositorCo
else { else {
converter.mapOutputSocket(outputImage, operation->getOutputSocket()); converter.mapOutputSocket(outputImage, operation->getOutputSocket());
} }
converter.addPreview(operation->getOutputSocket()); converter.addPreview(operation->getOutputSocket());
} }
if (numberOfOutputs > 1) { if (numberOfOutputs > 1) {
NodeOutput *alphaImage = this->getOutputSocket(1); NodeOutput *alphaImage = this->getOutputSocket(1);
ImageAlphaOperation *alphaOperation = new ImageAlphaOperation(); ImageAlphaOperation *alphaOperation = new ImageAlphaOperation();
@@ -213,7 +213,7 @@ void ImageNode::convertToOperations(NodeConverter &converter, const CompositorCo
alphaOperation->setRenderData(context.getRenderData()); alphaOperation->setRenderData(context.getRenderData());
alphaOperation->setViewName(context.getViewName()); alphaOperation->setViewName(context.getViewName());
converter.addOperation(alphaOperation); converter.addOperation(alphaOperation);
converter.mapOutputSocket(alphaImage, alphaOperation->getOutputSocket()); converter.mapOutputSocket(alphaImage, alphaOperation->getOutputSocket());
} }
if (numberOfOutputs > 2) { if (numberOfOutputs > 2) {
@@ -225,7 +225,7 @@ void ImageNode::convertToOperations(NodeConverter &converter, const CompositorCo
depthOperation->setRenderData(context.getRenderData()); depthOperation->setRenderData(context.getRenderData());
depthOperation->setViewName(context.getViewName()); depthOperation->setViewName(context.getViewName());
converter.addOperation(depthOperation); converter.addOperation(depthOperation);
converter.mapOutputSocket(depthImage, depthOperation->getOutputSocket()); converter.mapOutputSocket(depthImage, depthOperation->getOutputSocket());
} }
if (numberOfOutputs > 3) { if (numberOfOutputs > 3) {

View File

@@ -33,7 +33,7 @@ InpaintNode::InpaintNode(bNode *editorNode) : Node(editorNode)
void InpaintNode::convertToOperations(NodeConverter &converter, const CompositorContext &/*context*/) const void InpaintNode::convertToOperations(NodeConverter &converter, const CompositorContext &/*context*/) const
{ {
bNode *editorNode = this->getbNode(); bNode *editorNode = this->getbNode();
/* if (editorNode->custom1 == CMP_NODE_INPAINT_SIMPLE) { */ /* if (editorNode->custom1 == CMP_NODE_INPAINT_SIMPLE) { */
@@ -41,7 +41,7 @@ void InpaintNode::convertToOperations(NodeConverter &converter, const Compositor
InpaintSimpleOperation *operation = new InpaintSimpleOperation(); InpaintSimpleOperation *operation = new InpaintSimpleOperation();
operation->setIterations(editorNode->custom2); operation->setIterations(editorNode->custom2);
converter.addOperation(operation); converter.addOperation(operation);
converter.mapInputSocket(getInputSocket(0), operation->getInputSocket(0)); converter.mapInputSocket(getInputSocket(0), operation->getInputSocket(0));
converter.mapOutputSocket(getOutputSocket(0), operation->getOutputSocket(0)); converter.mapOutputSocket(getOutputSocket(0), operation->getOutputSocket(0));
} }

View File

@@ -37,7 +37,7 @@ void InvertNode::convertToOperations(NodeConverter &converter, const CompositorC
operation->setColor(node->custom1 & CMP_CHAN_RGB); operation->setColor(node->custom1 & CMP_CHAN_RGB);
operation->setAlpha(node->custom1 & CMP_CHAN_A); operation->setAlpha(node->custom1 & CMP_CHAN_A);
converter.addOperation(operation); converter.addOperation(operation);
converter.mapInputSocket(getInputSocket(0), operation->getInputSocket(0)); converter.mapInputSocket(getInputSocket(0), operation->getInputSocket(0));
converter.mapInputSocket(getInputSocket(1), operation->getInputSocket(1)); converter.mapInputSocket(getInputSocket(1), operation->getInputSocket(1));
converter.mapOutputSocket(getOutputSocket(0), operation->getOutputSocket(0)); converter.mapOutputSocket(getOutputSocket(0), operation->getOutputSocket(0));

View File

@@ -52,9 +52,9 @@ NodeOperationOutput *KeyingNode::setupPreBlur(NodeConverter &converter, NodeInpu
ConvertRGBToYCCOperation *convertRGBToYCCOperation = new ConvertRGBToYCCOperation(); ConvertRGBToYCCOperation *convertRGBToYCCOperation = new ConvertRGBToYCCOperation();
convertRGBToYCCOperation->setMode(BLI_YCC_ITU_BT709); convertRGBToYCCOperation->setMode(BLI_YCC_ITU_BT709);
converter.addOperation(convertRGBToYCCOperation); converter.addOperation(convertRGBToYCCOperation);
converter.mapInputSocket(inputImage, convertRGBToYCCOperation->getInputSocket(0)); converter.mapInputSocket(inputImage, convertRGBToYCCOperation->getInputSocket(0));
CombineChannelsOperation *combineOperation = new CombineChannelsOperation(); CombineChannelsOperation *combineOperation = new CombineChannelsOperation();
converter.addOperation(combineOperation); converter.addOperation(combineOperation);
@@ -62,9 +62,9 @@ NodeOperationOutput *KeyingNode::setupPreBlur(NodeConverter &converter, NodeInpu
SeparateChannelOperation *separateOperation = new SeparateChannelOperation(); SeparateChannelOperation *separateOperation = new SeparateChannelOperation();
separateOperation->setChannel(channel); separateOperation->setChannel(channel);
converter.addOperation(separateOperation); converter.addOperation(separateOperation);
converter.addLink(convertRGBToYCCOperation->getOutputSocket(0), separateOperation->getInputSocket(0)); converter.addLink(convertRGBToYCCOperation->getOutputSocket(0), separateOperation->getInputSocket(0));
if (channel == 0 || channel == 3) { if (channel == 0 || channel == 3) {
converter.addLink(separateOperation->getOutputSocket(0), combineOperation->getInputSocket(channel)); converter.addLink(separateOperation->getOutputSocket(0), combineOperation->getInputSocket(channel));
} }
@@ -73,24 +73,24 @@ NodeOperationOutput *KeyingNode::setupPreBlur(NodeConverter &converter, NodeInpu
blurXOperation->setSize(size); blurXOperation->setSize(size);
blurXOperation->setAxis(KeyingBlurOperation::BLUR_AXIS_X); blurXOperation->setAxis(KeyingBlurOperation::BLUR_AXIS_X);
converter.addOperation(blurXOperation); converter.addOperation(blurXOperation);
KeyingBlurOperation *blurYOperation = new KeyingBlurOperation(); KeyingBlurOperation *blurYOperation = new KeyingBlurOperation();
blurYOperation->setSize(size); blurYOperation->setSize(size);
blurYOperation->setAxis(KeyingBlurOperation::BLUR_AXIS_Y); blurYOperation->setAxis(KeyingBlurOperation::BLUR_AXIS_Y);
converter.addOperation(blurYOperation); converter.addOperation(blurYOperation);
converter.addLink(separateOperation->getOutputSocket(), blurXOperation->getInputSocket(0)); converter.addLink(separateOperation->getOutputSocket(), blurXOperation->getInputSocket(0));
converter.addLink(blurXOperation->getOutputSocket(), blurYOperation->getInputSocket(0)); converter.addLink(blurXOperation->getOutputSocket(), blurYOperation->getInputSocket(0));
converter.addLink(blurYOperation->getOutputSocket(0), combineOperation->getInputSocket(channel)); converter.addLink(blurYOperation->getOutputSocket(0), combineOperation->getInputSocket(channel));
} }
} }
ConvertYCCToRGBOperation *convertYCCToRGBOperation = new ConvertYCCToRGBOperation(); ConvertYCCToRGBOperation *convertYCCToRGBOperation = new ConvertYCCToRGBOperation();
convertYCCToRGBOperation->setMode(BLI_YCC_ITU_BT709); convertYCCToRGBOperation->setMode(BLI_YCC_ITU_BT709);
converter.addOperation(convertYCCToRGBOperation); converter.addOperation(convertYCCToRGBOperation);
converter.addLink(combineOperation->getOutputSocket(0), convertYCCToRGBOperation->getInputSocket(0)); converter.addLink(combineOperation->getOutputSocket(0), convertYCCToRGBOperation->getInputSocket(0));
return convertYCCToRGBOperation->getOutputSocket(0); return convertYCCToRGBOperation->getOutputSocket(0);
} }
@@ -100,15 +100,15 @@ NodeOperationOutput *KeyingNode::setupPostBlur(NodeConverter &converter, NodeOpe
blurXOperation->setSize(size); blurXOperation->setSize(size);
blurXOperation->setAxis(KeyingBlurOperation::BLUR_AXIS_X); blurXOperation->setAxis(KeyingBlurOperation::BLUR_AXIS_X);
converter.addOperation(blurXOperation); converter.addOperation(blurXOperation);
KeyingBlurOperation *blurYOperation = new KeyingBlurOperation(); KeyingBlurOperation *blurYOperation = new KeyingBlurOperation();
blurYOperation->setSize(size); blurYOperation->setSize(size);
blurYOperation->setAxis(KeyingBlurOperation::BLUR_AXIS_Y); blurYOperation->setAxis(KeyingBlurOperation::BLUR_AXIS_Y);
converter.addOperation(blurYOperation); converter.addOperation(blurYOperation);
converter.addLink(postBlurInput, blurXOperation->getInputSocket(0)); converter.addLink(postBlurInput, blurXOperation->getInputSocket(0));
converter.addLink(blurXOperation->getOutputSocket(), blurYOperation->getInputSocket(0)); converter.addLink(blurXOperation->getOutputSocket(), blurYOperation->getInputSocket(0));
return blurYOperation->getOutputSocket(); return blurYOperation->getOutputSocket();
} }
@@ -124,9 +124,9 @@ NodeOperationOutput *KeyingNode::setupDilateErode(NodeConverter &converter, Node
dilateErodeOperation->setDistance(-distance); dilateErodeOperation->setDistance(-distance);
} }
converter.addOperation(dilateErodeOperation); converter.addOperation(dilateErodeOperation);
converter.addLink(dilateErodeInput, dilateErodeOperation->getInputSocket(0)); converter.addLink(dilateErodeInput, dilateErodeOperation->getInputSocket(0));
return dilateErodeOperation->getOutputSocket(0); return dilateErodeOperation->getOutputSocket(0);
} }
@@ -154,7 +154,7 @@ NodeOperationOutput *KeyingNode::setupFeather(NodeConverter &converter, const Co
operationx->setSubtract(distance < 0); operationx->setSubtract(distance < 0);
operationx->setFalloff(falloff); operationx->setFalloff(falloff);
converter.addOperation(operationx); converter.addOperation(operationx);
GaussianAlphaYBlurOperation *operationy = new GaussianAlphaYBlurOperation(); GaussianAlphaYBlurOperation *operationy = new GaussianAlphaYBlurOperation();
operationy->setData(&data); operationy->setData(&data);
operationy->setQuality(quality); operationy->setQuality(quality);
@@ -176,10 +176,10 @@ NodeOperationOutput *KeyingNode::setupDespill(NodeConverter &converter, NodeOper
despillOperation->setDespillFactor(factor); despillOperation->setDespillFactor(factor);
despillOperation->setColorBalance(colorBalance); despillOperation->setColorBalance(colorBalance);
converter.addOperation(despillOperation); converter.addOperation(despillOperation);
converter.addLink(despillInput, despillOperation->getInputSocket(0)); converter.addLink(despillInput, despillOperation->getInputSocket(0));
converter.mapInputSocket(inputScreen, despillOperation->getInputSocket(1)); converter.mapInputSocket(inputScreen, despillOperation->getInputSocket(1));
return despillOperation->getOutputSocket(0); return despillOperation->getOutputSocket(0);
} }
@@ -193,9 +193,9 @@ NodeOperationOutput *KeyingNode::setupClip(NodeConverter &converter, NodeOperati
clipOperation->setClipWhite(clipWhite); clipOperation->setClipWhite(clipWhite);
clipOperation->setIsEdgeMatte(edgeMatte); clipOperation->setIsEdgeMatte(edgeMatte);
converter.addOperation(clipOperation); converter.addOperation(clipOperation);
converter.addLink(clipInput, clipOperation->getInputSocket(0)); converter.addLink(clipInput, clipOperation->getInputSocket(0));
return clipOperation->getOutputSocket(0); return clipOperation->getOutputSocket(0);
} }
@@ -203,7 +203,7 @@ void KeyingNode::convertToOperations(NodeConverter &converter, const CompositorC
{ {
bNode *editorNode = this->getbNode(); bNode *editorNode = this->getbNode();
NodeKeyingData *keying_data = (NodeKeyingData *) editorNode->storage; NodeKeyingData *keying_data = (NodeKeyingData *) editorNode->storage;
NodeInput *inputImage = this->getInputSocket(0); NodeInput *inputImage = this->getInputSocket(0);
NodeInput *inputScreen = this->getInputSocket(1); NodeInput *inputScreen = this->getInputSocket(1);
NodeInput *inputGarbageMatte = this->getInputSocket(2); NodeInput *inputGarbageMatte = this->getInputSocket(2);
@@ -212,14 +212,14 @@ void KeyingNode::convertToOperations(NodeConverter &converter, const CompositorC
NodeOutput *outputMatte = this->getOutputSocket(1); NodeOutput *outputMatte = this->getOutputSocket(1);
NodeOutput *outputEdges = this->getOutputSocket(2); NodeOutput *outputEdges = this->getOutputSocket(2);
NodeOperationOutput *postprocessedMatte = NULL, *postprocessedImage = NULL, *edgesMatte = NULL; NodeOperationOutput *postprocessedMatte = NULL, *postprocessedImage = NULL, *edgesMatte = NULL;
/* keying operation */ /* keying operation */
KeyingOperation *keyingOperation = new KeyingOperation(); KeyingOperation *keyingOperation = new KeyingOperation();
keyingOperation->setScreenBalance(keying_data->screen_balance); keyingOperation->setScreenBalance(keying_data->screen_balance);
converter.addOperation(keyingOperation); converter.addOperation(keyingOperation);
converter.mapInputSocket(inputScreen, keyingOperation->getInputSocket(1)); converter.mapInputSocket(inputScreen, keyingOperation->getInputSocket(1));
if (keying_data->blur_pre) { if (keying_data->blur_pre) {
/* chroma preblur operation for input of keying operation */ /* chroma preblur operation for input of keying operation */
NodeOperationOutput *preBluredImage = setupPreBlur(converter, inputImage, keying_data->blur_pre); NodeOperationOutput *preBluredImage = setupPreBlur(converter, inputImage, keying_data->blur_pre);
@@ -228,53 +228,53 @@ void KeyingNode::convertToOperations(NodeConverter &converter, const CompositorC
else { else {
converter.mapInputSocket(inputImage, keyingOperation->getInputSocket(0)); converter.mapInputSocket(inputImage, keyingOperation->getInputSocket(0));
} }
postprocessedMatte = keyingOperation->getOutputSocket(); postprocessedMatte = keyingOperation->getOutputSocket();
/* black / white clipping */ /* black / white clipping */
if (keying_data->clip_black > 0.0f || keying_data->clip_white < 1.0f) { if (keying_data->clip_black > 0.0f || keying_data->clip_white < 1.0f) {
postprocessedMatte = setupClip(converter, postprocessedMatte, postprocessedMatte = setupClip(converter, postprocessedMatte,
keying_data->edge_kernel_radius, keying_data->edge_kernel_tolerance, keying_data->edge_kernel_radius, keying_data->edge_kernel_tolerance,
keying_data->clip_black, keying_data->clip_white, false); keying_data->clip_black, keying_data->clip_white, false);
} }
/* output edge matte */ /* output edge matte */
edgesMatte = setupClip(converter, postprocessedMatte, edgesMatte = setupClip(converter, postprocessedMatte,
keying_data->edge_kernel_radius, keying_data->edge_kernel_tolerance, keying_data->edge_kernel_radius, keying_data->edge_kernel_tolerance,
keying_data->clip_black, keying_data->clip_white, true); keying_data->clip_black, keying_data->clip_white, true);
/* apply garbage matte */ /* apply garbage matte */
if (inputGarbageMatte->isLinked()) { if (inputGarbageMatte->isLinked()) {
SetValueOperation *valueOperation = new SetValueOperation(); SetValueOperation *valueOperation = new SetValueOperation();
valueOperation->setValue(1.0f); valueOperation->setValue(1.0f);
converter.addOperation(valueOperation); converter.addOperation(valueOperation);
MathSubtractOperation *subtractOperation = new MathSubtractOperation(); MathSubtractOperation *subtractOperation = new MathSubtractOperation();
converter.addOperation(subtractOperation); converter.addOperation(subtractOperation);
MathMinimumOperation *minOperation = new MathMinimumOperation(); MathMinimumOperation *minOperation = new MathMinimumOperation();
converter.addOperation(minOperation); converter.addOperation(minOperation);
converter.addLink(valueOperation->getOutputSocket(), subtractOperation->getInputSocket(0)); converter.addLink(valueOperation->getOutputSocket(), subtractOperation->getInputSocket(0));
converter.mapInputSocket(inputGarbageMatte, subtractOperation->getInputSocket(1)); converter.mapInputSocket(inputGarbageMatte, subtractOperation->getInputSocket(1));
converter.addLink(subtractOperation->getOutputSocket(), minOperation->getInputSocket(0)); converter.addLink(subtractOperation->getOutputSocket(), minOperation->getInputSocket(0));
converter.addLink(postprocessedMatte, minOperation->getInputSocket(1)); converter.addLink(postprocessedMatte, minOperation->getInputSocket(1));
postprocessedMatte = minOperation->getOutputSocket(); postprocessedMatte = minOperation->getOutputSocket();
} }
/* apply core matte */ /* apply core matte */
if (inputCoreMatte->isLinked()) { if (inputCoreMatte->isLinked()) {
MathMaximumOperation *maxOperation = new MathMaximumOperation(); MathMaximumOperation *maxOperation = new MathMaximumOperation();
converter.addOperation(maxOperation); converter.addOperation(maxOperation);
converter.mapInputSocket(inputCoreMatte, maxOperation->getInputSocket(0)); converter.mapInputSocket(inputCoreMatte, maxOperation->getInputSocket(0));
converter.addLink(postprocessedMatte, maxOperation->getInputSocket(1)); converter.addLink(postprocessedMatte, maxOperation->getInputSocket(1));
postprocessedMatte = maxOperation->getOutputSocket(); postprocessedMatte = maxOperation->getOutputSocket();
} }
/* apply blur on matte if needed */ /* apply blur on matte if needed */
if (keying_data->blur_post) if (keying_data->blur_post)
postprocessedMatte = setupPostBlur(converter, postprocessedMatte, keying_data->blur_post); postprocessedMatte = setupPostBlur(converter, postprocessedMatte, keying_data->blur_post);
@@ -293,7 +293,7 @@ void KeyingNode::convertToOperations(NodeConverter &converter, const CompositorC
/* set alpha channel to output image */ /* set alpha channel to output image */
SetAlphaOperation *alphaOperation = new SetAlphaOperation(); SetAlphaOperation *alphaOperation = new SetAlphaOperation();
converter.addOperation(alphaOperation); converter.addOperation(alphaOperation);
converter.mapInputSocket(inputImage, alphaOperation->getInputSocket(0)); converter.mapInputSocket(inputImage, alphaOperation->getInputSocket(0));
converter.addLink(postprocessedMatte, alphaOperation->getInputSocket(1)); converter.addLink(postprocessedMatte, alphaOperation->getInputSocket(1));

View File

@@ -39,15 +39,15 @@ void KeyingScreenNode::convertToOperations(NodeConverter &converter, const Compo
bNode *editorNode = this->getbNode(); bNode *editorNode = this->getbNode();
MovieClip *clip = (MovieClip *) editorNode->id; MovieClip *clip = (MovieClip *) editorNode->id;
NodeKeyingScreenData *keyingscreen_data = (NodeKeyingScreenData *) editorNode->storage; NodeKeyingScreenData *keyingscreen_data = (NodeKeyingScreenData *) editorNode->storage;
NodeOutput *outputScreen = this->getOutputSocket(0); NodeOutput *outputScreen = this->getOutputSocket(0);
// always connect the output image // always connect the output image
KeyingScreenOperation *operation = new KeyingScreenOperation(); KeyingScreenOperation *operation = new KeyingScreenOperation();
operation->setMovieClip(clip); operation->setMovieClip(clip);
operation->setTrackingObject(keyingscreen_data->tracking_object); operation->setTrackingObject(keyingscreen_data->tracking_object);
operation->setFramenumber(context.getFramenumber()); operation->setFramenumber(context.getFramenumber());
converter.addOperation(operation); converter.addOperation(operation);
converter.mapOutputSocket(outputScreen, operation->getOutputSocket()); converter.mapOutputSocket(outputScreen, operation->getOutputSocket());
} }

View File

@@ -37,7 +37,7 @@ void LensDistortionNode::convertToOperations(NodeConverter &converter, const Com
if (data->proj) { if (data->proj) {
ProjectorLensDistortionOperation *operation = new ProjectorLensDistortionOperation(); ProjectorLensDistortionOperation *operation = new ProjectorLensDistortionOperation();
converter.addOperation(operation); converter.addOperation(operation);
converter.mapInputSocket(getInputSocket(0), operation->getInputSocket(0)); converter.mapInputSocket(getInputSocket(0), operation->getInputSocket(0));
converter.mapInputSocket(getInputSocket(2), operation->getInputSocket(1)); converter.mapInputSocket(getInputSocket(2), operation->getInputSocket(1));
converter.mapOutputSocket(getOutputSocket(0), operation->getOutputSocket(0)); converter.mapOutputSocket(getOutputSocket(0), operation->getOutputSocket(0));
@@ -51,9 +51,9 @@ void LensDistortionNode::convertToOperations(NodeConverter &converter, const Com
operation->setDistortion(getInputSocket(1)->getEditorValueFloat()); operation->setDistortion(getInputSocket(1)->getEditorValueFloat());
if (!getInputSocket(2)->isLinked()) if (!getInputSocket(2)->isLinked())
operation->setDispersion(getInputSocket(2)->getEditorValueFloat()); operation->setDispersion(getInputSocket(2)->getEditorValueFloat());
converter.addOperation(operation); converter.addOperation(operation);
converter.mapInputSocket(getInputSocket(0), operation->getInputSocket(0)); converter.mapInputSocket(getInputSocket(0), operation->getInputSocket(0));
converter.mapInputSocket(getInputSocket(1), operation->getInputSocket(1)); converter.mapInputSocket(getInputSocket(1), operation->getInputSocket(1));
converter.mapInputSocket(getInputSocket(2), operation->getInputSocket(2)); converter.mapInputSocket(getInputSocket(2), operation->getInputSocket(2));

View File

@@ -46,10 +46,10 @@ void LuminanceMatteNode::convertToOperations(NodeConverter &converter, const Com
SetAlphaOperation *operation = new SetAlphaOperation(); SetAlphaOperation *operation = new SetAlphaOperation();
converter.addOperation(operation); converter.addOperation(operation);
converter.mapInputSocket(inputSocket, operation->getInputSocket(0)); converter.mapInputSocket(inputSocket, operation->getInputSocket(0));
converter.addLink(operationSet->getOutputSocket(), operation->getInputSocket(1)); converter.addLink(operationSet->getOutputSocket(), operation->getInputSocket(1));
converter.mapOutputSocket(outputSocketImage, operation->getOutputSocket()); converter.mapOutputSocket(outputSocketImage, operation->getOutputSocket());
converter.addPreview(operation->getOutputSocket()); converter.addPreview(operation->getOutputSocket());
} }

View File

@@ -38,11 +38,11 @@ void MapRangeNode::convertToOperations(NodeConverter &converter, const Composito
NodeInput *destMinSocket = this->getInputSocket(3); NodeInput *destMinSocket = this->getInputSocket(3);
NodeInput *destMaxSocket = this->getInputSocket(4); NodeInput *destMaxSocket = this->getInputSocket(4);
NodeOutput *outputSocket = this->getOutputSocket(0); NodeOutput *outputSocket = this->getOutputSocket(0);
MapRangeOperation *operation = new MapRangeOperation(); MapRangeOperation *operation = new MapRangeOperation();
operation->setUseClamp(this->getbNode()->custom1); operation->setUseClamp(this->getbNode()->custom1);
converter.addOperation(operation); converter.addOperation(operation);
converter.mapInputSocket(valueSocket, operation->getInputSocket(0)); converter.mapInputSocket(valueSocket, operation->getInputSocket(0));
converter.mapInputSocket(sourceMinSocket, operation->getInputSocket(1)); converter.mapInputSocket(sourceMinSocket, operation->getInputSocket(1));
converter.mapInputSocket(sourceMaxSocket, operation->getInputSocket(2)); converter.mapInputSocket(sourceMaxSocket, operation->getInputSocket(2));

View File

@@ -31,7 +31,7 @@ MapUVNode::MapUVNode(bNode *editorNode) : Node(editorNode)
void MapUVNode::convertToOperations(NodeConverter &converter, const CompositorContext &/*context*/) const void MapUVNode::convertToOperations(NodeConverter &converter, const CompositorContext &/*context*/) const
{ {
bNode *node = this->getbNode(); bNode *node = this->getbNode();
MapUVOperation *operation = new MapUVOperation(); MapUVOperation *operation = new MapUVOperation();
operation->setAlpha((float)node->custom1); operation->setAlpha((float)node->custom1);
operation->setResolutionInputSocketIndex(1); operation->setResolutionInputSocketIndex(1);

View File

@@ -33,14 +33,14 @@ MapValueNode::MapValueNode(bNode *editorNode) : Node(editorNode)
void MapValueNode::convertToOperations(NodeConverter &converter, const CompositorContext &/*context*/) const void MapValueNode::convertToOperations(NodeConverter &converter, const CompositorContext &/*context*/) const
{ {
TexMapping *storage = (TexMapping *)this->getbNode()->storage; TexMapping *storage = (TexMapping *)this->getbNode()->storage;
NodeInput *colorSocket = this->getInputSocket(0); NodeInput *colorSocket = this->getInputSocket(0);
NodeOutput *valueSocket = this->getOutputSocket(0); NodeOutput *valueSocket = this->getOutputSocket(0);
MapValueOperation *convertProg = new MapValueOperation(); MapValueOperation *convertProg = new MapValueOperation();
convertProg->setSettings(storage); convertProg->setSettings(storage);
converter.addOperation(convertProg); converter.addOperation(convertProg);
converter.mapInputSocket(colorSocket, convertProg->getInputSocket(0)); converter.mapInputSocket(colorSocket, convertProg->getInputSocket(0));
converter.mapOutputSocket(valueSocket, convertProg->getOutputSocket(0)); converter.mapOutputSocket(valueSocket, convertProg->getOutputSocket(0));
} }

View File

@@ -27,7 +27,7 @@
void MathNode::convertToOperations(NodeConverter &converter, const CompositorContext &/*context*/) const void MathNode::convertToOperations(NodeConverter &converter, const CompositorContext &/*context*/) const
{ {
MathBaseOperation *operation = NULL; MathBaseOperation *operation = NULL;
switch (this->getbNode()->custom1) { switch (this->getbNode()->custom1) {
case NODE_MATH_ADD: case NODE_MATH_ADD:
operation = new MathAddOperation(); operation = new MathAddOperation();
@@ -90,12 +90,12 @@ void MathNode::convertToOperations(NodeConverter &converter, const CompositorCon
operation = new MathArcTan2Operation(); operation = new MathArcTan2Operation();
break; break;
} }
if (operation) { if (operation) {
bool useClamp = getbNode()->custom2; bool useClamp = getbNode()->custom2;
operation->setUseClamp(useClamp); operation->setUseClamp(useClamp);
converter.addOperation(operation); converter.addOperation(operation);
converter.mapInputSocket(getInputSocket(0), operation->getInputSocket(0)); converter.mapInputSocket(getInputSocket(0), operation->getInputSocket(0));
converter.mapInputSocket(getInputSocket(1), operation->getInputSocket(1)); converter.mapInputSocket(getInputSocket(1), operation->getInputSocket(1));
converter.mapOutputSocket(getOutputSocket(0), operation->getOutputSocket()); converter.mapOutputSocket(getOutputSocket(0), operation->getOutputSocket());

View File

@@ -43,7 +43,7 @@ void MixNode::convertToOperations(NodeConverter &converter, const CompositorCont
bNode *editorNode = this->getbNode(); bNode *editorNode = this->getbNode();
bool useAlphaPremultiply = (this->getbNode()->custom2 & 1) != 0; bool useAlphaPremultiply = (this->getbNode()->custom2 & 1) != 0;
bool useClamp = (this->getbNode()->custom2 & 2) != 0; bool useClamp = (this->getbNode()->custom2 & 2) != 0;
MixBaseOperation *convertProg; MixBaseOperation *convertProg;
switch (editorNode->custom1) { switch (editorNode->custom1) {
case MA_RAMP_ADD: case MA_RAMP_ADD:
@@ -106,11 +106,11 @@ void MixNode::convertToOperations(NodeConverter &converter, const CompositorCont
convertProg->setUseValueAlphaMultiply(useAlphaPremultiply); convertProg->setUseValueAlphaMultiply(useAlphaPremultiply);
convertProg->setUseClamp(useClamp); convertProg->setUseClamp(useClamp);
converter.addOperation(convertProg); converter.addOperation(convertProg);
converter.mapInputSocket(valueSocket, convertProg->getInputSocket(0)); converter.mapInputSocket(valueSocket, convertProg->getInputSocket(0));
converter.mapInputSocket(color1Socket, convertProg->getInputSocket(1)); converter.mapInputSocket(color1Socket, convertProg->getInputSocket(1));
converter.mapInputSocket(color2Socket, convertProg->getInputSocket(2)); converter.mapInputSocket(color2Socket, convertProg->getInputSocket(2));
converter.mapOutputSocket(outputSocket, convertProg->getOutputSocket(0)); converter.mapOutputSocket(outputSocket, convertProg->getOutputSocket(0));
converter.addPreview(convertProg->getOutputSocket(0)); converter.addPreview(convertProg->getOutputSocket(0));
} }

View File

@@ -46,7 +46,7 @@ void MovieClipNode::convertToOperations(NodeConverter &converter, const Composit
NodeOutput *offsetYMovieClip = this->getOutputSocket(3); NodeOutput *offsetYMovieClip = this->getOutputSocket(3);
NodeOutput *scaleMovieClip = this->getOutputSocket(4); NodeOutput *scaleMovieClip = this->getOutputSocket(4);
NodeOutput *angleMovieClip = this->getOutputSocket(5); NodeOutput *angleMovieClip = this->getOutputSocket(5);
bNode *editorNode = this->getbNode(); bNode *editorNode = this->getbNode();
MovieClip *movieClip = (MovieClip *)editorNode->id; MovieClip *movieClip = (MovieClip *)editorNode->id;
MovieClipUser *movieClipUser = (MovieClipUser *)editorNode->storage; MovieClipUser *movieClipUser = (MovieClipUser *)editorNode->storage;
@@ -59,7 +59,7 @@ void MovieClipNode::convertToOperations(NodeConverter &converter, const Composit
else else
ibuf = BKE_movieclip_get_ibuf_flag(movieClip, movieClipUser, movieClip->flag, MOVIECLIP_CACHE_SKIP); ibuf = BKE_movieclip_get_ibuf_flag(movieClip, movieClipUser, movieClip->flag, MOVIECLIP_CACHE_SKIP);
} }
// always connect the output image // always connect the output image
MovieClipOperation *operation = new MovieClipOperation(); MovieClipOperation *operation = new MovieClipOperation();
operation->setMovieClip(movieClip); operation->setMovieClip(movieClip);
@@ -76,7 +76,7 @@ void MovieClipNode::convertToOperations(NodeConverter &converter, const Composit
alphaOperation->setMovieClipUser(movieClipUser); alphaOperation->setMovieClipUser(movieClipUser);
alphaOperation->setFramenumber(context.getFramenumber()); alphaOperation->setFramenumber(context.getFramenumber());
alphaOperation->setCacheFrame(cacheFrame); alphaOperation->setCacheFrame(cacheFrame);
converter.addOperation(alphaOperation); converter.addOperation(alphaOperation);
converter.mapOutputSocket(alphaMovieClip, alphaOperation->getOutputSocket()); converter.mapOutputSocket(alphaMovieClip, alphaOperation->getOutputSocket());
@@ -99,7 +99,7 @@ void MovieClipNode::convertToOperations(NodeConverter &converter, const Composit
converter.addOutputValue(offsetYMovieClip, loc[1]); converter.addOutputValue(offsetYMovieClip, loc[1]);
converter.addOutputValue(scaleMovieClip, scale); converter.addOutputValue(scaleMovieClip, scale);
converter.addOutputValue(angleMovieClip, angle); converter.addOutputValue(angleMovieClip, angle);
if (ibuf) { if (ibuf) {
IMB_freeImBuf(ibuf); IMB_freeImBuf(ibuf);
} }

View File

@@ -35,10 +35,10 @@ void MovieDistortionNode::convertToOperations(NodeConverter &converter, const Co
{ {
bNode *bnode = this->getbNode(); bNode *bnode = this->getbNode();
MovieClip *clip = (MovieClip *)bnode->id; MovieClip *clip = (MovieClip *)bnode->id;
NodeInput *inputSocket = this->getInputSocket(0); NodeInput *inputSocket = this->getInputSocket(0);
NodeOutput *outputSocket = this->getOutputSocket(0); NodeOutput *outputSocket = this->getOutputSocket(0);
MovieDistortionOperation *operation = new MovieDistortionOperation(bnode->custom1 == 1); MovieDistortionOperation *operation = new MovieDistortionOperation(bnode->custom1 == 1);
operation->setMovieClip(clip); operation->setMovieClip(clip);
operation->setFramenumber(context.getFramenumber()); operation->setFramenumber(context.getFramenumber());

View File

@@ -36,7 +36,7 @@ void NormalNode::convertToOperations(NodeConverter &converter, const CompositorC
NodeInput *inputSocket = this->getInputSocket(0); NodeInput *inputSocket = this->getInputSocket(0);
NodeOutput *outputSocket = this->getOutputSocket(0); NodeOutput *outputSocket = this->getOutputSocket(0);
NodeOutput *outputSocketDotproduct = this->getOutputSocket(1); NodeOutput *outputSocketDotproduct = this->getOutputSocket(1);
SetVectorOperation *operationSet = new SetVectorOperation(); SetVectorOperation *operationSet = new SetVectorOperation();
float normal[3]; float normal[3];
outputSocket->getEditorValueVector(normal); outputSocket->getEditorValueVector(normal);
@@ -47,12 +47,12 @@ void NormalNode::convertToOperations(NodeConverter &converter, const CompositorC
operationSet->setZ(normal[2]); operationSet->setZ(normal[2]);
operationSet->setW(0.0f); operationSet->setW(0.0f);
converter.addOperation(operationSet); converter.addOperation(operationSet);
converter.mapOutputSocket(outputSocket, operationSet->getOutputSocket(0)); converter.mapOutputSocket(outputSocket, operationSet->getOutputSocket(0));
DotproductOperation *operation = new DotproductOperation(); DotproductOperation *operation = new DotproductOperation();
converter.addOperation(operation); converter.addOperation(operation);
converter.mapInputSocket(inputSocket, operation->getInputSocket(0)); converter.mapInputSocket(inputSocket, operation->getInputSocket(0));
converter.addLink(operationSet->getOutputSocket(0), operation->getInputSocket(1)); converter.addLink(operationSet->getOutputSocket(0), operation->getInputSocket(1));
converter.mapOutputSocket(outputSocketDotproduct, operation->getOutputSocket(0)); converter.mapOutputSocket(outputSocketDotproduct, operation->getOutputSocket(0));

View File

@@ -39,7 +39,7 @@ void OutputFileNode::convertToOperations(NodeConverter &converter, const Composi
{ {
NodeImageMultiFile *storage = (NodeImageMultiFile *)this->getbNode()->storage; NodeImageMultiFile *storage = (NodeImageMultiFile *)this->getbNode()->storage;
const bool is_multiview = (context.getRenderData()->scemode & R_MULTIVIEW) != 0; const bool is_multiview = (context.getRenderData()->scemode & R_MULTIVIEW) != 0;
if (!context.isRendering()) { if (!context.isRendering()) {
/* only output files when rendering a sequence - /* only output files when rendering a sequence -
* otherwise, it overwrites the output files just * otherwise, it overwrites the output files just
@@ -70,12 +70,12 @@ void OutputFileNode::convertToOperations(NodeConverter &converter, const Composi
for (int i = 0; i < num_inputs; ++i) { for (int i = 0; i < num_inputs; ++i) {
NodeInput *input = getInputSocket(i); NodeInput *input = getInputSocket(i);
NodeImageMultiFileSocket *sockdata = (NodeImageMultiFileSocket *)input->getbNodeSocket()->storage; NodeImageMultiFileSocket *sockdata = (NodeImageMultiFileSocket *)input->getbNodeSocket()->storage;
/* note: layer becomes an empty placeholder if the input is not linked */ /* note: layer becomes an empty placeholder if the input is not linked */
outputOperation->add_layer(sockdata->layer, input->getDataType(), input->isLinked()); outputOperation->add_layer(sockdata->layer, input->getDataType(), input->isLinked());
converter.mapInputSocket(input, outputOperation->getInputSocket(i)); converter.mapInputSocket(input, outputOperation->getInputSocket(i));
if (!previewAdded) { if (!previewAdded) {
converter.addNodeInputPreview(input); converter.addNodeInputPreview(input);
previewAdded = true; previewAdded = true;

View File

@@ -35,7 +35,7 @@ void PixelateNode::convertToOperations(NodeConverter &converter, const Composito
NodeInput *inputSocket = this->getInputSocket(0); NodeInput *inputSocket = this->getInputSocket(0);
NodeOutput *outputSocket = this->getOutputSocket(0); NodeOutput *outputSocket = this->getOutputSocket(0);
DataType datatype = inputSocket->getDataType(); DataType datatype = inputSocket->getDataType();
if (inputSocket->isLinked()) { if (inputSocket->isLinked()) {
NodeOutput *link = inputSocket->getLink(); NodeOutput *link = inputSocket->getLink();
datatype = link->getDataType(); datatype = link->getDataType();
@@ -43,7 +43,7 @@ void PixelateNode::convertToOperations(NodeConverter &converter, const Composito
PixelateOperation *operation = new PixelateOperation(datatype); PixelateOperation *operation = new PixelateOperation(datatype);
converter.addOperation(operation); converter.addOperation(operation);
converter.mapInputSocket(inputSocket, operation->getInputSocket(0)); converter.mapInputSocket(inputSocket, operation->getInputSocket(0));
converter.mapOutputSocket(outputSocket, operation->getOutputSocket(0)); converter.mapOutputSocket(outputSocket, operation->getOutputSocket(0));
} }

View File

@@ -42,13 +42,13 @@ void PlaneTrackDeformNode::convertToOperations(NodeConverter &converter, const C
bNode *editorNode = this->getbNode(); bNode *editorNode = this->getbNode();
MovieClip *clip = (MovieClip *) editorNode->id; MovieClip *clip = (MovieClip *) editorNode->id;
NodePlaneTrackDeformData *data = (NodePlaneTrackDeformData *) editorNode->storage; NodePlaneTrackDeformData *data = (NodePlaneTrackDeformData *) editorNode->storage;
int frame_number = context.getFramenumber(); int frame_number = context.getFramenumber();
NodeInput *input_image = this->getInputSocket(0); NodeInput *input_image = this->getInputSocket(0);
NodeOutput *output_warped_image = this->getOutputSocket(0); NodeOutput *output_warped_image = this->getOutputSocket(0);
NodeOutput *output_plane = this->getOutputSocket(1); NodeOutput *output_plane = this->getOutputSocket(1);
PlaneTrackWarpImageOperation *warp_image_operation = new PlaneTrackWarpImageOperation(); PlaneTrackWarpImageOperation *warp_image_operation = new PlaneTrackWarpImageOperation();
warp_image_operation->setMovieClip(clip); warp_image_operation->setMovieClip(clip);
warp_image_operation->setTrackingObject(data->tracking_object); warp_image_operation->setTrackingObject(data->tracking_object);
@@ -59,10 +59,10 @@ void PlaneTrackDeformNode::convertToOperations(NodeConverter &converter, const C
warp_image_operation->setMotionBlurShutter(data->motion_blur_shutter); warp_image_operation->setMotionBlurShutter(data->motion_blur_shutter);
} }
converter.addOperation(warp_image_operation); converter.addOperation(warp_image_operation);
converter.mapInputSocket(input_image, warp_image_operation->getInputSocket(0)); converter.mapInputSocket(input_image, warp_image_operation->getInputSocket(0));
converter.mapOutputSocket(output_warped_image, warp_image_operation->getOutputSocket()); converter.mapOutputSocket(output_warped_image, warp_image_operation->getOutputSocket());
PlaneTrackMaskOperation *plane_mask_operation = new PlaneTrackMaskOperation(); PlaneTrackMaskOperation *plane_mask_operation = new PlaneTrackMaskOperation();
plane_mask_operation->setMovieClip(clip); plane_mask_operation->setMovieClip(clip);
plane_mask_operation->setTrackingObject(data->tracking_object); plane_mask_operation->setTrackingObject(data->tracking_object);
@@ -73,6 +73,6 @@ void PlaneTrackDeformNode::convertToOperations(NodeConverter &converter, const C
plane_mask_operation->setMotionBlurShutter(data->motion_blur_shutter); plane_mask_operation->setMotionBlurShutter(data->motion_blur_shutter);
} }
converter.addOperation(plane_mask_operation); converter.addOperation(plane_mask_operation);
converter.mapOutputSocket(output_plane, plane_mask_operation->getOutputSocket()); converter.mapOutputSocket(output_plane, plane_mask_operation->getOutputSocket());
} }

View File

@@ -39,10 +39,10 @@ void RotateNode::convertToOperations(NodeConverter &converter, const CompositorC
RotateOperation *operation = new RotateOperation(); RotateOperation *operation = new RotateOperation();
SetSamplerOperation *sampler = new SetSamplerOperation(); SetSamplerOperation *sampler = new SetSamplerOperation();
sampler->setSampler((PixelSampler)this->getbNode()->custom1); sampler->setSampler((PixelSampler)this->getbNode()->custom1);
converter.addOperation(sampler); converter.addOperation(sampler);
converter.addOperation(operation); converter.addOperation(operation);
converter.addLink(sampler->getOutputSocket(), operation->getInputSocket(0)); converter.addLink(sampler->getOutputSocket(), operation->getInputSocket(0));
converter.mapInputSocket(inputSocket, sampler->getInputSocket(0)); converter.mapInputSocket(inputSocket, sampler->getInputSocket(0));
converter.mapInputSocket(inputDegreeSocket, operation->getInputSocket(1)); converter.mapInputSocket(inputDegreeSocket, operation->getInputSocket(1));

View File

@@ -36,7 +36,7 @@ ScaleNode::ScaleNode(bNode *editorNode) : Node(editorNode)
void ScaleNode::convertToOperations(NodeConverter &converter, const CompositorContext &context) const void ScaleNode::convertToOperations(NodeConverter &converter, const CompositorContext &context) const
{ {
bNode *bnode = this->getbNode(); bNode *bnode = this->getbNode();
NodeInput *inputSocket = this->getInputSocket(0); NodeInput *inputSocket = this->getInputSocket(0);
NodeInput *inputXSocket = this->getInputSocket(1); NodeInput *inputXSocket = this->getInputSocket(1);
NodeInput *inputYSocket = this->getInputSocket(2); NodeInput *inputYSocket = this->getInputSocket(2);
@@ -47,7 +47,7 @@ void ScaleNode::convertToOperations(NodeConverter &converter, const CompositorCo
{ {
ScaleOperation *operation = new ScaleOperation(); ScaleOperation *operation = new ScaleOperation();
converter.addOperation(operation); converter.addOperation(operation);
converter.mapInputSocket(inputSocket, operation->getInputSocket(0)); converter.mapInputSocket(inputSocket, operation->getInputSocket(0));
converter.mapInputSocket(inputXSocket, operation->getInputSocket(1)); converter.mapInputSocket(inputXSocket, operation->getInputSocket(1));
converter.mapInputSocket(inputYSocket, operation->getInputSocket(2)); converter.mapInputSocket(inputYSocket, operation->getInputSocket(2));
@@ -62,10 +62,10 @@ void ScaleNode::convertToOperations(NodeConverter &converter, const CompositorCo
SetValueOperation *scaleFactorOperation = new SetValueOperation(); SetValueOperation *scaleFactorOperation = new SetValueOperation();
scaleFactorOperation->setValue(context.getRenderData()->size / 100.0f); scaleFactorOperation->setValue(context.getRenderData()->size / 100.0f);
converter.addOperation(scaleFactorOperation); converter.addOperation(scaleFactorOperation);
ScaleOperation *operation = new ScaleOperation(); ScaleOperation *operation = new ScaleOperation();
converter.addOperation(operation); converter.addOperation(operation);
converter.mapInputSocket(inputSocket, operation->getInputSocket(0)); converter.mapInputSocket(inputSocket, operation->getInputSocket(0));
converter.addLink(scaleFactorOperation->getOutputSocket(), operation->getInputSocket(1)); converter.addLink(scaleFactorOperation->getOutputSocket(), operation->getInputSocket(1));
converter.addLink(scaleFactorOperation->getOutputSocket(), operation->getInputSocket(2)); converter.addLink(scaleFactorOperation->getOutputSocket(), operation->getInputSocket(2));

View File

@@ -38,55 +38,55 @@ void SeparateColorNode::convertToOperations(NodeConverter &converter, const Comp
NodeOutput *outputGSocket = this->getOutputSocket(1); NodeOutput *outputGSocket = this->getOutputSocket(1);
NodeOutput *outputBSocket = this->getOutputSocket(2); NodeOutput *outputBSocket = this->getOutputSocket(2);
NodeOutput *outputASocket = this->getOutputSocket(3); NodeOutput *outputASocket = this->getOutputSocket(3);
NodeOperation *color_conv = getColorConverter(context); NodeOperation *color_conv = getColorConverter(context);
if (color_conv) { if (color_conv) {
converter.addOperation(color_conv); converter.addOperation(color_conv);
converter.mapInputSocket(imageSocket, color_conv->getInputSocket(0)); converter.mapInputSocket(imageSocket, color_conv->getInputSocket(0));
} }
{ {
SeparateChannelOperation *operation = new SeparateChannelOperation(); SeparateChannelOperation *operation = new SeparateChannelOperation();
operation->setChannel(0); operation->setChannel(0);
converter.addOperation(operation); converter.addOperation(operation);
if (color_conv) if (color_conv)
converter.addLink(color_conv->getOutputSocket(), operation->getInputSocket(0)); converter.addLink(color_conv->getOutputSocket(), operation->getInputSocket(0));
else else
converter.mapInputSocket(imageSocket, operation->getInputSocket(0)); converter.mapInputSocket(imageSocket, operation->getInputSocket(0));
converter.mapOutputSocket(outputRSocket, operation->getOutputSocket(0)); converter.mapOutputSocket(outputRSocket, operation->getOutputSocket(0));
} }
{ {
SeparateChannelOperation *operation = new SeparateChannelOperation(); SeparateChannelOperation *operation = new SeparateChannelOperation();
operation->setChannel(1); operation->setChannel(1);
converter.addOperation(operation); converter.addOperation(operation);
if (color_conv) if (color_conv)
converter.addLink(color_conv->getOutputSocket(), operation->getInputSocket(0)); converter.addLink(color_conv->getOutputSocket(), operation->getInputSocket(0));
else else
converter.mapInputSocket(imageSocket, operation->getInputSocket(0)); converter.mapInputSocket(imageSocket, operation->getInputSocket(0));
converter.mapOutputSocket(outputGSocket, operation->getOutputSocket(0)); converter.mapOutputSocket(outputGSocket, operation->getOutputSocket(0));
} }
{ {
SeparateChannelOperation *operation = new SeparateChannelOperation(); SeparateChannelOperation *operation = new SeparateChannelOperation();
operation->setChannel(2); operation->setChannel(2);
converter.addOperation(operation); converter.addOperation(operation);
if (color_conv) if (color_conv)
converter.addLink(color_conv->getOutputSocket(), operation->getInputSocket(0)); converter.addLink(color_conv->getOutputSocket(), operation->getInputSocket(0));
else else
converter.mapInputSocket(imageSocket, operation->getInputSocket(0)); converter.mapInputSocket(imageSocket, operation->getInputSocket(0));
converter.mapOutputSocket(outputBSocket, operation->getOutputSocket(0)); converter.mapOutputSocket(outputBSocket, operation->getOutputSocket(0));
} }
{ {
SeparateChannelOperation *operation = new SeparateChannelOperation(); SeparateChannelOperation *operation = new SeparateChannelOperation();
operation->setChannel(3); operation->setChannel(3);
converter.addOperation(operation); converter.addOperation(operation);
if (color_conv) if (color_conv)
converter.addLink(color_conv->getOutputSocket(), operation->getInputSocket(0)); converter.addLink(color_conv->getOutputSocket(), operation->getInputSocket(0));
else else

View File

@@ -30,7 +30,7 @@ class SeparateColorNode : public Node {
public: public:
SeparateColorNode(bNode *editorNode); SeparateColorNode(bNode *editorNode);
void convertToOperations(NodeConverter &converter, const CompositorContext &context) const; void convertToOperations(NodeConverter &converter, const CompositorContext &context) const;
protected: protected:
virtual NodeOperation *getColorConverter(const CompositorContext &context) const = 0; virtual NodeOperation *getColorConverter(const CompositorContext &context) const = 0;
}; };
@@ -40,7 +40,7 @@ public:
SeparateRGBANode(bNode *editorNode) : SeparateRGBANode(bNode *editorNode) :
SeparateColorNode(editorNode) SeparateColorNode(editorNode)
{} {}
NodeOperation *getColorConverter(const CompositorContext &context) const; NodeOperation *getColorConverter(const CompositorContext &context) const;
}; };
@@ -49,7 +49,7 @@ public:
SeparateHSVANode(bNode *editorNode) : SeparateHSVANode(bNode *editorNode) :
SeparateColorNode(editorNode) SeparateColorNode(editorNode)
{} {}
NodeOperation *getColorConverter(const CompositorContext &context) const; NodeOperation *getColorConverter(const CompositorContext &context) const;
}; };
@@ -58,7 +58,7 @@ public:
SeparateYCCANode(bNode *editorNode) : SeparateYCCANode(bNode *editorNode) :
SeparateColorNode(editorNode) SeparateColorNode(editorNode)
{} {}
NodeOperation *getColorConverter(const CompositorContext &context) const; NodeOperation *getColorConverter(const CompositorContext &context) const;
}; };
@@ -67,7 +67,7 @@ public:
SeparateYUVANode(bNode *editorNode) : SeparateYUVANode(bNode *editorNode) :
SeparateColorNode(editorNode) SeparateColorNode(editorNode)
{} {}
NodeOperation *getColorConverter(const CompositorContext &context) const; NodeOperation *getColorConverter(const CompositorContext &context) const;
}; };

View File

@@ -27,13 +27,13 @@
void SetAlphaNode::convertToOperations(NodeConverter &converter, const CompositorContext &/*context*/) const void SetAlphaNode::convertToOperations(NodeConverter &converter, const CompositorContext &/*context*/) const
{ {
SetAlphaOperation *operation = new SetAlphaOperation(); SetAlphaOperation *operation = new SetAlphaOperation();
if (!this->getInputSocket(0)->isLinked() && this->getInputSocket(1)->isLinked()) { if (!this->getInputSocket(0)->isLinked() && this->getInputSocket(1)->isLinked()) {
operation->setResolutionInputSocketIndex(1); operation->setResolutionInputSocketIndex(1);
} }
converter.addOperation(operation); converter.addOperation(operation);
converter.mapInputSocket(getInputSocket(0), operation->getInputSocket(0)); converter.mapInputSocket(getInputSocket(0), operation->getInputSocket(0));
converter.mapInputSocket(getInputSocket(1), operation->getInputSocket(1)); converter.mapInputSocket(getInputSocket(1), operation->getInputSocket(1));
converter.mapOutputSocket(getOutputSocket(0), operation->getOutputSocket()); converter.mapOutputSocket(getOutputSocket(0), operation->getOutputSocket());

View File

@@ -72,14 +72,14 @@ void SocketBufferNode::convertToOperations(NodeConverter &converter, const Compo
{ {
NodeOutput *output = this->getOutputSocket(0); NodeOutput *output = this->getOutputSocket(0);
NodeInput *input = this->getInputSocket(0); NodeInput *input = this->getInputSocket(0);
DataType datatype = output->getDataType(); DataType datatype = output->getDataType();
WriteBufferOperation *writeOperation = new WriteBufferOperation(datatype); WriteBufferOperation *writeOperation = new WriteBufferOperation(datatype);
ReadBufferOperation *readOperation = new ReadBufferOperation(datatype); ReadBufferOperation *readOperation = new ReadBufferOperation(datatype);
readOperation->setMemoryProxy(writeOperation->getMemoryProxy()); readOperation->setMemoryProxy(writeOperation->getMemoryProxy());
converter.addOperation(writeOperation); converter.addOperation(writeOperation);
converter.addOperation(readOperation); converter.addOperation(readOperation);
converter.mapInputSocket(input, writeOperation->getInputSocket(0)); converter.mapInputSocket(input, writeOperation->getInputSocket(0));
converter.mapOutputSocket(output, readOperation->getOutputSocket()); converter.mapOutputSocket(output, readOperation->getOutputSocket());
} }

View File

@@ -33,10 +33,10 @@ class SocketProxyNode : public Node {
public: public:
SocketProxyNode(bNode *editorNode, bNodeSocket *editorInput, bNodeSocket *editorOutput, bool use_conversion); SocketProxyNode(bNode *editorNode, bNodeSocket *editorInput, bNodeSocket *editorOutput, bool use_conversion);
void convertToOperations(NodeConverter &converter, const CompositorContext &context) const; void convertToOperations(NodeConverter &converter, const CompositorContext &context) const;
bool getUseConversion() const { return m_use_conversion; } bool getUseConversion() const { return m_use_conversion; }
void setUseConversion(bool use_conversion) { m_use_conversion = use_conversion; } void setUseConversion(bool use_conversion) { m_use_conversion = use_conversion; }
private: private:
/** If true, the proxy will convert input and output data to/from the proxy socket types. */ /** If true, the proxy will convert input and output data to/from the proxy socket types. */
bool m_use_conversion; bool m_use_conversion;

View File

@@ -44,7 +44,7 @@ void Stabilize2dNode::convertToOperations(NodeConverter &converter, const Compos
NodeInput *imageInput = this->getInputSocket(0); NodeInput *imageInput = this->getInputSocket(0);
MovieClip *clip = (MovieClip *)editorNode->id; MovieClip *clip = (MovieClip *)editorNode->id;
bool invert = (editorNode->custom2 & CMP_NODEFLAG_STABILIZE_INVERSE) != 0; bool invert = (editorNode->custom2 & CMP_NODEFLAG_STABILIZE_INVERSE) != 0;
ScaleOperation *scaleOperation = new ScaleOperation(); ScaleOperation *scaleOperation = new ScaleOperation();
scaleOperation->setSampler((PixelSampler)editorNode->custom1); scaleOperation->setSampler((PixelSampler)editorNode->custom1);
RotateOperation *rotateOperation = new RotateOperation(); RotateOperation *rotateOperation = new RotateOperation();
@@ -85,18 +85,18 @@ void Stabilize2dNode::convertToOperations(NodeConverter &converter, const Compos
converter.addOperation(translateOperation); converter.addOperation(translateOperation);
converter.addOperation(rotateOperation); converter.addOperation(rotateOperation);
converter.addOperation(psoperation); converter.addOperation(psoperation);
converter.mapInputSocket(imageInput, scaleOperation->getInputSocket(0)); converter.mapInputSocket(imageInput, scaleOperation->getInputSocket(0));
converter.addLink(scaleAttribute->getOutputSocket(), scaleOperation->getInputSocket(1)); converter.addLink(scaleAttribute->getOutputSocket(), scaleOperation->getInputSocket(1));
converter.addLink(scaleAttribute->getOutputSocket(), scaleOperation->getInputSocket(2)); converter.addLink(scaleAttribute->getOutputSocket(), scaleOperation->getInputSocket(2));
converter.addLink(scaleOperation->getOutputSocket(), rotateOperation->getInputSocket(0)); converter.addLink(scaleOperation->getOutputSocket(), rotateOperation->getInputSocket(0));
converter.addLink(angleAttribute->getOutputSocket(), rotateOperation->getInputSocket(1)); converter.addLink(angleAttribute->getOutputSocket(), rotateOperation->getInputSocket(1));
converter.addLink(rotateOperation->getOutputSocket(), translateOperation->getInputSocket(0)); converter.addLink(rotateOperation->getOutputSocket(), translateOperation->getInputSocket(0));
converter.addLink(xAttribute->getOutputSocket(), translateOperation->getInputSocket(1)); converter.addLink(xAttribute->getOutputSocket(), translateOperation->getInputSocket(1));
converter.addLink(yAttribute->getOutputSocket(), translateOperation->getInputSocket(2)); converter.addLink(yAttribute->getOutputSocket(), translateOperation->getInputSocket(2));
converter.addLink(translateOperation->getOutputSocket(), psoperation->getInputSocket(0)); converter.addLink(translateOperation->getOutputSocket(), psoperation->getInputSocket(0));
converter.mapOutputSocket(getOutputSocket(), psoperation->getOutputSocket()); converter.mapOutputSocket(getOutputSocket(), psoperation->getOutputSocket());
} }

View File

@@ -30,12 +30,12 @@ SwitchNode::SwitchNode(bNode *editorNode) : Node(editorNode)
void SwitchNode::convertToOperations(NodeConverter &converter, const CompositorContext &/*context*/) const void SwitchNode::convertToOperations(NodeConverter &converter, const CompositorContext &/*context*/) const
{ {
bool condition = this->getbNode()->custom1; bool condition = this->getbNode()->custom1;
NodeOperationOutput *result; NodeOperationOutput *result;
if (!condition) if (!condition)
result = converter.addInputProxy(getInputSocket(0), false); result = converter.addInputProxy(getInputSocket(0), false);
else else
result = converter.addInputProxy(getInputSocket(1), false); result = converter.addInputProxy(getInputSocket(1), false);
converter.mapOutputSocket(getOutputSocket(0), result); converter.mapOutputSocket(getOutputSocket(0), result);
} }

View File

@@ -40,11 +40,11 @@ void TextureNode::convertToOperations(NodeConverter &converter, const Compositor
operation->setRenderData(context.getRenderData()); operation->setRenderData(context.getRenderData());
operation->setSceneColorManage(sceneColorManage); operation->setSceneColorManage(sceneColorManage);
converter.addOperation(operation); converter.addOperation(operation);
converter.mapInputSocket(getInputSocket(0), operation->getInputSocket(0)); converter.mapInputSocket(getInputSocket(0), operation->getInputSocket(0));
converter.mapInputSocket(getInputSocket(1), operation->getInputSocket(1)); converter.mapInputSocket(getInputSocket(1), operation->getInputSocket(1));
converter.mapOutputSocket(getOutputSocket(1), operation->getOutputSocket()); converter.mapOutputSocket(getOutputSocket(1), operation->getOutputSocket());
converter.addPreview(operation->getOutputSocket()); converter.addPreview(operation->getOutputSocket());
TextureAlphaOperation *alphaOperation = new TextureAlphaOperation(); TextureAlphaOperation *alphaOperation = new TextureAlphaOperation();
@@ -52,7 +52,7 @@ void TextureNode::convertToOperations(NodeConverter &converter, const Compositor
alphaOperation->setRenderData(context.getRenderData()); alphaOperation->setRenderData(context.getRenderData());
alphaOperation->setSceneColorManage(sceneColorManage); alphaOperation->setSceneColorManage(sceneColorManage);
converter.addOperation(alphaOperation); converter.addOperation(alphaOperation);
converter.mapInputSocket(getInputSocket(0), alphaOperation->getInputSocket(0)); converter.mapInputSocket(getInputSocket(0), alphaOperation->getInputSocket(0));
converter.mapInputSocket(getInputSocket(1), alphaOperation->getInputSocket(1)); converter.mapInputSocket(getInputSocket(1), alphaOperation->getInputSocket(1));
converter.mapOutputSocket(getOutputSocket(0), alphaOperation->getOutputSocket()); converter.mapOutputSocket(getOutputSocket(0), alphaOperation->getOutputSocket());

View File

@@ -56,6 +56,6 @@ void TimeNode::convertToOperations(NodeConverter &converter, const CompositorCon
fac = curvemapping_evaluateF((CurveMapping *)node->storage, 0, fac); fac = curvemapping_evaluateF((CurveMapping *)node->storage, 0, fac);
operation->setValue(clamp_f(fac, 0.0f, 1.0f)); operation->setValue(clamp_f(fac, 0.0f, 1.0f));
converter.addOperation(operation); converter.addOperation(operation);
converter.mapOutputSocket(getOutputSocket(0), operation->getOutputSocket()); converter.mapOutputSocket(getOutputSocket(0), operation->getOutputSocket());
} }

View File

@@ -32,11 +32,11 @@ TonemapNode::TonemapNode(bNode *editorNode) : Node(editorNode)
void TonemapNode::convertToOperations(NodeConverter &converter, const CompositorContext &/*context*/) const void TonemapNode::convertToOperations(NodeConverter &converter, const CompositorContext &/*context*/) const
{ {
NodeTonemap *data = (NodeTonemap *)this->getbNode()->storage; NodeTonemap *data = (NodeTonemap *)this->getbNode()->storage;
TonemapOperation *operation = data->type == 1 ? new PhotoreceptorTonemapOperation() : new TonemapOperation(); TonemapOperation *operation = data->type == 1 ? new PhotoreceptorTonemapOperation() : new TonemapOperation();
operation->setData(data); operation->setData(data);
converter.addOperation(operation); converter.addOperation(operation);
converter.mapInputSocket(getInputSocket(0), operation->getInputSocket(0)); converter.mapInputSocket(getInputSocket(0), operation->getInputSocket(0));
converter.mapOutputSocket(getOutputSocket(0), operation->getOutputSocket(0)); converter.mapOutputSocket(getOutputSocket(0), operation->getOutputSocket(0));
} }

View File

@@ -63,7 +63,7 @@ void TrackPositionNode::convertToOperations(NodeConverter &converter, const Comp
bNode *editorNode = this->getbNode(); bNode *editorNode = this->getbNode();
MovieClip *clip = (MovieClip *) editorNode->id; MovieClip *clip = (MovieClip *) editorNode->id;
NodeTrackPosData *trackpos_data = (NodeTrackPosData *) editorNode->storage; NodeTrackPosData *trackpos_data = (NodeTrackPosData *) editorNode->storage;
NodeOutput *outputX = this->getOutputSocket(0); NodeOutput *outputX = this->getOutputSocket(0);
NodeOutput *outputY = this->getOutputSocket(1); NodeOutput *outputY = this->getOutputSocket(1);
NodeOutput *outputSpeed = this->getOutputSocket(2); NodeOutput *outputSpeed = this->getOutputSocket(2);

View File

@@ -40,32 +40,32 @@ void TransformNode::convertToOperations(NodeConverter &converter, const Composit
NodeInput *yInput = this->getInputSocket(2); NodeInput *yInput = this->getInputSocket(2);
NodeInput *angleInput = this->getInputSocket(3); NodeInput *angleInput = this->getInputSocket(3);
NodeInput *scaleInput = this->getInputSocket(4); NodeInput *scaleInput = this->getInputSocket(4);
ScaleOperation *scaleOperation = new ScaleOperation(); ScaleOperation *scaleOperation = new ScaleOperation();
converter.addOperation(scaleOperation); converter.addOperation(scaleOperation);
RotateOperation *rotateOperation = new RotateOperation(); RotateOperation *rotateOperation = new RotateOperation();
rotateOperation->setDoDegree2RadConversion(false); rotateOperation->setDoDegree2RadConversion(false);
converter.addOperation(rotateOperation); converter.addOperation(rotateOperation);
TranslateOperation *translateOperation = new TranslateOperation(); TranslateOperation *translateOperation = new TranslateOperation();
converter.addOperation(translateOperation); converter.addOperation(translateOperation);
SetSamplerOperation *sampler = new SetSamplerOperation(); SetSamplerOperation *sampler = new SetSamplerOperation();
sampler->setSampler((PixelSampler)this->getbNode()->custom1); sampler->setSampler((PixelSampler)this->getbNode()->custom1);
converter.addOperation(sampler); converter.addOperation(sampler);
converter.mapInputSocket(imageInput, sampler->getInputSocket(0)); converter.mapInputSocket(imageInput, sampler->getInputSocket(0));
converter.addLink(sampler->getOutputSocket(), scaleOperation->getInputSocket(0)); converter.addLink(sampler->getOutputSocket(), scaleOperation->getInputSocket(0));
converter.mapInputSocket(scaleInput, scaleOperation->getInputSocket(1)); converter.mapInputSocket(scaleInput, scaleOperation->getInputSocket(1));
converter.mapInputSocket(scaleInput, scaleOperation->getInputSocket(2)); // xscale = yscale converter.mapInputSocket(scaleInput, scaleOperation->getInputSocket(2)); // xscale = yscale
converter.addLink(scaleOperation->getOutputSocket(), rotateOperation->getInputSocket(0)); converter.addLink(scaleOperation->getOutputSocket(), rotateOperation->getInputSocket(0));
converter.mapInputSocket(angleInput, rotateOperation->getInputSocket(1)); converter.mapInputSocket(angleInput, rotateOperation->getInputSocket(1));
converter.addLink(rotateOperation->getOutputSocket(), translateOperation->getInputSocket(0)); converter.addLink(rotateOperation->getOutputSocket(), translateOperation->getInputSocket(0));
converter.mapInputSocket(xInput, translateOperation->getInputSocket(1)); converter.mapInputSocket(xInput, translateOperation->getInputSocket(1));
converter.mapInputSocket(yInput, translateOperation->getInputSocket(2)); converter.mapInputSocket(yInput, translateOperation->getInputSocket(2));
converter.mapOutputSocket(getOutputSocket(), translateOperation->getOutputSocket()); converter.mapOutputSocket(getOutputSocket(), translateOperation->getOutputSocket());
} }

View File

@@ -36,32 +36,32 @@ void TranslateNode::convertToOperations(NodeConverter &converter, const Composit
{ {
bNode *bnode = this->getbNode(); bNode *bnode = this->getbNode();
NodeTranslateData *data = (NodeTranslateData *)bnode->storage; NodeTranslateData *data = (NodeTranslateData *)bnode->storage;
NodeInput *inputSocket = this->getInputSocket(0); NodeInput *inputSocket = this->getInputSocket(0);
NodeInput *inputXSocket = this->getInputSocket(1); NodeInput *inputXSocket = this->getInputSocket(1);
NodeInput *inputYSocket = this->getInputSocket(2); NodeInput *inputYSocket = this->getInputSocket(2);
NodeOutput *outputSocket = this->getOutputSocket(0); NodeOutput *outputSocket = this->getOutputSocket(0);
TranslateOperation *operation = new TranslateOperation(); TranslateOperation *operation = new TranslateOperation();
if (data->relative) { if (data->relative) {
const RenderData *rd = context.getRenderData(); const RenderData *rd = context.getRenderData();
float fx = rd->xsch * rd->size / 100.0f; float fx = rd->xsch * rd->size / 100.0f;
float fy = rd->ysch * rd->size / 100.0f; float fy = rd->ysch * rd->size / 100.0f;
operation->setFactorXY(fx, fy); operation->setFactorXY(fx, fy);
} }
converter.addOperation(operation); converter.addOperation(operation);
converter.mapInputSocket(inputXSocket, operation->getInputSocket(1)); converter.mapInputSocket(inputXSocket, operation->getInputSocket(1));
converter.mapInputSocket(inputYSocket, operation->getInputSocket(2)); converter.mapInputSocket(inputYSocket, operation->getInputSocket(2));
converter.mapOutputSocket(outputSocket, operation->getOutputSocket(0)); converter.mapOutputSocket(outputSocket, operation->getOutputSocket(0));
if (data->wrap_axis) { if (data->wrap_axis) {
WriteBufferOperation *writeOperation = new WriteBufferOperation(COM_DT_COLOR); WriteBufferOperation *writeOperation = new WriteBufferOperation(COM_DT_COLOR);
WrapOperation *wrapOperation = new WrapOperation(COM_DT_COLOR); WrapOperation *wrapOperation = new WrapOperation(COM_DT_COLOR);
wrapOperation->setMemoryProxy(writeOperation->getMemoryProxy()); wrapOperation->setMemoryProxy(writeOperation->getMemoryProxy());
wrapOperation->setWrapping(data->wrap_axis); wrapOperation->setWrapping(data->wrap_axis);
converter.addOperation(writeOperation); converter.addOperation(writeOperation);
converter.addOperation(wrapOperation); converter.addOperation(wrapOperation);
converter.mapInputSocket(inputSocket, writeOperation->getInputSocket(0)); converter.mapInputSocket(inputSocket, writeOperation->getInputSocket(0));

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