Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCampbell Barton <ideasman42@gmail.com>2012-06-14 03:31:47 +0400
committerCampbell Barton <ideasman42@gmail.com>2012-06-14 03:31:47 +0400
commitbde7e6c96b9e180b293ee6e49ab813a30fac0635 (patch)
treecf9f09aa0b3bb0528553546674269f0e5e96bd93 /source/blender/compositor/intern
parent906b9e0584b93094b1c45514fbf6fd8c62e6d015 (diff)
stule cleanup: node headers
Diffstat (limited to 'source/blender/compositor/intern')
-rw-r--r--source/blender/compositor/intern/COM_CPUDevice.h14
-rw-r--r--source/blender/compositor/intern/COM_ChannelInfo.h72
-rw-r--r--source/blender/compositor/intern/COM_ChunkOrder.h10
-rw-r--r--source/blender/compositor/intern/COM_CompositorContext.h112
-rw-r--r--source/blender/compositor/intern/COM_Converter.h54
-rw-r--r--source/blender/compositor/intern/COM_Device.h24
-rw-r--r--source/blender/compositor/intern/COM_ExecutionGroup.h422
-rw-r--r--source/blender/compositor/intern/COM_ExecutionSystem.h260
-rw-r--r--source/blender/compositor/intern/COM_ExecutionSystemHelper.h144
-rw-r--r--source/blender/compositor/intern/COM_InputSocket.h104
-rw-r--r--source/blender/compositor/intern/COM_MemoryBuffer.h102
-rw-r--r--source/blender/compositor/intern/COM_MemoryProxy.h82
-rw-r--r--source/blender/compositor/intern/COM_Node.h88
-rw-r--r--source/blender/compositor/intern/COM_NodeBase.h160
-rw-r--r--source/blender/compositor/intern/COM_NodeOperation.h290
-rw-r--r--source/blender/compositor/intern/COM_OpenCLDevice.h54
-rw-r--r--source/blender/compositor/intern/COM_OutputSocket.h56
-rw-r--r--source/blender/compositor/intern/COM_SingleThreadedNodeOperation.h18
-rw-r--r--source/blender/compositor/intern/COM_Socket.h58
-rw-r--r--source/blender/compositor/intern/COM_SocketConnection.h102
-rw-r--r--source/blender/compositor/intern/COM_SocketReader.h58
-rw-r--r--source/blender/compositor/intern/COM_WorkPackage.h34
-rw-r--r--source/blender/compositor/intern/COM_WorkScheduler.h90
23 files changed, 1205 insertions, 1203 deletions
diff --git a/source/blender/compositor/intern/COM_CPUDevice.h b/source/blender/compositor/intern/COM_CPUDevice.h
index f577e2b8926..3dc8fff66a3 100644
--- a/source/blender/compositor/intern/COM_CPUDevice.h
+++ b/source/blender/compositor/intern/COM_CPUDevice.h
@@ -26,15 +26,15 @@
#include "COM_Device.h"
/**
- * @brief class representing a CPU device.
- * @note for every hardware thread in the system a CPUDevice instance will exist in the workscheduler
- */
-class CPUDevice: public Device {
+ * @brief class representing a CPU device.
+ * @note for every hardware thread in the system a CPUDevice instance will exist in the workscheduler
+ */
+class CPUDevice : public Device {
public:
/**
- * @brief execute a WorkPackage
- * @param work the WorkPackage to execute
- */
+ * @brief execute a WorkPackage
+ * @param work the WorkPackage to execute
+ */
void execute(WorkPackage *work);
};
diff --git a/source/blender/compositor/intern/COM_ChannelInfo.h b/source/blender/compositor/intern/COM_ChannelInfo.h
index 40933bce6f5..399fdc62fa2 100644
--- a/source/blender/compositor/intern/COM_ChannelInfo.h
+++ b/source/blender/compositor/intern/COM_ChannelInfo.h
@@ -32,9 +32,9 @@
using namespace std;
/**
- * @brief List of possible channel types
- * @ingroup Model
- */
+ * @brief List of possible channel types
+ * @ingroup Model
+ */
typedef enum ChannelType {
COM_CT_ColorComponent /** @brief this channel is contains color information. Specific used is determined by channelnumber, and in the future color space */,
COM_CT_Alpha /** @brief this channel is contains transparency value */,
@@ -47,31 +47,31 @@ typedef enum ChannelType {
} ChannelType;
/**
- * @brief ChannelInfo holds information about a channel.
- *
- * Channels are transported from node to node via a SocketConnection.
- * ChannelInfo holds specific setting of these channels in order that the to-node of the connection
- * Can handle specific logic per channel setting.
- *
- * @note currently this is not used, but a future place to implement color spacing and other things.
- * @ingroup Model
- */
+ * @brief ChannelInfo holds information about a channel.
+ *
+ * Channels are transported from node to node via a SocketConnection.
+ * ChannelInfo holds specific setting of these channels in order that the to-node of the connection
+ * Can handle specific logic per channel setting.
+ *
+ * @note currently this is not used, but a future place to implement color spacing and other things.
+ * @ingroup Model
+ */
class ChannelInfo {
private:
/**
- * @brief the channel number, in the connection. [0-3]
- */
+ * @brief the channel number, in the connection. [0-3]
+ */
int number;
/**
- * @brief type of channel
- */
+ * @brief type of channel
+ */
ChannelType type;
/**
- * @brieg Is this value in this channel premultiplied with its alpha
- * @note only valid if type = ColorComponent;
- */
+ * @brieg Is this value in this channel premultiplied with its alpha
+ * @note only valid if type = ColorComponent;
+ */
bool premultiplied;
// /**
@@ -82,39 +82,39 @@ private:
public:
/**
- * @brief creates a new ChannelInfo and set default values
- */
+ * @brief creates a new ChannelInfo and set default values
+ */
ChannelInfo();
/**
- * @brief set the index of this channel in the SocketConnection
- */
+ * @brief set the index of this channel in the SocketConnection
+ */
void setNumber(const int number) { this->number = number; }
/**
- * @brief get the index of this channel in the SocketConnection
- */
- const int getNumber() const {return this->number; }
+ * @brief get the index of this channel in the SocketConnection
+ */
+ const int getNumber() const { return this->number; }
/**
- * @brief set the type of channel
- */
+ * @brief set the type of channel
+ */
void setType(const ChannelType type) { this->type = type; }
/**
- * @brief get the type of channel
- */
- const ChannelType getType() const {return this->type; }
+ * @brief get the type of channel
+ */
+ const ChannelType getType() const { return this->type; }
/**
- * @brief set the premultiplicatioin of this channel
- */
+ * @brief set the premultiplicatioin of this channel
+ */
void setPremultiplied(const bool premultiplied) { this->premultiplied = premultiplied; }
/**
- * @brief is this channel premultiplied
- */
- const bool isPremultiplied() const {return this->premultiplied;}
+ * @brief is this channel premultiplied
+ */
+ const bool isPremultiplied() const { return this->premultiplied; }
};
diff --git a/source/blender/compositor/intern/COM_ChunkOrder.h b/source/blender/compositor/intern/COM_ChunkOrder.h
index 3dbb4ae8080..f096ebeebfe 100644
--- a/source/blender/compositor/intern/COM_ChunkOrder.h
+++ b/source/blender/compositor/intern/COM_ChunkOrder.h
@@ -35,11 +35,11 @@ public:
void determineDistance(ChunkOrderHotspot **hotspots, unsigned int numberOfHotspots);
friend bool operator<(const ChunkOrder& a, const ChunkOrder& b);
- void setChunkNumber(unsigned int chunknumber) {this->number = chunknumber;}
- void setX(int x) {this->x = x;}
- void setY(int y) {this->y = y;}
- unsigned int getChunkNumber() {return this->number;}
- double getDistance() {return this->distance;}
+ void setChunkNumber(unsigned int chunknumber) { this->number = chunknumber; }
+ void setX(int x) { this->x = x; }
+ void setY(int y) { this->y = y; }
+ unsigned int getChunkNumber() { return this->number; }
+ double getDistance() { return this->distance; }
};
#endif
diff --git a/source/blender/compositor/intern/COM_CompositorContext.h b/source/blender/compositor/intern/COM_CompositorContext.h
index 8425030aec2..93872f4839f 100644
--- a/source/blender/compositor/intern/COM_CompositorContext.h
+++ b/source/blender/compositor/intern/COM_CompositorContext.h
@@ -32,36 +32,36 @@
#include "COM_defines.h"
/**
- * @brief Overall context of the compositor
- */
+ * @brief Overall context of the compositor
+ */
class CompositorContext {
private:
/**
- * @brief The rendering field describes if we are rendering (F12) or if we are editing (Node editor)
- * This field is initialized in ExecutionSystem and must only be read from that point on.
- * @see ExecutionSystem
- */
+ * @brief The rendering field describes if we are rendering (F12) or if we are editing (Node editor)
+ * This field is initialized in ExecutionSystem and must only be read from that point on.
+ * @see ExecutionSystem
+ */
bool rendering;
/**
- * @brief The quality of the composite.
- * This field is initialized in ExecutionSystem and must only be read from that point on.
- * @see ExecutionSystem
- */
+ * @brief The quality of the composite.
+ * This field is initialized in ExecutionSystem and must only be read from that point on.
+ * @see ExecutionSystem
+ */
CompositorQuality quality;
/**
- * @brief Reference to the scene that is being composited.
- * This field is initialized in ExecutionSystem and must only be read from that point on.
- * @see ExecutionSystem
- */
+ * @brief Reference to the scene that is being composited.
+ * This field is initialized in ExecutionSystem and must only be read from that point on.
+ * @see ExecutionSystem
+ */
Scene *scene;
/**
- * @brief reference to the bNodeTree
- * This field is initialized in ExecutionSystem and must only be read from that point on.
- * @see ExecutionSystem
- */
+ * @brief reference to the bNodeTree
+ * This field is initialized in ExecutionSystem and must only be read from that point on.
+ * @see ExecutionSystem
+ */
bNodeTree *bnodetree;
/**
@@ -70,90 +70,90 @@ private:
bNode *activegNode;
/**
- * @brief does this system have active opencl devices?
- */
+ * @brief does this system have active opencl devices?
+ */
bool hasActiveOpenCLDevices;
public:
/**
- * @brief constructor initializes the context with default values.
- */
+ * @brief constructor initializes the context with default values.
+ */
CompositorContext();
/**
- * @brief set the rendering field of the context
- */
+ * @brief set the rendering field of the context
+ */
void setRendering(bool rendering) { this->rendering = rendering; }
/**
- * @brief get the rendering field of the context
- */
- bool isRendering() const {return this->rendering;}
+ * @brief get the rendering field of the context
+ */
+ bool isRendering() const { return this->rendering; }
/**
- * @brief set the scene of the context
- */
- void setScene(Scene *scene) {this->scene = scene;}
+ * @brief set the scene of the context
+ */
+ void setScene(Scene *scene) { this->scene = scene; }
/**
- * @brief set the bnodetree of the context
- */
- void setbNodeTree(bNodeTree *bnodetree) {this->bnodetree = bnodetree;}
+ * @brief set the bnodetree of the context
+ */
+ void setbNodeTree(bNodeTree *bnodetree) { this->bnodetree = bnodetree; }
/**
- * @brief get the bnodetree of the context
- */
- const bNodeTree * getbNodeTree() const {return this->bnodetree;}
+ * @brief get the bnodetree of the context
+ */
+ const bNodeTree *getbNodeTree() const { return this->bnodetree; }
/**
- * @brief set the active groupnode of the context
- */
- void setActivegNode(bNode *gnode) {this->activegNode = gnode;}
+ * @brief set the active groupnode of the context
+ */
+ void setActivegNode(bNode *gnode) { this->activegNode = gnode; }
/**
- * @brief get the active groupnode of the context
- */
- const bNode * getActivegNode() const {return this->activegNode;}
+ * @brief get the active groupnode of the context
+ */
+ const bNode *getActivegNode() const { return this->activegNode; }
/**
- * @brief get the scene of the context
- */
- const Scene *getScene() const {return this->scene;}
+ * @brief get the scene of the context
+ */
+ const Scene *getScene() const { return this->scene; }
/**
- * @brief set the quality
- */
+ * @brief set the quality
+ */
void setQuality(CompositorQuality quality) {
this->quality = quality;
}
/**
- * @brief get the quality
- */
+ * @brief get the quality
+ */
const CompositorQuality getQuality() const {
return quality;
}
/**
- * @brief get the current framenumber of the scene in this context
- */
+ * @brief get the current framenumber of the scene in this context
+ */
const int getFramenumber() const;
/**
- * @brief has this system active openclDevices?
- */
+ * @brief has this system active openclDevices?
+ */
const bool getHasActiveOpenCLDevices() const {
return this->hasActiveOpenCLDevices;
}
/**
- * @brief set has this system active openclDevices?
- */
+ * @brief set has this system active openclDevices?
+ */
void setHasActiveOpenCLDevices(bool hasAvtiveOpenCLDevices) {
this->hasActiveOpenCLDevices = hasAvtiveOpenCLDevices;
}
- int getChunksize() {return this->getbNodeTree()->chunksize;}
+ int getChunksize() { return this->getbNodeTree()->chunksize; }
const int isColorManaged() const;
};
diff --git a/source/blender/compositor/intern/COM_Converter.h b/source/blender/compositor/intern/COM_Converter.h
index fa12be4e79a..d01556cc79c 100644
--- a/source/blender/compositor/intern/COM_Converter.h
+++ b/source/blender/compositor/intern/COM_Converter.h
@@ -32,39 +32,39 @@
class Converter {
public:
/**
- * @brief Convert/wraps a bNode in its Node instance.
- *
- * For all nodetypes a wrapper class is created.
- * Muted nodes are wrapped with MuteNode.
- *
- * @note When adding a new node to blender, this method needs to be changed to return the correct Node instance.
- *
- * @see Node
- * @see MuteNode
- */
+ * @brief Convert/wraps a bNode in its Node instance.
+ *
+ * For all nodetypes a wrapper class is created.
+ * Muted nodes are wrapped with MuteNode.
+ *
+ * @note When adding a new node to blender, this method needs to be changed to return the correct Node instance.
+ *
+ * @see Node
+ * @see MuteNode
+ */
static Node *convert(bNode *bNode);
/**
- * @brief This method will add a datetype conversion rule when the to-socket does not support the from-socket actual data type.
- *
- * @note this method is called when conversion is needed.
- *
- * @param connection the SocketConnection what needs conversion
- * @param system the ExecutionSystem to add the conversion to.
- * @see SocketConnection - a link between two sockets
- */
+ * @brief This method will add a datetype conversion rule when the to-socket does not support the from-socket actual data type.
+ *
+ * @note this method is called when conversion is needed.
+ *
+ * @param connection the SocketConnection what needs conversion
+ * @param system the ExecutionSystem to add the conversion to.
+ * @see SocketConnection - a link between two sockets
+ */
static void convertDataType(SocketConnection *connection, ExecutionSystem *system);
/**
- * @brief This method will add a resolution rule based on the settings of the InputSocket.
- *
- * @note Conversion logic is implemented in this method
- * @see InputSocketResizeMode for the possible conversions.
-
- * @param connection the SocketConnection what needs conversion
- * @param system the ExecutionSystem to add the conversion to.
- * @see SocketConnection - a link between two sockets
- */
+ * @brief This method will add a resolution rule based on the settings of the InputSocket.
+ *
+ * @note Conversion logic is implemented in this method
+ * @see InputSocketResizeMode for the possible conversions.
+
+ * @param connection the SocketConnection what needs conversion
+ * @param system the ExecutionSystem to add the conversion to.
+ * @see SocketConnection - a link between two sockets
+ */
static void convertResolution(SocketConnection *connection, ExecutionSystem *system);
};
#endif
diff --git a/source/blender/compositor/intern/COM_Device.h b/source/blender/compositor/intern/COM_Device.h
index 74a9400f8f3..08fdb5bb578 100644
--- a/source/blender/compositor/intern/COM_Device.h
+++ b/source/blender/compositor/intern/COM_Device.h
@@ -30,26 +30,26 @@
#include "COM_MemoryBuffer.h"
/**
- * @brief Abstract class for device implementations to be used by the Compositor.
- * devices are queried, initialized and used by the WorkScheduler.
- * work are packaged as a WorkPackage instance.
- */
+ * @brief Abstract class for device implementations to be used by the Compositor.
+ * devices are queried, initialized and used by the WorkScheduler.
+ * work are packaged as a WorkPackage instance.
+ */
class Device {
public:
/**
- * @brief initialize the device
- */
- virtual bool initialize() {return true;}
+ * @brief initialize the device
+ */
+ virtual bool initialize() { return true; }
/**
- * @brief deinitialize the device
- */
+ * @brief deinitialize the device
+ */
virtual void deinitialize() {}
/**
- * @brief execute a WorkPackage
- * @param work the WorkPackage to execute
- */
+ * @brief execute a WorkPackage
+ * @param work the WorkPackage to execute
+ */
virtual void execute(WorkPackage *work) = 0;
};
diff --git a/source/blender/compositor/intern/COM_ExecutionGroup.h b/source/blender/compositor/intern/COM_ExecutionGroup.h
index 1698890cc34..541b3e4866d 100644
--- a/source/blender/compositor/intern/COM_ExecutionGroup.h
+++ b/source/blender/compositor/intern/COM_ExecutionGroup.h
@@ -33,21 +33,21 @@
/**
- * @brief the execution state of a chunk in an ExecutionGroup
- * @ingroup Execution
- */
+ * @brief the execution state of a chunk in an ExecutionGroup
+ * @ingroup Execution
+ */
typedef enum ChunkExecutionState {
/**
- * @brief chunk is not yet scheduled
- */
+ * @brief chunk is not yet scheduled
+ */
COM_ES_NOT_SCHEDULED = 0,
/**
- * @brief chunk is scheduled, but not yet executed
- */
+ * @brief chunk is scheduled, but not yet executed
+ */
COM_ES_SCHEDULED = 1,
/**
- * @brief chunk is executed.
- */
+ * @brief chunk is executed.
+ */
COM_ES_EXECUTED = 2
} ChunkExecutionState;
@@ -56,64 +56,64 @@ class ReadBufferOperation;
class Device;
/**
- * @brief Class ExecutionGroup is a group of NodeOperations that are executed as one.
- * This grouping is used to combine Operations that can be executed as one whole when multi-processing.
- * @ingroup Execution
- */
+ * @brief Class ExecutionGroup is a group of NodeOperations that are executed as one.
+ * This grouping is used to combine Operations that can be executed as one whole when multi-processing.
+ * @ingroup Execution
+ */
class ExecutionGroup {
private:
// fields
/**
- * @brief list of operations in this ExecutionGroup
- */
- vector<NodeOperation*> operations;
+ * @brief list of operations in this ExecutionGroup
+ */
+ vector<NodeOperation *> 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)
- */
+ * @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 isOutput;
/**
- * @brief Width of the output
- */
+ * @brief Width of the output
+ */
unsigned int width;
/**
- * @brief Height of the output
- */
+ * @brief Height of the output
+ */
unsigned int 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
- */
+ * @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 chunkSize;
/**
- * @brief number of chunks in the x-axis
- */
+ * @brief number of chunks in the x-axis
+ */
unsigned int numberOfXChunks;
/**
- * @brief number of chunks in the y-axis
- */
+ * @brief number of chunks in the y-axis
+ */
unsigned int numberOfYChunks;
/**
- * @brief total number of chunks
- */
+ * @brief total number of chunks
+ */
unsigned int numberOfChunks;
/**
- * @brief contains this ExecutionGroup a complex NodeOperation.
- */
+ * @brief contains this ExecutionGroup a complex NodeOperation.
+ */
bool complex;
/**
- * @brief can this ExecutionGroup be scheduled on an OpenCLDevice
- */
+ * @brief can this ExecutionGroup be scheduled on an OpenCLDevice
+ */
bool openCL;
/**
@@ -122,113 +122,113 @@ private:
bool 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.
- */
+ * @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 cachedMaxReadBufferOffset;
/**
- * @brief a cached vector of all read operations in the execution group.
- */
- vector<NodeOperation*> cachedReadOperations;
+ * @brief a cached vector of all read operations in the execution group.
+ */
+ vector<NodeOperation *> 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 * bTree;
+ * @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 *bTree;
/**
- * @brief total number of chunks that have been calculated for this ExecutionGroup
- */
+ * @brief total number of chunks that have been calculated for this ExecutionGroup
+ */
unsigned int chunksFinished;
/**
- * @brief the chunkExecutionStates holds per chunk the execution state. this state can be
- * - COM_ES_NOT_SCHEDULED: not scheduled
- * - COM_ES_SCHEDULED: scheduled
- * - COM_ES_EXECUTED: executed
- */
+ * @brief the chunkExecutionStates holds per chunk the execution state. this state can be
+ * - COM_ES_NOT_SCHEDULED: not scheduled
+ * - COM_ES_SCHEDULED: scheduled
+ * - COM_ES_EXECUTED: executed
+ */
ChunkExecutionState *chunkExecutionStates;
/**
- * @brief indicator when this ExecutionGroup has valid NodeOperations in its vector for Execution
- * @note When building the ExecutionGroup NodeOperations are added via recursion. First a WriteBufferOperations is added, then the
- * @note Operation containing the settings that is important for the ExecutiongGroup is added,
- * @note When this occurs, these settings are copied over from the node to the ExecutionGroup
- * @note and the Initialized flag is set to true.
+ * @brief indicator when this ExecutionGroup has valid NodeOperations in its vector for Execution
+ * @note When building the ExecutionGroup NodeOperations are added via recursion. First a WriteBufferOperations is added, then the
+ * @note Operation containing the settings that is important for the ExecutiongGroup is added,
+ * @note When this occurs, these settings are copied over from the node to the ExecutionGroup
+ * @note and the Initialized flag is set to true.
* @see complex
- * @see openCL
- */
+ * @see openCL
+ */
bool initialized;
// methods
/**
- * @brief check whether parameter operation can be added to the execution group
- * @param operation the operation to be added
- */
+ * @brief check whether parameter operation can be added to the execution group
+ * @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.
- * @note The chunk size will not be stored in the chunkSize field. This needs to be done
- * @note by the calling method.
- */
+ * @brief calculate the actual chunk size of this execution group.
+ * @note A chunk size is an unsigned int that is both the height and width of a chunk.
+ * @note The chunk size will not be stored in the chunkSize field. This needs to be done
+ * @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 usefull results ater the determination of the chunksize
- * @see determineChunkSize()
- */
+ * @brief Determine the rect (minx, maxx, miny, maxy) of a chunk at a position.
+ * @note Only gives usefull 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
- */
+ * @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 hasen't been scheduled yet.
- * @param graph
- * @param xChunk
- * @param yChunk
- * @return [true:false]
- * true: package(s) are scheduled
- * false: scheduling is deferred (depending workpackages are scheduled)
- */
- bool scheduleChunkWhenPossible(ExecutionSystem * graph, int xChunk, int yChunk);
-
- /**
- * @brief try to schedule a specific area.
- * @note Check if a certain area is available, when not available this are will be checked.
- * @note This method is called from other ExecutionGroup's.
- * @param graph
- * @param rect
- * @return [true:false]
- * true: package(s) are scheduled
- * false: scheduling is deferred (depending workpackages are scheduled)
- */
- bool scheduleAreaWhenPossible(ExecutionSystem * graph, rcti * rect);
-
- /**
- * @brief add a chunk to the WorkScheduler.
- * @param chunknumber
- */
+ * @brief try to schedule a specific chunk.
+ * @note scheduling succeeds when all input requirements are met and the chunks hasen't been scheduled yet.
+ * @param graph
+ * @param xChunk
+ * @param yChunk
+ * @return [true:false]
+ * true: package(s) are scheduled
+ * false: scheduling is deferred (depending workpackages are scheduled)
+ */
+ bool scheduleChunkWhenPossible(ExecutionSystem *graph, int xChunk, int yChunk);
+
+ /**
+ * @brief try to schedule a specific area.
+ * @note Check if a certain area is available, when not available this are will be checked.
+ * @note This method is called from other ExecutionGroup's.
+ * @param graph
+ * @param rect
+ * @return [true:false]
+ * true: package(s) are scheduled
+ * false: scheduling is deferred (depending workpackages are scheduled)
+ */
+ bool scheduleAreaWhenPossible(ExecutionSystem *graph, rcti *rect);
+
+ /**
+ * @brief add a chunk to the WorkScheduler.
+ * @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
- * @param input the input area
- * @param readOperation The ReadBufferOperation where the area needs to be evaluated
- * @param output the area needed of the ReadBufferOperation. Result
- */
- void determineDependingAreaOfInterest(rcti * input, ReadBufferOperation *readOperation, rcti *output);
+ * @brief determine the area of interest of a certain input area
+ * @note This method only evaluates a single ReadBufferOperation
+ * @param input the input area
+ * @param readOperation The ReadBufferOperation where the area needs to be evaluated
+ * @param output the area needed of the ReadBufferOperation. Result
+ */
+ void determineDependingAreaOfInterest(rcti *input, ReadBufferOperation *readOperation, rcti *output);
public:
@@ -237,162 +237,162 @@ public:
// methods
/**
- * @brief check to see if a NodeOperation is already inside this execution group
- * @param operation the NodeOperation to check
- * @return [true,false]
- */
+ * @brief check to see if a NodeOperation is already inside this execution group
+ * @param operation the NodeOperation to check
+ * @return [true,false]
+ */
bool containsOperation(NodeOperation *operation);
/**
- * @brief add an operation to this ExecutionGroup
- * @note this method will add input of the operations recursivly
- * @note this method can create multiple ExecutionGroup's
- * @param system
- * @param operation
- */
+ * @brief add an operation to this ExecutionGroup
+ * @note this method will add input of the operations recursivly
+ * @note this method can create multiple ExecutionGroup's
+ * @param system
+ * @param operation
+ */
void addOperation(ExecutionSystem *system, NodeOperation *operation);
/**
- * @brief is this ExecutionGroup an output ExecutionGroup
- * @note An OutputExecution group are groups containing a
- * @note ViewerOperation, CompositeOperation, PreviewOperation.
- * @see NodeOperation.isOutputOperation
- */
- const int isOutputExecutionGroup() const {return this->isOutput;}
-
+ * @brief is this ExecutionGroup an output ExecutionGroup
+ * @note An OutputExecution group are groups containing a
+ * @note ViewerOperation, CompositeOperation, PreviewOperation.
+ * @see NodeOperation.isOutputOperation
+ */
+ const int isOutputExecutionGroup() const { return this->isOutput; }
+
/**
- * @brief set whether this ExecutionGroup is an output
- * @param isOutput
- */
- void setOutputExecutionGroup(int isOutput) {this->isOutput = isOutput;}
-
+ * @brief set whether this ExecutionGroup is an output
+ * @param isOutput
+ */
+ void setOutputExecutionGroup(int isOutput) { this->isOutput = isOutput; }
+
/**
- * @brief determine the resolution of this ExecutionGroup
- * @param resolution
- */
+ * @brief determine the resolution of this ExecutionGroup
+ * @param resolution
+ */
void determineResolution(unsigned int resolution[]);
/**
- * @brief set the resolution of this executiongroup
- * @param resolution
- */
- void setResolution(unsigned int resolution[]) {this->width = resolution[0];this->height = resolution[1];}
+ * @brief set the resolution of this executiongroup
+ * @param resolution
+ */
+ void setResolution(unsigned int resolution[]) { this->width = resolution[0]; this->height = resolution[1]; }
/**
- * @brief get the width of this execution group
- */
- const unsigned int getWidth() {return this->width;}
+ * @brief get the width of this execution group
+ */
+ const unsigned int getWidth() { return this->width; }
/**
- * @brief get the height of this execution group
- */
- const unsigned int getHeight() {return this->height;}
+ * @brief get the height of this execution group
+ */
+ const unsigned int getHeight() { return this->height; }
/**
- * @brief does this ExecutionGroup contains a complex NodeOperation
- */
+ * @brief does this ExecutionGroup contains a complex NodeOperation
+ */
const bool isComplex() const;
/**
- * @brief get the output operation of this ExecutionGroup
- * @return NodeOperation *output operation
- */
- NodeOperation *getOutputNodeOperation() const;
+ * @brief get the output operation of this ExecutionGroup
+ * @return NodeOperation *output operation
+ */
+ NodeOperation *getOutputNodeOperation() const;
/**
- * @brief compose multiple chunks into a single chunk
- * @return Memorybuffer *consolidated chunk
- */
+ * @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.
- */
+ * @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
- * @param chunkNumber the chunk to be calculated
- * @return MemoryBuffer** the inputbuffers
- */
- MemoryBuffer** getInputBuffersCPU();
+ * @brief get all inputbuffers needed to calculate an chunk
+ * @note all inputbuffers must be executed
+ * @param chunkNumber the chunk to be calculated
+ * @return MemoryBuffer** the inputbuffers
+ */
+ MemoryBuffer **getInputBuffersCPU();
/**
- * @brief get all inputbuffers needed to calculate an chunk
- * @note all inputbuffers must be executed
- * @param chunkNumber the chunk to be calculated
- * @return MemoryBuffer** the inputbuffers
- */
- MemoryBuffer** getInputBuffersOpenCL(int chunkNumber);
+ * @brief get all inputbuffers needed to calculate an chunk
+ * @note all inputbuffers must be executed
+ * @param chunkNumber the chunk to be calculated
+ * @return MemoryBuffer** the inputbuffers
+ */
+ MemoryBuffer **getInputBuffersOpenCL(int chunkNumber);
/**
- * @brief allocate the outputbuffer of a chunk
- * @param chunkNumber the number of the chunk in the ExecutionGroup
- * @param rect the rect of that chunk
- * @see determineChunkRect
- */
+ * @brief allocate the outputbuffer of a chunk
+ * @param chunkNumber the number of the chunk in the ExecutionGroup
+ * @param rect the rect of that chunk
+ * @see determineChunkRect
+ */
MemoryBuffer *allocateOutputBuffer(int chunkNumber, rcti *rect);
/**
- * @brief after a chunk is executed the needed resources can be freed or unlocked.
- * @param chunknumber
- * @param memorybuffers
- */
- void finalizeChunkExecution(int chunkNumber, MemoryBuffer** memoryBuffers);
+ * @brief after a chunk is executed the needed resources can be freed or unlocked.
+ * @param chunknumber
+ * @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
- */
+ * @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)
- *
- * first the order of the chunks will be determined. This is determined by finding the ViewerOperation and get the relevant information from it.
- * - ChunkOrdering
- * - CenterX
- * - CenterY
- *
- * After determining the order of the chunks the chunks will be scheduled
- *
- * @see ViewerOperation
- * @param system
- */
+ * @brief schedule an ExecutionGroup
+ * @note this method will return when all chunks have been calculated, or the execution has breaked (by user)
+ *
+ * first the order of the chunks will be determined. This is determined by finding the ViewerOperation and get the relevant information from it.
+ * - ChunkOrdering
+ * - CenterX
+ * - CenterY
+ *
+ * After determining the order of the chunks the chunks will be scheduled
+ *
+ * @see ViewerOperation
+ * @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
- * @note the area of the MemoryProxy.creator thas has to be executed.
- * @param memoryProxies result
- */
- void determineDependingMemoryProxies(vector<MemoryProxy*> *memoryProxies);
+ * @brief this method determines the MemoryProxy's where this execution group depends on.
+ * @note After this method determineDependingAreaOfInterest can be called to determine
+ * @note the area of the MemoryProxy.creator thas has to be executed.
+ * @param memoryProxies result
+ */
+ void determineDependingMemoryProxies(vector<MemoryProxy *> *memoryProxies);
/**
- * @brief Determine the rect (minx, maxx, miny, maxy) of a chunk.
- * @note Only gives usefull results ater the determination of the chunksize
- * @see determineChunkSize()
- */
+ * @brief Determine the rect (minx, maxx, miny, maxy) of a chunk.
+ * @note Only gives usefull results ater the determination of the chunksize
+ * @see determineChunkSize()
+ */
void determineChunkRect(rcti *rect, const unsigned int chunkNumber) const;
/**
- * @brief can this ExecutionGroup be scheduled on an OpenCLDevice
- * @see WorkScheduler.schedule
- */
+ * @brief can this ExecutionGroup be scheduled on an OpenCLDevice
+ * @see WorkScheduler.schedule
+ */
bool isOpenCL();
- void setChunksize(int chunksize) {this->chunkSize = chunksize;}
+ void setChunksize(int chunksize) { this->chunkSize = chunksize; }
/**
- * @brief get the Render priority of this ExecutionGroup
- * @see ExecutionSystem.execute
- */
+ * @brief get the Render priority of this ExecutionGroup
+ * @see ExecutionSystem.execute
+ */
CompositorPriority getRenderPriotrity();
};
diff --git a/source/blender/compositor/intern/COM_ExecutionSystem.h b/source/blender/compositor/intern/COM_ExecutionSystem.h
index 510e58ba1bb..70fd94ca57f 100644
--- a/source/blender/compositor/intern/COM_ExecutionSystem.h
+++ b/source/blender/compositor/intern/COM_ExecutionSystem.h
@@ -36,69 +36,69 @@ class ExecutionGroup;
using namespace std;
/**
- * @page execution Execution model
- * In order to get to an efficient model for execution, serveral steps are being done. these steps are explained below.
- *
- * @section EM_Step1 Step 1: translating blender node system to the new compsitor system
- * Blenders node structure is based on C structs (DNA). These structs are not efficient in the new architecture. We want to use classes in order to simplify the system.
- * during this step the blender node_tree is evaluated and converted to a CPP node system.
- *
- * @see ExecutionSystem
- * @see Converter.convert
- * @see Node
- *
- * @section EM_Step2 Step2: translating nodes to operations
- * Ungrouping the GroupNodes. Group nodes are node_tree's in node_tree's. The new system only supports a single level of node_tree. We will 'flatten' the system in a single level.
- * @see GroupNode
- * @see ExecutionSystemHelper.ungroup
- *
- * Every node has the ability to convert itself to operations. The node itself is responsible to create a correct NodeOperation setup based on its internal settings.
- * Most Node only need to convert it to its NodeOperation. Like a ColorToBWNode doesn't check anything, but replaces itself with a ConvertColorToBWOperation.
- * More complex nodes can use different NodeOperation based on settings; like MixNode. based on the selected Mixtype a different operation will be used.
- * for more information see the page about creating new Nodes. [@subpage newnode]
- *
- * @see ExecutionSystem.convertToOperations
- * @see Node.convertToOperations
- * @see NodeOperation base class for all operations in the system
- *
- * @section EM_Step3 Step3: add additional conversions to the operation system
- * - Data type conversions: the system has 3 data types COM_DT_VALUE, COM_DT_VECTOR, COM_DT_COLOR. The user can connect a Value socket to a color socket. As values are ordered differently than colors a conversion happens.
- *
- * - Image size conversions: the system can automatically convert when resolutions do not match. An InputSocket has a resize mode. This can be any of the folowing settings.
- * - [@ref InputSocketResizeMode.COM_SC_CENTER]: The center of both images are aligned
- * - [@ref InputSocketResizeMode.COM_SC_FIT_WIDTH]: The width of both images are aligned
- * - [@ref InputSocketResizeMode.COM_SC_FIT_HEIGHT]: the height of both images are aligned
- * - [@ref InputSocketResizeMode.COM_SC_FIT]: The width, or the height of both images are aligned to make sure that it fits.
- * - [@ref InputSocketResizeMode.COM_SC_STRETCH]: The width and the height of both images are aligned
- * - [@ref InputSocketResizeMode.COM_SC_NO_RESIZE]: bottom left of the images are aligned.
- *
- * @see Converter.convertDataType Datatype conversions
- * @see Converter.convertResolution Image size conversions
- *
- * @section EM_Step4 Step4: group operations in executions groups
- * ExecutionGroup are groups of operations that are calculated as being one bigger operation. All operations will be part of an ExecutionGroup.
- * Complex nodes will be added to separate groups. Between ExecutionGroup's the data will be stored in MemoryBuffers. ReadBufferOperations and WriteBufferOperations are added where needed.
- *
- * <pre>
- *
- * +------------------------------+ +----------------+
- * | ExecutionGroup A | |ExecutionGroup B| ExecutionGroup
- * | +----------+ +----------+| |+----------+ |
- * /----->| Operation|---->| Operation|-\ /--->| Operation|-\ | NodeOperation
- * | | | A | | B ||| | || C | | |
- * | | | cFFA | /->| cFFA ||| | || cFFA | | |
- * | | +----------+ | +----------+|| | |+----------+ | |
- * | +---------------|--------------+v | +-------------v--+
- * +-*----+ +---*--+ +--*-*--+ +--*----+
- * |inputA| |inputB| |outputA| |outputB| MemoryBuffer
- * |cFAA | |cFAA | |cFAA | |cFAA |
- * +------+ +------+ +-------+ +-------+
- * </pre>
- * @see ExecutionSystem.groupOperations method doing this step
- * @see ExecutionSystem.addReadWriteBufferOperations
- * @see NodeOperation.isComplex
- * @see ExecutionGroup class representing the ExecutionGroup
- */
+ * @page execution Execution model
+ * In order to get to an efficient model for execution, serveral steps are being done. these steps are explained below.
+ *
+ * @section EM_Step1 Step 1: translating blender node system to the new compsitor system
+ * Blenders node structure is based on C structs (DNA). These structs are not efficient in the new architecture. We want to use classes in order to simplify the system.
+ * during this step the blender node_tree is evaluated and converted to a CPP node system.
+ *
+ * @see ExecutionSystem
+ * @see Converter.convert
+ * @see Node
+ *
+ * @section EM_Step2 Step2: translating nodes to operations
+ * Ungrouping the GroupNodes. Group nodes are node_tree's in node_tree's. The new system only supports a single level of node_tree. We will 'flatten' the system in a single level.
+ * @see GroupNode
+ * @see ExecutionSystemHelper.ungroup
+ *
+ * Every node has the ability to convert itself to operations. The node itself is responsible to create a correct NodeOperation setup based on its internal settings.
+ * Most Node only need to convert it to its NodeOperation. Like a ColorToBWNode doesn't check anything, but replaces itself with a ConvertColorToBWOperation.
+ * More complex nodes can use different NodeOperation based on settings; like MixNode. based on the selected Mixtype a different operation will be used.
+ * for more information see the page about creating new Nodes. [@subpage newnode]
+ *
+ * @see ExecutionSystem.convertToOperations
+ * @see Node.convertToOperations
+ * @see NodeOperation base class for all operations in the system
+ *
+ * @section EM_Step3 Step3: add additional conversions to the operation system
+ * - Data type conversions: the system has 3 data types COM_DT_VALUE, COM_DT_VECTOR, COM_DT_COLOR. The user can connect a Value socket to a color socket. As values are ordered differently than colors a conversion happens.
+ *
+ * - Image size conversions: the system can automatically convert when resolutions do not match. An InputSocket has a resize mode. This can be any of the folowing settings.
+ * - [@ref InputSocketResizeMode.COM_SC_CENTER]: The center of both images are aligned
+ * - [@ref InputSocketResizeMode.COM_SC_FIT_WIDTH]: The width of both images are aligned
+ * - [@ref InputSocketResizeMode.COM_SC_FIT_HEIGHT]: the height of both images are aligned
+ * - [@ref InputSocketResizeMode.COM_SC_FIT]: The width, or the height of both images are aligned to make sure that it fits.
+ * - [@ref InputSocketResizeMode.COM_SC_STRETCH]: The width and the height of both images are aligned
+ * - [@ref InputSocketResizeMode.COM_SC_NO_RESIZE]: bottom left of the images are aligned.
+ *
+ * @see Converter.convertDataType Datatype conversions
+ * @see Converter.convertResolution Image size conversions
+ *
+ * @section EM_Step4 Step4: group operations in executions groups
+ * ExecutionGroup are groups of operations that are calculated as being one bigger operation. All operations will be part of an ExecutionGroup.
+ * Complex nodes will be added to separate groups. Between ExecutionGroup's the data will be stored in MemoryBuffers. ReadBufferOperations and WriteBufferOperations are added where needed.
+ *
+ * <pre>
+ *
+ * +------------------------------+ +----------------+
+ * | ExecutionGroup A | |ExecutionGroup B| ExecutionGroup
+ * | +----------+ +----------+| |+----------+ |
+ * /----->| Operation|---->| Operation|-\ /--->| Operation|-\ | NodeOperation
+ * | | | A | | B ||| | || C | | |
+ * | | | cFFA | /->| cFFA ||| | || cFFA | | |
+ * | | +----------+ | +----------+|| | |+----------+ | |
+ * | +---------------|--------------+v | +-------------v--+
+ * +-*----+ +---*--+ +--*-*--+ +--*----+
+ * |inputA| |inputB| |outputA| |outputB| MemoryBuffer
+ * |cFAA | |cFAA | |cFAA | |cFAA |
+ * +------+ +------+ +-------+ +-------+
+ * </pre>
+ * @see ExecutionSystem.groupOperations method doing this step
+ * @see ExecutionSystem.addReadWriteBufferOperations
+ * @see NodeOperation.isComplex
+ * @see ExecutionGroup class representing the ExecutionGroup
+ */
/**
* @brief the ExecutionSystem contains the whole compositor tree.
@@ -106,129 +106,129 @@ using namespace std;
class ExecutionSystem {
private:
/**
- * @brief the context used during execution
- */
+ * @brief the context used during execution
+ */
CompositorContext context;
/**
- * @brief vector of nodes
- */
- vector<Node*> nodes;
+ * @brief vector of nodes
+ */
+ vector<Node *> nodes;
/**
- * @brief vector of operations
- */
- vector<NodeOperation*> operations;
+ * @brief vector of operations
+ */
+ vector<NodeOperation *> operations;
/**
- * @brief vector of groups
- */
- vector<ExecutionGroup*> groups
+ * @brief vector of groups
+ */
+ vector<ExecutionGroup *> groups
/**
- * @brief vector of connections
- */;
- vector<SocketConnection*> connections;
+ * @brief vector of connections
+ */;
+ vector<SocketConnection *> connections;
private: //methods
/**
- * @brief add ReadBufferOperation and WriteBufferOperation around an operation
- * @param operation the operation to add the bufferoperations around.
- */
+ * @brief add ReadBufferOperation and WriteBufferOperation around an operation
+ * @param operation the operation to add the bufferoperations around.
+ */
void addReadWriteBufferOperations(NodeOperation *operation);
/**
- * find all execution group with output nodes
- */
- void findOutputExecutionGroup(vector<ExecutionGroup*> *result, CompositorPriority priority) const;
+ * find all execution group with output nodes
+ */
+ void findOutputExecutionGroup(vector<ExecutionGroup *> *result, CompositorPriority priority) const;
/**
- * find all execution group with output nodes
- */
- void findOutputExecutionGroup(vector<ExecutionGroup*> *result) const;
+ * find all execution group with output nodes
+ */
+ void findOutputExecutionGroup(vector<ExecutionGroup *> *result) const;
public:
/**
- * @brief Create a new ExecutionSystem and initialize it with the
- * editingtree.
- *
- * @param editingtree [bNodeTree*]
- * @param rendering [true false]
- */
+ * @brief Create a new ExecutionSystem and initialize it with the
+ * editingtree.
+ *
+ * @param editingtree [bNodeTree*]
+ * @param rendering [true false]
+ */
ExecutionSystem(bNodeTree *editingtree, bool rendering);
/**
- * Destructor
- */
+ * Destructor
+ */
~ExecutionSystem();
/**
- * @brief execute this system
- * - initialize the NodeOperation's and ExecutionGroup's
- * - schedule the output ExecutionGroup's based on their priority
- * - deinitialize the ExecutionGroup's and NodeOperation's
- */
+ * @brief execute this system
+ * - initialize the NodeOperation's and ExecutionGroup's
+ * - schedule the output ExecutionGroup's based on their priority
+ * - deinitialize the ExecutionGroup's and NodeOperation's
+ */
void execute();
/**
- * @brief Add an operation to the operation list
- *
- * @param operation the operation to add
- */
+ * @brief Add an operation to the operation list
+ *
+ * @param operation the operation to add
+ */
void addOperation(NodeOperation *operation);
/**
- * Add an editor link to the system. convert it to an socketconnection (CPP-representative)
- * this converted socket is returned.
- */
+ * Add an editor link to the system. convert it to an socketconnection (CPP-representative)
+ * this converted socket is returned.
+ */
SocketConnection *addNodeLink(bNodeLink *bNodeLink);
void addSocketConnection(SocketConnection *connection);
/**
- * @brief Convert all nodes to operations
- */
+ * @brief Convert all nodes to operations
+ */
void convertToOperations();
/**
- * @brief group operations in ExecutionGroup's
- * @see ExecutionGroup
- */
+ * @brief group operations in ExecutionGroup's
+ * @see ExecutionGroup
+ */
void groupOperations();
/**
- * @brief get the reference to the compositor context
- */
- CompositorContext& getContext() {return this->context;}
+ * @brief get the reference to the compositor context
+ */
+ CompositorContext& getContext() { return this->context; }
/**
- * @brief get the reference to the compositor nodes
- */
- vector<Node*>& getNodes() {return this->nodes;}
+ * @brief get the reference to the compositor nodes
+ */
+ vector<Node *>& getNodes() { return this->nodes; }
/**
- * @brief get the reference to the compositor connections
- */
- vector<SocketConnection*>& getConnections() {return this->connections;}
+ * @brief get the reference to the compositor connections
+ */
+ vector<SocketConnection *>& getConnections() { return this->connections; }
/**
- * @brief get the reference to the list of execution groups
- */
- vector<ExecutionGroup*>& getExecutionGroups() {return this->groups;}
+ * @brief get the reference to the list of execution groups
+ */
+ vector<ExecutionGroup *>& getExecutionGroups() { return this->groups; }
/**
- * @brief get the reference to the list of operations
- */
- vector<NodeOperation*>& getOperations() {return this->operations;}
+ * @brief get the reference to the list of operations
+ */
+ vector<NodeOperation *>& getOperations() { return this->operations; }
private:
/**
- * @brief determine the actual data types of all sockets
- * @param nodes list of nodes or operations to do the data type determination
- */
- void determineActualSocketDataTypes(vector<NodeBase*> &nodes);
+ * @brief determine the actual data types of all sockets
+ * @param nodes list of nodes or operations to do the data type determination
+ */
+ void determineActualSocketDataTypes(vector<NodeBase *> &nodes);
void executeGroups(CompositorPriority priority);
diff --git a/source/blender/compositor/intern/COM_ExecutionSystemHelper.h b/source/blender/compositor/intern/COM_ExecutionSystemHelper.h
index 9321cb571e8..99a05472075 100644
--- a/source/blender/compositor/intern/COM_ExecutionSystemHelper.h
+++ b/source/blender/compositor/intern/COM_ExecutionSystemHelper.h
@@ -42,86 +42,86 @@ class ExecutionSystemHelper {
public:
/**
- * @brief add an bNodeTree to the nodes list and connections
- * @param system Execution system
- * @param nodes_start Starting index in the system's nodes list for nodes in this tree.
- * @param tree bNodeTree to add
- * @return Node representing the "Compositor node" of the maintree. or NULL when a subtree is added
- */
- static Node *addbNodeTree(ExecutionSystem &system, int nodes_start, bNodeTree* tree, bNode *groupnode);
-
+ * @brief add an bNodeTree to the nodes list and connections
+ * @param system Execution system
+ * @param nodes_start Starting index in the system's nodes list for nodes in this tree.
+ * @param tree bNodeTree to add
+ * @return Node representing the "Compositor node" of the maintree. or NULL when a subtree is added
+ */
+ static Node *addbNodeTree(ExecutionSystem &system, int nodes_start, bNodeTree *tree, bNode *groupnode);
+
/**
- * @brief add an editor node to the system.
- * this node is converted to a Node instance.
- * and the converted node is returned
- *
- * @param bNode node to add
- * @return Node that represents the bNode or null when not able to convert.
- */
- static Node *addNode(vector<Node*>& nodes, bNode *bNode, bool isInActiveGroup);
-
+ * @brief add an editor node to the system.
+ * this node is converted to a Node instance.
+ * and the converted node is returned
+ *
+ * @param bNode node to add
+ * @return Node that represents the bNode or null when not able to convert.
+ */
+ static Node *addNode(vector<Node *>& nodes, bNode *bNode, bool isInActiveGroup);
+
/**
- * @brief Add a Node to a list
- *
- * @param nodes the list where the node needs to be added to
- * @param node the node to be added
- */
- static void addNode(vector<Node*>& nodes, Node *node);
-
+ * @brief Add a Node to a list
+ *
+ * @param nodes the list where the node needs to be added to
+ * @param node the node to be added
+ */
+ static void addNode(vector<Node *>& nodes, Node *node);
+
/**
- * @brief Add an operation to the operation list
- *
- * The id of the operation is updated.
- *
- * @param operations the list where the operation need to be added to
- * @param operation the operation to add
- */
- static void addOperation(vector<NodeOperation*> &operations, NodeOperation *operation);
-
+ * @brief Add an operation to the operation list
+ *
+ * The id of the operation is updated.
+ *
+ * @param operations the list where the operation need to be added to
+ * @param operation the operation to add
+ */
+ static void addOperation(vector<NodeOperation *> &operations, NodeOperation *operation);
+
/**
- * @brief Add an ExecutionGroup to a list
- *
- * The id of the ExecutionGroup is updated.
- *
- * @param executionGroups the list where the executionGroup need to be added to
- * @param executionGroup the ExecutionGroup to add
- */
- static void addExecutionGroup(vector<ExecutionGroup*>& executionGroups, ExecutionGroup *executionGroup);
-
+ * @brief Add an ExecutionGroup to a list
+ *
+ * The id of the ExecutionGroup is updated.
+ *
+ * @param executionGroups the list where the executionGroup need to be added to
+ * @param executionGroup the ExecutionGroup to add
+ */
+ static void addExecutionGroup(vector<ExecutionGroup *>& executionGroups, ExecutionGroup *executionGroup);
+
/**
- * Find all Node Operations that needs to be executed.
- * @param rendering
- * the rendering parameter will tell what type of execution we are doing
- * FALSE is editing, TRUE is rendering
- */
- static void findOutputNodeOperations(vector<NodeOperation*>* result, vector<NodeOperation*>& operations , bool rendering);
-
+ * Find all Node Operations that needs to be executed.
+ * @param rendering
+ * the rendering parameter will tell what type of execution we are doing
+ * FALSE is editing, TRUE is rendering
+ */
+ static void findOutputNodeOperations(vector<NodeOperation *> *result, vector<NodeOperation *>& operations, bool rendering);
+
/**
- * @brief add a bNodeLink to the list of links
- * the bNodeLink will be wrapped in a SocketConnection
- *
- * @note Cyclic links will be ignored
- *
- * @param node_range list of possible nodes for lookup.
- * @param links list of links to add the bNodeLink to
- * @param bNodeLink the link to be added
- * @return the created SocketConnection or NULL
- */
- static SocketConnection *addNodeLink(NodeRange &node_range, vector<SocketConnection*>& links, bNodeLink *bNodeLink);
-
+ * @brief add a bNodeLink to the list of links
+ * the bNodeLink will be wrapped in a SocketConnection
+ *
+ * @note Cyclic links will be ignored
+ *
+ * @param node_range list of possible nodes for lookup.
+ * @param links list of links to add the bNodeLink to
+ * @param bNodeLink the link to be added
+ * @return the created SocketConnection or NULL
+ */
+ static SocketConnection *addNodeLink(NodeRange &node_range, vector<SocketConnection *>& links, bNodeLink *bNodeLink);
+
/**
- * @brief create a new SocketConnection and add to a vector of links
- * @param links the vector of links
- * @param fromSocket the startpoint of the connection
- * @param toSocket the endpoint of the connection
- * @return the new created SocketConnection
- */
- static SocketConnection *addLink(vector<SocketConnection*>& links, OutputSocket *fromSocket, InputSocket *toSocket);
-
+ * @brief create a new SocketConnection and add to a vector of links
+ * @param links the vector of links
+ * @param fromSocket the startpoint of the connection
+ * @param toSocket the endpoint of the connection
+ * @return the new created SocketConnection
+ */
+ static SocketConnection *addLink(vector<SocketConnection *>& links, OutputSocket *fromSocket, InputSocket *toSocket);
+
/**
- * @brief dumps the content of the execution system to standard out
- * @param system the execution system to dump
- */
+ * @brief dumps the content of the execution system to standard out
+ * @param system the execution system to dump
+ */
static void debugDump(ExecutionSystem *system);
};
#endif
diff --git a/source/blender/compositor/intern/COM_InputSocket.h b/source/blender/compositor/intern/COM_InputSocket.h
index b1c75e34844..6ac6ad09126 100644
--- a/source/blender/compositor/intern/COM_InputSocket.h
+++ b/source/blender/compositor/intern/COM_InputSocket.h
@@ -36,10 +36,10 @@ class ChannelInfo;
class NodeOperation;
/**
- * @brief Resize modes of inputsockets
- * How are the input and working resolutions matched
- * @ingroup Model
- */
+ * @brief Resize modes of inputsockets
+ * How are the input and working resolutions matched
+ * @ingroup Model
+ */
typedef enum InputSocketResizeMode {
/** @brief Center the input image to the center of the working area of the node, no resizing occurs */
COM_SC_CENTER = NS_CR_CENTER,
@@ -56,34 +56,34 @@ typedef enum InputSocketResizeMode {
} InputSocketResizeMode;
/**
- * @brief InputSocket are sockets that can receive data/input
- * @ingroup Model
- */
+ * @brief InputSocket are sockets that can receive data/input
+ * @ingroup Model
+ */
class InputSocket : public Socket {
private:
/**
- * @brief connection connected to this InputSocket.
- * An input socket can only have a single connection
- */
+ * @brief connection connected to this InputSocket.
+ * An input socket can only have a single connection
+ */
SocketConnection *connection;
/**
- * @brief resize mode of this socket
- */
+ * @brief resize mode of this socket
+ */
InputSocketResizeMode resizeMode;
/**
- * @brief convert a data type to a by the socket supported data type.
- *
- * @param datatype the datatype that needs to be checked
- * @section data-conversion
- */
+ * @brief convert a data type to a by the socket supported data type.
+ *
+ * @param datatype the datatype that needs to be checked
+ * @section data-conversion
+ */
DataType convertToSupportedDataType(DataType datatype);
/**
- * @brief called when the ActualDataType is set. notifies other parties
- */
+ * @brief called when the ActualDataType is set. notifies other parties
+ */
void fireActualDataTypeSet();
public:
@@ -98,55 +98,59 @@ public:
int isInputSocket() const;
/**
- * @brief determine the resolution of this data going through this socket
- * @param resolution the result of this operation
- * @param preferredResolution the preferrable resolution as no resolution could be determined
- */
- void determineResolution(unsigned int resolution[],unsigned int preferredResolution[]);
+ * @brief determine the resolution of this data going through this socket
+ * @param resolution the result of this operation
+ * @param preferredResolution the preferrable resolution as no resolution could be determined
+ */
+ void determineResolution(unsigned int resolution[], unsigned int preferredResolution[]);
void determineActualDataType();
/**
- * @brief Notifies the Input of the data type (via a SocketConnection)
- * @param datatype the datatype to evaluate
- */
+ * @brief Notifies the Input of the data type (via a SocketConnection)
+ * @param datatype the datatype to evaluate
+ */
void notifyActualInputType(DataType datatype);
/**
- * @brief move all connections of this input socket to another socket
- * only use this method when already checked the availability of a SocketConnection
- * @param relinkToSocket the socket to move to connections to
- */
+ * @brief move all connections of this input socket to another socket
+ * only use this method when already checked the availability of a SocketConnection
+ * @param relinkToSocket the socket to move to connections to
+ */
void relinkConnections(InputSocket *relinkToSocket);
/**
- * @brief move all connections of this input socket to another socket
- * @param relinkToSocket the socket to move to connections to
- * @param autoconnect will a set operation be added when no connections exist
- * @param editorNodeInputSocketIndex index of the socket number of the bNode (used to retrieve the value for autoconnection)
- * @param system ExecutionSystem to update to
- */
+ * @brief move all connections of this input socket to another socket
+ * @param relinkToSocket the socket to move to connections to
+ * @param autoconnect will a set operation be added when no connections exist
+ * @param editorNodeInputSocketIndex index of the socket number of the bNode (used to retrieve the value for autoconnection)
+ * @param system ExecutionSystem to update to
+ */
void relinkConnections(InputSocket *relinkToSocket, int editorNodeInputSocketIndex, ExecutionSystem *system);
/**
- * @brief move all connections of this input socket to another socket
- * @param relinkToSocket the socket to move to connections to
- * @param editorNodeInputSocketIndex index of the socket number of the bNode (used to retrieve the value for autoconnection)
- * @param system ExecutionSystem to update to
- */
+ * @brief move all connections of this input socket to another socket
+ * @param relinkToSocket the socket to move to connections to
+ * @param editorNodeInputSocketIndex index of the socket number of the bNode (used to retrieve the value for autoconnection)
+ * @param system ExecutionSystem to update to
+ */
void relinkConnectionsDuplicate(InputSocket *relinkToSocket, int editorNodeInputSocketIndex, ExecutionSystem *system);
/**
- * @brief set the resize mode
- * @param resizeMode the new resize mode.
- */
- void setResizeMode(InputSocketResizeMode resizeMode) {this->resizeMode = resizeMode;}
+ * @brief set the resize mode
+ * @param resizeMode the new resize mode.
+ */
+ void setResizeMode(InputSocketResizeMode resizeMode) {
+ this->resizeMode = resizeMode;
+ }
/**
- * @brief get the resize mode of this socket
- * @return InputSocketResizeMode
- */
- InputSocketResizeMode getResizeMode() const {return this->resizeMode;}
+ * @brief get the resize mode of this socket
+ * @return InputSocketResizeMode
+ */
+ InputSocketResizeMode getResizeMode() const {
+ return this->resizeMode;
+ }
const ChannelInfo *getChannelInfo(const int channelnumber);
diff --git a/source/blender/compositor/intern/COM_MemoryBuffer.h b/source/blender/compositor/intern/COM_MemoryBuffer.h
index fd90e5fcb5a..dee2c9b771f 100644
--- a/source/blender/compositor/intern/COM_MemoryBuffer.h
+++ b/source/blender/compositor/intern/COM_MemoryBuffer.h
@@ -34,9 +34,9 @@ extern "C" {
#include <vector>
/**
- * @brief state of a memory buffer
- * @ingroup Memory
- */
+ * @brief state of a memory buffer
+ * @ingroup Memory
+ */
typedef enum MemoryBufferState {
/** @brief memory has been allocated on creator device and CPU machine, but kernel has not been executed */
COM_MB_ALLOCATED = 1,
@@ -49,77 +49,77 @@ typedef enum MemoryBufferState {
class MemoryProxy;
/**
- * @brief a MemoryBuffer contains access to the data of a chunk
- */
+ * @brief a MemoryBuffer contains access to the data of a chunk
+ */
class MemoryBuffer {
private:
/**
- * @brief proxy of the memory (same for all chunks in the same buffer)
- */
- MemoryProxy * memoryProxy;
+ * @brief proxy of the memory (same for all chunks in the same buffer)
+ */
+ MemoryProxy *memoryProxy;
/**
- * @brief the type of buffer COM_DT_VALUE, COM_DT_VECTOR, COM_DT_COLOR
- */
+ * @brief the type of buffer COM_DT_VALUE, COM_DT_VECTOR, COM_DT_COLOR
+ */
DataType datatype;
/**
- * @brief region of this buffer inside reative to the MemoryProxy
- */
+ * @brief region of this buffer inside reative to the MemoryProxy
+ */
rcti rect;
/**
- * brief refers to the chunknumber within the executiongroup where related to the MemoryProxy
- * @see memoryProxy
- */
+ * brief refers to the chunknumber within the executiongroup where related to the MemoryProxy
+ * @see memoryProxy
+ */
unsigned int chunkNumber;
/**
- * @brief width of the chunk
- */
+ * @brief width of the chunk
+ */
unsigned int chunkWidth;
/**
- * @brief state of the buffer
- */
+ * @brief state of the buffer
+ */
MemoryBufferState state;
/**
- * @brief the actual float buffer/data
- */
+ * @brief the actual float buffer/data
+ */
float *buffer;
public:
/**
- * @brief construct new MemoryBuffer for a chunk
- */
+ * @brief construct new MemoryBuffer for a chunk
+ */
MemoryBuffer(MemoryProxy *memoryProxy, unsigned int chunkNumber, rcti *rect);
/**
- * @brief construct new temporarily MemoryBuffer for an area
- */
+ * @brief construct new temporarily MemoryBuffer for an area
+ */
MemoryBuffer(MemoryProxy *memoryProxy, rcti *rect);
/**
- * @brief destructor
- */
+ * @brief destructor
+ */
~MemoryBuffer();
/**
- * @brief read the ChunkNumber of this MemoryBuffer
- */
- unsigned int getChunkNumber() {return this->chunkNumber;}
+ * @brief read the ChunkNumber of this MemoryBuffer
+ */
+ unsigned int getChunkNumber() { return this->chunkNumber; }
/**
- * @brief get the data of this MemoryBuffer
- * @note buffer should already be available in memory
- */
- float *getBuffer() {return this->buffer;}
+ * @brief get the data of this MemoryBuffer
+ * @note buffer should already be available in memory
+ */
+ float *getBuffer() { return this->buffer; }
/**
- * @brief after execution the state will be set to available by calling this method
- */
+ * @brief after execution the state will be set to available by calling this method
+ */
void setCreatedState() {
this->state = COM_MB_AVAILABLE;
}
@@ -130,34 +130,34 @@ public:
void readEWA(float result[4], float fx, float fy, float dx, float dy);
/**
- * @brief is this MemoryBuffer a temporarily buffer (based on an area, not on a chunk)
- */
- inline const bool isTemporarily() const {return this->state == COM_MB_TEMPORARILY;}
+ * @brief is this MemoryBuffer a temporarily buffer (based on an area, not on a chunk)
+ */
+ inline const bool isTemporarily() const { return this->state == COM_MB_TEMPORARILY; }
/**
- * @brief add the content from otherBuffer to this MemoryBuffer
- * @param otherBuffer source buffer
- */
+ * @brief add the content from otherBuffer to this MemoryBuffer
+ * @param otherBuffer source buffer
+ */
void copyContentFrom(MemoryBuffer *otherBuffer);
/**
- * @brief get the rect of this MemoryBuffer
- */
- rcti *getRect() {return &this->rect;}
+ * @brief get the rect of this MemoryBuffer
+ */
+ rcti *getRect() { return &this->rect; }
/**
- * @brief get the width of this MemoryBuffer
- */
+ * @brief get the width of this MemoryBuffer
+ */
int getWidth() const;
/**
- * @brief get the height of this MemoryBuffer
- */
+ * @brief get the height of this MemoryBuffer
+ */
int getHeight() const;
/**
- * @brief clear the buffer. Make all pixels black transparant.
- */
+ * @brief clear the buffer. Make all pixels black transparant.
+ */
void clear();
MemoryBuffer *duplicate();
diff --git a/source/blender/compositor/intern/COM_MemoryProxy.h b/source/blender/compositor/intern/COM_MemoryProxy.h
index e0ac72de0d3..e7e7f1cf3a0 100644
--- a/source/blender/compositor/intern/COM_MemoryProxy.h
+++ b/source/blender/compositor/intern/COM_MemoryProxy.h
@@ -30,78 +30,78 @@ class MemoryProxy;
class ExecutionGroup;
/**
- * @brief A MemoryProxy is a unique identifier for a memory buffer.
- * A single MemoryProxy is used among all chunks of the same buffer,
- * the MemoryBuffer only stores the data of a single chunk.
- * @ingroup Memory
- */
+ * @brief A MemoryProxy is a unique identifier for a memory buffer.
+ * A single MemoryProxy is used among all chunks of the same buffer,
+ * the MemoryBuffer only stores the data of a single chunk.
+ * @ingroup Memory
+ */
class MemoryProxy {
private:
/**
- * @brief reference to the ouput operation of the executiongroup
- */
+ * @brief reference to the ouput operation of the executiongroup
+ */
WriteBufferOperation *writeBufferOperation;
/**
- * @brief reference to the executor. the Execution group that can fill a chunk
- */
+ * @brief reference to the executor. the Execution group that can fill a chunk
+ */
ExecutionGroup *executor;
/**
- * @brief datatype of this MemoryProxy
- */
+ * @brief datatype of this MemoryProxy
+ */
DataType datatype;
/**
- * @brief channel information of this buffer
- */
+ * @brief channel information of this buffer
+ */
ChannelInfo channelInfo[COM_NUMBER_OF_CHANNELS];
/**
- * @brief the allocated memory
- */
- MemoryBuffer* buffer;
+ * @brief the allocated memory
+ */
+ MemoryBuffer *buffer;
public:
MemoryProxy();
/**
- * @brief set the ExecutionGroup that can be scheduled to calculate a certain chunk.
- * @param group the ExecutionGroup to set
- */
- void setExecutor(ExecutionGroup *executor) {this->executor = executor;}
-
+ * @brief set the ExecutionGroup that can be scheduled to calculate a certain chunk.
+ * @param group the ExecutionGroup to set
+ */
+ void setExecutor(ExecutionGroup *executor) { this->executor = executor; }
+
/**
- * @brief get the ExecutionGroup that can be scheduled to calculate a certain chunk.
- */
- ExecutionGroup *getExecutor() {return this->executor;}
-
+ * @brief get the ExecutionGroup that can be scheduled to calculate a certain chunk.
+ */
+ ExecutionGroup *getExecutor() { return this->executor; }
+
/**
- * @brief set the WriteBufferOperation that is responsible for writing to this MemoryProxy
- * @param operation
- */
- void setWriteBufferOperation(WriteBufferOperation *operation) {this->writeBufferOperation = operation;}
-
+ * @brief set the WriteBufferOperation that is responsible for writing to this MemoryProxy
+ * @param operation
+ */
+ void setWriteBufferOperation(WriteBufferOperation *operation) { this->writeBufferOperation = operation; }
+
/**
- * @brief get the WriteBufferOperation that is responsible for writing to this MemoryProxy
- * @return WriteBufferOperation
- */
- WriteBufferOperation *getWriteBufferOperation() {return this->writeBufferOperation;}
+ * @brief get the WriteBufferOperation that is responsible for writing to this MemoryProxy
+ * @return WriteBufferOperation
+ */
+ WriteBufferOperation *getWriteBufferOperation() { return this->writeBufferOperation; }
/**
- * @brief allocate memory of size widht x height
- */
+ * @brief allocate memory of size widht x height
+ */
void allocate(unsigned int width, unsigned int height);
/**
- * @brief free the allocated memory
- */
+ * @brief free the allocated memory
+ */
void free();
/**
- * @brief get the allocated memory
- */
- inline MemoryBuffer* getBuffer() {return this->buffer;}
+ * @brief get the allocated memory
+ */
+ inline MemoryBuffer *getBuffer() { return this->buffer; }
};
#endif
diff --git a/source/blender/compositor/intern/COM_Node.h b/source/blender/compositor/intern/COM_Node.h
index 0546062f790..12baa26cd6e 100644
--- a/source/blender/compositor/intern/COM_Node.h
+++ b/source/blender/compositor/intern/COM_Node.h
@@ -38,18 +38,18 @@ class Node;
class NodeOperation;
class ExecutionSystem;
-typedef vector<Node*> NodeList;
+typedef vector<Node *> NodeList;
typedef NodeList::iterator NodeIterator;
typedef pair<NodeIterator, NodeIterator> NodeRange;
/**
- * My node documentation.
- */
-class Node:public NodeBase {
+ * My node documentation.
+ */
+class Node : public NodeBase {
private:
/**
- * @brief stores the reference to the SDNA bNode struct
- */
+ * @brief stores the reference to the SDNA bNode struct
+ */
bNode *editorNode;
/**
@@ -58,18 +58,18 @@ private:
bool inActiveGroup;
public:
- Node(bNode *editorNode, bool create_sockets=true);
+ Node(bNode *editorNode, bool create_sockets = true);
/**
- * @brief get the reference to the SDNA bNode struct
- */
+ * @brief get the reference to the SDNA bNode struct
+ */
bNode *getbNode();
/**
* @brief Is this node in the active group (the group that is being edited)
* @param isInActiveGroup
*/
- void setIsInActiveGroup(bool isInActiveGroup) {this->inActiveGroup = isInActiveGroup; }
+ void setIsInActiveGroup(bool isInActiveGroup) { this->inActiveGroup = isInActiveGroup; }
/**
* @brief Is this node part of the active group
@@ -77,63 +77,63 @@ public:
* the active group will be the main tree (all nodes that are not part of a group will be active)
* @return bool [false:true]
*/
- inline bool isInActiveGroup() {return this->inActiveGroup;}
-
+ inline bool isInActiveGroup() { return this->inActiveGroup; }
+
/**
- * @brief convert node to operation
- *
- * @todo this must be described furter
- *
- * @param system the ExecutionSystem where the operations need to be added
- * @param context reference to the CompositorContext
- */
- virtual void convertToOperations(ExecutionSystem *system, CompositorContext * context) =0;
+ * @brief convert node to operation
+ *
+ * @todo this must be described furter
+ *
+ * @param system the ExecutionSystem where the operations need to be added
+ * @param context reference to the CompositorContext
+ */
+ virtual void convertToOperations(ExecutionSystem *system, CompositorContext *context) = 0;
/**
- * this method adds a SetValueOperation as input of the input socket.
- * This can only be used from the convertToOperation method. all other usages are not allowed
- */
+ * this method adds a SetValueOperation as input of the input socket.
+ * This can only be used from the convertToOperation method. all other usages are not allowed
+ */
void addSetValueOperation(ExecutionSystem *graph, InputSocket *inputsocket, int editorNodeInputSocketIndex);
/**
- * this method adds a SetColorOperation as input of the input socket.
- * This can only be used from the convertToOperation method. all other usages are not allowed
- */
+ * this method adds a SetColorOperation as input of the input socket.
+ * This can only be used from the convertToOperation method. all other usages are not allowed
+ */
void addSetColorOperation(ExecutionSystem *graph, InputSocket *inputsocket, int editorNodeInputSocketIndex);
/**
- * this method adds a SetVectorOperation as input of the input socket.
- * This can only be used from the convertToOperation method. all other usages are not allowed
- */
+ * this method adds a SetVectorOperation as input of the input socket.
+ * This can only be used from the convertToOperation method. all other usages are not allowed
+ */
void addSetVectorOperation(ExecutionSystem *graph, InputSocket *inputsocket, int editorNodeInputSocketIndex);
/**
- * Creates a new link between an outputSocket and inputSocket and registrates the link to the graph
- * @return the new created link
- */
+ * Creates a new link between an outputSocket and inputSocket and registrates the link to the graph
+ * @return the new created link
+ */
SocketConnection *addLink(ExecutionSystem *graph, OutputSocket *outputSocket, InputSocket *inputsocket);
/**
- * is this node a group node.
- */
+ * is this node a group node.
+ */
virtual bool isGroupNode() const { return false; }
/**
- * is this node a proxy node.
- */
+ * is this node a proxy node.
+ */
virtual bool isProxyNode() const { return false; }
/**
- * @brief find the InputSocket by bNodeSocket
- *
- * @param socket
- */
+ * @brief find the InputSocket by bNodeSocket
+ *
+ * @param socket
+ */
InputSocket *findInputSocketBybNodeSocket(bNodeSocket *socket);
/**
- * @brief find the OutputSocket by bNodeSocket
- *
- * @param socket
- */
+ * @brief find the OutputSocket by bNodeSocket
+ *
+ * @param socket
+ */
OutputSocket *findOutputSocketBybNodeSocket(bNodeSocket *socket);
protected:
diff --git a/source/blender/compositor/intern/COM_NodeBase.h b/source/blender/compositor/intern/COM_NodeBase.h
index 123797c780a..3917904afe3 100644
--- a/source/blender/compositor/intern/COM_NodeBase.h
+++ b/source/blender/compositor/intern/COM_NodeBase.h
@@ -37,136 +37,136 @@ class NodeOperation;
class ExecutionSystem;
/**
- * @brief The NodeBase class is the super-class of all node related objects like @see Node @see NodeOperation
- * the reason for the existence of this class is to support graph-nodes when using ExecutionSystem
- * the NodeBase also contains the reference to InputSocket and OutputSocket.
- * @ingroup Model
- */
+ * @brief The NodeBase class is the super-class of all node related objects like @see Node @see NodeOperation
+ * the reason for the existence of this class is to support graph-nodes when using ExecutionSystem
+ * the NodeBase also contains the reference to InputSocket and OutputSocket.
+ * @ingroup Model
+ */
class NodeBase {
private:
/**
- * @brief the list of actual inputsockets @see InputSocket
- */
- vector<InputSocket*> inputsockets;
+ * @brief the list of actual inputsockets @see InputSocket
+ */
+ vector<InputSocket *> inputsockets;
/**
- * @brief the list of actual outputsockets @see OutputSocket
- */
- vector<OutputSocket*> outputsockets;
+ * @brief the list of actual outputsockets @see OutputSocket
+ */
+ vector<OutputSocket *> outputsockets;
protected:
/**
- * @brief get access to the vector of input sockets
- */
- inline vector<InputSocket*>& getInputSockets() {return this->inputsockets;}
+ * @brief get access to the vector of input sockets
+ */
+ inline vector<InputSocket *>& getInputSockets() { return this->inputsockets; }
/**
- * @brief get access to the vector of input sockets
- */
- inline vector<OutputSocket*>& getOutputSockets() {return this->outputsockets;}
+ * @brief get access to the vector of input sockets
+ */
+ inline vector<OutputSocket *>& getOutputSockets() { return this->outputsockets; }
public:
/**
- * @brief destructor
- * clean up memory related to this NodeBase.
- */
+ * @brief destructor
+ * clean up memory related to this NodeBase.
+ */
virtual ~NodeBase();
/**
- * @brief determine the actual socket data types that will go through the system
- */
+ * @brief determine the actual socket data types that will go through the system
+ */
virtual void determineActualSocketDataTypes();
/**
- * @brief determine the actual socket data types of a specific outputsocket
- *
- * @param outputsocket
- * a reference to the actual outputsocket where the datatype must be determined from
- *
- * @return
- * COM_DT_VALUE if it is a value (1 float buffer)
- * COM_DT_COLOR if it is a value (4 float buffer)
- * COM_DT_VECTOR if it is a value (3 float buffer)
- */
+ * @brief determine the actual socket data types of a specific outputsocket
+ *
+ * @param outputsocket
+ * a reference to the actual outputsocket where the datatype must be determined from
+ *
+ * @return
+ * COM_DT_VALUE if it is a value (1 float buffer)
+ * COM_DT_COLOR if it is a value (4 float buffer)
+ * COM_DT_VECTOR if it is a value (3 float buffer)
+ */
virtual DataType determineActualDataType(OutputSocket *outputsocket);
/**
- * @brief is this node an operation?
- * This is true when the instance is of the subclass NodeOperation.
- * @return [true:false]
- * @see NodeOperation
- */
- virtual const int isOperation() const {return false;}
+ * @brief is this node an operation?
+ * This is true when the instance is of the subclass NodeOperation.
+ * @return [true:false]
+ * @see NodeOperation
+ */
+ virtual const int isOperation() const { return false; }
/**
- * @brief check if this is an input node
- * An input node is a node that only has output sockets and no input sockets
- * @return [false..true]
- */
+ * @brief check if this is an input node
+ * An input node is a node that only has output sockets and no input sockets
+ * @return [false..true]
+ */
const bool isInputNode() const;
/**
- * @brief Return the number of input sockets of this node.
- */
- const unsigned int getNumberOfInputSockets() const {return this->inputsockets.size();}
-
+ * @brief Return the number of input sockets of this node.
+ */
+ const unsigned int getNumberOfInputSockets() const { return this->inputsockets.size(); }
+
/**
- * @brief Return the number of output sockets of this node.
- */
- const unsigned int getNumberOfOutputSockets() const {return this->outputsockets.size();}
-
+ * @brief Return the number of output sockets of this node.
+ */
+ const unsigned int getNumberOfOutputSockets() const { return this->outputsockets.size(); }
+
/**
- * after the data has been determined of an outputsocket that has a connection with an inputsocket this method is called on the
- * node that contains the inputsocket.
- * @param socket
- * the reference of the inputsocket where connected data type is found
- * @param actualType [COM_DT_VALUE, COM_DT_VECTOR, COM_DT_COLOR]
- * the actual data type that is coming from the connected output socket
- */
+ * after the data has been determined of an outputsocket that has a connection with an inputsocket this method is called on the
+ * node that contains the inputsocket.
+ * @param socket
+ * the reference of the inputsocket where connected data type is found
+ * @param actualType [COM_DT_VALUE, COM_DT_VECTOR, COM_DT_COLOR]
+ * the actual data type that is coming from the connected output socket
+ */
virtual void notifyActualDataTypeSet(InputSocket *socket, const DataType actualType);
/**
- * get the reference to a certain outputsocket
- * @param index
- * the index of the needed outputsocket
- */
+ * get the reference to a certain outputsocket
+ * @param index
+ * the index of the needed outputsocket
+ */
OutputSocket *getOutputSocket(const int index);
/**
- * get the reference to the first outputsocket
- * @param index
- * the index of the needed outputsocket
- */
- inline OutputSocket *getOutputSocket() {return getOutputSocket(0);}
+ * get the reference to the first outputsocket
+ * @param index
+ * the index of the needed outputsocket
+ */
+ inline OutputSocket *getOutputSocket() { return getOutputSocket(0); }
/**
- * get the reference to a certain inputsocket
- * @param index
- * the index of the needed inputsocket
- */
+ * get the reference to a certain inputsocket
+ * @param index
+ * the index of the needed inputsocket
+ */
InputSocket *getInputSocket(const int index);
- virtual bool isStatic() const {return false;}
- void getStaticValues(float *result) const {}
+ virtual bool isStatic() const { return false; }
+ void getStaticValues(float *result) const { }
protected:
NodeBase();
/**
- * @brief add an InputSocket to the collection of inputsockets
- * @note may only be called in an constructor
- * @param socket the InputSocket to add
- */
+ * @brief add an InputSocket to the collection of inputsockets
+ * @note may only be called in an constructor
+ * @param socket the InputSocket to add
+ */
void addInputSocket(DataType datatype);
void addInputSocket(DataType datatype, InputSocketResizeMode resizeMode);
void addInputSocket(DataType datatype, InputSocketResizeMode resizeMode, bNodeSocket *socket);
/**
- * @brief add an OutputSocket to the collection of outputsockets
- * @note may only be called in an constructor
- * @param socket the OutputSocket to add
- */
+ * @brief add an OutputSocket to the collection of outputsockets
+ * @note may only be called in an constructor
+ * @param socket the OutputSocket to add
+ */
void addOutputSocket(DataType datatype);
void addOutputSocket(DataType datatype, bNodeSocket *socket);
};
diff --git a/source/blender/compositor/intern/COM_NodeOperation.h b/source/blender/compositor/intern/COM_NodeOperation.h
index e56ac7bd51f..30731572712 100644
--- a/source/blender/compositor/intern/COM_NodeOperation.h
+++ b/source/blender/compositor/intern/COM_NodeOperation.h
@@ -41,41 +41,41 @@ class NodeOperation;
class ReadBufferOperation;
/**
- * @brief NodeOperation are contains calculation logic
- *
- * Subclasses needs to implement the execution method (defined in SocketReader) to implement logic.
- * @ingroup Model
- */
+ * @brief NodeOperation are contains calculation logic
+ *
+ * Subclasses needs to implement the execution method (defined in SocketReader) to implement logic.
+ * @ingroup Model
+ */
class NodeOperation : public NodeBase, public SocketReader {
private:
/**
- * @brief the index of the input socket that will be used to determine the resolution
- */
+ * @brief the index of the input socket that will be used to determine the resolution
+ */
unsigned int resolutionInputSocketIndex;
/**
- * @brief is this operation a complex one.
- *
- * Complex operations are typically doing many reads to calculate the output of a single pixel.
- * Mostly Filter types (Blurs, Convolution, Defocus etc) need this to be set to true.
- */
+ * @brief is this operation a complex one.
+ *
+ * Complex operations are typically doing many reads to calculate the output of a single pixel.
+ * Mostly Filter types (Blurs, Convolution, Defocus etc) need this to be set to true.
+ */
bool complex;
/**
- * @brief can this operation be scheduled on an OpenCL device.
- * @note Only applicable if complex is True
- */
+ * @brief can this operation be scheduled on an OpenCL device.
+ * @note Only applicable if complex is True
+ */
bool openCL;
/**
- * @brief mutex reference for very special node initializations
- * @note only use when you really know what you are doing.
- * this mutex is used to share data among chunks in the same operation
- * @see TonemapOperation for an example of usage
- * @see NodeOperation.initMutex initializes this mutex
- * @see NodeOperation.deinitMutex deinitializes this mutex
- * @see NodeOperation.getMutex retrieve a pointer to this mutex.
- */
+ * @brief mutex reference for very special node initializations
+ * @note only use when you really know what you are doing.
+ * this mutex is used to share data among chunks in the same operation
+ * @see TonemapOperation for an example of usage
+ * @see NodeOperation.initMutex initializes this mutex
+ * @see NodeOperation.deinitMutex deinitializes this mutex
+ * @see NodeOperation.getMutex retrieve a pointer to this mutex.
+ */
ThreadMutex mutex;
/**
@@ -85,87 +85,87 @@ private:
public:
/**
- * @brief is this node an operation?
- * This is true when the instance is of the subclass NodeOperation.
- * @return [true:false]
- * @see NodeBase
- */
- const int isOperation() const {return true;}
+ * @brief is this node an operation?
+ * This is true when the instance is of the subclass NodeOperation.
+ * @return [true:false]
+ * @see NodeBase
+ */
+ const int isOperation() const { return true; }
/**
- * @brief determine the resolution of this node
- * @note this method will not set the resolution, this is the responsibility of the caller
- * @param resolution the result of this operation
- * @param preferredResolution the preferrable resolution as no resolution could be determined
- */
+ * @brief determine the resolution of this node
+ * @note this method will not set the resolution, this is the responsibility of the caller
+ * @param resolution the result of this operation
+ * @param preferredResolution the preferrable resolution as no resolution could be determined
+ */
virtual void determineResolution(unsigned int resolution[], unsigned int preferredResolution[]);
/**
- * @brief isOutputOperation determines whether this operation is an output of the ExecutionSystem during rendering or editing.
- *
- * Default behaviour if not overriden, this operation will not be evaluated as being an output of the ExecutionSystem.
- *
- * @see ExecutionSystem
- * @group check
- * @param rendering [true false]
- * true: rendering
- * false: editing
- *
- * @return bool the result of this method
- */
- virtual bool isOutputOperation(bool rendering) const {return false;}
+ * @brief isOutputOperation determines whether this operation is an output of the ExecutionSystem during rendering or editing.
+ *
+ * Default behaviour if not overriden, this operation will not be evaluated as being an output of the ExecutionSystem.
+ *
+ * @see ExecutionSystem
+ * @group check
+ * @param rendering [true false]
+ * true: rendering
+ * false: editing
+ *
+ * @return bool the result of this method
+ */
+ virtual bool isOutputOperation(bool rendering) const { return false; }
/**
- * isBufferOperation returns if this is an operation that work directly on buffers.
- *
- * there are only 2 implementation where this is true:
- * @see ReadBufferOperation
- * @see WriteBufferOperation
- * for all other operations this will result in false.
- */
- virtual int isBufferOperation() {return false;}
- virtual int isSingleThreaded() {return false;}
-
- void setbNodeTree(const bNodeTree * tree) {this->btree = tree;}
+ * isBufferOperation returns if this is an operation that work directly on buffers.
+ *
+ * there are only 2 implementation where this is true:
+ * @see ReadBufferOperation
+ * @see WriteBufferOperation
+ * for all other operations this will result in false.
+ */
+ virtual int isBufferOperation() { return false; }
+ virtual int isSingleThreaded() { return false; }
+
+ void setbNodeTree(const bNodeTree *tree) { this->btree = tree; }
virtual void initExecution();
/**
- * @brief when a chunk is executed by a CPUDevice, this method is called
- * @ingroup execution
- * @param rect the rectangle of the chunk (location and size)
- * @param chunkNumber the chunkNumber to be calculated
- * @param memoryBuffers all input MemoryBuffer's needed
- */
- virtual void executeRegion(rcti *rect, unsigned int chunkNumber, MemoryBuffer** memoryBuffers) {}
+ * @brief when a chunk is executed by a CPUDevice, this method is called
+ * @ingroup execution
+ * @param rect the rectangle of the chunk (location and size)
+ * @param chunkNumber the chunkNumber to be calculated
+ * @param memoryBuffers all input MemoryBuffer's needed
+ */
+ virtual void executeRegion(rcti *rect, unsigned int chunkNumber, MemoryBuffer **memoryBuffers) {}
/**
- * @brief when a chunk is executed by an OpenCLDevice, this method is called
- * @ingroup execution
- * @note this method is only implemented in WriteBufferOperation
- * @param context the OpenCL context
- * @param program the OpenCL program containing all compositor kernels
- * @param queue the OpenCL command queue of the device the chunk is executed on
- * @param rect the rectangle of the chunk (location and size)
- * @param chunkNumber the chunkNumber to be calculated
- * @param memoryBuffers all input MemoryBuffer's needed
- * @param outputBuffer the outputbuffer to write to
- */
+ * @brief when a chunk is executed by an OpenCLDevice, this method is called
+ * @ingroup execution
+ * @note this method is only implemented in WriteBufferOperation
+ * @param context the OpenCL context
+ * @param program the OpenCL program containing all compositor kernels
+ * @param queue the OpenCL command queue of the device the chunk is executed on
+ * @param rect the rectangle of the chunk (location and size)
+ * @param chunkNumber the chunkNumber to be calculated
+ * @param memoryBuffers all input MemoryBuffer's needed
+ * @param outputBuffer the outputbuffer to write to
+ */
virtual void executeOpenCLRegion(cl_context context, cl_program program, cl_command_queue queue, rcti *rect,
- unsigned int chunkNumber, MemoryBuffer** memoryBuffers, MemoryBuffer* outputBuffer) {}
+ unsigned int chunkNumber, MemoryBuffer **memoryBuffers, MemoryBuffer *outputBuffer) {}
/**
- * @brief custom handle to add new tasks to the OpenCL command queue in order to execute a chunk on an GPUDevice
- * @ingroup execution
- * @param context the OpenCL context
- * @param program the OpenCL program containing all compositor kernels
- * @param queue the OpenCL command queue of the device the chunk is executed on
- * @param outputMemoryBuffer the allocated memory buffer in main CPU memory
- * @param clOutputBuffer the allocated memory buffer in OpenCLDevice memory
- * @param inputMemoryBuffers all input MemoryBuffer's needed
- * @param clMemToCleanUp all created cl_mem references must be added to this list. Framework will clean this after execution
- * @param clKernelsToCleanUp all created cl_kernel references must be added to this list. Framework will clean this after execution
- */
- virtual void executeOpenCL(cl_context context,cl_program program, cl_command_queue queue, MemoryBuffer *outputMemoryBuffer, cl_mem clOutputBuffer, MemoryBuffer** inputMemoryBuffers, list<cl_mem> *clMemToCleanUp, list<cl_kernel> *clKernelsToCleanUp) {}
+ * @brief custom handle to add new tasks to the OpenCL command queue in order to execute a chunk on an GPUDevice
+ * @ingroup execution
+ * @param context the OpenCL context
+ * @param program the OpenCL program containing all compositor kernels
+ * @param queue the OpenCL command queue of the device the chunk is executed on
+ * @param outputMemoryBuffer the allocated memory buffer in main CPU memory
+ * @param clOutputBuffer the allocated memory buffer in OpenCLDevice memory
+ * @param inputMemoryBuffers all input MemoryBuffer's needed
+ * @param clMemToCleanUp all created cl_mem references must be added to this list. Framework will clean this after execution
+ * @param clKernelsToCleanUp all created cl_kernel references must be added to this list. Framework will clean this after execution
+ */
+ virtual void executeOpenCL(cl_context context, cl_program program, cl_command_queue queue, MemoryBuffer *outputMemoryBuffer, cl_mem clOutputBuffer, MemoryBuffer **inputMemoryBuffers, list<cl_mem> *clMemToCleanUp, list<cl_kernel> *clKernelsToCleanUp) {}
virtual void deinitExecution();
bool isResolutionSet() {
@@ -173,9 +173,9 @@ public:
}
/**
- * @brief set the resolution
- * @param resolution the resolution to set
- */
+ * @brief set the resolution
+ * @param resolution the resolution to set
+ */
void setResolution(unsigned int resolution[]) {
if (!isResolutionSet()) {
this->width = resolution[0];
@@ -184,63 +184,63 @@ public:
}
- void getConnectedInputSockets(vector<InputSocket*> *sockets);
+ void getConnectedInputSockets(vector<InputSocket *> *sockets);
/**
- * @brief is this operation complex
- *
- * Complex operations are typically doing many reads to calculate the output of a single pixel.
- * Mostly Filter types (Blurs, Convolution, Defocus etc) need this to be set to true.
- */
- const bool isComplex() const {return this->complex;}
- virtual const bool isSetOperation() const {return false;}
+ * @brief is this operation complex
+ *
+ * Complex operations are typically doing many reads to calculate the output of a single pixel.
+ * Mostly Filter types (Blurs, Convolution, Defocus etc) need this to be set to true.
+ */
+ const bool isComplex() const { return this->complex; }
+ virtual const bool isSetOperation() const { return false; }
/**
- * @brief is this operation of type ReadBufferOperation
- * @return [true:false]
- * @see ReadBufferOperation
- */
- virtual const bool isReadBufferOperation() const {return false;}
+ * @brief is this operation of type ReadBufferOperation
+ * @return [true:false]
+ * @see ReadBufferOperation
+ */
+ virtual const bool isReadBufferOperation() const { return false; }
/**
- * @brief is this operation of type WriteBufferOperation
- * @return [true:false]
- * @see WriteBufferOperation
- */
- virtual const bool isWriteBufferOperation() const {return false;}
+ * @brief is this operation of type WriteBufferOperation
+ * @return [true:false]
+ * @see WriteBufferOperation
+ */
+ virtual const bool isWriteBufferOperation() const { return false; }
/**
- * @brief is this operation the active viewer output
- * user can select an ViewerNode to be active (the result of this node will be drawn on the backdrop)
- * @return [true:false]
- * @see BaseViewerOperation
- */
- virtual const bool isActiveViewerOutput() const {return false;}
+ * @brief is this operation the active viewer output
+ * user can select an ViewerNode to be active (the result of this node will be drawn on the backdrop)
+ * @return [true:false]
+ * @see BaseViewerOperation
+ */
+ virtual const bool isActiveViewerOutput() const { return false; }
- virtual bool determineDependingAreaOfInterest(rcti * input, ReadBufferOperation *readOperation, rcti *output);
+ virtual bool determineDependingAreaOfInterest(rcti *input, ReadBufferOperation *readOperation, rcti *output);
/**
- * @brief set the index of the input socket that will determine the resolution of this operation
- * @param index the index to set
- */
+ * @brief set the index of the input socket that will determine the resolution of this operation
+ * @param index the index to set
+ */
void setResolutionInputSocketIndex(unsigned int index);
/**
- * @brief get the render priority of this node.
- * @note only applicable for output operations like ViewerOperation
- * @return CompositorPriority
- */
- virtual const CompositorPriority getRenderPriority() const {return COM_PRIORITY_LOW;}
+ * @brief get the render priority of this node.
+ * @note only applicable for output operations like ViewerOperation
+ * @return CompositorPriority
+ */
+ virtual const CompositorPriority getRenderPriority() const { return COM_PRIORITY_LOW; }
/**
- * @brief can this NodeOperation be scheduled on an OpenCLDevice
- * @see WorkScheduler.schedule
- * @see ExecutionGroup.addOperation
- */
+ * @brief can this NodeOperation be scheduled on an OpenCLDevice
+ * @see WorkScheduler.schedule
+ * @see ExecutionGroup.addOperation
+ */
bool isOpenCL() { return this->openCL; }
- virtual bool isViewerOperation() {return false;}
- virtual bool isPreviewOperation() {return false;}
+ virtual bool isViewerOperation() { return false; }
+ virtual bool isPreviewOperation() { return false; }
inline bool isBreaked() {
return btree->test_break(btree->tbh);
@@ -249,8 +249,8 @@ public:
protected:
NodeOperation();
- void setWidth(unsigned int width) {this->width = width;}
- void setHeight(unsigned int height) {this->height = height;}
+ void setWidth(unsigned int width) { this->width = width; }
+ void setHeight(unsigned int height) { this->height = height; }
SocketReader *getInputSocketReader(unsigned int inputSocketindex);
NodeOperation *getInputOperation(unsigned int inputSocketindex);
@@ -261,25 +261,25 @@ protected:
/**
- * @brief set whether this operation is complex
- *
- * Complex operations are typically doing many reads to calculate the output of a single pixel.
- * Mostly Filter types (Blurs, Convolution, Defocus etc) need this to be set to true.
- */
- void setComplex(bool complex) {this->complex = complex;}
+ * @brief set whether this operation is complex
+ *
+ * Complex operations are typically doing many reads to calculate the output of a single pixel.
+ * Mostly Filter types (Blurs, Convolution, Defocus etc) need this to be set to true.
+ */
+ void setComplex(bool complex) { this->complex = complex; }
/**
- * @brief set if this NodeOperation can be scheduled on a OpenCLDevice
- */
- void setOpenCL(bool openCL) {this->openCL = openCL;}
+ * @brief set if this NodeOperation can be scheduled on a OpenCLDevice
+ */
+ void setOpenCL(bool openCL) { this->openCL = openCL; }
- static cl_mem COM_clAttachMemoryBufferToKernelParameter(cl_context context, cl_kernel kernel, int parameterIndex, int offsetIndex, list<cl_mem> *cleanup, MemoryBuffer **inputMemoryBuffers, SocketReader* reader);
+ static cl_mem COM_clAttachMemoryBufferToKernelParameter(cl_context context, cl_kernel kernel, int parameterIndex, int offsetIndex, list<cl_mem> *cleanup, MemoryBuffer **inputMemoryBuffers, SocketReader *reader);
static void COM_clAttachMemoryBufferOffsetToKernelParameter(cl_kernel kernel, int offsetIndex, MemoryBuffer *memoryBuffers);
static void COM_clAttachOutputMemoryBufferToKernelParameter(cl_kernel kernel, int parameterIndex, cl_mem clOutputMemoryBuffer);
void COM_clAttachSizeToKernelParameter(cl_kernel kernel, int offsetIndex);
- static void COM_clEnqueueRange(cl_command_queue queue, cl_kernel kernel, MemoryBuffer* outputMemoryBuffer);
+ static void COM_clEnqueueRange(cl_command_queue queue, cl_kernel kernel, MemoryBuffer *outputMemoryBuffer);
void COM_clEnqueueRange(cl_command_queue queue, cl_kernel kernel, MemoryBuffer *outputMemoryBuffer, int offsetIndex);
- cl_kernel COM_clCreateKernel(cl_program program, const char* kernelname, list<cl_kernel> *clKernelsToCleanUp);
+ cl_kernel COM_clCreateKernel(cl_program program, const char *kernelname, list<cl_kernel> *clKernelsToCleanUp);
};
diff --git a/source/blender/compositor/intern/COM_OpenCLDevice.h b/source/blender/compositor/intern/COM_OpenCLDevice.h
index f61c555558d..75c326eda23 100644
--- a/source/blender/compositor/intern/COM_OpenCLDevice.h
+++ b/source/blender/compositor/intern/COM_OpenCLDevice.h
@@ -31,57 +31,57 @@ class OpenCLDevice;
/**
- * @brief device representing an GPU OpenCL device.
- * an instance of this class represents a single cl_device
- */
-class OpenCLDevice: public Device {
+ * @brief device representing an GPU OpenCL device.
+ * an instance of this class represents a single cl_device
+ */
+class OpenCLDevice : public Device {
private:
/**
- *@brief opencl context
- */
+ *@brief opencl context
+ */
cl_context context;
/**
- *@brief opencl device
- */
+ *@brief opencl device
+ */
cl_device_id device;
/**
- *@brief opencl program
- */
+ *@brief opencl program
+ */
cl_program program;
/**
- *@brief opencl command queue
- */
+ *@brief opencl command queue
+ */
cl_command_queue queue;
public:
/**
- *@brief constructor with opencl device
- *@param context
- *@param device
- */
+ *@brief constructor with opencl device
+ *@param context
+ *@param device
+ */
OpenCLDevice(cl_context context, cl_device_id device, cl_program program);
/**
- * @brief initialize the device
- * During initialization the OpenCL cl_command_queue is created
- * the command queue is stored in the field queue.
- * @see queue
- */
+ * @brief initialize the device
+ * During initialization the OpenCL cl_command_queue is created
+ * the command queue is stored in the field queue.
+ * @see queue
+ */
bool initialize();
/**
- * @brief deinitialize the device
- * During deintiialization the command queue is cleared
- */
+ * @brief deinitialize the device
+ * During deintiialization the command queue is cleared
+ */
void deinitialize();
/**
- * @brief execute a WorkPackage
- * @param work the WorkPackage to execute
- */
+ * @brief execute a WorkPackage
+ * @param work the WorkPackage to execute
+ */
void execute(WorkPackage *work);
};
diff --git a/source/blender/compositor/intern/COM_OutputSocket.h b/source/blender/compositor/intern/COM_OutputSocket.h
index 640588417b4..e008d651046 100644
--- a/source/blender/compositor/intern/COM_OutputSocket.h
+++ b/source/blender/compositor/intern/COM_OutputSocket.h
@@ -37,18 +37,18 @@ class WriteBufferOperation;
//#define COM_ST_OUTPUT 1
/**
- * @brief OutputSocket are sockets that can send data/input
- * @ingroup Model
- */
+ * @brief OutputSocket are sockets that can send data/input
+ * @ingroup Model
+ */
class OutputSocket : public Socket {
private:
- vector<SocketConnection*> connections;
+ vector<SocketConnection *> connections;
/**
- * @brief index of the inputsocket that determines the datatype of this outputsocket
- * -1 will not use any inputsocket to determine the datatype, but use the outputsocket
- * default datatype.
- */
+ * @brief index of the inputsocket that determines the datatype of this outputsocket
+ * -1 will not use any inputsocket to determine the datatype, but use the outputsocket
+ * default datatype.
+ */
int inputSocketDataTypeDeterminatorIndex;
ChannelInfo channelinfo[4];
@@ -56,47 +56,47 @@ private:
public:
OutputSocket(DataType datatype);
OutputSocket(DataType datatype, int inputSocketDataTypeDeterminatorIndex);
- OutputSocket(OutputSocket * from);
+ OutputSocket(OutputSocket *from);
void addConnection(SocketConnection *connection);
- SocketConnection *getConnection(unsigned int index) {return this->connections[index];}
+ SocketConnection *getConnection(unsigned int index) { return this->connections[index]; }
const int isConnected() const;
int isOutputSocket() const;
/**
- * @brief determine the resolution of this socket
- * @param resolution the result of this operation
- * @param preferredResolution the preferrable resolution as no resolution could be determined
- */
+ * @brief determine the resolution of this socket
+ * @param resolution the result of this operation
+ * @param preferredResolution the preferrable resolution as no resolution could be determined
+ */
void determineResolution(unsigned int resolution[], unsigned int preferredResolution[]);
/**
- * @brief determine the actual data type and channel info.
- */
+ * @brief determine the actual data type and channel info.
+ */
void determineActualDataType();
- void relinkConnections(OutputSocket *relinkToSocket) {this->relinkConnections(relinkToSocket, false);};
+ void relinkConnections(OutputSocket *relinkToSocket) { this->relinkConnections(relinkToSocket, false); };
void relinkConnections(OutputSocket *relinkToSocket, bool single);
bool isActualDataTypeDeterminedByInputSocket() {
- return this->inputSocketDataTypeDeterminatorIndex>-1;
+ return this->inputSocketDataTypeDeterminatorIndex > -1;
}
- const int getNumberOfConnections() {return connections.size();}
+ const int getNumberOfConnections() { return connections.size(); }
/**
- * @brief get the index of the inputsocket that determines the datatype of this outputsocket
- */
- int getInputSocketDataTypeDeterminatorIndex() {return this->inputSocketDataTypeDeterminatorIndex;}
+ * @brief get the index of the inputsocket that determines the datatype of this outputsocket
+ */
+ int getInputSocketDataTypeDeterminatorIndex() { return this->inputSocketDataTypeDeterminatorIndex; }
void clearConnections();
/**
- * @brief find a connected write buffer operation to this OutputSocket
- * @return WriteBufferOperation or NULL
- */
+ * @brief find a connected write buffer operation to this OutputSocket
+ * @return WriteBufferOperation or NULL
+ */
WriteBufferOperation *findAttachedWriteBufferOperation() const;
ChannelInfo *getChannelInfo(const int channelnumber);
/**
- * @brief trigger determine actual data type to all connected sockets
- * @note will only be triggered just after the actual data type is set.
- */
+ * @brief trigger determine actual data type to all connected sockets
+ * @note will only be triggered just after the actual data type is set.
+ */
void fireActualDataType();
private:
diff --git a/source/blender/compositor/intern/COM_SingleThreadedNodeOperation.h b/source/blender/compositor/intern/COM_SingleThreadedNodeOperation.h
index ace48365752..b1bf28c9c07 100644
--- a/source/blender/compositor/intern/COM_SingleThreadedNodeOperation.h
+++ b/source/blender/compositor/intern/COM_SingleThreadedNodeOperation.h
@@ -37,24 +37,24 @@ public:
SingleThreadedNodeOperation();
/**
- * the inner loop of this program
- */
- void executePixel(float *color, int x, int y, MemoryBuffer *inputBuffers[], void *data);
+ * the inner loop of this program
+ */
+ void executePixel(float *color, int x, int y, MemoryBuffer * inputBuffers[], void *data);
/**
- * Initialize the execution
- */
+ * Initialize the execution
+ */
void initExecution();
/**
- * Deinitialize the execution
- */
+ * Deinitialize the execution
+ */
void deinitExecution();
void *initializeTileData(rcti *rect, MemoryBuffer **memoryBuffers);
- virtual MemoryBuffer* createMemoryBuffer(rcti *rect, MemoryBuffer **memoryBuffers) = 0;
+ virtual MemoryBuffer *createMemoryBuffer(rcti *rect, MemoryBuffer **memoryBuffers) = 0;
- int isSingleThreaded() {return true;}
+ int isSingleThreaded() { return true; }
};
#endif
diff --git a/source/blender/compositor/intern/COM_Socket.h b/source/blender/compositor/intern/COM_Socket.h
index 8ad7a5c7fde..0be21a6b1b8 100644
--- a/source/blender/compositor/intern/COM_Socket.h
+++ b/source/blender/compositor/intern/COM_Socket.h
@@ -34,33 +34,33 @@ class SocketConnection;
class NodeBase;
/**
- * @brief Base class for InputSocket and OutputSocket.
- *
- * A socket are the points on an node where the user can make a connection between.
- * Sockets are always part of a node or an operation.
- *
- * @see InputSocket
- * @see OutputSocket
- * @see SocketConnection - a connection between an InputSocket and an OutputSocket
- * @ingroup Model
- */
+ * @brief Base class for InputSocket and OutputSocket.
+ *
+ * A socket are the points on an node where the user can make a connection between.
+ * Sockets are always part of a node or an operation.
+ *
+ * @see InputSocket
+ * @see OutputSocket
+ * @see SocketConnection - a connection between an InputSocket and an OutputSocket
+ * @ingroup Model
+ */
class Socket {
private:
/**
- * Reference to the node where this Socket belongs to
- */
+ * Reference to the node where this Socket belongs to
+ */
NodeBase *node;
/**
- * the datatype of this socket. Is used for automatically data transformation.
- * @section data-conversion
- */
+ * the datatype of this socket. Is used for automatically data transformation.
+ * @section data-conversion
+ */
DataType datatype;
/**
- * the actual data type during execution. This can be different than the field datatype, based on the conversion rules of the node
- * @section data-conversion
- */
+ * the actual data type during execution. This can be different than the field datatype, based on the conversion rules of the node
+ * @section data-conversion
+ */
DataType actualType;
bNodeSocket *editorSocket;
@@ -72,17 +72,17 @@ public:
NodeBase *getNode() const;
/**
- * @brief get the actual data type
- *
- * @note The actual data type can differ from the data type this socket expects.
- * @return actual DataType
- */
+ * @brief get the actual data type
+ *
+ * @note The actual data type can differ from the data type this socket expects.
+ * @return actual DataType
+ */
DataType getActualDataType() const;
/**
- * @brief set the actual data type
- * @param actualType the new actual type
- */
+ * @brief set the actual data type
+ * @param actualType the new actual type
+ */
void setActualDataType(DataType actualType);
const virtual int isConnected() const;
@@ -90,9 +90,9 @@ public:
int isOutputSocket() const;
virtual void determineResolution(int resolution[], unsigned int preferredResolution[]) {}
virtual void determineActualDataType() {}
-
- void setEditorSocket(bNodeSocket *editorSocket) {this->editorSocket = editorSocket;}
- bNodeSocket *getbNodeSocket() const {return this->editorSocket;}
+
+ void setEditorSocket(bNodeSocket *editorSocket) { this->editorSocket = editorSocket; }
+ bNodeSocket *getbNodeSocket() const { return this->editorSocket; }
};
diff --git a/source/blender/compositor/intern/COM_SocketConnection.h b/source/blender/compositor/intern/COM_SocketConnection.h
index 1c4dcebfe07..5385c5be49b 100644
--- a/source/blender/compositor/intern/COM_SocketConnection.h
+++ b/source/blender/compositor/intern/COM_SocketConnection.h
@@ -29,94 +29,94 @@
#include "COM_ChannelInfo.h"
/**
- * @brief An SocketConnection is an connection between an InputSocket and an OutputSocket.
- *
- * <pre>
- * +----------+ To InputSocket +----------+
- * | From | SocketConnection \| To Node |
- * | Node *====================* |
- * | |\ | |
- * | | From OutputSocket +----------+
- * +----------+
- * </pre>
- * @ingroup Model
- * @see InputSocket
- * @see OutputSocket
- */
+ * @brief An SocketConnection is an connection between an InputSocket and an OutputSocket.
+ *
+ * <pre>
+ * +----------+ To InputSocket +----------+
+ * | From | SocketConnection \| To Node |
+ * | Node *====================* |
+ * | |\ | |
+ * | | From OutputSocket +----------+
+ * +----------+
+ * </pre>
+ * @ingroup Model
+ * @see InputSocket
+ * @see OutputSocket
+ */
class SocketConnection {
private:
/**
- * @brief Startpoint of the connection
- */
+ * @brief Startpoint of the connection
+ */
OutputSocket *fromSocket;
/**
- * @brief Endpoint of the connection
- */
+ * @brief Endpoint of the connection
+ */
InputSocket *toSocket;
/**
- * @brief has the resize already been done for this connection
- */
+ * @brief has the resize already been done for this connection
+ */
bool ignoreResizeCheck;
public:
SocketConnection();
/**
- * @brief set the startpoint of the connection
- * @param fromsocket
- */
+ * @brief set the startpoint of the connection
+ * @param fromsocket
+ */
void setFromSocket(OutputSocket *fromsocket);
/**
- * @brief get the startpoint of the connection
- * @return from OutputSocket
- */
+ * @brief get the startpoint of the connection
+ * @return from OutputSocket
+ */
OutputSocket *getFromSocket() const;
/**
- * @brief set the endpoint of the connection
- * @param tosocket
- */
+ * @brief set the endpoint of the connection
+ * @param tosocket
+ */
void setToSocket(InputSocket *tosocket);
/**
- * @brief get the endpoint of the connection
- * @return to InputSocket
- */
+ * @brief get the endpoint of the connection
+ * @return to InputSocket
+ */
InputSocket *getToSocket() const;
/**
- * @brief check if this connection is valid
- */
+ * @brief check if this connection is valid
+ */
bool isValid() const;
/**
- * @brief return the Node where this connection is connected from
- */
- NodeBase * getFromNode() const;
+ * @brief return the Node where this connection is connected from
+ */
+ NodeBase *getFromNode() const;
/**
- * @brief return the Node where this connection is connected to
- */
- NodeBase * getToNode() const;
+ * @brief return the Node where this connection is connected to
+ */
+ NodeBase *getToNode() const;
/**
- * @brief set, whether the resize has already been done for this SocketConnection
- */
- void setIgnoreResizeCheck(bool check) {this->ignoreResizeCheck = check;}
+ * @brief set, whether the resize has already been done for this SocketConnection
+ */
+ void setIgnoreResizeCheck(bool check) { this->ignoreResizeCheck = check; }
/**
- * @brief has the resize already been done for this SocketConnection
- */
- bool isIgnoreResizeCheck() const { return this->ignoreResizeCheck;}
+ * @brief has the resize already been done for this SocketConnection
+ */
+ bool isIgnoreResizeCheck() const { return this->ignoreResizeCheck; }
/**
- * @brief does this SocketConnection need resolution conversion
- * @note PreviewOperation's will be ignored
- * @note Already converted SocketConnection's will be ignored
- * @return needs conversion [true:false]
- */
+ * @brief does this SocketConnection need resolution conversion
+ * @note PreviewOperation's will be ignored
+ * @note Already converted SocketConnection's will be ignored
+ * @return needs conversion [true:false]
+ */
bool needsResolutionConversion() const;
};
diff --git a/source/blender/compositor/intern/COM_SocketReader.h b/source/blender/compositor/intern/COM_SocketReader.h
index 24322847517..3eb39e4bf02 100644
--- a/source/blender/compositor/intern/COM_SocketReader.h
+++ b/source/blender/compositor/intern/COM_SocketReader.h
@@ -33,43 +33,43 @@ typedef enum PixelSampler {
class MemoryBuffer;
/**
- * @brief Helper class for reading socket data.
- * Only use this class for dispatching (un-ary and n-ary) executions.
- * @ingroup Execution
- */
+ * @brief Helper class for reading socket data.
+ * Only use this class for dispatching (un-ary and n-ary) executions.
+ * @ingroup Execution
+ */
class SocketReader {
private:
protected:
/**
- * @brief Holds the width of the output of this operation.
- */
+ * @brief Holds the width of the output of this operation.
+ */
unsigned int width;
/**
- * @brief Holds the height of the output of this operation.
- */
+ * @brief Holds the height of the output of this operation.
+ */
unsigned int height;
/**
- * @brief calculate a single pixel
- * @note this method is called for non-complex
- * @param result is a float[4] array to store the result
- * @param x the x-coordinate of the pixel to calculate in image space
- * @param y the y-coordinate of the pixel to calculate in image space
- * @param inputBuffers chunks that can be read by their ReadBufferOperation.
- */
+ * @brief calculate a single pixel
+ * @note this method is called for non-complex
+ * @param result is a float[4] array to store the result
+ * @param x the x-coordinate of the pixel to calculate in image space
+ * @param y the y-coordinate of the pixel to calculate in image space
+ * @param inputBuffers chunks that can be read by their ReadBufferOperation.
+ */
virtual void executePixel(float *result, float x, float y, PixelSampler sampler, MemoryBuffer *inputBuffers[]) {}
/**
- * @brief calculate a single pixel
- * @note this method is called for complex
- * @param result is a float[4] array to store the result
- * @param x the x-coordinate of the pixel to calculate in image space
- * @param y the y-coordinate of the pixel to calculate in image space
- * @param inputBuffers chunks that can be read by their ReadBufferOperation.
- * @param chunkData chunk specific data a during execution time.
- */
+ * @brief calculate a single pixel
+ * @note this method is called for complex
+ * @param result is a float[4] array to store the result
+ * @param x the x-coordinate of the pixel to calculate in image space
+ * @param y the y-coordinate of the pixel to calculate in image space
+ * @param inputBuffers chunks that can be read by their ReadBufferOperation.
+ * @param chunkData chunk specific data a during execution time.
+ */
virtual void executePixel(float *result, int x, int y, MemoryBuffer *inputBuffers[], void *chunkData) {
executePixel(result, x, y, COM_PS_NEAREST, inputBuffers);
}
@@ -97,17 +97,15 @@ public:
executePixel(result, x, y, dx, dy, inputBuffers);
}
- virtual void *initializeTileData(rcti *rect, MemoryBuffer** memoryBuffers) {
- return 0;
- }
- virtual void deinitializeTileData(rcti *rect, MemoryBuffer** memoryBuffers, void *data) {
+ virtual void *initializeTileData(rcti *rect, MemoryBuffer **memoryBuffers) { return 0; }
+ virtual void deinitializeTileData(rcti *rect, MemoryBuffer **memoryBuffers, void *data) {
}
- virtual MemoryBuffer *getInputMemoryBuffer(MemoryBuffer** memoryBuffers) {return 0;}
+ virtual MemoryBuffer *getInputMemoryBuffer(MemoryBuffer **memoryBuffers) { return 0; }
- inline const unsigned int getWidth() const {return this->width;}
- inline const unsigned int getHeight() const {return this->height;}
+ inline const unsigned int getWidth() const { return this->width; }
+ inline const unsigned int getHeight() const { return this->height; }
};
#endif
diff --git a/source/blender/compositor/intern/COM_WorkPackage.h b/source/blender/compositor/intern/COM_WorkPackage.h
index 8bdf21499cf..18d83cc151c 100644
--- a/source/blender/compositor/intern/COM_WorkPackage.h
+++ b/source/blender/compositor/intern/COM_WorkPackage.h
@@ -28,37 +28,37 @@ class WorkPackage;
#include "COM_ExecutionGroup.h"
/**
- * @brief contains data about work that can be scheduled
- * @see WorkScheduler
- */
+ * @brief contains data about work that can be scheduled
+ * @see WorkScheduler
+ */
class WorkPackage {
private:
/**
- * @brief executionGroup with the operations-setup to be evaluated
- */
+ * @brief executionGroup with the operations-setup to be evaluated
+ */
ExecutionGroup *executionGroup;
/**
- * @brief number of the chunk to be executed
- */
+ * @brief number of the chunk to be executed
+ */
unsigned int chunkNumber;
public:
/**
- * @constructor
- * @param group the ExecutionGroup
- * @param chunkNumber the number of the chunk
- */
+ * @constructor
+ * @param group the ExecutionGroup
+ * @param chunkNumber the number of the chunk
+ */
WorkPackage(ExecutionGroup *group, unsigned int chunkNumber);
/**
- * @brief get the ExecutionGroup
- */
- ExecutionGroup *getExecutionGroup() const {return this->executionGroup;}
+ * @brief get the ExecutionGroup
+ */
+ ExecutionGroup *getExecutionGroup() const { return this->executionGroup; }
/**
- * @brief get the number of the chunk
- */
- unsigned int getChunkNumber() const {return this->chunkNumber;}
+ * @brief get the number of the chunk
+ */
+ unsigned int getChunkNumber() const { return this->chunkNumber; }
};
#endif
diff --git a/source/blender/compositor/intern/COM_WorkScheduler.h b/source/blender/compositor/intern/COM_WorkScheduler.h
index b03b514d139..e52e0295607 100644
--- a/source/blender/compositor/intern/COM_WorkScheduler.h
+++ b/source/blender/compositor/intern/COM_WorkScheduler.h
@@ -32,83 +32,83 @@ extern "C" {
#include "COM_Device.h"
/** @brief the workscheduler
- * @ingroup execution
- */
+ * @ingroup execution
+ */
class WorkScheduler {
#if COM_CURRENT_THREADING_MODEL == COM_TM_QUEUE
/**
- * @brief are we being stopped.
- */
+ * @brief are we being stopped.
+ */
static bool isStopping();
/**
- * @brief main thread loop for cpudevices
- * inside this loop new work is queried and being executed
- */
+ * @brief main thread loop for cpudevices
+ * inside this loop new work is queried and being executed
+ */
static void *thread_execute_cpu(void *data);
/**
- * @brief main thread loop for gpudevices
- * inside this loop new work is queried and being executed
- */
+ * @brief main thread loop for gpudevices
+ * inside this loop new work is queried and being executed
+ */
static void *thread_execute_gpu(void *data);
#endif
public:
/**
- * @brief schedule a chunk of a group to be calculated.
- * An execution group schedules a chunk in the WorkScheduler
- * when ExecutionGroup.isOpenCL is set the work will be handled by a OpenCLDevice
- * otherwide the work is scheduled for an CPUDevice
- * @see ExecutionGroup.execute
- * @param group the execution group
- * @param chunkNumber the number of the chunk in the group to be executed
- */
+ * @brief schedule a chunk of a group to be calculated.
+ * An execution group schedules a chunk in the WorkScheduler
+ * when ExecutionGroup.isOpenCL is set the work will be handled by a OpenCLDevice
+ * otherwide the work is scheduled for an CPUDevice
+ * @see ExecutionGroup.execute
+ * @param group the execution group
+ * @param chunkNumber the number of the chunk in the group to be executed
+ */
static void schedule(ExecutionGroup *group, int chunkNumber);
/**
- * @brief initialize the WorkScheduler
- *
- * during initialization the mutexes are initialized.
- * there are two mutexes (for every device type one)
- * After mutex initialization the system is queried in order to count the number of CPUDevices and GPUDevices to be created.
- * For every hardware thread a CPUDevice and for every OpenCL GPU device a OpenCLDevice is created.
- * these devices are stored in a separate list (cpudevices & gpudevices)
- */
+ * @brief initialize the WorkScheduler
+ *
+ * during initialization the mutexes are initialized.
+ * there are two mutexes (for every device type one)
+ * After mutex initialization the system is queried in order to count the number of CPUDevices and GPUDevices to be created.
+ * For every hardware thread a CPUDevice and for every OpenCL GPU device a OpenCLDevice is created.
+ * these devices are stored in a separate list (cpudevices & gpudevices)
+ */
static void initialize();
/**
- * @brief deinitialize the WorkScheduler
- * free all allocated resources
- */
+ * @brief deinitialize the WorkScheduler
+ * free all allocated resources
+ */
static void deinitialize();
/**
- * @brief Start the execution
- * this methods will start the WorkScheduler. Inside this method all threads are initialized.
- * for every device a thread is created.
- * @see initialize Initialization and query of the number of devices
- */
+ * @brief Start the execution
+ * this methods will start the WorkScheduler. Inside this method all threads are initialized.
+ * for every device a thread is created.
+ * @see initialize Initialization and query of the number of devices
+ */
static void start(CompositorContext &context);
/**
- * @brief stop the execution
- * All created thread by the start method are destroyed.
- * @see start
- */
+ * @brief stop the execution
+ * All created thread by the start method are destroyed.
+ * @see start
+ */
static void stop();
/**
- * @brief wait for all work to be completed.
- */
+ * @brief wait for all work to be completed.
+ */
static void finish();
/**
- * @brief Are there OpenCL capable GPU devices initialized?
- * the result of this method is stored in the CompositorContext
- * A node can generate a different operation tree when OpenCLDevices exists.
- * @see CompositorContext.getHasActiveOpenCLDevices
- */
+ * @brief Are there OpenCL capable GPU devices initialized?
+ * the result of this method is stored in the CompositorContext
+ * A node can generate a different operation tree when OpenCLDevices exists.
+ * @see CompositorContext.getHasActiveOpenCLDevices
+ */
static bool hasGPUDevices();
};
#endif