Cleanup: trailing space for compositor
This commit is contained in:
parent
410880552b
commit
a262ea8c47
|
@ -34,7 +34,7 @@ public:
|
|||
ChunkOrder();
|
||||
void determineDistance(ChunkOrderHotspot **hotspots, unsigned int numberOfHotspots);
|
||||
friend bool operator<(const ChunkOrder &a, const ChunkOrder &b);
|
||||
|
||||
|
||||
void setChunkNumber(unsigned int chunknumber) { this->m_number = chunknumber; }
|
||||
void setX(int x) { this->m_x = x; }
|
||||
void setY(int y) { this->m_y = y; }
|
||||
|
|
|
@ -126,7 +126,7 @@ public:
|
|||
* @brief get the scene of the context
|
||||
*/
|
||||
const RenderData *getRenderData() const { return this->m_rd; }
|
||||
|
||||
|
||||
void setScene(Scene *scene) { m_scene = scene; }
|
||||
Scene *getScene() const { return m_scene; }
|
||||
|
||||
|
@ -196,7 +196,7 @@ public:
|
|||
void setViewName(const char *viewName) { this->m_viewName = viewName; }
|
||||
|
||||
int getChunksize() const { return this->getbNodeTree()->chunksize; }
|
||||
|
||||
|
||||
void setFastCalculation(bool fastCalculation) {this->m_fastCalculation = fastCalculation;}
|
||||
bool isFastCalculation() const { return this->m_fastCalculation; }
|
||||
bool isGroupnodeBufferEnabled() const { return (this->getbNodeTree()->flag & NTREE_COM_GROUPNODE_BUFFER) != 0; }
|
||||
|
|
|
@ -414,7 +414,7 @@ NodeOperation *Converter::convertDataType(NodeOperationOutput *from, NodeOperati
|
|||
{
|
||||
DataType fromDatatype = from->getDataType();
|
||||
DataType toDatatype = to->getDataType();
|
||||
|
||||
|
||||
if (fromDatatype == COM_DT_VALUE && toDatatype == COM_DT_COLOR) {
|
||||
return new ConvertValueToColorOperation();
|
||||
}
|
||||
|
@ -433,7 +433,7 @@ NodeOperation *Converter::convertDataType(NodeOperationOutput *from, NodeOperati
|
|||
else if (fromDatatype == COM_DT_VECTOR && toDatatype == COM_DT_COLOR) {
|
||||
return new ConvertVectorToColorOperation();
|
||||
}
|
||||
|
||||
|
||||
return NULL;
|
||||
}
|
||||
|
||||
|
|
|
@ -50,14 +50,14 @@ public:
|
|||
* @see Node
|
||||
*/
|
||||
static Node *convert(bNode *b_node);
|
||||
|
||||
|
||||
/**
|
||||
* @brief True if the node is considered 'fast'.
|
||||
*
|
||||
* Slow nodes will be skipped if fast execution is required.
|
||||
*/
|
||||
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.
|
||||
*
|
||||
|
@ -68,7 +68,7 @@ public:
|
|||
* @see NodeLink - a link between two sockets
|
||||
*/
|
||||
static NodeOperation *convertDataType(NodeOperationOutput *from, NodeOperationInput *to);
|
||||
|
||||
|
||||
/**
|
||||
* @brief This method will add a resolution rule based on the settings of the NodeInput.
|
||||
*
|
||||
|
|
|
@ -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 len = 0;
|
||||
|
||||
|
||||
std::string fillcolor = "gainsboro";
|
||||
if (operation->isViewerOperation()) {
|
||||
const ViewerOperation *viewer = (const ViewerOperation *)operation;
|
||||
|
@ -141,14 +141,14 @@ int DebugInfo::graphviz_operation(const ExecutionSystem *system, const NodeOpera
|
|||
else if (operation->isWriteBufferOperation()) {
|
||||
fillcolor = "darkorange";
|
||||
}
|
||||
|
||||
|
||||
len += snprintf(str + len, maxlen > len ? maxlen - len : 0, "// OPERATION: %p\r\n", operation);
|
||||
if (group)
|
||||
len += snprintf(str + len, maxlen > len ? maxlen - len : 0, "\"O_%p_%p\"", operation, group);
|
||||
else
|
||||
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());
|
||||
|
||||
|
||||
int totinputs = operation->getNumberOfInputSockets();
|
||||
if (totinputs != 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, "%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());
|
||||
|
||||
|
||||
int totoutputs = operation->getNumberOfOutputSockets();
|
||||
if (totoutputs != 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, "\r\n");
|
||||
|
||||
|
||||
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 len = 0;
|
||||
|
||||
|
||||
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, "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];
|
||||
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, "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, "splines=false\r\n");
|
||||
|
||||
|
||||
#if 0
|
||||
for (ExecutionSystem::Operations::const_iterator it = system->m_operations.begin();
|
||||
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);
|
||||
}
|
||||
#endif
|
||||
|
||||
|
||||
int totops = system->m_operations.size();
|
||||
int totgroups = system->m_groups.size();
|
||||
std::map<NodeOperation *, std::vector<std::string> > op_groups;
|
||||
for (int i = 0; i < totgroups; ++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, "subgraph cluster_%d{\r\n", i);
|
||||
/* 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, "fillcolor=chartreuse4\r\n");
|
||||
}
|
||||
|
||||
|
||||
for (ExecutionGroup::Operations::const_iterator it = group->m_operations.begin(); it != group->m_operations.end(); ++it) {
|
||||
NodeOperation *operation = *it;
|
||||
|
||||
|
||||
sprintf(strbuf, "_%p", group);
|
||||
op_groups[operation].push_back(std::string(strbuf));
|
||||
|
||||
|
||||
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, " O_%p\r\n", group->getOutputOperation());
|
||||
len += snprintf(str + len, maxlen > len ? maxlen - len : 0, "}\r\n");
|
||||
}
|
||||
|
||||
|
||||
/* operations not included in any group */
|
||||
for (int j = 0; j < totops; ++j) {
|
||||
NodeOperation *operation = system->m_operations[j];
|
||||
if (op_groups.find(operation) != op_groups.end())
|
||||
continue;
|
||||
|
||||
|
||||
op_groups[operation].push_back(std::string(""));
|
||||
|
||||
|
||||
len += graphviz_operation(system, operation, 0, str + len, maxlen > len ? maxlen - len : 0);
|
||||
}
|
||||
|
||||
|
||||
for (int i = 0; i < totops; i++) {
|
||||
NodeOperation *operation = system->m_operations[i];
|
||||
|
||||
|
||||
if (operation->isReadBufferOperation()) {
|
||||
ReadBufferOperation *read = (ReadBufferOperation *)operation;
|
||||
WriteBufferOperation *write = read->getMemoryProxy()->getWriteBufferOperation();
|
||||
std::vector<std::string> &read_groups = op_groups[read];
|
||||
std::vector<std::string> &write_groups = op_groups[write];
|
||||
|
||||
|
||||
for (int k = 0; k < write_groups.size(); ++k) {
|
||||
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());
|
||||
|
@ -344,17 +344,17 @@ bool DebugInfo::graphviz_system(const ExecutionSystem *system, char *str, int ma
|
|||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
for (int i = 0; i < totops; i++) {
|
||||
NodeOperation *op = system->m_operations[i];
|
||||
|
||||
|
||||
for (NodeOperation::Inputs::const_iterator it = op->m_inputs.begin(); it != op->m_inputs.end(); ++it) {
|
||||
NodeOperationInput *to = *it;
|
||||
NodeOperationOutput *from = to->getLink();
|
||||
|
||||
|
||||
if (!from)
|
||||
continue;
|
||||
|
||||
|
||||
std::string color;
|
||||
switch (from->getDataType()) {
|
||||
case COM_DT_VALUE:
|
||||
|
@ -367,12 +367,12 @@ bool DebugInfo::graphviz_system(const ExecutionSystem *system, char *str, int ma
|
|||
color = "orange";
|
||||
break;
|
||||
}
|
||||
|
||||
|
||||
NodeOperation *to_op = &to->getOperation();
|
||||
NodeOperation *from_op = &from->getOperation();
|
||||
std::vector<std::string> &from_groups = op_groups[from_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",
|
||||
from_op, from, to_op, to);
|
||||
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 += snprintf(str + len, maxlen > len ? maxlen - len : 0, "}\r\n");
|
||||
|
||||
|
||||
return (len < maxlen);
|
||||
}
|
||||
|
||||
|
@ -399,11 +399,11 @@ void DebugInfo::graphviz(const ExecutionSystem *system)
|
|||
if (graphviz_system(system, str, sizeof(str) - 1)) {
|
||||
char basename[FILE_MAX];
|
||||
char filename[FILE_MAX];
|
||||
|
||||
|
||||
BLI_snprintf(basename, sizeof(basename), "compositor_%d.dot", m_file_index);
|
||||
BLI_join_dirfile(filename, sizeof(filename), BKE_tempdir_session(), basename);
|
||||
++m_file_index;
|
||||
|
||||
|
||||
FILE *fp = BLI_fopen(filename, "wb");
|
||||
fputs(str, fp);
|
||||
fclose(fp);
|
||||
|
|
|
@ -39,27 +39,27 @@ public:
|
|||
EG_RUNNING,
|
||||
EG_FINISHED
|
||||
} GroupState;
|
||||
|
||||
|
||||
typedef std::map<const Node *, std::string> NodeNameMap;
|
||||
typedef std::map<const NodeOperation *, std::string> OpNameMap;
|
||||
typedef std::map<const ExecutionGroup *, GroupState> GroupStateMap;
|
||||
|
||||
|
||||
static std::string node_name(const Node *node);
|
||||
static std::string operation_name(const NodeOperation *op);
|
||||
|
||||
|
||||
static void convert_started();
|
||||
static void execute_started(const ExecutionSystem *system);
|
||||
|
||||
|
||||
static void node_added(const Node *node);
|
||||
static void node_to_operations(const Node *node);
|
||||
static void operation_added(const NodeOperation *operation);
|
||||
static void operation_read_write_buffer(const NodeOperation *operation);
|
||||
|
||||
|
||||
static void execution_group_started(const ExecutionGroup *group);
|
||||
static void execution_group_finished(const ExecutionGroup *group);
|
||||
|
||||
|
||||
static void graphviz(const ExecutionSystem *system);
|
||||
|
||||
|
||||
#ifdef COM_DEBUG
|
||||
protected:
|
||||
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(char *str, int maxlen);
|
||||
static bool graphviz_system(const ExecutionSystem *system, char *str, int maxlen);
|
||||
|
||||
|
||||
private:
|
||||
static int m_file_index;
|
||||
static NodeNameMap m_node_names; /**< map nodes to usable names for debug output */
|
||||
|
|
|
@ -34,11 +34,11 @@ class Device {
|
|||
|
||||
public:
|
||||
/**
|
||||
* @brief Declaration of the virtual destructor
|
||||
* @brief Declaration of the virtual destructor
|
||||
* @note resolve warning gcc 4.7
|
||||
*/
|
||||
virtual ~Device() {}
|
||||
|
||||
|
||||
/**
|
||||
* @brief initialize the device
|
||||
*/
|
||||
|
|
|
@ -73,16 +73,16 @@ CompositorPriority ExecutionGroup::getRenderPriotrity()
|
|||
bool ExecutionGroup::canContainOperation(NodeOperation *operation)
|
||||
{
|
||||
if (!this->m_initialized) { return true; }
|
||||
|
||||
|
||||
if (operation->isReadBufferOperation()) { return true; }
|
||||
if (operation->isWriteBufferOperation()) { return false; }
|
||||
if (operation->isSetOperation()) { return true; }
|
||||
|
||||
|
||||
/* complex groups don't allow further ops (except read buffer and values, see above) */
|
||||
if (m_complex) { return false; }
|
||||
/* complex ops can't be added to other groups (except their own, which they initialize, see above) */
|
||||
if (operation->isComplex()) { return false; }
|
||||
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
|
@ -90,16 +90,16 @@ bool ExecutionGroup::addOperation(NodeOperation *operation)
|
|||
{
|
||||
if (!canContainOperation(operation))
|
||||
return false;
|
||||
|
||||
|
||||
if (!operation->isReadBufferOperation() && !operation->isWriteBufferOperation()) {
|
||||
m_complex = operation->isComplex();
|
||||
m_openCL = operation->isOpenCL();
|
||||
m_singleThreaded = operation->isSingleThreaded();
|
||||
m_initialized = true;
|
||||
}
|
||||
|
||||
|
||||
m_operations.push_back(operation);
|
||||
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
|
@ -382,7 +382,7 @@ void ExecutionGroup::finalizeChunkExecution(int chunkNumber, MemoryBuffer **memo
|
|||
{
|
||||
if (this->m_chunkExecutionStates[chunkNumber] == COM_ES_SCHEDULED)
|
||||
this->m_chunkExecutionStates[chunkNumber] = COM_ES_EXECUTED;
|
||||
|
||||
|
||||
atomic_add_and_fetch_u(&this->m_chunksFinished, 1);
|
||||
if (memoryBuffers) {
|
||||
for (unsigned int index = 0; index < this->m_cachedMaxReadBufferOffset; index++) {
|
||||
|
|
|
@ -65,89 +65,89 @@ typedef enum ChunkExecutionState {
|
|||
class ExecutionGroup {
|
||||
public:
|
||||
typedef std::vector<NodeOperation*> Operations;
|
||||
|
||||
|
||||
private:
|
||||
// fields
|
||||
|
||||
|
||||
/**
|
||||
* @brief list of operations in this ExecutionGroup
|
||||
*/
|
||||
Operations m_operations;
|
||||
|
||||
|
||||
/**
|
||||
* @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)
|
||||
*/
|
||||
int m_isOutput;
|
||||
|
||||
|
||||
/**
|
||||
* @brief Width of the output
|
||||
*/
|
||||
unsigned int m_width;
|
||||
|
||||
|
||||
/**
|
||||
* @brief Height of the output
|
||||
*/
|
||||
unsigned int m_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
|
||||
*/
|
||||
unsigned int m_chunkSize;
|
||||
|
||||
|
||||
/**
|
||||
* @brief number of chunks in the x-axis
|
||||
*/
|
||||
unsigned int m_numberOfXChunks;
|
||||
|
||||
|
||||
/**
|
||||
* @brief number of chunks in the y-axis
|
||||
*/
|
||||
unsigned int m_numberOfYChunks;
|
||||
|
||||
|
||||
/**
|
||||
* @brief total number of chunks
|
||||
*/
|
||||
unsigned int m_numberOfChunks;
|
||||
|
||||
|
||||
/**
|
||||
* @brief contains this ExecutionGroup a complex NodeOperation.
|
||||
*/
|
||||
bool m_complex;
|
||||
|
||||
|
||||
/**
|
||||
* @brief can this ExecutionGroup be scheduled on an OpenCLDevice
|
||||
*/
|
||||
bool m_openCL;
|
||||
|
||||
|
||||
/**
|
||||
* @brief Is this Execution group SingleThreaded
|
||||
*/
|
||||
bool m_singleThreaded;
|
||||
|
||||
|
||||
/**
|
||||
* @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.
|
||||
*/
|
||||
unsigned int m_cachedMaxReadBufferOffset;
|
||||
|
||||
|
||||
/**
|
||||
* @brief a cached vector of all read operations in the execution group.
|
||||
*/
|
||||
Operations m_cachedReadOperations;
|
||||
|
||||
|
||||
/**
|
||||
* @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
|
||||
*/
|
||||
const bNodeTree *m_bTree;
|
||||
|
||||
|
||||
/**
|
||||
* @brief total number of chunks that have been calculated for this ExecutionGroup
|
||||
*/
|
||||
unsigned int m_chunksFinished;
|
||||
|
||||
|
||||
/**
|
||||
* @brief the chunkExecutionStates holds per chunk the execution state. this state can be
|
||||
* - COM_ES_NOT_SCHEDULED: not scheduled
|
||||
|
@ -155,7 +155,7 @@ private:
|
|||
* - COM_ES_EXECUTED: executed
|
||||
*/
|
||||
ChunkExecutionState *m_chunkExecutionStates;
|
||||
|
||||
|
||||
/**
|
||||
* @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
|
||||
|
@ -184,7 +184,7 @@ private:
|
|||
* @param operation the operation to be added
|
||||
*/
|
||||
bool canContainOperation(NodeOperation *operation);
|
||||
|
||||
|
||||
/**
|
||||
* @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.
|
||||
|
@ -192,21 +192,21 @@ private:
|
|||
* @note by the calling method.
|
||||
*/
|
||||
unsigned int determineChunkSize();
|
||||
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* @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
|
||||
* @see determineChunkSize()
|
||||
*/
|
||||
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.
|
||||
* @note The result are stored in the fields numberOfChunks, numberOfXChunks, numberOfYChunks
|
||||
*/
|
||||
void determineNumberOfChunks();
|
||||
|
||||
|
||||
/**
|
||||
* @brief try to schedule a specific chunk.
|
||||
* @note scheduling succeeds when all input requirements are met and the chunks hasn't been scheduled yet.
|
||||
|
@ -236,7 +236,7 @@ private:
|
|||
* @param chunknumber
|
||||
*/
|
||||
bool scheduleChunk(unsigned int chunkNumber);
|
||||
|
||||
|
||||
/**
|
||||
* @brief determine the area of interest of a certain input area
|
||||
* @note This method only evaluates a single ReadBufferOperation
|
||||
|
@ -250,7 +250,7 @@ private:
|
|||
public:
|
||||
// constructors
|
||||
ExecutionGroup();
|
||||
|
||||
|
||||
// methods
|
||||
/**
|
||||
* @brief add an operation to this ExecutionGroup
|
||||
|
@ -261,7 +261,7 @@ public:
|
|||
* @return True if the operation was successfully added
|
||||
*/
|
||||
bool addOperation(NodeOperation *operation);
|
||||
|
||||
|
||||
/**
|
||||
* @brief is this ExecutionGroup an output ExecutionGroup
|
||||
* @note An OutputExecution group are groups containing a
|
||||
|
@ -281,47 +281,47 @@ public:
|
|||
* @param resolution
|
||||
*/
|
||||
void determineResolution(unsigned int resolution[2]);
|
||||
|
||||
|
||||
/**
|
||||
* @brief set the resolution of this executiongroup
|
||||
* @param resolution
|
||||
*/
|
||||
void setResolution(unsigned int resolution[2]) { this->m_width = resolution[0]; this->m_height = resolution[1]; }
|
||||
|
||||
|
||||
/**
|
||||
* @brief get the width of this execution group
|
||||
*/
|
||||
unsigned int getWidth() const { return m_width; }
|
||||
|
||||
|
||||
/**
|
||||
* @brief get the height of this execution group
|
||||
*/
|
||||
unsigned int getHeight() const { return m_height; }
|
||||
|
||||
|
||||
/**
|
||||
* @brief does this ExecutionGroup contains a complex NodeOperation
|
||||
*/
|
||||
bool isComplex() const { return m_complex; }
|
||||
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* @brief get the output operation of this ExecutionGroup
|
||||
* @return NodeOperation *output operation
|
||||
*/
|
||||
NodeOperation *getOutputOperation() const;
|
||||
|
||||
|
||||
/**
|
||||
* @brief compose multiple chunks into a single chunk
|
||||
* @return Memorybuffer *consolidated chunk
|
||||
*/
|
||||
MemoryBuffer *constructConsolidatedMemoryBuffer(MemoryProxy *memoryProxy, rcti *output);
|
||||
|
||||
|
||||
/**
|
||||
* @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.
|
||||
*/
|
||||
void initExecution();
|
||||
|
||||
|
||||
/**
|
||||
* @brief get all inputbuffers needed to calculate an chunk
|
||||
* @note all inputbuffers must be executed
|
||||
|
@ -352,14 +352,14 @@ public:
|
|||
* @param memorybuffers
|
||||
*/
|
||||
void finalizeChunkExecution(int chunkNumber, MemoryBuffer **memoryBuffers);
|
||||
|
||||
|
||||
/**
|
||||
* @brief deinitExecution is called just after execution the whole graph.
|
||||
* @note It will release all needed resources
|
||||
*/
|
||||
void deinitExecution();
|
||||
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* @brief schedule an ExecutionGroup
|
||||
* @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
|
||||
*/
|
||||
void execute(ExecutionSystem *system);
|
||||
|
||||
|
||||
/**
|
||||
* @brief this method determines the MemoryProxy's where this execution group depends on.
|
||||
* @note After this method determineDependingAreaOfInterest can be called to determine
|
||||
|
@ -383,7 +383,7 @@ public:
|
|||
* @param memoryProxies result
|
||||
*/
|
||||
void determineDependingMemoryProxies(vector<MemoryProxy *> *memoryProxies);
|
||||
|
||||
|
||||
/**
|
||||
* @brief Determine the rect (minx, maxx, miny, maxy) of a chunk.
|
||||
* @note Only gives useful results ater the determination of the chunksize
|
||||
|
|
|
@ -132,7 +132,7 @@ void ExecutionSystem::execute()
|
|||
editingtree->stats_draw(editingtree->sdh, IFACE_("Compositing | Initializing execution"));
|
||||
|
||||
DebugInfo::execute_started(this);
|
||||
|
||||
|
||||
unsigned int order = 0;
|
||||
for (vector<NodeOperation *>::iterator iter = this->m_operations.begin(); iter != this->m_operations.end(); ++iter) {
|
||||
NodeOperation *operation = *iter;
|
||||
|
|
|
@ -114,7 +114,7 @@ class ExecutionSystem {
|
|||
public:
|
||||
typedef std::vector<NodeOperation*> Operations;
|
||||
typedef std::vector<ExecutionGroup*> Groups;
|
||||
|
||||
|
||||
private:
|
||||
/**
|
||||
* @brief the context used during execution
|
||||
|
@ -136,7 +136,7 @@ private: //methods
|
|||
* find all execution group with output nodes
|
||||
*/
|
||||
void findOutputExecutionGroup(vector<ExecutionGroup *> *result, CompositorPriority priority) const;
|
||||
|
||||
|
||||
/**
|
||||
* find all execution group with output nodes
|
||||
*/
|
||||
|
|
|
@ -64,29 +64,29 @@ private:
|
|||
* @brief proxy of the memory (same for all chunks in the same buffer)
|
||||
*/
|
||||
MemoryProxy *m_memoryProxy;
|
||||
|
||||
|
||||
/**
|
||||
* @brief the type of buffer COM_DT_VALUE, COM_DT_VECTOR, COM_DT_COLOR
|
||||
*/
|
||||
DataType m_datatype;
|
||||
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* @brief region of this buffer inside relative to the MemoryProxy
|
||||
*/
|
||||
rcti m_rect;
|
||||
|
||||
|
||||
/**
|
||||
* brief refers to the chunknumber within the executiongroup where related to the MemoryProxy
|
||||
* @see memoryProxy
|
||||
*/
|
||||
unsigned int m_chunkNumber;
|
||||
|
||||
|
||||
/**
|
||||
* @brief state of the buffer
|
||||
*/
|
||||
MemoryBufferState m_state;
|
||||
|
||||
|
||||
/**
|
||||
* @brief the actual float buffer/data
|
||||
*/
|
||||
|
@ -106,7 +106,7 @@ public:
|
|||
* @brief construct new MemoryBuffer for a chunk
|
||||
*/
|
||||
MemoryBuffer(MemoryProxy *memoryProxy, unsigned int chunkNumber, rcti *rect);
|
||||
|
||||
|
||||
/**
|
||||
* @brief construct new temporarily MemoryBuffer for an area
|
||||
*/
|
||||
|
@ -121,7 +121,7 @@ public:
|
|||
* @brief destructor
|
||||
*/
|
||||
~MemoryBuffer();
|
||||
|
||||
|
||||
/**
|
||||
* @brief read the ChunkNumber of this MemoryBuffer
|
||||
*/
|
||||
|
@ -134,7 +134,7 @@ public:
|
|||
* @note buffer should already be available in memory
|
||||
*/
|
||||
float *getBuffer() { return this->m_buffer; }
|
||||
|
||||
|
||||
/**
|
||||
* @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;
|
||||
}
|
||||
|
||||
|
||||
inline void wrap_pixel(int &x, int &y, MemoryBufferExtend extend_x, MemoryBufferExtend extend_y)
|
||||
{
|
||||
int w = this->m_width;
|
||||
int h = this->m_height;
|
||||
x = x - m_rect.xmin;
|
||||
y = y - m_rect.ymin;
|
||||
|
||||
|
||||
switch (extend_x) {
|
||||
case COM_MB_CLIP:
|
||||
break;
|
||||
|
@ -161,7 +161,7 @@ public:
|
|||
x = (x >= 0.0f ? (x % w) : (x % w) + w);
|
||||
break;
|
||||
}
|
||||
|
||||
|
||||
switch (extend_y) {
|
||||
case COM_MB_CLIP:
|
||||
break;
|
||||
|
@ -174,7 +174,7 @@ public:
|
|||
break;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
inline void wrap_pixel(float &x, float &y, MemoryBufferExtend extend_x, MemoryBufferExtend extend_y)
|
||||
{
|
||||
float w = (float)this->m_width;
|
||||
|
@ -249,7 +249,7 @@ public:
|
|||
float *buffer = &this->m_buffer[offset];
|
||||
memcpy(result, buffer, sizeof(float) * this->m_num_channels);
|
||||
}
|
||||
|
||||
|
||||
void writePixel(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,
|
||||
|
@ -271,12 +271,12 @@ public:
|
|||
}
|
||||
|
||||
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)
|
||||
*/
|
||||
inline const bool isTemporarily() const { return this->m_state == COM_MB_TEMPORARILY; }
|
||||
|
||||
|
||||
/**
|
||||
* @brief add the content from otherBuffer to this MemoryBuffer
|
||||
* @param otherBuffer source buffer
|
||||
|
@ -285,29 +285,29 @@ public:
|
|||
* uninitialized values in areas where the buffers don't overlap.
|
||||
*/
|
||||
void copyContentFrom(MemoryBuffer *otherBuffer);
|
||||
|
||||
|
||||
/**
|
||||
* @brief get the rect of this MemoryBuffer
|
||||
*/
|
||||
rcti *getRect() { return &this->m_rect; }
|
||||
|
||||
|
||||
/**
|
||||
* @brief get the width of this MemoryBuffer
|
||||
*/
|
||||
int getWidth() const;
|
||||
|
||||
|
||||
/**
|
||||
* @brief get the height of this MemoryBuffer
|
||||
*/
|
||||
int getHeight() const;
|
||||
|
||||
|
||||
/**
|
||||
* @brief clear the buffer. Make all pixels black transparent.
|
||||
*/
|
||||
void clear();
|
||||
|
||||
|
||||
MemoryBuffer *duplicate();
|
||||
|
||||
|
||||
float getMaximumValue();
|
||||
float getMaximumValue(rcti *rect);
|
||||
private:
|
||||
|
|
|
@ -42,17 +42,17 @@ private:
|
|||
* @brief reference to the ouput operation of the executiongroup
|
||||
*/
|
||||
WriteBufferOperation *m_writeBufferOperation;
|
||||
|
||||
|
||||
/**
|
||||
* @brief reference to the executor. the Execution group that can fill a chunk
|
||||
*/
|
||||
ExecutionGroup *m_executor;
|
||||
|
||||
|
||||
/**
|
||||
* @brief datatype of this MemoryProxy
|
||||
*/
|
||||
/* DataType m_datatype; */ /* UNUSED */
|
||||
|
||||
|
||||
/**
|
||||
* @brief channel information of this buffer
|
||||
*/
|
||||
|
@ -70,7 +70,7 @@ private:
|
|||
|
||||
public:
|
||||
MemoryProxy(DataType type);
|
||||
|
||||
|
||||
/**
|
||||
* @brief set the ExecutionGroup that can be scheduled to calculate a certain chunk.
|
||||
* @param group the ExecutionGroup to set
|
||||
|
|
|
@ -54,7 +54,7 @@ Node::Node(bNode *editorNode, bool create_sockets) :
|
|||
DataType dt = COM_DT_VALUE;
|
||||
if (input->type == SOCK_RGBA) dt = COM_DT_COLOR;
|
||||
if (input->type == SOCK_VECTOR) dt = COM_DT_VECTOR;
|
||||
|
||||
|
||||
this->addInputSocket(dt, input);
|
||||
input = input->next;
|
||||
}
|
||||
|
@ -63,7 +63,7 @@ Node::Node(bNode *editorNode, bool create_sockets) :
|
|||
DataType dt = COM_DT_VALUE;
|
||||
if (output->type == SOCK_RGBA) dt = COM_DT_COLOR;
|
||||
if (output->type == SOCK_VECTOR) dt = COM_DT_VECTOR;
|
||||
|
||||
|
||||
this->addOutputSocket(dt, output);
|
||||
output = output->next;
|
||||
}
|
||||
|
@ -96,7 +96,7 @@ void Node::addInputSocket(DataType datatype, bNodeSocket *bSocket)
|
|||
void Node::addOutputSocket(DataType datatype)
|
||||
{
|
||||
this->addOutputSocket(datatype, NULL);
|
||||
|
||||
|
||||
}
|
||||
void Node::addOutputSocket(DataType datatype, bNodeSocket *bSocket)
|
||||
{
|
||||
|
|
|
@ -45,13 +45,13 @@ class Node {
|
|||
public:
|
||||
typedef std::vector<NodeInput *> Inputs;
|
||||
typedef std::vector<NodeOutput *> Outputs;
|
||||
|
||||
|
||||
private:
|
||||
/**
|
||||
* @brief stores the reference to the SDNA bNode struct
|
||||
*/
|
||||
bNodeTree *m_editorNodeTree;
|
||||
|
||||
|
||||
/**
|
||||
* @brief stores the reference to the SDNA bNode struct
|
||||
*/
|
||||
|
@ -82,7 +82,7 @@ protected:
|
|||
* @brief get access to the vector of input sockets
|
||||
*/
|
||||
const Inputs &getInputSockets() const { return this->m_inputsockets; }
|
||||
|
||||
|
||||
/**
|
||||
* @brief get access to the vector of input sockets
|
||||
*/
|
||||
|
@ -101,14 +101,14 @@ public:
|
|||
* @brief get the reference to the SDNA bNodeTree struct
|
||||
*/
|
||||
bNodeTree *getbNodeTree() const {return m_editorNodeTree;}
|
||||
|
||||
|
||||
/**
|
||||
* @brief set the reference to the bNode
|
||||
* @note used in Node instances to receive the storage/settings and complex node for highlight during execution
|
||||
* @param bNode
|
||||
*/
|
||||
void setbNode(bNode *node) {this->m_editorNode = node;}
|
||||
|
||||
|
||||
/**
|
||||
* @brief set the reference to the bNodeTree
|
||||
* @param bNodeTree
|
||||
|
@ -131,35 +131,35 @@ public:
|
|||
* the index of the needed outputsocket
|
||||
*/
|
||||
NodeOutput *getOutputSocket(const unsigned int index) const;
|
||||
|
||||
|
||||
/**
|
||||
* get the reference to the first outputsocket
|
||||
* @param index
|
||||
* the index of the needed outputsocket
|
||||
*/
|
||||
inline NodeOutput *getOutputSocket() const { return getOutputSocket(0); }
|
||||
|
||||
|
||||
/**
|
||||
* get the reference to a certain inputsocket
|
||||
* @param index
|
||||
* the index of the needed inputsocket
|
||||
*/
|
||||
NodeInput *getInputSocket(const unsigned int index) const;
|
||||
|
||||
|
||||
/** Check if this is an input node
|
||||
* An input node is a node that only has output sockets and no input sockets
|
||||
*/
|
||||
bool isInputNode() const { return m_inputsockets.empty(); }
|
||||
|
||||
|
||||
/**
|
||||
* @brief Is this node in the active group (the group that is being edited)
|
||||
* @param isInActiveGroup
|
||||
*/
|
||||
void setIsInActiveGroup(bool value) { this->m_inActiveGroup = value; }
|
||||
|
||||
|
||||
/**
|
||||
* @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)
|
||||
* @return bool [false:true]
|
||||
*/
|
||||
|
@ -174,7 +174,7 @@ public:
|
|||
* @param context reference to the CompositorContext
|
||||
*/
|
||||
virtual void convertToOperations(NodeConverter &converter, const CompositorContext &context) const = 0;
|
||||
|
||||
|
||||
/**
|
||||
* 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]
|
||||
*/
|
||||
void convertToOperations_invalid(NodeConverter *compiler) const;
|
||||
|
||||
|
||||
void setInstanceKey(bNodeInstanceKey instance_key) { m_instanceKey = instance_key; }
|
||||
bNodeInstanceKey getInstanceKey() const { return m_instanceKey; }
|
||||
|
||||
|
||||
protected:
|
||||
/**
|
||||
* @brief add an NodeInput to the collection of inputsockets
|
||||
|
@ -197,7 +197,7 @@ protected:
|
|||
*/
|
||||
void addInputSocket(DataType datatype);
|
||||
void addInputSocket(DataType datatype, bNodeSocket *socket);
|
||||
|
||||
|
||||
/**
|
||||
* @brief add an NodeOutput to the collection of outputsockets
|
||||
* @note may only be called in an constructor
|
||||
|
@ -205,7 +205,7 @@ protected:
|
|||
*/
|
||||
void addOutputSocket(DataType datatype);
|
||||
void addOutputSocket(DataType datatype, bNodeSocket *socket);
|
||||
|
||||
|
||||
bNodeSocket *getEditorInputSocket(int editorNodeInputSocketIndex);
|
||||
bNodeSocket *getEditorOutputSocket(int editorNodeOutputSocketIndex);
|
||||
};
|
||||
|
@ -219,26 +219,26 @@ class NodeInput {
|
|||
private:
|
||||
Node *m_node;
|
||||
bNodeSocket *m_editorSocket;
|
||||
|
||||
|
||||
DataType m_datatype;
|
||||
|
||||
|
||||
/**
|
||||
* @brief link connected to this NodeInput.
|
||||
* An input socket can only have a single link
|
||||
*/
|
||||
NodeOutput *m_link;
|
||||
|
||||
|
||||
public:
|
||||
NodeInput(Node *node, bNodeSocket *b_socket, DataType datatype);
|
||||
|
||||
|
||||
Node *getNode() const { return this->m_node; }
|
||||
DataType getDataType() const { return m_datatype; }
|
||||
bNodeSocket *getbNodeSocket() const { return this->m_editorSocket; }
|
||||
|
||||
|
||||
void setLink(NodeOutput *link);
|
||||
bool isLinked() const { return m_link; }
|
||||
NodeOutput *getLink() { return m_link; }
|
||||
|
||||
|
||||
float getEditorValueFloat();
|
||||
void getEditorValueColor(float *value);
|
||||
void getEditorValueVector(float *value);
|
||||
|
@ -253,16 +253,16 @@ class NodeOutput {
|
|||
private:
|
||||
Node *m_node;
|
||||
bNodeSocket *m_editorSocket;
|
||||
|
||||
|
||||
DataType m_datatype;
|
||||
|
||||
|
||||
public:
|
||||
NodeOutput(Node *node, bNodeSocket *b_socket, DataType datatype);
|
||||
|
||||
|
||||
Node *getNode() const { return this->m_node; }
|
||||
DataType getDataType() const { return m_datatype; }
|
||||
bNodeSocket *getbNodeSocket() const { return this->m_editorSocket; }
|
||||
|
||||
|
||||
float getEditorValueFloat();
|
||||
void getEditorValueColor(float *value);
|
||||
void getEditorValueVector(float *value);
|
||||
|
|
|
@ -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 */
|
||||
const float warning_color[4] = {1.0f, 0.0f, 1.0f, 1.0f};
|
||||
|
||||
|
||||
SetColorOperation *operation = new SetColorOperation();
|
||||
operation->setChannels(warning_color);
|
||||
|
||||
|
||||
m_builder->addOperation(operation);
|
||||
m_builder->mapOutputSocket(output, operation->getOutputSocket());
|
||||
|
||||
|
||||
return operation;
|
||||
}
|
||||
|
||||
|
@ -87,9 +87,9 @@ NodeOperationOutput *NodeConverter::addInputProxy(NodeInput *input, bool use_con
|
|||
{
|
||||
SocketProxyOperation *proxy = new SocketProxyOperation(input->getDataType(), use_conversion);
|
||||
m_builder->addOperation(proxy);
|
||||
|
||||
|
||||
m_builder->mapInputSocket(input, proxy->getInputSocket(0));
|
||||
|
||||
|
||||
return proxy->getOutputSocket();
|
||||
}
|
||||
|
||||
|
@ -97,9 +97,9 @@ NodeOperationInput *NodeConverter::addOutputProxy(NodeOutput *output, bool use_c
|
|||
{
|
||||
SocketProxyOperation *proxy = new SocketProxyOperation(output->getDataType(), use_conversion);
|
||||
m_builder->addOperation(proxy);
|
||||
|
||||
|
||||
m_builder->mapOutputSocket(output, proxy->getOutputSocket());
|
||||
|
||||
|
||||
return proxy->getInputSocket(0);
|
||||
}
|
||||
|
||||
|
@ -107,7 +107,7 @@ void NodeConverter::addInputValue(NodeOperationInput *input, float value)
|
|||
{
|
||||
SetValueOperation *operation = new SetValueOperation();
|
||||
operation->setValue(value);
|
||||
|
||||
|
||||
m_builder->addOperation(operation);
|
||||
m_builder->addLink(operation->getOutputSocket(), input);
|
||||
}
|
||||
|
@ -116,7 +116,7 @@ void NodeConverter::addInputColor(NodeOperationInput *input, const float value[4
|
|||
{
|
||||
SetColorOperation *operation = new SetColorOperation();
|
||||
operation->setChannels(value);
|
||||
|
||||
|
||||
m_builder->addOperation(operation);
|
||||
m_builder->addLink(operation->getOutputSocket(), input);
|
||||
}
|
||||
|
@ -125,7 +125,7 @@ void NodeConverter::addInputVector(NodeOperationInput *input, const float value[
|
|||
{
|
||||
SetVectorOperation *operation = new SetVectorOperation();
|
||||
operation->setVector(value);
|
||||
|
||||
|
||||
m_builder->addOperation(operation);
|
||||
m_builder->addLink(operation->getOutputSocket(), input);
|
||||
}
|
||||
|
@ -134,7 +134,7 @@ void NodeConverter::addOutputValue(NodeOutput *output, float value)
|
|||
{
|
||||
SetValueOperation *operation = new SetValueOperation();
|
||||
operation->setValue(value);
|
||||
|
||||
|
||||
m_builder->addOperation(operation);
|
||||
m_builder->mapOutputSocket(output, operation->getOutputSocket());
|
||||
}
|
||||
|
@ -143,7 +143,7 @@ void NodeConverter::addOutputColor(NodeOutput *output, const float value[4])
|
|||
{
|
||||
SetColorOperation *operation = new SetColorOperation();
|
||||
operation->setChannels(value);
|
||||
|
||||
|
||||
m_builder->addOperation(operation);
|
||||
m_builder->mapOutputSocket(output, operation->getOutputSocket());
|
||||
}
|
||||
|
@ -152,7 +152,7 @@ void NodeConverter::addOutputVector(NodeOutput *output, const float value[3])
|
|||
{
|
||||
SetVectorOperation *operation = new SetVectorOperation();
|
||||
operation->setVector(value);
|
||||
|
||||
|
||||
m_builder->addOperation(operation);
|
||||
m_builder->mapOutputSocket(output, operation->getOutputSocket());
|
||||
}
|
||||
|
|
|
@ -44,28 +44,28 @@ class ViewerOperation;
|
|||
class NodeConverter {
|
||||
public:
|
||||
NodeConverter(NodeOperationBuilder *builder);
|
||||
|
||||
|
||||
/** Insert a new operation into the operations graph.
|
||||
* The operation must be created by the node.
|
||||
*/
|
||||
void addOperation(NodeOperation *operation);
|
||||
|
||||
|
||||
/** Map input socket of the node to an operation socket.
|
||||
* Links between nodes will then generate equivalent links between
|
||||
* the mapped operation sockets.
|
||||
*
|
||||
*
|
||||
* \note A \a Node input can be mapped to multiple \a NodeOperation inputs.
|
||||
*/
|
||||
void mapInputSocket(NodeInput *node_socket, NodeOperationInput *operation_socket);
|
||||
/** Map output socket of the node to an operation socket.
|
||||
* Links between nodes will then generate equivalent links between
|
||||
* the mapped operation sockets.
|
||||
*
|
||||
*
|
||||
* \note A \a Node output can only be mapped to one \a NodeOperation output.
|
||||
* Any existing operation output mapping will be replaced.
|
||||
*/
|
||||
void mapOutputSocket(NodeOutput *node_socket, NodeOperationOutput *operation_socket);
|
||||
|
||||
|
||||
/** Create a proxy operation for a node input.
|
||||
* This operation will be removed later and replaced
|
||||
* by direct links between the connected operations.
|
||||
|
@ -76,39 +76,39 @@ public:
|
|||
* by direct links between the connected operations.
|
||||
*/
|
||||
NodeOperationInput *addOutputProxy(NodeOutput *output, bool use_conversion);
|
||||
|
||||
|
||||
/** Define a constant input value. */
|
||||
void addInputValue(NodeOperationInput *input, float value);
|
||||
/** Define a constant input color. */
|
||||
void addInputColor(NodeOperationInput *input, const float value[4]);
|
||||
/** Define a constant input vector. */
|
||||
void addInputVector(NodeOperationInput *input, const float value[3]);
|
||||
|
||||
|
||||
/** Define a constant output value. */
|
||||
void addOutputValue(NodeOutput *output, float value);
|
||||
/** Define a constant output color. */
|
||||
void addOutputColor(NodeOutput *output, const float value[4]);
|
||||
/** Define a constant output vector. */
|
||||
void addOutputVector(NodeOutput *output, const float value[3]);
|
||||
|
||||
|
||||
/** Add an explicit link between two operations. */
|
||||
void addLink(NodeOperationOutput *from, NodeOperationInput *to);
|
||||
|
||||
|
||||
/** Add a preview operation for a operation output. */
|
||||
void addPreview(NodeOperationOutput *output);
|
||||
/** Add a preview operation for a node input. */
|
||||
void addNodeInputPreview(NodeInput *input);
|
||||
|
||||
|
||||
/** When a node has no valid data
|
||||
* @note missing image / group pointer, or missing renderlayer from EXR
|
||||
*/
|
||||
NodeOperation *setInvalidOutput(NodeOutput *output);
|
||||
|
||||
|
||||
/** Define a viewer operation as the active output, if possible */
|
||||
void registerViewer(ViewerOperation *viewer);
|
||||
/** The currently active viewer output operation */
|
||||
ViewerOperation *active_viewer() const;
|
||||
|
||||
|
||||
private:
|
||||
/** The internal builder for storing the results of the graph construction. */
|
||||
NodeOperationBuilder *m_builder;
|
||||
|
|
|
@ -82,16 +82,16 @@ void NodeGraph::add_node(Node *node, bNodeTree *b_ntree, bNodeInstanceKey key, b
|
|||
node->setbNodeTree(b_ntree);
|
||||
node->setInstanceKey(key);
|
||||
node->setIsInActiveGroup(is_active_group);
|
||||
|
||||
|
||||
m_nodes.push_back(node);
|
||||
|
||||
|
||||
DebugInfo::node_added(node);
|
||||
}
|
||||
|
||||
void NodeGraph::add_link(NodeOutput *fromSocket, NodeInput *toSocket)
|
||||
{
|
||||
m_links.push_back(Link(fromSocket, toSocket));
|
||||
|
||||
|
||||
/* register with the input */
|
||||
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)
|
||||
{
|
||||
const bNodeTree *basetree = context.getbNodeTree();
|
||||
|
||||
|
||||
/* 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);
|
||||
|
||||
|
||||
/* add all nodes of the tree to the node list */
|
||||
for (bNode *node = (bNode *)tree->nodes.first; node; node = node->next) {
|
||||
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);
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
/* replace slow nodes with proxies for fast execution */
|
||||
if (context.isFastCalculation() && !Converter::is_fast_node(b_node)) {
|
||||
add_proxies_skip(b_ntree, b_node, key, is_active_group);
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
/* special node types */
|
||||
if (b_node->type == NODE_GROUP) {
|
||||
add_proxies_group(context, b_node, key);
|
||||
|
@ -181,15 +181,15 @@ void NodeGraph::add_bNodeLink(const NodeRange &node_range, bNodeLink *b_nodelink
|
|||
return;
|
||||
if ((b_nodelink->fromsock->flag & SOCK_UNAVAIL) || (b_nodelink->tosock->flag & SOCK_UNAVAIL))
|
||||
return;
|
||||
|
||||
|
||||
/* Note: a DNA input socket can have multiple NodeInput in the compositor tree! (proxies)
|
||||
* The output then gets linked to each one of them.
|
||||
*/
|
||||
|
||||
|
||||
NodeOutput *output = find_output(node_range, b_nodelink->fromsock);
|
||||
if (!output)
|
||||
return;
|
||||
|
||||
|
||||
NodeInputs inputs = find_inputs(node_range, b_nodelink->tosock);
|
||||
for (NodeInputs::const_iterator it = inputs.begin(); it != inputs.end(); ++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) {
|
||||
bNodeSocket *input;
|
||||
|
||||
|
||||
/* look for first input with matching datatype for each output */
|
||||
for (input = (bNodeSocket *)b_node->inputs.first; input; input = input->next) {
|
||||
if (input->type == output->type)
|
||||
break;
|
||||
}
|
||||
|
||||
|
||||
if (input) {
|
||||
SocketProxyNode *proxy = new SocketProxyNode(b_node, input, output, true);
|
||||
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;
|
||||
BLI_assert(b_group_tree); /* should have been checked in advance */
|
||||
|
||||
|
||||
/* not important for proxies */
|
||||
bNodeInstanceKey key = NODE_INSTANCE_KEY_BASE;
|
||||
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) {
|
||||
bNodeSocket *b_sock_group = find_b_node_input(b_node, b_sock_io->identifier);
|
||||
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;
|
||||
BLI_assert(b_group_tree); /* should have been checked in advance */
|
||||
|
||||
|
||||
/* not important for proxies */
|
||||
bNodeInstanceKey key = NODE_INSTANCE_KEY_BASE;
|
||||
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) {
|
||||
bNodeSocket *b_sock_group = find_b_node_output(b_node, b_sock_io->identifier);
|
||||
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) {
|
||||
if (b_node_io->type == NODE_GROUP_INPUT)
|
||||
add_proxies_group_inputs(b_node, b_node_io);
|
||||
|
||||
|
||||
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_bNodeTree(context, nodes_start, b_group_tree, key);
|
||||
}
|
||||
|
||||
|
|
|
@ -48,66 +48,66 @@ public:
|
|||
private:
|
||||
NodeOutput *m_from;
|
||||
NodeInput *m_to;
|
||||
|
||||
|
||||
public:
|
||||
Link(NodeOutput *from, NodeInput *to) :
|
||||
m_from(from),
|
||||
m_to(to)
|
||||
{}
|
||||
|
||||
|
||||
NodeOutput *getFromSocket() const { return m_from; }
|
||||
NodeInput *getToSocket() const { return m_to; }
|
||||
};
|
||||
|
||||
|
||||
typedef std::vector<Node *> Nodes;
|
||||
typedef Nodes::iterator NodeIterator;
|
||||
typedef std::vector<Link> Links;
|
||||
|
||||
|
||||
private:
|
||||
Nodes m_nodes;
|
||||
Links m_links;
|
||||
|
||||
|
||||
public:
|
||||
NodeGraph();
|
||||
~NodeGraph();
|
||||
|
||||
|
||||
const Nodes &nodes() const { return m_nodes; }
|
||||
const Links &links() const { return m_links; }
|
||||
|
||||
|
||||
void from_bNodeTree(const CompositorContext &context, bNodeTree *tree);
|
||||
|
||||
|
||||
protected:
|
||||
typedef std::pair<NodeIterator, NodeIterator> NodeRange;
|
||||
typedef std::vector<NodeInput *> NodeInputs;
|
||||
|
||||
|
||||
static bNodeSocket *find_b_node_input(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_link(NodeOutput *fromSocket, NodeInput *toSocket);
|
||||
|
||||
|
||||
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);
|
||||
|
||||
|
||||
NodeInputs find_inputs(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);
|
||||
|
||||
|
||||
/* **** Special proxy node type conversions **** */
|
||||
/* These nodes are not represented in the node graph themselves,
|
||||
* 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_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_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_reroute(bNodeTree *b_ntree, bNode *b_node, bNodeInstanceKey key, bool is_active_group);
|
||||
|
||||
|
||||
#ifdef WITH_CXX_GUARDEDALLOC
|
||||
MEM_CXX_CLASS_ALLOC_FUNCS("COM:NodeGraph")
|
||||
#endif
|
||||
|
|
|
@ -83,7 +83,7 @@ void NodeOperation::determineResolution(unsigned int resolution[2], unsigned int
|
|||
{
|
||||
unsigned int temp[2];
|
||||
unsigned int temp2[2];
|
||||
|
||||
|
||||
for (unsigned int index = 0; index < m_inputs.size(); index++) {
|
||||
NodeOperationInput *input = m_inputs[index];
|
||||
if (input->isConnected()) {
|
||||
|
|
|
@ -81,11 +81,11 @@ class NodeOperation : public SocketReader {
|
|||
public:
|
||||
typedef std::vector<NodeOperationInput*> Inputs;
|
||||
typedef std::vector<NodeOperationOutput*> Outputs;
|
||||
|
||||
|
||||
private:
|
||||
Inputs m_inputs;
|
||||
Outputs m_outputs;
|
||||
|
||||
|
||||
/**
|
||||
* @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.
|
||||
*/
|
||||
ThreadMutex m_mutex;
|
||||
|
||||
|
||||
/**
|
||||
* @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
|
||||
*/
|
||||
bool m_isResolutionSet;
|
||||
|
||||
|
||||
public:
|
||||
virtual ~NodeOperation();
|
||||
|
||||
|
||||
unsigned int getNumberOfInputSockets() const { return m_inputs.size(); }
|
||||
unsigned int getNumberOfOutputSockets() const { return m_outputs.size(); }
|
||||
NodeOperationOutput *getOutputSocket(unsigned int index) const;
|
||||
NodeOperationOutput *getOutputSocket() const { return getOutputSocket(0); }
|
||||
NodeOperationInput *getInputSocket(unsigned int index) const;
|
||||
|
||||
|
||||
/** Check if this is an input operation
|
||||
* An input operation is an operation that only has output sockets and no input sockets
|
||||
*/
|
||||
bool isInputOperation() const { return m_inputs.empty(); }
|
||||
|
||||
|
||||
/**
|
||||
* @brief determine the resolution of this node
|
||||
* @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; }
|
||||
virtual void initExecution();
|
||||
|
||||
|
||||
/**
|
||||
* @brief when a chunk is executed by a CPUDevice, this method is called
|
||||
* @ingroup execution
|
||||
|
@ -231,7 +231,7 @@ public:
|
|||
this->m_isResolutionSet = true;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
void getConnectedInputSockets(Inputs *sockets);
|
||||
|
||||
|
@ -288,14 +288,14 @@ public:
|
|||
* @see ExecutionGroup.addOperation
|
||||
*/
|
||||
bool isOpenCL() const { return this->m_openCL; }
|
||||
|
||||
|
||||
virtual bool isViewerOperation() const { return false; }
|
||||
virtual bool isPreviewOperation() const { return false; }
|
||||
virtual bool isFileOutputOperation() const { return false; }
|
||||
virtual bool isProxyOperation() const { return false; }
|
||||
|
||||
|
||||
virtual bool useDatatypeConversion() const { return true; }
|
||||
|
||||
|
||||
inline bool isBreaked() const {
|
||||
return this->m_btree->test_break(this->m_btree->tbh);
|
||||
}
|
||||
|
@ -319,7 +319,7 @@ protected:
|
|||
void initMutex();
|
||||
void lockMutex();
|
||||
void unlockMutex();
|
||||
|
||||
|
||||
/**
|
||||
* @brief set whether this operation is complex
|
||||
*
|
||||
|
@ -345,35 +345,35 @@ protected:
|
|||
class NodeOperationInput {
|
||||
private:
|
||||
NodeOperation *m_operation;
|
||||
|
||||
|
||||
/** Datatype of this socket. Is used for automatically data transformation.
|
||||
* @section data-conversion
|
||||
*/
|
||||
DataType m_datatype;
|
||||
|
||||
|
||||
/** Resize mode of this socket */
|
||||
InputResizeMode m_resizeMode;
|
||||
|
||||
|
||||
/** Connected output */
|
||||
NodeOperationOutput *m_link;
|
||||
|
||||
|
||||
public:
|
||||
NodeOperationInput(NodeOperation *op, DataType datatype, InputResizeMode resizeMode = COM_SC_CENTER);
|
||||
|
||||
|
||||
NodeOperation &getOperation() const { return *m_operation; }
|
||||
DataType getDataType() const { return m_datatype; }
|
||||
|
||||
|
||||
void setLink(NodeOperationOutput *link) { m_link = link; }
|
||||
NodeOperationOutput *getLink() const { return m_link; }
|
||||
bool isConnected() const { return m_link; }
|
||||
|
||||
|
||||
void setResizeMode(InputResizeMode resizeMode) { this->m_resizeMode = resizeMode; }
|
||||
InputResizeMode getResizeMode() const { return this->m_resizeMode; }
|
||||
|
||||
|
||||
SocketReader *getReader();
|
||||
|
||||
|
||||
void determineResolution(unsigned int resolution[2], unsigned int preferredResolution[2]);
|
||||
|
||||
|
||||
#ifdef WITH_CXX_GUARDEDALLOC
|
||||
MEM_CXX_CLASS_ALLOC_FUNCS("COM:NodeOperation")
|
||||
#endif
|
||||
|
@ -383,18 +383,18 @@ public:
|
|||
class NodeOperationOutput {
|
||||
private:
|
||||
NodeOperation *m_operation;
|
||||
|
||||
|
||||
/** Datatype of this socket. Is used for automatically data transformation.
|
||||
* @section data-conversion
|
||||
*/
|
||||
DataType m_datatype;
|
||||
|
||||
|
||||
public:
|
||||
NodeOperationOutput(NodeOperation *op, DataType datatype);
|
||||
|
||||
|
||||
NodeOperation &getOperation() const { return *m_operation; }
|
||||
DataType getDataType() const { return m_datatype; }
|
||||
|
||||
|
||||
/**
|
||||
* @brief determine the resolution of this data going through this socket
|
||||
* @param resolution the result of this operation
|
||||
|
|
|
@ -58,18 +58,18 @@ void NodeOperationBuilder::convertToOperations(ExecutionSystem *system)
|
|||
{
|
||||
/* interface handle for nodes */
|
||||
NodeConverter converter(this);
|
||||
|
||||
|
||||
for (int index = 0; index < m_graph.nodes().size(); index++) {
|
||||
Node *node = (Node *)m_graph.nodes()[index];
|
||||
|
||||
|
||||
m_current_node = node;
|
||||
|
||||
|
||||
DebugInfo::node_to_operations(node);
|
||||
node->convertToOperations(converter, *m_context);
|
||||
}
|
||||
|
||||
|
||||
m_current_node = NULL;
|
||||
|
||||
|
||||
/* The input map constructed by nodes maps operation inputs to node inputs.
|
||||
* Inverting yields a map of node inputs to all connected operation inputs,
|
||||
* so multiple operations can use the same node input.
|
||||
|
@ -77,12 +77,12 @@ void NodeOperationBuilder::convertToOperations(ExecutionSystem *system)
|
|||
OpInputInverseMap inverse_input_map;
|
||||
for (InputSocketMap::const_iterator it = m_input_map.begin(); it != m_input_map.end(); ++it)
|
||||
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) {
|
||||
const NodeGraph::Link &link = *it;
|
||||
NodeOutput *from = link.getFromSocket();
|
||||
NodeInput *to = link.getToSocket();
|
||||
|
||||
|
||||
NodeOperationOutput *op_from = find_operation_output(m_output_map, from);
|
||||
const OpInputs &op_to_list = find_operation_inputs(inverse_input_map, to);
|
||||
if (!op_from || op_to_list.empty()) {
|
||||
|
@ -94,36 +94,36 @@ void NodeOperationBuilder::convertToOperations(ExecutionSystem *system)
|
|||
*/
|
||||
continue;
|
||||
}
|
||||
|
||||
|
||||
for (OpInputs::const_iterator it = op_to_list.begin(); it != op_to_list.end(); ++it) {
|
||||
NodeOperationInput *op_to = *it;
|
||||
addLink(op_from, op_to);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
add_operation_input_constants();
|
||||
|
||||
|
||||
resolve_proxies();
|
||||
|
||||
|
||||
add_datatype_conversions();
|
||||
|
||||
|
||||
determineResolutions();
|
||||
|
||||
|
||||
/* surround complex ops with read/write buffer */
|
||||
add_complex_operation_buffers();
|
||||
|
||||
|
||||
/* links not available from here on */
|
||||
/* XXX make m_links a local variable to avoid confusion! */
|
||||
m_links.clear();
|
||||
|
||||
|
||||
prune_operations();
|
||||
|
||||
|
||||
/* ensure topological (link-based) order of nodes */
|
||||
/*sort_operations();*/ /* not needed yet */
|
||||
|
||||
|
||||
/* create execution groups */
|
||||
group_operations();
|
||||
|
||||
|
||||
/* transfer resulting operations to the system */
|
||||
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(node_socket->getNode() == m_current_node);
|
||||
|
||||
|
||||
/* note: this maps operation sockets to node sockets.
|
||||
* for resolving links the map will be inverted first in convertToOperations,
|
||||
* 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(node_socket->getNode() == m_current_node);
|
||||
|
||||
|
||||
m_output_map[node_socket] = operation_socket;
|
||||
}
|
||||
|
||||
|
@ -157,9 +157,9 @@ void NodeOperationBuilder::addLink(NodeOperationOutput *from, NodeOperationInput
|
|||
{
|
||||
if (to->isConnected())
|
||||
return;
|
||||
|
||||
|
||||
m_links.push_back(Link(from, to));
|
||||
|
||||
|
||||
/* register with the input */
|
||||
to->setLink(from);
|
||||
}
|
||||
|
@ -171,7 +171,7 @@ void NodeOperationBuilder::removeInputLink(NodeOperationInput *to)
|
|||
if (link.to() == to) {
|
||||
/* unregister with the input */
|
||||
to->setLink(NULL);
|
||||
|
||||
|
||||
m_links.erase(it);
|
||||
return;
|
||||
}
|
||||
|
@ -200,7 +200,7 @@ NodeOperationOutput *NodeOperationBuilder::find_operation_output(const OutputSoc
|
|||
PreviewOperation *NodeOperationBuilder::make_preview_operation() const
|
||||
{
|
||||
BLI_assert(m_current_node);
|
||||
|
||||
|
||||
if (!(m_current_node->getbNode()->flag & NODE_PREVIEW))
|
||||
return NULL;
|
||||
/* previews only in the active group */
|
||||
|
@ -209,7 +209,7 @@ PreviewOperation *NodeOperationBuilder::make_preview_operation() const
|
|||
/* do not calculate previews of hidden nodes */
|
||||
if (m_current_node->getbNode()->flag & NODE_HIDDEN)
|
||||
return NULL;
|
||||
|
||||
|
||||
bNodeInstanceHash *previews = m_context->getPreviewHash();
|
||||
if (previews) {
|
||||
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());
|
||||
return operation;
|
||||
}
|
||||
|
||||
|
||||
return NULL;
|
||||
}
|
||||
|
||||
|
@ -226,7 +226,7 @@ void NodeOperationBuilder::addPreview(NodeOperationOutput *output)
|
|||
PreviewOperation *operation = make_preview_operation();
|
||||
if (operation) {
|
||||
addOperation(operation);
|
||||
|
||||
|
||||
addLink(output, operation->getInputSocket(0));
|
||||
}
|
||||
}
|
||||
|
@ -236,7 +236,7 @@ void NodeOperationBuilder::addNodeInputPreview(NodeInput *input)
|
|||
PreviewOperation *operation = make_preview_operation();
|
||||
if (operation) {
|
||||
addOperation(operation);
|
||||
|
||||
|
||||
mapInputSocket(input, operation->getInputSocket(0));
|
||||
}
|
||||
}
|
||||
|
@ -247,7 +247,7 @@ void NodeOperationBuilder::registerViewer(ViewerOperation *viewer)
|
|||
if (m_current_node->isInActiveGroup()) {
|
||||
/* deactivate previous viewer */
|
||||
m_active_viewer->setActive(false);
|
||||
|
||||
|
||||
m_active_viewer = viewer;
|
||||
viewer->setActive(true);
|
||||
}
|
||||
|
@ -269,13 +269,13 @@ void NodeOperationBuilder::add_datatype_conversions()
|
|||
Links convert_links;
|
||||
for (Links::const_iterator it = m_links.begin(); it != m_links.end(); ++it) {
|
||||
const Link &link = *it;
|
||||
|
||||
|
||||
/* proxy operations can skip data type conversion */
|
||||
NodeOperation *from_op = &link.from()->getOperation();
|
||||
NodeOperation *to_op = &link.to()->getOperation();
|
||||
if (!(from_op->useDatatypeConversion() || to_op->useDatatypeConversion()))
|
||||
continue;
|
||||
|
||||
|
||||
if (link.from()->getDataType() != link.to()->getDataType())
|
||||
convert_links.push_back(link);
|
||||
}
|
||||
|
@ -284,7 +284,7 @@ void NodeOperationBuilder::add_datatype_conversions()
|
|||
NodeOperation *converter = Converter::convertDataType(link.from(), link.to());
|
||||
if (converter) {
|
||||
addOperation(converter);
|
||||
|
||||
|
||||
removeInputLink(link.to());
|
||||
addLink(link.from(), converter->getInputSocket(0));
|
||||
addLink(converter->getOutputSocket(0), link.to());
|
||||
|
@ -322,7 +322,7 @@ void NodeOperationBuilder::add_input_constant_value(NodeOperationInput *input, N
|
|||
value = node_input->getEditorValueFloat();
|
||||
else
|
||||
value = 0.0f;
|
||||
|
||||
|
||||
SetValueOperation *op = new SetValueOperation();
|
||||
op->setValue(value);
|
||||
addOperation(op);
|
||||
|
@ -335,7 +335,7 @@ void NodeOperationBuilder::add_input_constant_value(NodeOperationInput *input, N
|
|||
node_input->getEditorValueColor(value);
|
||||
else
|
||||
zero_v4(value);
|
||||
|
||||
|
||||
SetColorOperation *op = new SetColorOperation();
|
||||
op->setChannels(value);
|
||||
addOperation(op);
|
||||
|
@ -348,7 +348,7 @@ void NodeOperationBuilder::add_input_constant_value(NodeOperationInput *input, N
|
|||
node_input->getEditorValueVector(value);
|
||||
else
|
||||
zero_v3(value);
|
||||
|
||||
|
||||
SetVectorOperation *op = new SetVectorOperation();
|
||||
op->setVector(value);
|
||||
addOperation(op);
|
||||
|
@ -370,17 +370,17 @@ void NodeOperationBuilder::resolve_proxies()
|
|||
proxy_links.push_back(link);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
for (Links::const_iterator it = proxy_links.begin(); it != proxy_links.end(); ++it) {
|
||||
const Link &link = *it;
|
||||
|
||||
|
||||
NodeOperationInput *to = link.to();
|
||||
NodeOperationOutput *from = link.from();
|
||||
do {
|
||||
/* walk upstream bypassing the proxy operation */
|
||||
from = from->getOperation().getInputSocket(0)->getLink();
|
||||
} while (from && from->getOperation().isProxyOperation());
|
||||
|
||||
|
||||
removeInputLink(to);
|
||||
/* we may not have a final proxy input link,
|
||||
* in that case it just gets dropped
|
||||
|
@ -395,7 +395,7 @@ void NodeOperationBuilder::determineResolutions()
|
|||
/* determine all resolutions of the operations (Width/Height) */
|
||||
for (Operations::const_iterator it = m_operations.begin(); it != m_operations.end(); ++it) {
|
||||
NodeOperation *op = *it;
|
||||
|
||||
|
||||
if (op->isOutputOperation(m_context->isRendering()) && !op->isPreviewOperation()) {
|
||||
unsigned int resolution[2] = {0, 0};
|
||||
unsigned int preferredResolution[2] = {0, 0};
|
||||
|
@ -403,10 +403,10 @@ void NodeOperationBuilder::determineResolutions()
|
|||
op->setResolution(resolution);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
for (Operations::const_iterator it = m_operations.begin(); it != m_operations.end(); ++it) {
|
||||
NodeOperation *op = *it;
|
||||
|
||||
|
||||
if (op->isOutputOperation(m_context->isRendering()) && op->isPreviewOperation()) {
|
||||
unsigned int resolution[2] = {0, 0};
|
||||
unsigned int preferredResolution[2] = {0, 0};
|
||||
|
@ -414,13 +414,13 @@ void NodeOperationBuilder::determineResolutions()
|
|||
op->setResolution(resolution);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/* add convert resolution operations when needed */
|
||||
{
|
||||
Links convert_links;
|
||||
for (Links::const_iterator it = m_links.begin(); it != m_links.end(); ++it) {
|
||||
const Link &link = *it;
|
||||
|
||||
|
||||
if (link.to()->getResizeMode() != COM_SC_NO_RESIZE) {
|
||||
NodeOperation &from_op = link.from()->getOperation();
|
||||
NodeOperation &to_op = link.to()->getOperation();
|
||||
|
@ -464,35 +464,35 @@ void NodeOperationBuilder::add_input_buffers(NodeOperation * /*operation*/,
|
|||
{
|
||||
if (!input->isConnected())
|
||||
return;
|
||||
|
||||
|
||||
NodeOperationOutput *output = input->getLink();
|
||||
if (output->getOperation().isReadBufferOperation()) {
|
||||
/* input is already buffered, no need to add another */
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
/* this link will be replaced below */
|
||||
removeInputLink(input);
|
||||
|
||||
|
||||
/* check of other end already has write operation, otherwise add a new one */
|
||||
WriteBufferOperation *writeoperation = find_attached_write_buffer_operation(output);
|
||||
if (!writeoperation) {
|
||||
writeoperation = new WriteBufferOperation(output->getDataType());
|
||||
writeoperation->setbNodeTree(m_context->getbNodeTree());
|
||||
addOperation(writeoperation);
|
||||
|
||||
|
||||
addLink(output, writeoperation->getInputSocket(0));
|
||||
|
||||
|
||||
writeoperation->readResolutionFromInputSocket();
|
||||
}
|
||||
|
||||
|
||||
/* add readbuffer op for the input */
|
||||
ReadBufferOperation *readoperation = new ReadBufferOperation(output->getDataType());
|
||||
readoperation->setMemoryProxy(writeoperation->getMemoryProxy());
|
||||
this->addOperation(readoperation);
|
||||
|
||||
|
||||
addLink(readoperation->getOutputSocket(), input);
|
||||
|
||||
|
||||
readoperation->readResolutionFromWriteBuffer();
|
||||
}
|
||||
|
||||
|
@ -502,11 +502,11 @@ void NodeOperationBuilder::add_output_buffers(NodeOperation *operation, NodeOper
|
|||
OpInputs targets = cache_output_links(output);
|
||||
if (targets.empty())
|
||||
return;
|
||||
|
||||
|
||||
WriteBufferOperation *writeOperation = NULL;
|
||||
for (OpInputs::const_iterator it = targets.begin(); it != targets.end(); ++it) {
|
||||
NodeOperationInput *target = *it;
|
||||
|
||||
|
||||
/* try to find existing write buffer operation */
|
||||
if (target->getOperation().isWriteBufferOperation()) {
|
||||
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);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/* if no write buffer operation exists yet, create a new one */
|
||||
if (!writeOperation) {
|
||||
writeOperation = new WriteBufferOperation(operation->getOutputSocket()->getDataType());
|
||||
writeOperation->setbNodeTree(m_context->getbNodeTree());
|
||||
addOperation(writeOperation);
|
||||
|
||||
|
||||
addLink(output, writeOperation->getInputSocket(0));
|
||||
}
|
||||
|
||||
|
||||
writeOperation->readResolutionFromInputSocket();
|
||||
|
||||
|
||||
/* add readbuffer op for every former connected input */
|
||||
for (OpInputs::const_iterator it = targets.begin(); it != targets.end(); ++it) {
|
||||
NodeOperationInput *target = *it;
|
||||
if (&target->getOperation() == writeOperation)
|
||||
continue; /* skip existing write op links */
|
||||
|
||||
|
||||
ReadBufferOperation *readoperation = new ReadBufferOperation(operation->getOutputSocket()->getDataType());
|
||||
readoperation->setMemoryProxy(writeOperation->getMemoryProxy());
|
||||
addOperation(readoperation);
|
||||
|
||||
|
||||
addLink(readoperation->getOutputSocket(), target);
|
||||
|
||||
|
||||
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)
|
||||
if ((*it)->isComplex())
|
||||
complex_ops.push_back(*it);
|
||||
|
||||
|
||||
for (Operations::const_iterator it = complex_ops.begin(); it != complex_ops.end(); ++it) {
|
||||
NodeOperation *op = *it;
|
||||
|
||||
|
||||
DebugInfo::operation_read_write_buffer(op);
|
||||
|
||||
|
||||
for (int index = 0; index < op->getNumberOfInputSockets(); index++)
|
||||
add_input_buffers(op, op->getInputSocket(index));
|
||||
|
||||
|
||||
for (int index = 0; index < op->getNumberOfOutputSockets(); 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())
|
||||
return;
|
||||
reachable.insert(op);
|
||||
|
||||
|
||||
for (int i = 0; i < op->getNumberOfInputSockets(); ++i) {
|
||||
NodeOperationInput *input = op->getInputSocket(i);
|
||||
if (input->isConnected())
|
||||
find_reachable_operations_recursive(reachable, &input->getLink()->getOperation());
|
||||
}
|
||||
|
||||
|
||||
/* associated write-buffer operations are executed as well */
|
||||
if (op->isReadBufferOperation()) {
|
||||
ReadBufferOperation *read_op = (ReadBufferOperation *)op;
|
||||
|
@ -595,17 +595,17 @@ void NodeOperationBuilder::prune_operations()
|
|||
Tags reachable;
|
||||
for (Operations::const_iterator it = m_operations.begin(); it != m_operations.end(); ++it) {
|
||||
NodeOperation *op = *it;
|
||||
|
||||
|
||||
/* output operations are primary executed operations */
|
||||
if (op->isOutputOperation(m_context->isRendering()))
|
||||
find_reachable_operations_recursive(reachable, op);
|
||||
}
|
||||
|
||||
|
||||
/* delete unreachable operations */
|
||||
Operations reachable_ops;
|
||||
for (Operations::const_iterator it = m_operations.begin(); it != m_operations.end(); ++it) {
|
||||
NodeOperation *op = *it;
|
||||
|
||||
|
||||
if (reachable.find(op) != reachable.end())
|
||||
reachable_ops.push_back(op);
|
||||
else
|
||||
|
@ -621,13 +621,13 @@ static void sort_operations_recursive(NodeOperationBuilder::Operations &sorted,
|
|||
if (visited.find(op) != visited.end())
|
||||
return;
|
||||
visited.insert(op);
|
||||
|
||||
|
||||
for (int i = 0; i < op->getNumberOfInputSockets(); ++i) {
|
||||
NodeOperationInput *input = op->getInputSocket(i);
|
||||
if (input->isConnected())
|
||||
sort_operations_recursive(sorted, visited, &input->getLink()->getOperation());
|
||||
}
|
||||
|
||||
|
||||
sorted.push_back(op);
|
||||
}
|
||||
|
||||
|
@ -636,10 +636,10 @@ void NodeOperationBuilder::sort_operations()
|
|||
Operations sorted;
|
||||
sorted.reserve(m_operations.size());
|
||||
Tags visited;
|
||||
|
||||
|
||||
for (Operations::const_iterator it = m_operations.begin(); it != m_operations.end(); ++it)
|
||||
sort_operations_recursive(sorted, visited, *it);
|
||||
|
||||
|
||||
m_operations = sorted;
|
||||
}
|
||||
|
||||
|
@ -648,10 +648,10 @@ static void add_group_operations_recursive(Tags &visited, NodeOperation *op, Exe
|
|||
if (visited.find(op) != visited.end())
|
||||
return;
|
||||
visited.insert(op);
|
||||
|
||||
|
||||
if (!group->addOperation(op))
|
||||
return;
|
||||
|
||||
|
||||
/* add all eligible input ops to the group */
|
||||
for (int i = 0; i < op->getNumberOfInputSockets(); ++i) {
|
||||
NodeOperationInput *input = op->getInputSocket(i);
|
||||
|
@ -664,10 +664,10 @@ ExecutionGroup *NodeOperationBuilder::make_group(NodeOperation *op)
|
|||
{
|
||||
ExecutionGroup *group = new ExecutionGroup();
|
||||
m_groups.push_back(group);
|
||||
|
||||
|
||||
Tags visited;
|
||||
add_group_operations_recursive(visited, op, group);
|
||||
|
||||
|
||||
return group;
|
||||
}
|
||||
|
||||
|
@ -675,17 +675,17 @@ void NodeOperationBuilder::group_operations()
|
|||
{
|
||||
for (Operations::const_iterator it = m_operations.begin(); it != m_operations.end(); ++it) {
|
||||
NodeOperation *op = *it;
|
||||
|
||||
|
||||
if (op->isOutputOperation(m_context->isRendering())) {
|
||||
ExecutionGroup *group = make_group(op);
|
||||
group->setOutputExecutionGroup(true);
|
||||
}
|
||||
|
||||
|
||||
/* add new groups for associated memory proxies where needed */
|
||||
if (op->isReadBufferOperation()) {
|
||||
ReadBufferOperation *read_op = (ReadBufferOperation *)op;
|
||||
MemoryProxy *memproxy = read_op->getMemoryProxy();
|
||||
|
||||
|
||||
if (memproxy->getExecutor() == NULL) {
|
||||
ExecutionGroup *group = make_group(memproxy->getWriteBufferOperation());
|
||||
memproxy->setExecutor(group);
|
||||
|
|
|
@ -52,48 +52,48 @@ public:
|
|||
private:
|
||||
NodeOperationOutput *m_from;
|
||||
NodeOperationInput *m_to;
|
||||
|
||||
|
||||
public:
|
||||
Link(NodeOperationOutput *from, NodeOperationInput *to) :
|
||||
m_from(from),
|
||||
m_to(to)
|
||||
{}
|
||||
|
||||
|
||||
NodeOperationOutput *from() const { return m_from; }
|
||||
NodeOperationInput *to() const { return m_to; }
|
||||
};
|
||||
|
||||
|
||||
typedef std::vector<NodeOperation *> Operations;
|
||||
typedef std::vector<Link> Links;
|
||||
typedef std::vector<ExecutionGroup *> Groups;
|
||||
|
||||
|
||||
typedef std::map<NodeOperationInput *, NodeInput *> InputSocketMap;
|
||||
typedef std::map<NodeOutput *, NodeOperationOutput *> OutputSocketMap;
|
||||
|
||||
|
||||
typedef std::vector<NodeOperationInput *> OpInputs;
|
||||
typedef std::map<NodeInput *, OpInputs> OpInputInverseMap;
|
||||
|
||||
|
||||
private:
|
||||
const CompositorContext *m_context;
|
||||
NodeGraph m_graph;
|
||||
|
||||
|
||||
Operations m_operations;
|
||||
Links m_links;
|
||||
Groups m_groups;
|
||||
|
||||
|
||||
/** Maps operation inputs to node inputs */
|
||||
InputSocketMap m_input_map;
|
||||
/** Maps node outputs to operation outputs */
|
||||
OutputSocketMap m_output_map;
|
||||
|
||||
|
||||
Node *m_current_node;
|
||||
|
||||
|
||||
/** Operation that will be writing to the viewer image
|
||||
* Only one operation can occupy this place at a time,
|
||||
* to avoid race conditions
|
||||
*/
|
||||
ViewerOperation *m_active_viewer;
|
||||
|
||||
|
||||
public:
|
||||
NodeOperationBuilder(const CompositorContext *context, bNodeTree *b_nodetree);
|
||||
~NodeOperationBuilder();
|
||||
|
@ -103,43 +103,43 @@ public:
|
|||
void convertToOperations(ExecutionSystem *system);
|
||||
|
||||
void addOperation(NodeOperation *operation);
|
||||
|
||||
|
||||
/** Map input socket of the current node to an operation socket */
|
||||
void mapInputSocket(NodeInput *node_socket, NodeOperationInput *operation_socket);
|
||||
/** Map output socket of the current node to an operation socket */
|
||||
void mapOutputSocket(NodeOutput *node_socket, NodeOperationOutput *operation_socket);
|
||||
|
||||
|
||||
void addLink(NodeOperationOutput *from, NodeOperationInput *to);
|
||||
void removeInputLink(NodeOperationInput *to);
|
||||
|
||||
|
||||
/** Add a preview operation for a operation output */
|
||||
void addPreview(NodeOperationOutput *output);
|
||||
/** Add a preview operation for a node input */
|
||||
void addNodeInputPreview(NodeInput *input);
|
||||
|
||||
|
||||
/** Define a viewer operation as the active output, if possible */
|
||||
void registerViewer(ViewerOperation *viewer);
|
||||
/** The currently active viewer output operation */
|
||||
ViewerOperation *active_viewer() const { return m_active_viewer; }
|
||||
|
||||
|
||||
protected:
|
||||
static NodeInput *find_node_input(const InputSocketMap &map, NodeOperationInput *op_input);
|
||||
static const OpInputs &find_operation_inputs(const OpInputInverseMap &map, NodeInput *node_input);
|
||||
static NodeOperationOutput *find_operation_output(const OutputSocketMap &map, NodeOutput *node_output);
|
||||
|
||||
|
||||
/** Add datatype conversion where needed */
|
||||
void add_datatype_conversions();
|
||||
|
||||
|
||||
/** Construct a constant value operation for every unconnected input */
|
||||
void add_operation_input_constants();
|
||||
void add_input_constant_value(NodeOperationInput *input, NodeInput *node_input);
|
||||
|
||||
|
||||
/** Replace proxy operations with direct links */
|
||||
void resolve_proxies();
|
||||
|
||||
|
||||
/** Calculate resolution for each operation */
|
||||
void determineResolutions();
|
||||
|
||||
|
||||
/** Helper function to store connected inputs for replacement */
|
||||
OpInputs cache_output_links(NodeOperationOutput *output) const;
|
||||
/** Find a connected write buffer operation to an OpOutput */
|
||||
|
@ -148,17 +148,17 @@ protected:
|
|||
void add_complex_operation_buffers();
|
||||
void add_input_buffers(NodeOperation *operation, NodeOperationInput *input);
|
||||
void add_output_buffers(NodeOperation *operation, NodeOperationOutput *output);
|
||||
|
||||
|
||||
/** Remove unreachable operations */
|
||||
void prune_operations();
|
||||
|
||||
|
||||
/** Sort operations by link dependencies */
|
||||
void sort_operations();
|
||||
|
||||
|
||||
/** Create execution groups */
|
||||
void group_operations();
|
||||
ExecutionGroup *make_group(NodeOperation *op);
|
||||
|
||||
|
||||
private:
|
||||
PreviewOperation *make_preview_operation() const;
|
||||
|
||||
|
|
|
@ -74,7 +74,7 @@ void OpenCLDevice::execute(WorkPackage *work)
|
|||
chunkNumber, inputBuffers, outputBuffer);
|
||||
|
||||
delete outputBuffer;
|
||||
|
||||
|
||||
executionGroup->finalizeChunkExecution(chunkNumber, inputBuffers);
|
||||
}
|
||||
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)
|
||||
{
|
||||
cl_int error;
|
||||
|
||||
|
||||
MemoryBuffer *result = reader->getInputMemoryBuffer(inputMemoryBuffers);
|
||||
|
||||
const cl_image_format *imageFormat = determineImageFormat(result);
|
||||
|
|
|
@ -42,17 +42,17 @@ private:
|
|||
* @brief opencl context
|
||||
*/
|
||||
cl_context m_context;
|
||||
|
||||
|
||||
/**
|
||||
* @brief opencl device
|
||||
*/
|
||||
cl_device_id m_device;
|
||||
|
||||
|
||||
/**
|
||||
* @brief opencl program
|
||||
*/
|
||||
cl_program m_program;
|
||||
|
||||
|
||||
/**
|
||||
* @brief opencl command queue
|
||||
*/
|
||||
|
@ -72,8 +72,8 @@ public:
|
|||
* @param vendorID
|
||||
*/
|
||||
OpenCLDevice(cl_context context, cl_device_id device, cl_program program, cl_int vendorId);
|
||||
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* @brief initialize the device
|
||||
* During initialization the OpenCL cl_command_queue is created
|
||||
|
@ -81,13 +81,13 @@ public:
|
|||
* @see queue
|
||||
*/
|
||||
bool initialize();
|
||||
|
||||
|
||||
/**
|
||||
* @brief deinitialize the device
|
||||
* During deintiialization the command queue is cleared
|
||||
*/
|
||||
void deinitialize();
|
||||
|
||||
|
||||
/**
|
||||
* @brief execute a WorkPackage
|
||||
* @param work the WorkPackage to execute
|
||||
|
|
|
@ -49,7 +49,7 @@ void SingleThreadedOperation::deinitExecution()
|
|||
void *SingleThreadedOperation::initializeTileData(rcti *rect)
|
||||
{
|
||||
if (this->m_cachedInstance) return this->m_cachedInstance;
|
||||
|
||||
|
||||
lockMutex();
|
||||
if (this->m_cachedInstance == NULL) {
|
||||
//
|
||||
|
|
|
@ -27,7 +27,7 @@
|
|||
class SingleThreadedOperation : public NodeOperation {
|
||||
private:
|
||||
MemoryBuffer *m_cachedInstance;
|
||||
|
||||
|
||||
protected:
|
||||
inline bool isCached() {
|
||||
return this->m_cachedInstance != NULL;
|
||||
|
@ -35,17 +35,17 @@ protected:
|
|||
|
||||
public:
|
||||
SingleThreadedOperation();
|
||||
|
||||
|
||||
/**
|
||||
* the inner loop of this program
|
||||
*/
|
||||
void executePixel(float output[4], int x, int y, void *data);
|
||||
|
||||
|
||||
/**
|
||||
* Initialize the execution
|
||||
*/
|
||||
void initExecution();
|
||||
|
||||
|
||||
/**
|
||||
* Deinitialize the execution
|
||||
*/
|
||||
|
@ -54,7 +54,7 @@ public:
|
|||
void *initializeTileData(rcti *rect);
|
||||
|
||||
virtual MemoryBuffer *createMemoryBuffer(rcti *rect) = 0;
|
||||
|
||||
|
||||
int isSingleThreaded() { return true; }
|
||||
};
|
||||
#endif
|
||||
|
|
|
@ -85,7 +85,7 @@ void *WorkScheduler::thread_execute_cpu(void *data)
|
|||
device->execute(work);
|
||||
delete work;
|
||||
}
|
||||
|
||||
|
||||
return NULL;
|
||||
}
|
||||
|
||||
|
@ -93,12 +93,12 @@ void *WorkScheduler::thread_execute_gpu(void *data)
|
|||
{
|
||||
Device *device = (Device *)data;
|
||||
WorkPackage *work;
|
||||
|
||||
|
||||
while ((work = (WorkPackage *)BLI_thread_queue_pop(g_gpuqueue))) {
|
||||
device->execute(work);
|
||||
delete work;
|
||||
}
|
||||
|
||||
|
||||
return NULL;
|
||||
}
|
||||
#endif
|
||||
|
|
|
@ -53,7 +53,7 @@ class WorkScheduler {
|
|||
* inside this loop new work is queried and being executed
|
||||
*/
|
||||
static void *thread_execute_gpu(void *data);
|
||||
#endif
|
||||
#endif
|
||||
public:
|
||||
/**
|
||||
* @brief schedule a chunk of a group to be calculated.
|
||||
|
|
|
@ -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);
|
||||
system->execute();
|
||||
delete system;
|
||||
|
||||
|
||||
if (editingtree->test_break(editingtree->tbh)) {
|
||||
// during editing multiple calls to this method can be triggered.
|
||||
// make sure one the last one will be doing the work.
|
||||
|
|
|
@ -35,14 +35,14 @@ void AlphaOverNode::convertToOperations(NodeConverter &converter, const Composit
|
|||
NodeInput *color1Socket = this->getInputSocket(1);
|
||||
NodeInput *color2Socket = this->getInputSocket(2);
|
||||
bNode *editorNode = this->getbNode();
|
||||
|
||||
|
||||
MixBaseOperation *convertProg;
|
||||
NodeTwoFloats *ntf = (NodeTwoFloats *)editorNode->storage;
|
||||
if (ntf->x != 0.0f) {
|
||||
AlphaOverMixedOperation *mixOperation = new AlphaOverMixedOperation();
|
||||
mixOperation->setX(ntf->x);
|
||||
convertProg = mixOperation;
|
||||
|
||||
|
||||
}
|
||||
else if (editorNode->custom1) {
|
||||
convertProg = new AlphaOverKeyOperation();
|
||||
|
@ -50,7 +50,7 @@ void AlphaOverNode::convertToOperations(NodeConverter &converter, const Composit
|
|||
else {
|
||||
convertProg = new AlphaOverPremultiplyOperation();
|
||||
}
|
||||
|
||||
|
||||
convertProg->setUseValueAlphaMultiply(false);
|
||||
if (color1Socket->isLinked()) {
|
||||
convertProg->setResolutionInputSocketIndex(1);
|
||||
|
@ -61,7 +61,7 @@ void AlphaOverNode::convertToOperations(NodeConverter &converter, const Composit
|
|||
else {
|
||||
convertProg->setResolutionInputSocketIndex(0);
|
||||
}
|
||||
|
||||
|
||||
converter.addOperation(convertProg);
|
||||
converter.mapInputSocket(getInputSocket(0), convertProg->getInputSocket(0));
|
||||
converter.mapInputSocket(getInputSocket(1), convertProg->getInputSocket(1));
|
||||
|
|
|
@ -36,7 +36,7 @@ void BilateralBlurNode::convertToOperations(NodeConverter &converter, const Comp
|
|||
BilateralBlurOperation *operation = new BilateralBlurOperation();
|
||||
operation->setQuality(context.getQuality());
|
||||
operation->setData(data);
|
||||
|
||||
|
||||
converter.addOperation(operation);
|
||||
converter.mapInputSocket(getInputSocket(0), operation->getInputSocket(0));
|
||||
converter.mapInputSocket(getInputSocket(1), operation->getInputSocket(1));
|
||||
|
|
|
@ -56,9 +56,9 @@ void BlurNode::convertToOperations(NodeConverter &converter, const CompositorCon
|
|||
operationfgb->setData(data);
|
||||
operationfgb->setExtendBounds(extend_bounds);
|
||||
converter.addOperation(operationfgb);
|
||||
|
||||
|
||||
converter.mapInputSocket(getInputSocket(1), operationfgb->getInputSocket(1));
|
||||
|
||||
|
||||
input_operation = operationfgb;
|
||||
output_operation = operationfgb;
|
||||
}
|
||||
|
@ -67,12 +67,12 @@ void BlurNode::convertToOperations(NodeConverter &converter, const CompositorCon
|
|||
SetValueOperation *zero = new SetValueOperation();
|
||||
zero->setValue(0.0f);
|
||||
clamp->setUseClamp(true);
|
||||
|
||||
|
||||
converter.addOperation(clamp);
|
||||
converter.addOperation(zero);
|
||||
converter.mapInputSocket(getInputSocket(1), clamp->getInputSocket(0));
|
||||
converter.addLink(zero->getOutputSocket(), clamp->getInputSocket(1));
|
||||
|
||||
|
||||
GaussianAlphaXBlurOperation *operationx = new GaussianAlphaXBlurOperation();
|
||||
operationx->setData(data);
|
||||
operationx->setQuality(quality);
|
||||
|
@ -80,10 +80,10 @@ void BlurNode::convertToOperations(NodeConverter &converter, const CompositorCon
|
|||
operationx->setFalloff(PROP_SMOOTH);
|
||||
operationx->setSubtract(false);
|
||||
operationx->setExtendBounds(extend_bounds);
|
||||
|
||||
|
||||
converter.addOperation(operationx);
|
||||
converter.addLink(clamp->getOutputSocket(), operationx->getInputSocket(0));
|
||||
|
||||
|
||||
GaussianAlphaYBlurOperation *operationy = new GaussianAlphaYBlurOperation();
|
||||
operationy->setData(data);
|
||||
operationy->setQuality(quality);
|
||||
|
@ -94,7 +94,7 @@ void BlurNode::convertToOperations(NodeConverter &converter, const CompositorCon
|
|||
|
||||
converter.addOperation(operationy);
|
||||
converter.addLink(operationx->getOutputSocket(), operationy->getInputSocket(0));
|
||||
|
||||
|
||||
GaussianBlurReferenceOperation *operation = new GaussianBlurReferenceOperation();
|
||||
operation->setData(data);
|
||||
operation->setQuality(quality);
|
||||
|
@ -102,7 +102,7 @@ void BlurNode::convertToOperations(NodeConverter &converter, const CompositorCon
|
|||
|
||||
converter.addOperation(operation);
|
||||
converter.addLink(operationy->getOutputSocket(), operation->getInputSocket(1));
|
||||
|
||||
|
||||
output_operation = operation;
|
||||
input_operation = operation;
|
||||
}
|
||||
|
@ -115,7 +115,7 @@ void BlurNode::convertToOperations(NodeConverter &converter, const CompositorCon
|
|||
|
||||
converter.addOperation(operationx);
|
||||
converter.mapInputSocket(getInputSocket(1), operationx->getInputSocket(1));
|
||||
|
||||
|
||||
GaussianYBlurOperation *operationy = new GaussianYBlurOperation();
|
||||
operationy->setData(data);
|
||||
operationy->setQuality(quality);
|
||||
|
@ -156,18 +156,18 @@ void BlurNode::convertToOperations(NodeConverter &converter, const CompositorCon
|
|||
GammaUncorrectOperation *inverse = new GammaUncorrectOperation();
|
||||
converter.addOperation(correct);
|
||||
converter.addOperation(inverse);
|
||||
|
||||
|
||||
converter.mapInputSocket(getInputSocket(0), correct->getInputSocket(0));
|
||||
converter.addLink(correct->getOutputSocket(), input_operation->getInputSocket(0));
|
||||
converter.addLink(output_operation->getOutputSocket(), inverse->getInputSocket(0));
|
||||
converter.mapOutputSocket(getOutputSocket(), inverse->getOutputSocket());
|
||||
|
||||
|
||||
converter.addPreview(inverse->getOutputSocket());
|
||||
}
|
||||
else {
|
||||
converter.mapInputSocket(getInputSocket(0), input_operation->getInputSocket(0));
|
||||
converter.mapOutputSocket(getOutputSocket(), output_operation->getOutputSocket());
|
||||
|
||||
|
||||
converter.addPreview(output_operation->getOutputSocket());
|
||||
}
|
||||
}
|
||||
|
|
|
@ -49,7 +49,7 @@ void BokehBlurNode::convertToOperations(NodeConverter &converter, const Composit
|
|||
operation->setThreshold(0.0f);
|
||||
operation->setMaxBlur(b_node->custom4);
|
||||
operation->setDoScaleSize(true);
|
||||
|
||||
|
||||
converter.addOperation(operation);
|
||||
converter.mapInputSocket(getInputSocket(0), operation->getInputSocket(0));
|
||||
converter.mapInputSocket(getInputSocket(1), operation->getInputSocket(1));
|
||||
|
@ -60,7 +60,7 @@ void BokehBlurNode::convertToOperations(NodeConverter &converter, const Composit
|
|||
BokehBlurOperation *operation = new BokehBlurOperation();
|
||||
operation->setQuality(context.getQuality());
|
||||
operation->setExtendBounds(extend_bounds);
|
||||
|
||||
|
||||
converter.addOperation(operation);
|
||||
converter.mapInputSocket(getInputSocket(0), operation->getInputSocket(0));
|
||||
converter.mapInputSocket(getInputSocket(1), operation->getInputSocket(1));
|
||||
|
|
|
@ -33,9 +33,9 @@ void BokehImageNode::convertToOperations(NodeConverter &converter, const Composi
|
|||
{
|
||||
BokehImageOperation *operation = new BokehImageOperation();
|
||||
operation->setData((NodeBokehImage *)this->getbNode()->storage);
|
||||
|
||||
|
||||
converter.addOperation(operation);
|
||||
converter.mapOutputSocket(getOutputSocket(0), operation->getOutputSocket(0));
|
||||
|
||||
|
||||
converter.addPreview(operation->getOutputSocket(0));
|
||||
}
|
||||
|
|
|
@ -36,13 +36,13 @@ void BoxMaskNode::convertToOperations(NodeConverter &converter, const Compositor
|
|||
{
|
||||
NodeInput *inputSocket = this->getInputSocket(0);
|
||||
NodeOutput *outputSocket = this->getOutputSocket(0);
|
||||
|
||||
|
||||
BoxMaskOperation *operation;
|
||||
operation = new BoxMaskOperation();
|
||||
operation->setData((NodeBoxMask *)this->getbNode()->storage);
|
||||
operation->setMaskType(this->getbNode()->custom1);
|
||||
converter.addOperation(operation);
|
||||
|
||||
|
||||
if (inputSocket->isLinked()) {
|
||||
converter.mapInputSocket(inputSocket, operation->getInputSocket(0));
|
||||
converter.mapOutputSocket(outputSocket, operation->getOutputSocket());
|
||||
|
|
|
@ -35,7 +35,7 @@ void BrightnessNode::convertToOperations(NodeConverter &converter, const Composi
|
|||
BrightnessOperation *operation = new BrightnessOperation();
|
||||
operation->setUsePremultiply((bnode->custom1 & 1) != 0);
|
||||
converter.addOperation(operation);
|
||||
|
||||
|
||||
converter.mapInputSocket(getInputSocket(0), operation->getInputSocket(0));
|
||||
converter.mapInputSocket(getInputSocket(1), operation->getInputSocket(1));
|
||||
converter.mapInputSocket(getInputSocket(2), operation->getInputSocket(2));
|
||||
|
|
|
@ -33,35 +33,35 @@ ChromaMatteNode::ChromaMatteNode(bNode *editorNode) : Node(editorNode)
|
|||
void ChromaMatteNode::convertToOperations(NodeConverter &converter, const CompositorContext &/*context*/) const
|
||||
{
|
||||
bNode *editorsnode = getbNode();
|
||||
|
||||
|
||||
NodeInput *inputSocketImage = this->getInputSocket(0);
|
||||
NodeInput *inputSocketKey = this->getInputSocket(1);
|
||||
NodeOutput *outputSocketImage = this->getOutputSocket(0);
|
||||
NodeOutput *outputSocketMatte = this->getOutputSocket(1);
|
||||
|
||||
|
||||
ConvertRGBToYCCOperation *operationRGBToYCC_Image = new ConvertRGBToYCCOperation();
|
||||
ConvertRGBToYCCOperation *operationRGBToYCC_Key = new ConvertRGBToYCCOperation();
|
||||
operationRGBToYCC_Image->setMode(BLI_YCC_ITU_BT709);
|
||||
operationRGBToYCC_Key->setMode(BLI_YCC_ITU_BT709);
|
||||
converter.addOperation(operationRGBToYCC_Image);
|
||||
converter.addOperation(operationRGBToYCC_Key);
|
||||
|
||||
|
||||
ChromaMatteOperation *operation = new ChromaMatteOperation();
|
||||
operation->setSettings((NodeChroma *)editorsnode->storage);
|
||||
converter.addOperation(operation);
|
||||
|
||||
|
||||
SetAlphaOperation *operationAlpha = new SetAlphaOperation();
|
||||
converter.addOperation(operationAlpha);
|
||||
|
||||
|
||||
converter.mapInputSocket(inputSocketImage, operationRGBToYCC_Image->getInputSocket(0));
|
||||
converter.mapInputSocket(inputSocketKey, operationRGBToYCC_Key->getInputSocket(0));
|
||||
converter.addLink(operationRGBToYCC_Image->getOutputSocket(), operation->getInputSocket(0));
|
||||
converter.addLink(operationRGBToYCC_Key->getOutputSocket(), operation->getInputSocket(1));
|
||||
converter.mapOutputSocket(outputSocketMatte, operation->getOutputSocket());
|
||||
|
||||
|
||||
converter.mapInputSocket(inputSocketImage, operationAlpha->getInputSocket(0));
|
||||
converter.addLink(operation->getOutputSocket(), operationAlpha->getInputSocket(1));
|
||||
converter.mapOutputSocket(outputSocketImage, operationAlpha->getOutputSocket());
|
||||
|
||||
|
||||
converter.addPreview(operationAlpha->getOutputSocket());
|
||||
}
|
||||
|
|
|
@ -36,11 +36,11 @@ void ColorBalanceNode::convertToOperations(NodeConverter &converter, const Compo
|
|||
{
|
||||
bNode *node = this->getbNode();
|
||||
NodeColorBalance *n = (NodeColorBalance *)node->storage;
|
||||
|
||||
|
||||
NodeInput *inputSocket = this->getInputSocket(0);
|
||||
NodeInput *inputImageSocket = this->getInputSocket(1);
|
||||
NodeOutput *outputSocket = this->getOutputSocket(0);
|
||||
|
||||
|
||||
NodeOperation *operation;
|
||||
if (node->custom1 == 0) {
|
||||
ColorBalanceLGGOperation *operationLGG = new ColorBalanceLGGOperation();
|
||||
|
@ -69,7 +69,7 @@ void ColorBalanceNode::convertToOperations(NodeConverter &converter, const Compo
|
|||
operation = operationCDL;
|
||||
}
|
||||
converter.addOperation(operation);
|
||||
|
||||
|
||||
converter.mapInputSocket(inputSocket, operation->getInputSocket(0));
|
||||
converter.mapInputSocket(inputImageSocket, operation->getInputSocket(1));
|
||||
converter.mapOutputSocket(outputSocket, operation->getOutputSocket(0));
|
||||
|
|
|
@ -32,14 +32,14 @@ ColorCorrectionNode::ColorCorrectionNode(bNode *editorNode) : Node(editorNode)
|
|||
void ColorCorrectionNode::convertToOperations(NodeConverter &converter, const CompositorContext &/*context*/) const
|
||||
{
|
||||
bNode *editorNode = getbNode();
|
||||
|
||||
|
||||
ColorCorrectionOperation *operation = new ColorCorrectionOperation();
|
||||
operation->setData((NodeColorCorrection *)editorNode->storage);
|
||||
operation->setRedChannelEnabled((editorNode->custom1 & 1) > 0);
|
||||
operation->setGreenChannelEnabled((editorNode->custom1 & 2) > 0);
|
||||
operation->setBlueChannelEnabled((editorNode->custom1 & 4) > 0);
|
||||
converter.addOperation(operation);
|
||||
|
||||
|
||||
converter.mapInputSocket(getInputSocket(0), operation->getInputSocket(0));
|
||||
converter.mapInputSocket(getInputSocket(1), operation->getInputSocket(1));
|
||||
converter.mapOutputSocket(getOutputSocket(0), operation->getOutputSocket(0));
|
||||
|
|
|
@ -35,12 +35,12 @@ void ColorCurveNode::convertToOperations(NodeConverter &converter, const Composi
|
|||
ColorCurveOperation *operation = new ColorCurveOperation();
|
||||
operation->setCurveMapping((CurveMapping *)this->getbNode()->storage);
|
||||
converter.addOperation(operation);
|
||||
|
||||
|
||||
converter.mapInputSocket(getInputSocket(0), operation->getInputSocket(0));
|
||||
converter.mapInputSocket(getInputSocket(1), operation->getInputSocket(1));
|
||||
converter.mapInputSocket(getInputSocket(2), operation->getInputSocket(2));
|
||||
converter.mapInputSocket(getInputSocket(3), operation->getInputSocket(3));
|
||||
|
||||
|
||||
converter.mapOutputSocket(getOutputSocket(0), operation->getOutputSocket());
|
||||
}
|
||||
else {
|
||||
|
@ -52,7 +52,7 @@ void ColorCurveNode::convertToOperations(NodeConverter &converter, const Composi
|
|||
operation->setWhiteLevel(col);
|
||||
operation->setCurveMapping((CurveMapping *)this->getbNode()->storage);
|
||||
converter.addOperation(operation);
|
||||
|
||||
|
||||
converter.mapInputSocket(getInputSocket(0), operation->getInputSocket(0));
|
||||
converter.mapInputSocket(getInputSocket(1), operation->getInputSocket(1));
|
||||
converter.mapOutputSocket(getOutputSocket(0), operation->getOutputSocket());
|
||||
|
|
|
@ -33,33 +33,33 @@ ColorMatteNode::ColorMatteNode(bNode *editorNode) : Node(editorNode)
|
|||
void ColorMatteNode::convertToOperations(NodeConverter &converter, const CompositorContext &/*context*/) const
|
||||
{
|
||||
bNode *editorsnode = getbNode();
|
||||
|
||||
|
||||
NodeInput *inputSocketImage = this->getInputSocket(0);
|
||||
NodeInput *inputSocketKey = this->getInputSocket(1);
|
||||
NodeOutput *outputSocketImage = this->getOutputSocket(0);
|
||||
NodeOutput *outputSocketMatte = this->getOutputSocket(1);
|
||||
|
||||
|
||||
ConvertRGBToHSVOperation *operationRGBToHSV_Image = new ConvertRGBToHSVOperation();
|
||||
ConvertRGBToHSVOperation *operationRGBToHSV_Key = new ConvertRGBToHSVOperation();
|
||||
converter.addOperation(operationRGBToHSV_Image);
|
||||
converter.addOperation(operationRGBToHSV_Key);
|
||||
|
||||
|
||||
ColorMatteOperation *operation = new ColorMatteOperation();
|
||||
operation->setSettings((NodeChroma *)editorsnode->storage);
|
||||
converter.addOperation(operation);
|
||||
|
||||
|
||||
SetAlphaOperation *operationAlpha = new SetAlphaOperation();
|
||||
converter.addOperation(operationAlpha);
|
||||
|
||||
|
||||
converter.mapInputSocket(inputSocketImage, operationRGBToHSV_Image->getInputSocket(0));
|
||||
converter.mapInputSocket(inputSocketKey, operationRGBToHSV_Key->getInputSocket(0));
|
||||
converter.addLink(operationRGBToHSV_Image->getOutputSocket(), operation->getInputSocket(0));
|
||||
converter.addLink(operationRGBToHSV_Key->getOutputSocket(), operation->getInputSocket(1));
|
||||
converter.mapOutputSocket(outputSocketMatte, operation->getOutputSocket(0));
|
||||
|
||||
|
||||
converter.mapInputSocket(inputSocketImage, operationAlpha->getInputSocket(0));
|
||||
converter.addLink(operation->getOutputSocket(), operationAlpha->getInputSocket(1));
|
||||
converter.mapOutputSocket(outputSocketImage, operationAlpha->getOutputSocket());
|
||||
|
||||
|
||||
converter.addPreview(operationAlpha->getOutputSocket());
|
||||
}
|
||||
|
|
|
@ -37,6 +37,6 @@ void ColorNode::convertToOperations(NodeConverter &converter, const CompositorCo
|
|||
output->getEditorValueColor(col);
|
||||
operation->setChannels(col);
|
||||
converter.addOperation(operation);
|
||||
|
||||
|
||||
converter.mapOutputSocket(output, operation->getOutputSocket());
|
||||
}
|
||||
|
|
|
@ -42,14 +42,14 @@ void ColorRampNode::convertToOperations(NodeConverter &converter, const Composit
|
|||
ColorRampOperation *operation = new ColorRampOperation();
|
||||
operation->setColorBand((ColorBand *)editorNode->storage);
|
||||
converter.addOperation(operation);
|
||||
|
||||
|
||||
converter.mapInputSocket(inputSocket, operation->getInputSocket(0));
|
||||
converter.mapOutputSocket(outputSocket, operation->getOutputSocket(0));
|
||||
|
||||
|
||||
SeparateChannelOperation *operation2 = new SeparateChannelOperation();
|
||||
operation2->setChannel(3);
|
||||
converter.addOperation(operation2);
|
||||
|
||||
|
||||
converter.addLink(operation->getOutputSocket(), operation2->getInputSocket(0));
|
||||
converter.mapOutputSocket(outputSocketAlpha, operation2->getOutputSocket());
|
||||
}
|
||||
|
|
|
@ -32,18 +32,18 @@ ColorSpillNode::ColorSpillNode(bNode *editorNode) : Node(editorNode)
|
|||
void ColorSpillNode::convertToOperations(NodeConverter &converter, const CompositorContext &/*context*/) const
|
||||
{
|
||||
bNode *editorsnode = getbNode();
|
||||
|
||||
|
||||
NodeInput *inputSocketImage = this->getInputSocket(0);
|
||||
NodeInput *inputSocketFac = this->getInputSocket(1);
|
||||
NodeOutput *outputSocketImage = this->getOutputSocket(0);
|
||||
|
||||
|
||||
ColorSpillOperation *operation;
|
||||
operation = new ColorSpillOperation();
|
||||
operation->setSettings((NodeColorspill *)editorsnode->storage);
|
||||
operation->setSpillChannel(editorsnode->custom1 - 1); // Channel for spilling
|
||||
operation->setSpillMethod(editorsnode->custom2); // Channel method
|
||||
converter.addOperation(operation);
|
||||
|
||||
|
||||
converter.mapInputSocket(inputSocketImage, operation->getInputSocket(0));
|
||||
converter.mapInputSocket(inputSocketFac, operation->getInputSocket(1));
|
||||
converter.mapOutputSocket(outputSocketImage, operation->getOutputSocket());
|
||||
|
|
|
@ -34,10 +34,10 @@ void ColorToBWNode::convertToOperations(NodeConverter &converter, const Composit
|
|||
{
|
||||
NodeInput *colorSocket = this->getInputSocket(0);
|
||||
NodeOutput *valueSocket = this->getOutputSocket(0);
|
||||
|
||||
|
||||
ConvertColorToBWOperation *convertProg = new ConvertColorToBWOperation();
|
||||
converter.addOperation(convertProg);
|
||||
|
||||
|
||||
converter.mapInputSocket(colorSocket, convertProg->getInputSocket(0));
|
||||
converter.mapOutputSocket(valueSocket, convertProg->getOutputSocket(0));
|
||||
}
|
||||
|
|
|
@ -38,7 +38,7 @@ void CombineColorNode::convertToOperations(NodeConverter &converter, const Compo
|
|||
NodeInput *inputBSocket = this->getInputSocket(2);
|
||||
NodeInput *inputASocket = this->getInputSocket(3);
|
||||
NodeOutput *outputSocket = this->getOutputSocket(0);
|
||||
|
||||
|
||||
CombineChannelsOperation *operation = new CombineChannelsOperation();
|
||||
if (inputRSocket->isLinked()) {
|
||||
operation->setResolutionInputSocketIndex(0);
|
||||
|
@ -53,16 +53,16 @@ void CombineColorNode::convertToOperations(NodeConverter &converter, const Compo
|
|||
operation->setResolutionInputSocketIndex(3);
|
||||
}
|
||||
converter.addOperation(operation);
|
||||
|
||||
|
||||
converter.mapInputSocket(inputRSocket, operation->getInputSocket(0));
|
||||
converter.mapInputSocket(inputGSocket, operation->getInputSocket(1));
|
||||
converter.mapInputSocket(inputBSocket, operation->getInputSocket(2));
|
||||
converter.mapInputSocket(inputASocket, operation->getInputSocket(3));
|
||||
|
||||
|
||||
NodeOperation *color_conv = getColorConverter(context);
|
||||
if (color_conv) {
|
||||
converter.addOperation(color_conv);
|
||||
|
||||
|
||||
converter.addLink(operation->getOutputSocket(), color_conv->getInputSocket(0));
|
||||
converter.mapOutputSocket(outputSocket, color_conv->getOutputSocket());
|
||||
}
|
||||
|
|
|
@ -30,7 +30,7 @@ class CombineColorNode : public Node {
|
|||
public:
|
||||
CombineColorNode(bNode *editorNode);
|
||||
void convertToOperations(NodeConverter &converter, const CompositorContext &context) const;
|
||||
|
||||
|
||||
protected:
|
||||
virtual NodeOperation *getColorConverter(const CompositorContext &context) const = 0;
|
||||
};
|
||||
|
@ -40,7 +40,7 @@ public:
|
|||
CombineRGBANode(bNode *editorNode) :
|
||||
CombineColorNode(editorNode)
|
||||
{}
|
||||
|
||||
|
||||
NodeOperation *getColorConverter(const CompositorContext &context) const;
|
||||
};
|
||||
|
||||
|
@ -49,7 +49,7 @@ public:
|
|||
CombineHSVANode(bNode *editorNode) :
|
||||
CombineColorNode(editorNode)
|
||||
{}
|
||||
|
||||
|
||||
NodeOperation *getColorConverter(const CompositorContext &context) const;
|
||||
};
|
||||
|
||||
|
@ -58,7 +58,7 @@ public:
|
|||
CombineYCCANode(bNode *editorNode) :
|
||||
CombineColorNode(editorNode)
|
||||
{}
|
||||
|
||||
|
||||
NodeOperation *getColorConverter(const CompositorContext &context) const;
|
||||
};
|
||||
|
||||
|
@ -67,7 +67,7 @@ public:
|
|||
CombineYUVANode(bNode *editorNode) :
|
||||
CombineColorNode(editorNode)
|
||||
{}
|
||||
|
||||
|
||||
NodeOperation *getColorConverter(const CompositorContext &context) const;
|
||||
};
|
||||
|
||||
|
|
|
@ -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 */
|
||||
compositorOperation->setUseAlphaInput(ignore_alpha || alphaSocket->isLinked());
|
||||
compositorOperation->setActive(is_active);
|
||||
|
||||
|
||||
converter.addOperation(compositorOperation);
|
||||
converter.mapInputSocket(imageSocket, compositorOperation->getInputSocket(0));
|
||||
/* only use alpha link if "use alpha" is enabled */
|
||||
|
@ -58,6 +58,6 @@ void CompositorNode::convertToOperations(NodeConverter &converter, const Composi
|
|||
else
|
||||
converter.mapInputSocket(alphaSocket, compositorOperation->getInputSocket(1));
|
||||
converter.mapInputSocket(depthSocket, compositorOperation->getInputSocket(2));
|
||||
|
||||
|
||||
converter.addNodeInputPreview(imageSocket);
|
||||
}
|
||||
|
|
|
@ -35,9 +35,9 @@ void ConvertAlphaNode::convertToOperations(NodeConverter &converter, const Compo
|
|||
else {
|
||||
operation = new ConvertStraightToPremulOperation();
|
||||
}
|
||||
|
||||
|
||||
converter.addOperation(operation);
|
||||
|
||||
|
||||
converter.mapInputSocket(getInputSocket(0), operation->getInputSocket(0));
|
||||
converter.mapOutputSocket(getOutputSocket(0), operation->getOutputSocket());
|
||||
}
|
||||
|
|
|
@ -46,7 +46,7 @@ void CornerPinNode::convertToOperations(NodeConverter &converter, const Composit
|
|||
converter.addOperation(warp_image_operation);
|
||||
PlaneCornerPinMaskOperation *plane_mask_operation = new PlaneCornerPinMaskOperation();
|
||||
converter.addOperation(plane_mask_operation);
|
||||
|
||||
|
||||
converter.mapInputSocket(input_image, warp_image_operation->getInputSocket(0));
|
||||
for (int i = 0; i < 4; ++i) {
|
||||
NodeInput *corner_input = getInputSocket(node_corner_index[i]);
|
||||
|
|
|
@ -45,7 +45,7 @@ void CropNode::convertToOperations(NodeConverter &converter, const CompositorCon
|
|||
operation->setCropSettings(cropSettings);
|
||||
operation->setRelative(relative);
|
||||
converter.addOperation(operation);
|
||||
|
||||
|
||||
converter.mapInputSocket(getInputSocket(0), operation->getInputSocket(0));
|
||||
converter.mapOutputSocket(getOutputSocket(), operation->getOutputSocket());
|
||||
}
|
||||
|
|
|
@ -54,17 +54,17 @@ void DefocusNode::convertToOperations(NodeConverter &converter, const Compositor
|
|||
SetValueOperation *maxRadius = new SetValueOperation();
|
||||
maxRadius->setValue(data->maxblur);
|
||||
MathMinimumOperation *minimize = new MathMinimumOperation();
|
||||
|
||||
|
||||
converter.addOperation(multiply);
|
||||
converter.addOperation(multiplier);
|
||||
converter.addOperation(maxRadius);
|
||||
converter.addOperation(minimize);
|
||||
|
||||
|
||||
converter.mapInputSocket(getInputSocket(1), multiply->getInputSocket(0));
|
||||
converter.addLink(multiplier->getOutputSocket(), multiply->getInputSocket(1));
|
||||
converter.addLink(multiply->getOutputSocket(), minimize->getInputSocket(0));
|
||||
converter.addLink(maxRadius->getOutputSocket(), minimize->getInputSocket(1));
|
||||
|
||||
|
||||
radiusOperation = minimize;
|
||||
}
|
||||
else {
|
||||
|
@ -73,20 +73,20 @@ void DefocusNode::convertToOperations(NodeConverter &converter, const Compositor
|
|||
radius_op->setfStop(data->fstop);
|
||||
radius_op->setMaxRadius(data->maxblur);
|
||||
converter.addOperation(radius_op);
|
||||
|
||||
|
||||
converter.mapInputSocket(getInputSocket(1), radius_op->getInputSocket(0));
|
||||
|
||||
|
||||
FastGaussianBlurValueOperation *blur = new FastGaussianBlurValueOperation();
|
||||
/* maintain close pixels so far Z values don't bleed into the foreground */
|
||||
blur->setOverlay(FAST_GAUSS_OVERLAY_MIN);
|
||||
converter.addOperation(blur);
|
||||
|
||||
|
||||
converter.addLink(radius_op->getOutputSocket(0), blur->getInputSocket(0));
|
||||
radius_op->setPostBlur(blur);
|
||||
|
||||
|
||||
radiusOperation = blur;
|
||||
}
|
||||
|
||||
|
||||
NodeBokehImage *bokehdata = new NodeBokehImage();
|
||||
bokehdata->angle = data->rotation;
|
||||
bokehdata->rounding = 0.0f;
|
||||
|
@ -97,20 +97,20 @@ void DefocusNode::convertToOperations(NodeConverter &converter, const Compositor
|
|||
}
|
||||
bokehdata->catadioptric = 0.0f;
|
||||
bokehdata->lensshift = 0.0f;
|
||||
|
||||
|
||||
BokehImageOperation *bokeh = new BokehImageOperation();
|
||||
bokeh->setData(bokehdata);
|
||||
bokeh->deleteDataOnFinish();
|
||||
converter.addOperation(bokeh);
|
||||
|
||||
|
||||
#ifdef COM_DEFOCUS_SEARCH
|
||||
InverseSearchRadiusOperation *search = new InverseSearchRadiusOperation();
|
||||
search->setMaxBlur(data->maxblur);
|
||||
converter.addOperation(search);
|
||||
|
||||
|
||||
converter.addLink(radiusOperation->getOutputSocket(0), search->getInputSocket(0));
|
||||
#endif
|
||||
|
||||
|
||||
VariableSizeBokehBlurOperation *operation = new VariableSizeBokehBlurOperation();
|
||||
if (data->preview)
|
||||
operation->setQuality(COM_QUALITY_LOW);
|
||||
|
@ -119,19 +119,19 @@ void DefocusNode::convertToOperations(NodeConverter &converter, const Compositor
|
|||
operation->setMaxBlur(data->maxblur);
|
||||
operation->setThreshold(data->bthresh);
|
||||
converter.addOperation(operation);
|
||||
|
||||
|
||||
converter.addLink(bokeh->getOutputSocket(), operation->getInputSocket(1));
|
||||
converter.addLink(radiusOperation->getOutputSocket(), operation->getInputSocket(2));
|
||||
#ifdef COM_DEFOCUS_SEARCH
|
||||
converter.addLink(search->getOutputSocket(), operation->getInputSocket(3));
|
||||
#endif
|
||||
|
||||
|
||||
if (data->gamco) {
|
||||
GammaCorrectOperation *correct = new GammaCorrectOperation();
|
||||
converter.addOperation(correct);
|
||||
GammaUncorrectOperation *inverse = new GammaUncorrectOperation();
|
||||
converter.addOperation(inverse);
|
||||
|
||||
|
||||
converter.mapInputSocket(getInputSocket(0), correct->getInputSocket(0));
|
||||
converter.addLink(correct->getOutputSocket(), operation->getInputSocket(0));
|
||||
converter.addLink(operation->getOutputSocket(), inverse->getInputSocket(0));
|
||||
|
|
|
@ -35,15 +35,15 @@ void DespeckleNode::convertToOperations(NodeConverter &converter, const Composit
|
|||
NodeInput *inputSocket = this->getInputSocket(0);
|
||||
NodeInput *inputImageSocket = this->getInputSocket(1);
|
||||
NodeOutput *outputSocket = this->getOutputSocket(0);
|
||||
|
||||
|
||||
DespeckleOperation *operation = new DespeckleOperation();
|
||||
operation->setThreshold(editorNode->custom3);
|
||||
operation->setThresholdNeighbor(editorNode->custom4);
|
||||
converter.addOperation(operation);
|
||||
|
||||
|
||||
converter.mapInputSocket(inputImageSocket, operation->getInputSocket(0));
|
||||
converter.mapInputSocket(inputSocket, operation->getInputSocket(1));
|
||||
converter.mapOutputSocket(outputSocket, operation->getOutputSocket());
|
||||
|
||||
|
||||
converter.addPreview(operation->getOutputSocket(0));
|
||||
}
|
||||
|
|
|
@ -41,17 +41,17 @@ void DifferenceMatteNode::convertToOperations(NodeConverter &converter, const Co
|
|||
DifferenceMatteOperation *operationSet = new DifferenceMatteOperation();
|
||||
operationSet->setSettings((NodeChroma *)editorNode->storage);
|
||||
converter.addOperation(operationSet);
|
||||
|
||||
|
||||
converter.mapInputSocket(inputSocket, operationSet->getInputSocket(0));
|
||||
converter.mapInputSocket(inputSocket2, operationSet->getInputSocket(1));
|
||||
converter.mapOutputSocket(outputSocketMatte, operationSet->getOutputSocket(0));
|
||||
|
||||
SetAlphaOperation *operation = new SetAlphaOperation();
|
||||
converter.addOperation(operation);
|
||||
|
||||
|
||||
converter.mapInputSocket(inputSocket, operation->getInputSocket(0));
|
||||
converter.addLink(operationSet->getOutputSocket(), operation->getInputSocket(1));
|
||||
converter.mapOutputSocket(outputSocketImage, operation->getOutputSocket());
|
||||
|
||||
|
||||
converter.addPreview(operation->getOutputSocket());
|
||||
}
|
||||
|
|
|
@ -45,20 +45,20 @@ DilateErodeNode::DilateErodeNode(bNode *editorNode) : Node(editorNode)
|
|||
|
||||
void DilateErodeNode::convertToOperations(NodeConverter &converter, const CompositorContext &context) const
|
||||
{
|
||||
|
||||
|
||||
bNode *editorNode = this->getbNode();
|
||||
if (editorNode->custom1 == CMP_NODE_DILATEERODE_DISTANCE_THRESH) {
|
||||
DilateErodeThresholdOperation *operation = new DilateErodeThresholdOperation();
|
||||
operation->setDistance(editorNode->custom2);
|
||||
operation->setInset(editorNode->custom3);
|
||||
converter.addOperation(operation);
|
||||
|
||||
|
||||
converter.mapInputSocket(getInputSocket(0), operation->getInputSocket(0));
|
||||
|
||||
|
||||
if (editorNode->custom3 < 2.0f) {
|
||||
AntiAliasOperation *antiAlias = new AntiAliasOperation();
|
||||
converter.addOperation(antiAlias);
|
||||
|
||||
|
||||
converter.addLink(operation->getOutputSocket(), antiAlias->getInputSocket(0));
|
||||
converter.mapOutputSocket(getOutputSocket(0), antiAlias->getOutputSocket(0));
|
||||
}
|
||||
|
@ -71,7 +71,7 @@ void DilateErodeNode::convertToOperations(NodeConverter &converter, const Compos
|
|||
DilateDistanceOperation *operation = new DilateDistanceOperation();
|
||||
operation->setDistance(editorNode->custom2);
|
||||
converter.addOperation(operation);
|
||||
|
||||
|
||||
converter.mapInputSocket(getInputSocket(0), operation->getInputSocket(0));
|
||||
converter.mapOutputSocket(getOutputSocket(0), operation->getOutputSocket(0));
|
||||
}
|
||||
|
@ -79,7 +79,7 @@ void DilateErodeNode::convertToOperations(NodeConverter &converter, const Compos
|
|||
ErodeDistanceOperation *operation = new ErodeDistanceOperation();
|
||||
operation->setDistance(-editorNode->custom2);
|
||||
converter.addOperation(operation);
|
||||
|
||||
|
||||
converter.mapInputSocket(getInputSocket(0), operation->getInputSocket(0));
|
||||
converter.mapOutputSocket(getOutputSocket(0), operation->getOutputSocket(0));
|
||||
}
|
||||
|
@ -93,20 +93,20 @@ void DilateErodeNode::convertToOperations(NodeConverter &converter, const Compos
|
|||
operationx->setQuality(quality);
|
||||
operationx->setFalloff(PROP_SMOOTH);
|
||||
converter.addOperation(operationx);
|
||||
|
||||
|
||||
converter.mapInputSocket(getInputSocket(0), operationx->getInputSocket(0));
|
||||
// converter.mapInputSocket(getInputSocket(1), operationx->getInputSocket(1)); // no size input yet
|
||||
|
||||
|
||||
GaussianAlphaYBlurOperation *operationy = new GaussianAlphaYBlurOperation();
|
||||
operationy->setData(&m_alpha_blur);
|
||||
operationy->setQuality(quality);
|
||||
operationy->setFalloff(PROP_SMOOTH);
|
||||
converter.addOperation(operationy);
|
||||
|
||||
|
||||
converter.addLink(operationx->getOutputSocket(), operationy->getInputSocket(0));
|
||||
// converter.mapInputSocket(getInputSocket(1), operationy->getInputSocket(1)); // no size input yet
|
||||
converter.mapOutputSocket(getOutputSocket(0), operationy->getOutputSocket());
|
||||
|
||||
|
||||
converter.addPreview(operationy->getOutputSocket());
|
||||
|
||||
/* TODO? */
|
||||
|
@ -134,7 +134,7 @@ void DilateErodeNode::convertToOperations(NodeConverter &converter, const Compos
|
|||
DilateStepOperation *operation = new DilateStepOperation();
|
||||
operation->setIterations(editorNode->custom2);
|
||||
converter.addOperation(operation);
|
||||
|
||||
|
||||
converter.mapInputSocket(getInputSocket(0), operation->getInputSocket(0));
|
||||
converter.mapOutputSocket(getOutputSocket(0), operation->getOutputSocket(0));
|
||||
}
|
||||
|
@ -142,7 +142,7 @@ void DilateErodeNode::convertToOperations(NodeConverter &converter, const Compos
|
|||
ErodeStepOperation *operation = new ErodeStepOperation();
|
||||
operation->setIterations(-editorNode->custom2);
|
||||
converter.addOperation(operation);
|
||||
|
||||
|
||||
converter.mapInputSocket(getInputSocket(0), operation->getInputSocket(0));
|
||||
converter.mapOutputSocket(getOutputSocket(0), operation->getOutputSocket(0));
|
||||
}
|
||||
|
|
|
@ -37,7 +37,7 @@ void DirectionalBlurNode::convertToOperations(NodeConverter &converter, const Co
|
|||
operation->setQuality(context.getQuality());
|
||||
operation->setData(data);
|
||||
converter.addOperation(operation);
|
||||
|
||||
|
||||
converter.mapInputSocket(getInputSocket(0), operation->getInputSocket(0));
|
||||
converter.mapOutputSocket(getOutputSocket(0), operation->getOutputSocket());
|
||||
}
|
||||
|
|
|
@ -35,27 +35,27 @@ void DistanceMatteNode::convertToOperations(NodeConverter &converter, const Comp
|
|||
{
|
||||
bNode *editorsnode = getbNode();
|
||||
NodeChroma *storage = (NodeChroma *)editorsnode->storage;
|
||||
|
||||
|
||||
NodeInput *inputSocketImage = this->getInputSocket(0);
|
||||
NodeInput *inputSocketKey = this->getInputSocket(1);
|
||||
NodeOutput *outputSocketImage = this->getOutputSocket(0);
|
||||
NodeOutput *outputSocketMatte = this->getOutputSocket(1);
|
||||
|
||||
|
||||
SetAlphaOperation *operationAlpha = new SetAlphaOperation();
|
||||
converter.addOperation(operationAlpha);
|
||||
|
||||
|
||||
/* work in RGB color space */
|
||||
NodeOperation *operation;
|
||||
if (storage->channel == 1) {
|
||||
DistanceRGBMatteOperation *matte = new DistanceRGBMatteOperation();
|
||||
matte->setSettings(storage);
|
||||
converter.addOperation(matte);
|
||||
|
||||
|
||||
converter.mapInputSocket(inputSocketImage, matte->getInputSocket(0));
|
||||
converter.mapInputSocket(inputSocketImage, operationAlpha->getInputSocket(0));
|
||||
|
||||
|
||||
converter.mapInputSocket(inputSocketKey, matte->getInputSocket(1));
|
||||
|
||||
|
||||
operation = matte;
|
||||
}
|
||||
/* work in YCbCr color space */
|
||||
|
@ -63,27 +63,27 @@ void DistanceMatteNode::convertToOperations(NodeConverter &converter, const Comp
|
|||
DistanceYCCMatteOperation *matte = new DistanceYCCMatteOperation();
|
||||
matte->setSettings(storage);
|
||||
converter.addOperation(matte);
|
||||
|
||||
|
||||
ConvertRGBToYCCOperation *operationYCCImage = new ConvertRGBToYCCOperation();
|
||||
ConvertRGBToYCCOperation *operationYCCMatte = new ConvertRGBToYCCOperation();
|
||||
operationYCCImage->setMode(BLI_YCC_ITU_BT709);
|
||||
operationYCCMatte->setMode(BLI_YCC_ITU_BT709);
|
||||
converter.addOperation(operationYCCImage);
|
||||
converter.addOperation(operationYCCMatte);
|
||||
|
||||
|
||||
converter.mapInputSocket(inputSocketImage, operationYCCImage->getInputSocket(0));
|
||||
converter.addLink(operationYCCImage->getOutputSocket(), matte->getInputSocket(0));
|
||||
converter.addLink(operationYCCImage->getOutputSocket(), operationAlpha->getInputSocket(0));
|
||||
|
||||
|
||||
converter.mapInputSocket(inputSocketKey, operationYCCMatte->getInputSocket(0));
|
||||
converter.addLink(operationYCCMatte->getOutputSocket(), matte->getInputSocket(1));
|
||||
|
||||
|
||||
operation = matte;
|
||||
}
|
||||
|
||||
|
||||
converter.mapOutputSocket(outputSocketMatte, operation->getOutputSocket(0));
|
||||
converter.addLink(operation->getOutputSocket(), operationAlpha->getInputSocket(1));
|
||||
|
||||
|
||||
if (storage->channel != 1) {
|
||||
ConvertYCCToRGBOperation *inv_convert = new ConvertYCCToRGBOperation();
|
||||
inv_convert->setMode(BLI_YCC_ITU_BT709);
|
||||
|
|
|
@ -33,12 +33,12 @@ void DoubleEdgeMaskNode::convertToOperations(NodeConverter &converter, const Com
|
|||
{
|
||||
DoubleEdgeMaskOperation *operation;
|
||||
bNode *bnode = this->getbNode();
|
||||
|
||||
|
||||
operation = new DoubleEdgeMaskOperation();
|
||||
operation->setAdjecentOnly(bnode->custom1);
|
||||
operation->setKeepInside(bnode->custom2);
|
||||
converter.addOperation(operation);
|
||||
|
||||
|
||||
converter.mapInputSocket(getInputSocket(0), operation->getInputSocket(0));
|
||||
converter.mapInputSocket(getInputSocket(1), operation->getInputSocket(1));
|
||||
converter.mapOutputSocket(getOutputSocket(0), operation->getOutputSocket(0));
|
||||
|
|
|
@ -36,13 +36,13 @@ void EllipseMaskNode::convertToOperations(NodeConverter &converter, const Compos
|
|||
{
|
||||
NodeInput *inputSocket = this->getInputSocket(0);
|
||||
NodeOutput *outputSocket = this->getOutputSocket(0);
|
||||
|
||||
|
||||
EllipseMaskOperation *operation;
|
||||
operation = new EllipseMaskOperation();
|
||||
operation->setData((NodeEllipseMask *)this->getbNode()->storage);
|
||||
operation->setMaskType(this->getbNode()->custom1);
|
||||
converter.addOperation(operation);
|
||||
|
||||
|
||||
if (inputSocket->isLinked()) {
|
||||
converter.mapInputSocket(inputSocket, operation->getInputSocket(0));
|
||||
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.mapOutputSocket(outputSocket, operation->getOutputSocket(0));
|
||||
}
|
||||
|
||||
|
||||
converter.mapInputSocket(getInputSocket(1), operation->getInputSocket(1));
|
||||
}
|
||||
|
|
|
@ -38,7 +38,7 @@ void FilterNode::convertToOperations(NodeConverter &converter, const CompositorC
|
|||
NodeInput *inputImageSocket = this->getInputSocket(1);
|
||||
NodeOutput *outputSocket = this->getOutputSocket(0);
|
||||
ConvolutionFilterOperation *operation = NULL;
|
||||
|
||||
|
||||
switch (this->getbNode()->custom1) {
|
||||
case CMP_FILT_SOFT:
|
||||
operation = new ConvolutionFilterOperation();
|
||||
|
@ -74,10 +74,10 @@ void FilterNode::convertToOperations(NodeConverter &converter, const CompositorC
|
|||
break;
|
||||
}
|
||||
converter.addOperation(operation);
|
||||
|
||||
|
||||
converter.mapInputSocket(inputImageSocket, operation->getInputSocket(0));
|
||||
converter.mapInputSocket(inputSocket, operation->getInputSocket(1));
|
||||
converter.mapOutputSocket(outputSocket, operation->getOutputSocket());
|
||||
|
||||
|
||||
converter.addPreview(operation->getOutputSocket(0));
|
||||
}
|
||||
|
|
|
@ -49,7 +49,7 @@ void FlipNode::convertToOperations(NodeConverter &converter, const CompositorCon
|
|||
operation->setFlipY(true);
|
||||
break;
|
||||
}
|
||||
|
||||
|
||||
converter.addOperation(operation);
|
||||
converter.mapInputSocket(inputSocket, operation->getInputSocket(0));
|
||||
converter.mapOutputSocket(outputSocket, operation->getOutputSocket(0));
|
||||
|
|
|
@ -33,7 +33,7 @@ void GammaNode::convertToOperations(NodeConverter &converter, const CompositorCo
|
|||
{
|
||||
GammaOperation *operation = new GammaOperation();
|
||||
converter.addOperation(operation);
|
||||
|
||||
|
||||
converter.mapInputSocket(getInputSocket(0), operation->getInputSocket(0));
|
||||
converter.mapInputSocket(getInputSocket(1), operation->getInputSocket(1));
|
||||
converter.mapOutputSocket(getOutputSocket(0), operation->getOutputSocket(0));
|
||||
|
|
|
@ -40,7 +40,7 @@ void GlareNode::convertToOperations(NodeConverter &converter, const CompositorCo
|
|||
{
|
||||
bNode *node = this->getbNode();
|
||||
NodeGlare *glare = (NodeGlare *)node->storage;
|
||||
|
||||
|
||||
GlareBaseOperation *glareoperation = NULL;
|
||||
switch (glare->type) {
|
||||
default:
|
||||
|
@ -59,17 +59,17 @@ void GlareNode::convertToOperations(NodeConverter &converter, const CompositorCo
|
|||
}
|
||||
BLI_assert(glareoperation);
|
||||
glareoperation->setGlareSettings(glare);
|
||||
|
||||
|
||||
GlareThresholdOperation *thresholdOperation = new GlareThresholdOperation();
|
||||
thresholdOperation->setGlareSettings(glare);
|
||||
|
||||
|
||||
SetValueOperation *mixvalueoperation = new SetValueOperation();
|
||||
mixvalueoperation->setValue(0.5f + glare->mix * 0.5f);
|
||||
|
||||
|
||||
MixGlareOperation *mixoperation = new MixGlareOperation();
|
||||
mixoperation->setResolutionInputSocketIndex(1);
|
||||
mixoperation->getInputSocket(2)->setResizeMode(COM_SC_FIT);
|
||||
|
||||
|
||||
converter.addOperation(glareoperation);
|
||||
converter.addOperation(thresholdOperation);
|
||||
converter.addOperation(mixvalueoperation);
|
||||
|
@ -77,7 +77,7 @@ void GlareNode::convertToOperations(NodeConverter &converter, const CompositorCo
|
|||
|
||||
converter.mapInputSocket(getInputSocket(0), thresholdOperation->getInputSocket(0));
|
||||
converter.addLink(thresholdOperation->getOutputSocket(), glareoperation->getInputSocket(0));
|
||||
|
||||
|
||||
converter.addLink(mixvalueoperation->getOutputSocket(), mixoperation->getInputSocket(0));
|
||||
converter.mapInputSocket(getInputSocket(0), mixoperation->getInputSocket(1));
|
||||
converter.addLink(glareoperation->getOutputSocket(), mixoperation->getInputSocket(2));
|
||||
|
|
|
@ -42,17 +42,17 @@ void HueSaturationValueCorrectNode::convertToOperations(NodeConverter &converter
|
|||
NodeOutput *outputSocket = this->getOutputSocket(0);
|
||||
bNode *editorsnode = getbNode();
|
||||
CurveMapping *storage = (CurveMapping *)editorsnode->storage;
|
||||
|
||||
|
||||
ConvertRGBToHSVOperation *rgbToHSV = new ConvertRGBToHSVOperation();
|
||||
converter.addOperation(rgbToHSV);
|
||||
|
||||
|
||||
ConvertHSVToRGBOperation *hsvToRGB = new ConvertHSVToRGBOperation();
|
||||
converter.addOperation(hsvToRGB);
|
||||
|
||||
|
||||
HueSaturationValueCorrectOperation *changeHSV = new HueSaturationValueCorrectOperation();
|
||||
changeHSV->setCurveMapping(storage);
|
||||
converter.addOperation(changeHSV);
|
||||
|
||||
|
||||
MixBlendOperation *blend = new MixBlendOperation();
|
||||
blend->setResolutionInputSocketIndex(1);
|
||||
converter.addOperation(blend);
|
||||
|
|
|
@ -46,16 +46,16 @@ void HueSaturationValueNode::convertToOperations(NodeConverter &converter, const
|
|||
|
||||
ConvertRGBToHSVOperation *rgbToHSV = new ConvertRGBToHSVOperation();
|
||||
converter.addOperation(rgbToHSV);
|
||||
|
||||
|
||||
ConvertHSVToRGBOperation *hsvToRGB = new ConvertHSVToRGBOperation();
|
||||
converter.addOperation(hsvToRGB);
|
||||
|
||||
|
||||
ChangeHSVOperation *changeHSV = new ChangeHSVOperation();
|
||||
converter.mapInputSocket(hueSocket, changeHSV->getInputSocket(1));
|
||||
converter.mapInputSocket(saturationSocket, changeHSV->getInputSocket(2));
|
||||
converter.mapInputSocket(valueSocket, changeHSV->getInputSocket(3));
|
||||
converter.addOperation(changeHSV);
|
||||
|
||||
|
||||
MixBlendOperation *blend = new MixBlendOperation();
|
||||
blend->setResolutionInputSocketIndex(1);
|
||||
converter.addOperation(blend);
|
||||
|
|
|
@ -32,12 +32,12 @@ IDMaskNode::IDMaskNode(bNode *editorNode) : Node(editorNode)
|
|||
void IDMaskNode::convertToOperations(NodeConverter &converter, const CompositorContext &context) const
|
||||
{
|
||||
bNode *bnode = this->getbNode();
|
||||
|
||||
|
||||
IDMaskOperation *operation;
|
||||
operation = new IDMaskOperation();
|
||||
operation->setObjectIndex(bnode->custom1);
|
||||
converter.addOperation(operation);
|
||||
|
||||
|
||||
converter.mapInputSocket(getInputSocket(0), operation->getInputSocket(0));
|
||||
if (bnode->custom2 == 0 || context.getRenderData()->scemode & R_FULL_SAMPLE) {
|
||||
converter.mapOutputSocket(getOutputSocket(0), operation->getOutputSocket(0));
|
||||
|
@ -45,7 +45,7 @@ void IDMaskNode::convertToOperations(NodeConverter &converter, const CompositorC
|
|||
else {
|
||||
AntiAliasOperation *antiAliasOperation = new AntiAliasOperation();
|
||||
converter.addOperation(antiAliasOperation);
|
||||
|
||||
|
||||
converter.addLink(operation->getOutputSocket(), antiAliasOperation->getInputSocket(0));
|
||||
converter.mapOutputSocket(getOutputSocket(0), antiAliasOperation->getOutputSocket(0));
|
||||
}
|
||||
|
|
|
@ -61,10 +61,10 @@ NodeOperation *ImageNode::doMultilayerCheck(NodeConverter &converter, RenderLaye
|
|||
operation->setRenderLayer(rl);
|
||||
operation->setImageUser(user);
|
||||
operation->setFramenumber(framenumber);
|
||||
|
||||
|
||||
converter.addOperation(operation);
|
||||
converter.mapOutputSocket(outputSocket, operation->getOutputSocket());
|
||||
|
||||
|
||||
return operation;
|
||||
}
|
||||
|
||||
|
@ -189,10 +189,10 @@ void ImageNode::convertToOperations(NodeConverter &converter, const CompositorCo
|
|||
operation->setRenderData(context.getRenderData());
|
||||
operation->setViewName(context.getViewName());
|
||||
converter.addOperation(operation);
|
||||
|
||||
|
||||
if (outputStraightAlpha) {
|
||||
NodeOperation *alphaConvertOperation = new ConvertPremulToStraightOperation();
|
||||
|
||||
|
||||
converter.addOperation(alphaConvertOperation);
|
||||
converter.mapOutputSocket(outputImage, alphaConvertOperation->getOutputSocket());
|
||||
converter.addLink(operation->getOutputSocket(0), alphaConvertOperation->getInputSocket(0));
|
||||
|
@ -200,10 +200,10 @@ void ImageNode::convertToOperations(NodeConverter &converter, const CompositorCo
|
|||
else {
|
||||
converter.mapOutputSocket(outputImage, operation->getOutputSocket());
|
||||
}
|
||||
|
||||
|
||||
converter.addPreview(operation->getOutputSocket());
|
||||
}
|
||||
|
||||
|
||||
if (numberOfOutputs > 1) {
|
||||
NodeOutput *alphaImage = this->getOutputSocket(1);
|
||||
ImageAlphaOperation *alphaOperation = new ImageAlphaOperation();
|
||||
|
@ -213,7 +213,7 @@ void ImageNode::convertToOperations(NodeConverter &converter, const CompositorCo
|
|||
alphaOperation->setRenderData(context.getRenderData());
|
||||
alphaOperation->setViewName(context.getViewName());
|
||||
converter.addOperation(alphaOperation);
|
||||
|
||||
|
||||
converter.mapOutputSocket(alphaImage, alphaOperation->getOutputSocket());
|
||||
}
|
||||
if (numberOfOutputs > 2) {
|
||||
|
@ -225,7 +225,7 @@ void ImageNode::convertToOperations(NodeConverter &converter, const CompositorCo
|
|||
depthOperation->setRenderData(context.getRenderData());
|
||||
depthOperation->setViewName(context.getViewName());
|
||||
converter.addOperation(depthOperation);
|
||||
|
||||
|
||||
converter.mapOutputSocket(depthImage, depthOperation->getOutputSocket());
|
||||
}
|
||||
if (numberOfOutputs > 3) {
|
||||
|
|
|
@ -33,7 +33,7 @@ InpaintNode::InpaintNode(bNode *editorNode) : Node(editorNode)
|
|||
|
||||
void InpaintNode::convertToOperations(NodeConverter &converter, const CompositorContext &/*context*/) const
|
||||
{
|
||||
|
||||
|
||||
bNode *editorNode = this->getbNode();
|
||||
|
||||
/* if (editorNode->custom1 == CMP_NODE_INPAINT_SIMPLE) { */
|
||||
|
@ -41,7 +41,7 @@ void InpaintNode::convertToOperations(NodeConverter &converter, const Compositor
|
|||
InpaintSimpleOperation *operation = new InpaintSimpleOperation();
|
||||
operation->setIterations(editorNode->custom2);
|
||||
converter.addOperation(operation);
|
||||
|
||||
|
||||
converter.mapInputSocket(getInputSocket(0), operation->getInputSocket(0));
|
||||
converter.mapOutputSocket(getOutputSocket(0), operation->getOutputSocket(0));
|
||||
}
|
||||
|
|
|
@ -37,7 +37,7 @@ void InvertNode::convertToOperations(NodeConverter &converter, const CompositorC
|
|||
operation->setColor(node->custom1 & CMP_CHAN_RGB);
|
||||
operation->setAlpha(node->custom1 & CMP_CHAN_A);
|
||||
converter.addOperation(operation);
|
||||
|
||||
|
||||
converter.mapInputSocket(getInputSocket(0), operation->getInputSocket(0));
|
||||
converter.mapInputSocket(getInputSocket(1), operation->getInputSocket(1));
|
||||
converter.mapOutputSocket(getOutputSocket(0), operation->getOutputSocket(0));
|
||||
|
|
|
@ -52,9 +52,9 @@ NodeOperationOutput *KeyingNode::setupPreBlur(NodeConverter &converter, NodeInpu
|
|||
ConvertRGBToYCCOperation *convertRGBToYCCOperation = new ConvertRGBToYCCOperation();
|
||||
convertRGBToYCCOperation->setMode(BLI_YCC_ITU_BT709);
|
||||
converter.addOperation(convertRGBToYCCOperation);
|
||||
|
||||
|
||||
converter.mapInputSocket(inputImage, convertRGBToYCCOperation->getInputSocket(0));
|
||||
|
||||
|
||||
CombineChannelsOperation *combineOperation = new CombineChannelsOperation();
|
||||
converter.addOperation(combineOperation);
|
||||
|
||||
|
@ -62,9 +62,9 @@ NodeOperationOutput *KeyingNode::setupPreBlur(NodeConverter &converter, NodeInpu
|
|||
SeparateChannelOperation *separateOperation = new SeparateChannelOperation();
|
||||
separateOperation->setChannel(channel);
|
||||
converter.addOperation(separateOperation);
|
||||
|
||||
|
||||
converter.addLink(convertRGBToYCCOperation->getOutputSocket(0), separateOperation->getInputSocket(0));
|
||||
|
||||
|
||||
if (channel == 0 || channel == 3) {
|
||||
converter.addLink(separateOperation->getOutputSocket(0), combineOperation->getInputSocket(channel));
|
||||
}
|
||||
|
@ -73,24 +73,24 @@ NodeOperationOutput *KeyingNode::setupPreBlur(NodeConverter &converter, NodeInpu
|
|||
blurXOperation->setSize(size);
|
||||
blurXOperation->setAxis(KeyingBlurOperation::BLUR_AXIS_X);
|
||||
converter.addOperation(blurXOperation);
|
||||
|
||||
|
||||
KeyingBlurOperation *blurYOperation = new KeyingBlurOperation();
|
||||
blurYOperation->setSize(size);
|
||||
blurYOperation->setAxis(KeyingBlurOperation::BLUR_AXIS_Y);
|
||||
converter.addOperation(blurYOperation);
|
||||
|
||||
|
||||
converter.addLink(separateOperation->getOutputSocket(), blurXOperation->getInputSocket(0));
|
||||
converter.addLink(blurXOperation->getOutputSocket(), blurYOperation->getInputSocket(0));
|
||||
converter.addLink(blurYOperation->getOutputSocket(0), combineOperation->getInputSocket(channel));
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
ConvertYCCToRGBOperation *convertYCCToRGBOperation = new ConvertYCCToRGBOperation();
|
||||
convertYCCToRGBOperation->setMode(BLI_YCC_ITU_BT709);
|
||||
converter.addOperation(convertYCCToRGBOperation);
|
||||
|
||||
|
||||
converter.addLink(combineOperation->getOutputSocket(0), convertYCCToRGBOperation->getInputSocket(0));
|
||||
|
||||
|
||||
return convertYCCToRGBOperation->getOutputSocket(0);
|
||||
}
|
||||
|
||||
|
@ -100,15 +100,15 @@ NodeOperationOutput *KeyingNode::setupPostBlur(NodeConverter &converter, NodeOpe
|
|||
blurXOperation->setSize(size);
|
||||
blurXOperation->setAxis(KeyingBlurOperation::BLUR_AXIS_X);
|
||||
converter.addOperation(blurXOperation);
|
||||
|
||||
|
||||
KeyingBlurOperation *blurYOperation = new KeyingBlurOperation();
|
||||
blurYOperation->setSize(size);
|
||||
blurYOperation->setAxis(KeyingBlurOperation::BLUR_AXIS_Y);
|
||||
converter.addOperation(blurYOperation);
|
||||
|
||||
|
||||
converter.addLink(postBlurInput, blurXOperation->getInputSocket(0));
|
||||
converter.addLink(blurXOperation->getOutputSocket(), blurYOperation->getInputSocket(0));
|
||||
|
||||
|
||||
return blurYOperation->getOutputSocket();
|
||||
}
|
||||
|
||||
|
@ -124,9 +124,9 @@ NodeOperationOutput *KeyingNode::setupDilateErode(NodeConverter &converter, Node
|
|||
dilateErodeOperation->setDistance(-distance);
|
||||
}
|
||||
converter.addOperation(dilateErodeOperation);
|
||||
|
||||
|
||||
converter.addLink(dilateErodeInput, dilateErodeOperation->getInputSocket(0));
|
||||
|
||||
|
||||
return dilateErodeOperation->getOutputSocket(0);
|
||||
}
|
||||
|
||||
|
@ -154,7 +154,7 @@ NodeOperationOutput *KeyingNode::setupFeather(NodeConverter &converter, const Co
|
|||
operationx->setSubtract(distance < 0);
|
||||
operationx->setFalloff(falloff);
|
||||
converter.addOperation(operationx);
|
||||
|
||||
|
||||
GaussianAlphaYBlurOperation *operationy = new GaussianAlphaYBlurOperation();
|
||||
operationy->setData(&data);
|
||||
operationy->setQuality(quality);
|
||||
|
@ -176,10 +176,10 @@ NodeOperationOutput *KeyingNode::setupDespill(NodeConverter &converter, NodeOper
|
|||
despillOperation->setDespillFactor(factor);
|
||||
despillOperation->setColorBalance(colorBalance);
|
||||
converter.addOperation(despillOperation);
|
||||
|
||||
|
||||
converter.addLink(despillInput, despillOperation->getInputSocket(0));
|
||||
converter.mapInputSocket(inputScreen, despillOperation->getInputSocket(1));
|
||||
|
||||
|
||||
return despillOperation->getOutputSocket(0);
|
||||
}
|
||||
|
||||
|
@ -193,9 +193,9 @@ NodeOperationOutput *KeyingNode::setupClip(NodeConverter &converter, NodeOperati
|
|||
clipOperation->setClipWhite(clipWhite);
|
||||
clipOperation->setIsEdgeMatte(edgeMatte);
|
||||
converter.addOperation(clipOperation);
|
||||
|
||||
|
||||
converter.addLink(clipInput, clipOperation->getInputSocket(0));
|
||||
|
||||
|
||||
return clipOperation->getOutputSocket(0);
|
||||
}
|
||||
|
||||
|
@ -203,7 +203,7 @@ void KeyingNode::convertToOperations(NodeConverter &converter, const CompositorC
|
|||
{
|
||||
bNode *editorNode = this->getbNode();
|
||||
NodeKeyingData *keying_data = (NodeKeyingData *) editorNode->storage;
|
||||
|
||||
|
||||
NodeInput *inputImage = this->getInputSocket(0);
|
||||
NodeInput *inputScreen = this->getInputSocket(1);
|
||||
NodeInput *inputGarbageMatte = this->getInputSocket(2);
|
||||
|
@ -212,14 +212,14 @@ void KeyingNode::convertToOperations(NodeConverter &converter, const CompositorC
|
|||
NodeOutput *outputMatte = this->getOutputSocket(1);
|
||||
NodeOutput *outputEdges = this->getOutputSocket(2);
|
||||
NodeOperationOutput *postprocessedMatte = NULL, *postprocessedImage = NULL, *edgesMatte = NULL;
|
||||
|
||||
|
||||
/* keying operation */
|
||||
KeyingOperation *keyingOperation = new KeyingOperation();
|
||||
keyingOperation->setScreenBalance(keying_data->screen_balance);
|
||||
converter.addOperation(keyingOperation);
|
||||
|
||||
|
||||
converter.mapInputSocket(inputScreen, keyingOperation->getInputSocket(1));
|
||||
|
||||
|
||||
if (keying_data->blur_pre) {
|
||||
/* chroma preblur operation for input of keying operation */
|
||||
NodeOperationOutput *preBluredImage = setupPreBlur(converter, inputImage, keying_data->blur_pre);
|
||||
|
@ -228,53 +228,53 @@ void KeyingNode::convertToOperations(NodeConverter &converter, const CompositorC
|
|||
else {
|
||||
converter.mapInputSocket(inputImage, keyingOperation->getInputSocket(0));
|
||||
}
|
||||
|
||||
|
||||
postprocessedMatte = keyingOperation->getOutputSocket();
|
||||
|
||||
|
||||
/* black / white clipping */
|
||||
if (keying_data->clip_black > 0.0f || keying_data->clip_white < 1.0f) {
|
||||
postprocessedMatte = setupClip(converter, postprocessedMatte,
|
||||
keying_data->edge_kernel_radius, keying_data->edge_kernel_tolerance,
|
||||
keying_data->clip_black, keying_data->clip_white, false);
|
||||
}
|
||||
|
||||
|
||||
/* output edge matte */
|
||||
edgesMatte = setupClip(converter, postprocessedMatte,
|
||||
keying_data->edge_kernel_radius, keying_data->edge_kernel_tolerance,
|
||||
keying_data->clip_black, keying_data->clip_white, true);
|
||||
|
||||
|
||||
/* apply garbage matte */
|
||||
if (inputGarbageMatte->isLinked()) {
|
||||
SetValueOperation *valueOperation = new SetValueOperation();
|
||||
valueOperation->setValue(1.0f);
|
||||
converter.addOperation(valueOperation);
|
||||
|
||||
|
||||
MathSubtractOperation *subtractOperation = new MathSubtractOperation();
|
||||
converter.addOperation(subtractOperation);
|
||||
|
||||
|
||||
MathMinimumOperation *minOperation = new MathMinimumOperation();
|
||||
converter.addOperation(minOperation);
|
||||
|
||||
|
||||
converter.addLink(valueOperation->getOutputSocket(), subtractOperation->getInputSocket(0));
|
||||
converter.mapInputSocket(inputGarbageMatte, subtractOperation->getInputSocket(1));
|
||||
|
||||
|
||||
converter.addLink(subtractOperation->getOutputSocket(), minOperation->getInputSocket(0));
|
||||
converter.addLink(postprocessedMatte, minOperation->getInputSocket(1));
|
||||
|
||||
|
||||
postprocessedMatte = minOperation->getOutputSocket();
|
||||
}
|
||||
|
||||
|
||||
/* apply core matte */
|
||||
if (inputCoreMatte->isLinked()) {
|
||||
MathMaximumOperation *maxOperation = new MathMaximumOperation();
|
||||
converter.addOperation(maxOperation);
|
||||
|
||||
|
||||
converter.mapInputSocket(inputCoreMatte, maxOperation->getInputSocket(0));
|
||||
converter.addLink(postprocessedMatte, maxOperation->getInputSocket(1));
|
||||
|
||||
|
||||
postprocessedMatte = maxOperation->getOutputSocket();
|
||||
}
|
||||
|
||||
|
||||
/* apply blur on matte if needed */
|
||||
if (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 */
|
||||
SetAlphaOperation *alphaOperation = new SetAlphaOperation();
|
||||
converter.addOperation(alphaOperation);
|
||||
|
||||
|
||||
converter.mapInputSocket(inputImage, alphaOperation->getInputSocket(0));
|
||||
converter.addLink(postprocessedMatte, alphaOperation->getInputSocket(1));
|
||||
|
||||
|
|
|
@ -39,15 +39,15 @@ void KeyingScreenNode::convertToOperations(NodeConverter &converter, const Compo
|
|||
bNode *editorNode = this->getbNode();
|
||||
MovieClip *clip = (MovieClip *) editorNode->id;
|
||||
NodeKeyingScreenData *keyingscreen_data = (NodeKeyingScreenData *) editorNode->storage;
|
||||
|
||||
|
||||
NodeOutput *outputScreen = this->getOutputSocket(0);
|
||||
|
||||
|
||||
// always connect the output image
|
||||
KeyingScreenOperation *operation = new KeyingScreenOperation();
|
||||
operation->setMovieClip(clip);
|
||||
operation->setTrackingObject(keyingscreen_data->tracking_object);
|
||||
operation->setFramenumber(context.getFramenumber());
|
||||
converter.addOperation(operation);
|
||||
|
||||
|
||||
converter.mapOutputSocket(outputScreen, operation->getOutputSocket());
|
||||
}
|
||||
|
|
|
@ -37,7 +37,7 @@ void LensDistortionNode::convertToOperations(NodeConverter &converter, const Com
|
|||
if (data->proj) {
|
||||
ProjectorLensDistortionOperation *operation = new ProjectorLensDistortionOperation();
|
||||
converter.addOperation(operation);
|
||||
|
||||
|
||||
converter.mapInputSocket(getInputSocket(0), operation->getInputSocket(0));
|
||||
converter.mapInputSocket(getInputSocket(2), operation->getInputSocket(1));
|
||||
converter.mapOutputSocket(getOutputSocket(0), operation->getOutputSocket(0));
|
||||
|
@ -51,9 +51,9 @@ void LensDistortionNode::convertToOperations(NodeConverter &converter, const Com
|
|||
operation->setDistortion(getInputSocket(1)->getEditorValueFloat());
|
||||
if (!getInputSocket(2)->isLinked())
|
||||
operation->setDispersion(getInputSocket(2)->getEditorValueFloat());
|
||||
|
||||
|
||||
converter.addOperation(operation);
|
||||
|
||||
|
||||
converter.mapInputSocket(getInputSocket(0), operation->getInputSocket(0));
|
||||
converter.mapInputSocket(getInputSocket(1), operation->getInputSocket(1));
|
||||
converter.mapInputSocket(getInputSocket(2), operation->getInputSocket(2));
|
||||
|
|
|
@ -46,10 +46,10 @@ void LuminanceMatteNode::convertToOperations(NodeConverter &converter, const Com
|
|||
|
||||
SetAlphaOperation *operation = new SetAlphaOperation();
|
||||
converter.addOperation(operation);
|
||||
|
||||
|
||||
converter.mapInputSocket(inputSocket, operation->getInputSocket(0));
|
||||
converter.addLink(operationSet->getOutputSocket(), operation->getInputSocket(1));
|
||||
converter.mapOutputSocket(outputSocketImage, operation->getOutputSocket());
|
||||
|
||||
|
||||
converter.addPreview(operation->getOutputSocket());
|
||||
}
|
||||
|
|
|
@ -38,11 +38,11 @@ void MapRangeNode::convertToOperations(NodeConverter &converter, const Composito
|
|||
NodeInput *destMinSocket = this->getInputSocket(3);
|
||||
NodeInput *destMaxSocket = this->getInputSocket(4);
|
||||
NodeOutput *outputSocket = this->getOutputSocket(0);
|
||||
|
||||
|
||||
MapRangeOperation *operation = new MapRangeOperation();
|
||||
operation->setUseClamp(this->getbNode()->custom1);
|
||||
converter.addOperation(operation);
|
||||
|
||||
|
||||
converter.mapInputSocket(valueSocket, operation->getInputSocket(0));
|
||||
converter.mapInputSocket(sourceMinSocket, operation->getInputSocket(1));
|
||||
converter.mapInputSocket(sourceMaxSocket, operation->getInputSocket(2));
|
||||
|
|
|
@ -31,7 +31,7 @@ MapUVNode::MapUVNode(bNode *editorNode) : Node(editorNode)
|
|||
void MapUVNode::convertToOperations(NodeConverter &converter, const CompositorContext &/*context*/) const
|
||||
{
|
||||
bNode *node = this->getbNode();
|
||||
|
||||
|
||||
MapUVOperation *operation = new MapUVOperation();
|
||||
operation->setAlpha((float)node->custom1);
|
||||
operation->setResolutionInputSocketIndex(1);
|
||||
|
|
|
@ -33,14 +33,14 @@ MapValueNode::MapValueNode(bNode *editorNode) : Node(editorNode)
|
|||
void MapValueNode::convertToOperations(NodeConverter &converter, const CompositorContext &/*context*/) const
|
||||
{
|
||||
TexMapping *storage = (TexMapping *)this->getbNode()->storage;
|
||||
|
||||
|
||||
NodeInput *colorSocket = this->getInputSocket(0);
|
||||
NodeOutput *valueSocket = this->getOutputSocket(0);
|
||||
|
||||
|
||||
MapValueOperation *convertProg = new MapValueOperation();
|
||||
convertProg->setSettings(storage);
|
||||
converter.addOperation(convertProg);
|
||||
|
||||
|
||||
converter.mapInputSocket(colorSocket, convertProg->getInputSocket(0));
|
||||
converter.mapOutputSocket(valueSocket, convertProg->getOutputSocket(0));
|
||||
}
|
||||
|
|
|
@ -27,7 +27,7 @@
|
|||
void MathNode::convertToOperations(NodeConverter &converter, const CompositorContext &/*context*/) const
|
||||
{
|
||||
MathBaseOperation *operation = NULL;
|
||||
|
||||
|
||||
switch (this->getbNode()->custom1) {
|
||||
case NODE_MATH_ADD:
|
||||
operation = new MathAddOperation();
|
||||
|
@ -90,12 +90,12 @@ void MathNode::convertToOperations(NodeConverter &converter, const CompositorCon
|
|||
operation = new MathArcTan2Operation();
|
||||
break;
|
||||
}
|
||||
|
||||
|
||||
if (operation) {
|
||||
bool useClamp = getbNode()->custom2;
|
||||
operation->setUseClamp(useClamp);
|
||||
converter.addOperation(operation);
|
||||
|
||||
|
||||
converter.mapInputSocket(getInputSocket(0), operation->getInputSocket(0));
|
||||
converter.mapInputSocket(getInputSocket(1), operation->getInputSocket(1));
|
||||
converter.mapOutputSocket(getOutputSocket(0), operation->getOutputSocket());
|
||||
|
|
|
@ -43,7 +43,7 @@ void MixNode::convertToOperations(NodeConverter &converter, const CompositorCont
|
|||
bNode *editorNode = this->getbNode();
|
||||
bool useAlphaPremultiply = (this->getbNode()->custom2 & 1) != 0;
|
||||
bool useClamp = (this->getbNode()->custom2 & 2) != 0;
|
||||
|
||||
|
||||
MixBaseOperation *convertProg;
|
||||
switch (editorNode->custom1) {
|
||||
case MA_RAMP_ADD:
|
||||
|
@ -106,11 +106,11 @@ void MixNode::convertToOperations(NodeConverter &converter, const CompositorCont
|
|||
convertProg->setUseValueAlphaMultiply(useAlphaPremultiply);
|
||||
convertProg->setUseClamp(useClamp);
|
||||
converter.addOperation(convertProg);
|
||||
|
||||
|
||||
converter.mapInputSocket(valueSocket, convertProg->getInputSocket(0));
|
||||
converter.mapInputSocket(color1Socket, convertProg->getInputSocket(1));
|
||||
converter.mapInputSocket(color2Socket, convertProg->getInputSocket(2));
|
||||
converter.mapOutputSocket(outputSocket, convertProg->getOutputSocket(0));
|
||||
|
||||
|
||||
converter.addPreview(convertProg->getOutputSocket(0));
|
||||
}
|
||||
|
|
|
@ -46,7 +46,7 @@ void MovieClipNode::convertToOperations(NodeConverter &converter, const Composit
|
|||
NodeOutput *offsetYMovieClip = this->getOutputSocket(3);
|
||||
NodeOutput *scaleMovieClip = this->getOutputSocket(4);
|
||||
NodeOutput *angleMovieClip = this->getOutputSocket(5);
|
||||
|
||||
|
||||
bNode *editorNode = this->getbNode();
|
||||
MovieClip *movieClip = (MovieClip *)editorNode->id;
|
||||
MovieClipUser *movieClipUser = (MovieClipUser *)editorNode->storage;
|
||||
|
@ -59,7 +59,7 @@ void MovieClipNode::convertToOperations(NodeConverter &converter, const Composit
|
|||
else
|
||||
ibuf = BKE_movieclip_get_ibuf_flag(movieClip, movieClipUser, movieClip->flag, MOVIECLIP_CACHE_SKIP);
|
||||
}
|
||||
|
||||
|
||||
// always connect the output image
|
||||
MovieClipOperation *operation = new MovieClipOperation();
|
||||
operation->setMovieClip(movieClip);
|
||||
|
@ -76,7 +76,7 @@ void MovieClipNode::convertToOperations(NodeConverter &converter, const Composit
|
|||
alphaOperation->setMovieClipUser(movieClipUser);
|
||||
alphaOperation->setFramenumber(context.getFramenumber());
|
||||
alphaOperation->setCacheFrame(cacheFrame);
|
||||
|
||||
|
||||
converter.addOperation(alphaOperation);
|
||||
converter.mapOutputSocket(alphaMovieClip, alphaOperation->getOutputSocket());
|
||||
|
||||
|
@ -99,7 +99,7 @@ void MovieClipNode::convertToOperations(NodeConverter &converter, const Composit
|
|||
converter.addOutputValue(offsetYMovieClip, loc[1]);
|
||||
converter.addOutputValue(scaleMovieClip, scale);
|
||||
converter.addOutputValue(angleMovieClip, angle);
|
||||
|
||||
|
||||
if (ibuf) {
|
||||
IMB_freeImBuf(ibuf);
|
||||
}
|
||||
|
|
|
@ -35,10 +35,10 @@ void MovieDistortionNode::convertToOperations(NodeConverter &converter, const Co
|
|||
{
|
||||
bNode *bnode = this->getbNode();
|
||||
MovieClip *clip = (MovieClip *)bnode->id;
|
||||
|
||||
|
||||
NodeInput *inputSocket = this->getInputSocket(0);
|
||||
NodeOutput *outputSocket = this->getOutputSocket(0);
|
||||
|
||||
|
||||
MovieDistortionOperation *operation = new MovieDistortionOperation(bnode->custom1 == 1);
|
||||
operation->setMovieClip(clip);
|
||||
operation->setFramenumber(context.getFramenumber());
|
||||
|
|
|
@ -36,7 +36,7 @@ void NormalNode::convertToOperations(NodeConverter &converter, const CompositorC
|
|||
NodeInput *inputSocket = this->getInputSocket(0);
|
||||
NodeOutput *outputSocket = this->getOutputSocket(0);
|
||||
NodeOutput *outputSocketDotproduct = this->getOutputSocket(1);
|
||||
|
||||
|
||||
SetVectorOperation *operationSet = new SetVectorOperation();
|
||||
float normal[3];
|
||||
outputSocket->getEditorValueVector(normal);
|
||||
|
@ -47,12 +47,12 @@ void NormalNode::convertToOperations(NodeConverter &converter, const CompositorC
|
|||
operationSet->setZ(normal[2]);
|
||||
operationSet->setW(0.0f);
|
||||
converter.addOperation(operationSet);
|
||||
|
||||
|
||||
converter.mapOutputSocket(outputSocket, operationSet->getOutputSocket(0));
|
||||
|
||||
|
||||
DotproductOperation *operation = new DotproductOperation();
|
||||
converter.addOperation(operation);
|
||||
|
||||
|
||||
converter.mapInputSocket(inputSocket, operation->getInputSocket(0));
|
||||
converter.addLink(operationSet->getOutputSocket(0), operation->getInputSocket(1));
|
||||
converter.mapOutputSocket(outputSocketDotproduct, operation->getOutputSocket(0));
|
||||
|
|
|
@ -39,7 +39,7 @@ void OutputFileNode::convertToOperations(NodeConverter &converter, const Composi
|
|||
{
|
||||
NodeImageMultiFile *storage = (NodeImageMultiFile *)this->getbNode()->storage;
|
||||
const bool is_multiview = (context.getRenderData()->scemode & R_MULTIVIEW) != 0;
|
||||
|
||||
|
||||
if (!context.isRendering()) {
|
||||
/* only output files when rendering a sequence -
|
||||
* 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) {
|
||||
NodeInput *input = getInputSocket(i);
|
||||
NodeImageMultiFileSocket *sockdata = (NodeImageMultiFileSocket *)input->getbNodeSocket()->storage;
|
||||
|
||||
|
||||
/* note: layer becomes an empty placeholder if the input is not linked */
|
||||
outputOperation->add_layer(sockdata->layer, input->getDataType(), input->isLinked());
|
||||
|
||||
|
||||
converter.mapInputSocket(input, outputOperation->getInputSocket(i));
|
||||
|
||||
|
||||
if (!previewAdded) {
|
||||
converter.addNodeInputPreview(input);
|
||||
previewAdded = true;
|
||||
|
|
|
@ -35,7 +35,7 @@ void PixelateNode::convertToOperations(NodeConverter &converter, const Composito
|
|||
NodeInput *inputSocket = this->getInputSocket(0);
|
||||
NodeOutput *outputSocket = this->getOutputSocket(0);
|
||||
DataType datatype = inputSocket->getDataType();
|
||||
|
||||
|
||||
if (inputSocket->isLinked()) {
|
||||
NodeOutput *link = inputSocket->getLink();
|
||||
datatype = link->getDataType();
|
||||
|
@ -43,7 +43,7 @@ void PixelateNode::convertToOperations(NodeConverter &converter, const Composito
|
|||
|
||||
PixelateOperation *operation = new PixelateOperation(datatype);
|
||||
converter.addOperation(operation);
|
||||
|
||||
|
||||
converter.mapInputSocket(inputSocket, operation->getInputSocket(0));
|
||||
converter.mapOutputSocket(outputSocket, operation->getOutputSocket(0));
|
||||
}
|
||||
|
|
|
@ -42,13 +42,13 @@ void PlaneTrackDeformNode::convertToOperations(NodeConverter &converter, const C
|
|||
bNode *editorNode = this->getbNode();
|
||||
MovieClip *clip = (MovieClip *) editorNode->id;
|
||||
NodePlaneTrackDeformData *data = (NodePlaneTrackDeformData *) editorNode->storage;
|
||||
|
||||
|
||||
int frame_number = context.getFramenumber();
|
||||
|
||||
|
||||
NodeInput *input_image = this->getInputSocket(0);
|
||||
NodeOutput *output_warped_image = this->getOutputSocket(0);
|
||||
NodeOutput *output_plane = this->getOutputSocket(1);
|
||||
|
||||
|
||||
PlaneTrackWarpImageOperation *warp_image_operation = new PlaneTrackWarpImageOperation();
|
||||
warp_image_operation->setMovieClip(clip);
|
||||
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);
|
||||
}
|
||||
converter.addOperation(warp_image_operation);
|
||||
|
||||
|
||||
converter.mapInputSocket(input_image, warp_image_operation->getInputSocket(0));
|
||||
converter.mapOutputSocket(output_warped_image, warp_image_operation->getOutputSocket());
|
||||
|
||||
|
||||
PlaneTrackMaskOperation *plane_mask_operation = new PlaneTrackMaskOperation();
|
||||
plane_mask_operation->setMovieClip(clip);
|
||||
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);
|
||||
}
|
||||
converter.addOperation(plane_mask_operation);
|
||||
|
||||
|
||||
converter.mapOutputSocket(output_plane, plane_mask_operation->getOutputSocket());
|
||||
}
|
||||
|
|
|
@ -39,10 +39,10 @@ void RotateNode::convertToOperations(NodeConverter &converter, const CompositorC
|
|||
RotateOperation *operation = new RotateOperation();
|
||||
SetSamplerOperation *sampler = new SetSamplerOperation();
|
||||
sampler->setSampler((PixelSampler)this->getbNode()->custom1);
|
||||
|
||||
|
||||
converter.addOperation(sampler);
|
||||
converter.addOperation(operation);
|
||||
|
||||
|
||||
converter.addLink(sampler->getOutputSocket(), operation->getInputSocket(0));
|
||||
converter.mapInputSocket(inputSocket, sampler->getInputSocket(0));
|
||||
converter.mapInputSocket(inputDegreeSocket, operation->getInputSocket(1));
|
||||
|
|
|
@ -36,7 +36,7 @@ ScaleNode::ScaleNode(bNode *editorNode) : Node(editorNode)
|
|||
void ScaleNode::convertToOperations(NodeConverter &converter, const CompositorContext &context) const
|
||||
{
|
||||
bNode *bnode = this->getbNode();
|
||||
|
||||
|
||||
NodeInput *inputSocket = this->getInputSocket(0);
|
||||
NodeInput *inputXSocket = this->getInputSocket(1);
|
||||
NodeInput *inputYSocket = this->getInputSocket(2);
|
||||
|
@ -47,7 +47,7 @@ void ScaleNode::convertToOperations(NodeConverter &converter, const CompositorCo
|
|||
{
|
||||
ScaleOperation *operation = new ScaleOperation();
|
||||
converter.addOperation(operation);
|
||||
|
||||
|
||||
converter.mapInputSocket(inputSocket, operation->getInputSocket(0));
|
||||
converter.mapInputSocket(inputXSocket, operation->getInputSocket(1));
|
||||
converter.mapInputSocket(inputYSocket, operation->getInputSocket(2));
|
||||
|
@ -62,10 +62,10 @@ void ScaleNode::convertToOperations(NodeConverter &converter, const CompositorCo
|
|||
SetValueOperation *scaleFactorOperation = new SetValueOperation();
|
||||
scaleFactorOperation->setValue(context.getRenderData()->size / 100.0f);
|
||||
converter.addOperation(scaleFactorOperation);
|
||||
|
||||
|
||||
ScaleOperation *operation = new ScaleOperation();
|
||||
converter.addOperation(operation);
|
||||
|
||||
|
||||
converter.mapInputSocket(inputSocket, operation->getInputSocket(0));
|
||||
converter.addLink(scaleFactorOperation->getOutputSocket(), operation->getInputSocket(1));
|
||||
converter.addLink(scaleFactorOperation->getOutputSocket(), operation->getInputSocket(2));
|
||||
|
|
|
@ -38,55 +38,55 @@ void SeparateColorNode::convertToOperations(NodeConverter &converter, const Comp
|
|||
NodeOutput *outputGSocket = this->getOutputSocket(1);
|
||||
NodeOutput *outputBSocket = this->getOutputSocket(2);
|
||||
NodeOutput *outputASocket = this->getOutputSocket(3);
|
||||
|
||||
|
||||
NodeOperation *color_conv = getColorConverter(context);
|
||||
if (color_conv) {
|
||||
converter.addOperation(color_conv);
|
||||
|
||||
|
||||
converter.mapInputSocket(imageSocket, color_conv->getInputSocket(0));
|
||||
}
|
||||
|
||||
|
||||
{
|
||||
SeparateChannelOperation *operation = new SeparateChannelOperation();
|
||||
operation->setChannel(0);
|
||||
converter.addOperation(operation);
|
||||
|
||||
|
||||
if (color_conv)
|
||||
converter.addLink(color_conv->getOutputSocket(), operation->getInputSocket(0));
|
||||
else
|
||||
converter.mapInputSocket(imageSocket, operation->getInputSocket(0));
|
||||
converter.mapOutputSocket(outputRSocket, operation->getOutputSocket(0));
|
||||
}
|
||||
|
||||
|
||||
{
|
||||
SeparateChannelOperation *operation = new SeparateChannelOperation();
|
||||
operation->setChannel(1);
|
||||
converter.addOperation(operation);
|
||||
|
||||
|
||||
if (color_conv)
|
||||
converter.addLink(color_conv->getOutputSocket(), operation->getInputSocket(0));
|
||||
else
|
||||
converter.mapInputSocket(imageSocket, operation->getInputSocket(0));
|
||||
converter.mapOutputSocket(outputGSocket, operation->getOutputSocket(0));
|
||||
}
|
||||
|
||||
|
||||
{
|
||||
SeparateChannelOperation *operation = new SeparateChannelOperation();
|
||||
operation->setChannel(2);
|
||||
converter.addOperation(operation);
|
||||
|
||||
|
||||
if (color_conv)
|
||||
converter.addLink(color_conv->getOutputSocket(), operation->getInputSocket(0));
|
||||
else
|
||||
converter.mapInputSocket(imageSocket, operation->getInputSocket(0));
|
||||
converter.mapOutputSocket(outputBSocket, operation->getOutputSocket(0));
|
||||
}
|
||||
|
||||
|
||||
{
|
||||
SeparateChannelOperation *operation = new SeparateChannelOperation();
|
||||
operation->setChannel(3);
|
||||
converter.addOperation(operation);
|
||||
|
||||
|
||||
if (color_conv)
|
||||
converter.addLink(color_conv->getOutputSocket(), operation->getInputSocket(0));
|
||||
else
|
||||
|
|
|
@ -30,7 +30,7 @@ class SeparateColorNode : public Node {
|
|||
public:
|
||||
SeparateColorNode(bNode *editorNode);
|
||||
void convertToOperations(NodeConverter &converter, const CompositorContext &context) const;
|
||||
|
||||
|
||||
protected:
|
||||
virtual NodeOperation *getColorConverter(const CompositorContext &context) const = 0;
|
||||
};
|
||||
|
@ -40,7 +40,7 @@ public:
|
|||
SeparateRGBANode(bNode *editorNode) :
|
||||
SeparateColorNode(editorNode)
|
||||
{}
|
||||
|
||||
|
||||
NodeOperation *getColorConverter(const CompositorContext &context) const;
|
||||
};
|
||||
|
||||
|
@ -49,7 +49,7 @@ public:
|
|||
SeparateHSVANode(bNode *editorNode) :
|
||||
SeparateColorNode(editorNode)
|
||||
{}
|
||||
|
||||
|
||||
NodeOperation *getColorConverter(const CompositorContext &context) const;
|
||||
};
|
||||
|
||||
|
@ -58,7 +58,7 @@ public:
|
|||
SeparateYCCANode(bNode *editorNode) :
|
||||
SeparateColorNode(editorNode)
|
||||
{}
|
||||
|
||||
|
||||
NodeOperation *getColorConverter(const CompositorContext &context) const;
|
||||
};
|
||||
|
||||
|
@ -67,7 +67,7 @@ public:
|
|||
SeparateYUVANode(bNode *editorNode) :
|
||||
SeparateColorNode(editorNode)
|
||||
{}
|
||||
|
||||
|
||||
NodeOperation *getColorConverter(const CompositorContext &context) const;
|
||||
};
|
||||
|
||||
|
|
|
@ -27,13 +27,13 @@
|
|||
void SetAlphaNode::convertToOperations(NodeConverter &converter, const CompositorContext &/*context*/) const
|
||||
{
|
||||
SetAlphaOperation *operation = new SetAlphaOperation();
|
||||
|
||||
|
||||
if (!this->getInputSocket(0)->isLinked() && this->getInputSocket(1)->isLinked()) {
|
||||
operation->setResolutionInputSocketIndex(1);
|
||||
}
|
||||
|
||||
|
||||
converter.addOperation(operation);
|
||||
|
||||
|
||||
converter.mapInputSocket(getInputSocket(0), operation->getInputSocket(0));
|
||||
converter.mapInputSocket(getInputSocket(1), operation->getInputSocket(1));
|
||||
converter.mapOutputSocket(getOutputSocket(0), operation->getOutputSocket());
|
||||
|
|
|
@ -72,14 +72,14 @@ void SocketBufferNode::convertToOperations(NodeConverter &converter, const Compo
|
|||
{
|
||||
NodeOutput *output = this->getOutputSocket(0);
|
||||
NodeInput *input = this->getInputSocket(0);
|
||||
|
||||
|
||||
DataType datatype = output->getDataType();
|
||||
WriteBufferOperation *writeOperation = new WriteBufferOperation(datatype);
|
||||
ReadBufferOperation *readOperation = new ReadBufferOperation(datatype);
|
||||
readOperation->setMemoryProxy(writeOperation->getMemoryProxy());
|
||||
converter.addOperation(writeOperation);
|
||||
converter.addOperation(readOperation);
|
||||
|
||||
|
||||
converter.mapInputSocket(input, writeOperation->getInputSocket(0));
|
||||
converter.mapOutputSocket(output, readOperation->getOutputSocket());
|
||||
}
|
||||
|
|
|
@ -33,10 +33,10 @@ class SocketProxyNode : public Node {
|
|||
public:
|
||||
SocketProxyNode(bNode *editorNode, bNodeSocket *editorInput, bNodeSocket *editorOutput, bool use_conversion);
|
||||
void convertToOperations(NodeConverter &converter, const CompositorContext &context) const;
|
||||
|
||||
|
||||
bool getUseConversion() const { return m_use_conversion; }
|
||||
void setUseConversion(bool use_conversion) { m_use_conversion = use_conversion; }
|
||||
|
||||
|
||||
private:
|
||||
/** If true, the proxy will convert input and output data to/from the proxy socket types. */
|
||||
bool m_use_conversion;
|
||||
|
|
|
@ -44,7 +44,7 @@ void Stabilize2dNode::convertToOperations(NodeConverter &converter, const Compos
|
|||
NodeInput *imageInput = this->getInputSocket(0);
|
||||
MovieClip *clip = (MovieClip *)editorNode->id;
|
||||
bool invert = (editorNode->custom2 & CMP_NODEFLAG_STABILIZE_INVERSE) != 0;
|
||||
|
||||
|
||||
ScaleOperation *scaleOperation = new ScaleOperation();
|
||||
scaleOperation->setSampler((PixelSampler)editorNode->custom1);
|
||||
RotateOperation *rotateOperation = new RotateOperation();
|
||||
|
@ -85,18 +85,18 @@ void Stabilize2dNode::convertToOperations(NodeConverter &converter, const Compos
|
|||
converter.addOperation(translateOperation);
|
||||
converter.addOperation(rotateOperation);
|
||||
converter.addOperation(psoperation);
|
||||
|
||||
|
||||
converter.mapInputSocket(imageInput, scaleOperation->getInputSocket(0));
|
||||
converter.addLink(scaleAttribute->getOutputSocket(), scaleOperation->getInputSocket(1));
|
||||
converter.addLink(scaleAttribute->getOutputSocket(), scaleOperation->getInputSocket(2));
|
||||
|
||||
|
||||
converter.addLink(scaleOperation->getOutputSocket(), rotateOperation->getInputSocket(0));
|
||||
converter.addLink(angleAttribute->getOutputSocket(), rotateOperation->getInputSocket(1));
|
||||
|
||||
converter.addLink(rotateOperation->getOutputSocket(), translateOperation->getInputSocket(0));
|
||||
converter.addLink(xAttribute->getOutputSocket(), translateOperation->getInputSocket(1));
|
||||
converter.addLink(yAttribute->getOutputSocket(), translateOperation->getInputSocket(2));
|
||||
|
||||
|
||||
converter.addLink(translateOperation->getOutputSocket(), psoperation->getInputSocket(0));
|
||||
converter.mapOutputSocket(getOutputSocket(), psoperation->getOutputSocket());
|
||||
}
|
||||
|
|
|
@ -30,12 +30,12 @@ SwitchNode::SwitchNode(bNode *editorNode) : Node(editorNode)
|
|||
void SwitchNode::convertToOperations(NodeConverter &converter, const CompositorContext &/*context*/) const
|
||||
{
|
||||
bool condition = this->getbNode()->custom1;
|
||||
|
||||
|
||||
NodeOperationOutput *result;
|
||||
if (!condition)
|
||||
result = converter.addInputProxy(getInputSocket(0), false);
|
||||
else
|
||||
result = converter.addInputProxy(getInputSocket(1), false);
|
||||
|
||||
|
||||
converter.mapOutputSocket(getOutputSocket(0), result);
|
||||
}
|
||||
|
|
|
@ -40,11 +40,11 @@ void TextureNode::convertToOperations(NodeConverter &converter, const Compositor
|
|||
operation->setRenderData(context.getRenderData());
|
||||
operation->setSceneColorManage(sceneColorManage);
|
||||
converter.addOperation(operation);
|
||||
|
||||
|
||||
converter.mapInputSocket(getInputSocket(0), operation->getInputSocket(0));
|
||||
converter.mapInputSocket(getInputSocket(1), operation->getInputSocket(1));
|
||||
converter.mapOutputSocket(getOutputSocket(1), operation->getOutputSocket());
|
||||
|
||||
|
||||
converter.addPreview(operation->getOutputSocket());
|
||||
|
||||
TextureAlphaOperation *alphaOperation = new TextureAlphaOperation();
|
||||
|
@ -52,7 +52,7 @@ void TextureNode::convertToOperations(NodeConverter &converter, const Compositor
|
|||
alphaOperation->setRenderData(context.getRenderData());
|
||||
alphaOperation->setSceneColorManage(sceneColorManage);
|
||||
converter.addOperation(alphaOperation);
|
||||
|
||||
|
||||
converter.mapInputSocket(getInputSocket(0), alphaOperation->getInputSocket(0));
|
||||
converter.mapInputSocket(getInputSocket(1), alphaOperation->getInputSocket(1));
|
||||
converter.mapOutputSocket(getOutputSocket(0), alphaOperation->getOutputSocket());
|
||||
|
|
|
@ -56,6 +56,6 @@ void TimeNode::convertToOperations(NodeConverter &converter, const CompositorCon
|
|||
fac = curvemapping_evaluateF((CurveMapping *)node->storage, 0, fac);
|
||||
operation->setValue(clamp_f(fac, 0.0f, 1.0f));
|
||||
converter.addOperation(operation);
|
||||
|
||||
|
||||
converter.mapOutputSocket(getOutputSocket(0), operation->getOutputSocket());
|
||||
}
|
||||
|
|
|
@ -32,11 +32,11 @@ TonemapNode::TonemapNode(bNode *editorNode) : Node(editorNode)
|
|||
void TonemapNode::convertToOperations(NodeConverter &converter, const CompositorContext &/*context*/) const
|
||||
{
|
||||
NodeTonemap *data = (NodeTonemap *)this->getbNode()->storage;
|
||||
|
||||
|
||||
TonemapOperation *operation = data->type == 1 ? new PhotoreceptorTonemapOperation() : new TonemapOperation();
|
||||
operation->setData(data);
|
||||
converter.addOperation(operation);
|
||||
|
||||
|
||||
converter.mapInputSocket(getInputSocket(0), operation->getInputSocket(0));
|
||||
converter.mapOutputSocket(getOutputSocket(0), operation->getOutputSocket(0));
|
||||
}
|
||||
|
|
|
@ -63,7 +63,7 @@ void TrackPositionNode::convertToOperations(NodeConverter &converter, const Comp
|
|||
bNode *editorNode = this->getbNode();
|
||||
MovieClip *clip = (MovieClip *) editorNode->id;
|
||||
NodeTrackPosData *trackpos_data = (NodeTrackPosData *) editorNode->storage;
|
||||
|
||||
|
||||
NodeOutput *outputX = this->getOutputSocket(0);
|
||||
NodeOutput *outputY = this->getOutputSocket(1);
|
||||
NodeOutput *outputSpeed = this->getOutputSocket(2);
|
||||
|
|
|
@ -40,32 +40,32 @@ void TransformNode::convertToOperations(NodeConverter &converter, const Composit
|
|||
NodeInput *yInput = this->getInputSocket(2);
|
||||
NodeInput *angleInput = this->getInputSocket(3);
|
||||
NodeInput *scaleInput = this->getInputSocket(4);
|
||||
|
||||
|
||||
ScaleOperation *scaleOperation = new ScaleOperation();
|
||||
converter.addOperation(scaleOperation);
|
||||
|
||||
|
||||
RotateOperation *rotateOperation = new RotateOperation();
|
||||
rotateOperation->setDoDegree2RadConversion(false);
|
||||
converter.addOperation(rotateOperation);
|
||||
|
||||
|
||||
TranslateOperation *translateOperation = new TranslateOperation();
|
||||
converter.addOperation(translateOperation);
|
||||
|
||||
|
||||
SetSamplerOperation *sampler = new SetSamplerOperation();
|
||||
sampler->setSampler((PixelSampler)this->getbNode()->custom1);
|
||||
converter.addOperation(sampler);
|
||||
|
||||
|
||||
converter.mapInputSocket(imageInput, sampler->getInputSocket(0));
|
||||
converter.addLink(sampler->getOutputSocket(), scaleOperation->getInputSocket(0));
|
||||
converter.mapInputSocket(scaleInput, scaleOperation->getInputSocket(1));
|
||||
converter.mapInputSocket(scaleInput, scaleOperation->getInputSocket(2)); // xscale = yscale
|
||||
|
||||
|
||||
converter.addLink(scaleOperation->getOutputSocket(), rotateOperation->getInputSocket(0));
|
||||
converter.mapInputSocket(angleInput, rotateOperation->getInputSocket(1));
|
||||
|
||||
|
||||
converter.addLink(rotateOperation->getOutputSocket(), translateOperation->getInputSocket(0));
|
||||
converter.mapInputSocket(xInput, translateOperation->getInputSocket(1));
|
||||
converter.mapInputSocket(yInput, translateOperation->getInputSocket(2));
|
||||
|
||||
|
||||
converter.mapOutputSocket(getOutputSocket(), translateOperation->getOutputSocket());
|
||||
}
|
||||
|
|
|
@ -36,32 +36,32 @@ void TranslateNode::convertToOperations(NodeConverter &converter, const Composit
|
|||
{
|
||||
bNode *bnode = this->getbNode();
|
||||
NodeTranslateData *data = (NodeTranslateData *)bnode->storage;
|
||||
|
||||
|
||||
NodeInput *inputSocket = this->getInputSocket(0);
|
||||
NodeInput *inputXSocket = this->getInputSocket(1);
|
||||
NodeInput *inputYSocket = this->getInputSocket(2);
|
||||
NodeOutput *outputSocket = this->getOutputSocket(0);
|
||||
|
||||
|
||||
TranslateOperation *operation = new TranslateOperation();
|
||||
if (data->relative) {
|
||||
const RenderData *rd = context.getRenderData();
|
||||
float fx = rd->xsch * rd->size / 100.0f;
|
||||
float fy = rd->ysch * rd->size / 100.0f;
|
||||
|
||||
|
||||
operation->setFactorXY(fx, fy);
|
||||
}
|
||||
|
||||
|
||||
converter.addOperation(operation);
|
||||
converter.mapInputSocket(inputXSocket, operation->getInputSocket(1));
|
||||
converter.mapInputSocket(inputYSocket, operation->getInputSocket(2));
|
||||
converter.mapOutputSocket(outputSocket, operation->getOutputSocket(0));
|
||||
|
||||
|
||||
if (data->wrap_axis) {
|
||||
WriteBufferOperation *writeOperation = new WriteBufferOperation(COM_DT_COLOR);
|
||||
WrapOperation *wrapOperation = new WrapOperation(COM_DT_COLOR);
|
||||
wrapOperation->setMemoryProxy(writeOperation->getMemoryProxy());
|
||||
wrapOperation->setWrapping(data->wrap_axis);
|
||||
|
||||
|
||||
converter.addOperation(writeOperation);
|
||||
converter.addOperation(wrapOperation);
|
||||
converter.mapInputSocket(inputSocket, writeOperation->getInputSocket(0));
|
||||
|
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue