style cleanup: braces, compositor
authorCampbell Barton <ideasman42@gmail.com>
Thu, 17 May 2012 13:44:15 +0000 (13:44 +0000)
committerCampbell Barton <ideasman42@gmail.com>
Thu, 17 May 2012 13:44:15 +0000 (13:44 +0000)
108 files changed:
source/blender/compositor/intern/COM_CompositorContext.cpp
source/blender/compositor/intern/COM_Converter.cpp
source/blender/compositor/intern/COM_ExecutionGroup.cpp
source/blender/compositor/intern/COM_ExecutionSystem.cpp
source/blender/compositor/intern/COM_ExecutionSystemHelper.cpp
source/blender/compositor/intern/COM_InputSocket.cpp
source/blender/compositor/intern/COM_MemoryBuffer.cpp
source/blender/compositor/intern/COM_MemoryManager.cpp
source/blender/compositor/intern/COM_MemoryManagerState.cpp
source/blender/compositor/intern/COM_Node.cpp
source/blender/compositor/intern/COM_NodeBase.cpp
source/blender/compositor/intern/COM_NodeOperation.cpp
source/blender/compositor/intern/COM_OpenCLDevice.cpp
source/blender/compositor/intern/COM_OutputSocket.cpp
source/blender/compositor/intern/COM_SocketConnection.cpp
source/blender/compositor/intern/COM_WorkScheduler.cpp
source/blender/compositor/nodes/COM_AlphaOverNode.cpp
source/blender/compositor/nodes/COM_BlurNode.cpp
source/blender/compositor/nodes/COM_BokehBlurNode.cpp
source/blender/compositor/nodes/COM_ChannelMatteNode.cpp
source/blender/compositor/nodes/COM_ColorBalanceNode.cpp
source/blender/compositor/nodes/COM_ColorSpillNode.cpp
source/blender/compositor/nodes/COM_CombineRGBANode.cpp
source/blender/compositor/nodes/COM_ConvertAlphaNode.cpp
source/blender/compositor/nodes/COM_CropNode.cpp
source/blender/compositor/nodes/COM_DefocusNode.cpp
source/blender/compositor/nodes/COM_FilterNode.cpp
source/blender/compositor/nodes/COM_GroupNode.cpp
source/blender/compositor/nodes/COM_IDMaskNode.cpp
source/blender/compositor/nodes/COM_ImageNode.cpp
source/blender/compositor/nodes/COM_LensDistortionNode.cpp
source/blender/compositor/nodes/COM_MathNode.cpp
source/blender/compositor/nodes/COM_MovieClipNode.cpp
source/blender/compositor/nodes/COM_RenderLayersNode.cpp
source/blender/compositor/nodes/COM_SwitchNode.cpp
source/blender/compositor/nodes/COM_TimeNode.cpp
source/blender/compositor/nodes/COM_ViewLevelsNode.cpp
source/blender/compositor/nodes/COM_ZCombineNode.cpp
source/blender/compositor/operations/COM_AlphaOverKeyOperation.cpp
source/blender/compositor/operations/COM_AlphaOverMixedOperation.cpp
source/blender/compositor/operations/COM_AlphaOverPremultiplyOperation.cpp
source/blender/compositor/operations/COM_AntiAliasOperation.cpp
source/blender/compositor/operations/COM_BilateralBlurOperation.cpp
source/blender/compositor/operations/COM_BlurBaseOperation.cpp
source/blender/compositor/operations/COM_BokehBlurOperation.cpp
source/blender/compositor/operations/COM_BokehImageOperation.cpp
source/blender/compositor/operations/COM_BoxMaskOperation.cpp
source/blender/compositor/operations/COM_BrightnessOperation.cpp
source/blender/compositor/operations/COM_CalculateMeanOperation.cpp
source/blender/compositor/operations/COM_CalculateStandardDeviationOperation.cpp
source/blender/compositor/operations/COM_ChangeHSVOperation.cpp
source/blender/compositor/operations/COM_ChannelMatteOperation.cpp
source/blender/compositor/operations/COM_ChromaMatteOperation.cpp
source/blender/compositor/operations/COM_ColorCorrectionOperation.cpp
source/blender/compositor/operations/COM_ColorCurveOperation.cpp
source/blender/compositor/operations/COM_ColorMatteOperation.cpp
source/blender/compositor/operations/COM_ColorSpillOperation.cpp
source/blender/compositor/operations/COM_CompositorOperation.cpp
source/blender/compositor/operations/COM_ConvertDepthToRadiusOperation.cpp
source/blender/compositor/operations/COM_ConvertPremulToKeyOperation.cpp
source/blender/compositor/operations/COM_ConvertRGBToYCCOperation.cpp
source/blender/compositor/operations/COM_ConvertYCCToRGBOperation.cpp
source/blender/compositor/operations/COM_CropOperation.cpp
source/blender/compositor/operations/COM_DifferenceMatteOperation.cpp
source/blender/compositor/operations/COM_DilateErodeOperation.cpp
source/blender/compositor/operations/COM_DirectionalBlurOperation.cpp
source/blender/compositor/operations/COM_DistanceMatteOperation.cpp
source/blender/compositor/operations/COM_DoubleEdgeMaskOperation.cpp
source/blender/compositor/operations/COM_EllipseMaskOperation.cpp
source/blender/compositor/operations/COM_FastGaussianBlurOperation.cpp
source/blender/compositor/operations/COM_FlipOperation.cpp
source/blender/compositor/operations/COM_GaussianBokehBlurOperation.cpp
source/blender/compositor/operations/COM_GaussianXBlurOperation.cpp
source/blender/compositor/operations/COM_GaussianYBlurOperation.cpp
source/blender/compositor/operations/COM_ImageOperation.cpp
source/blender/compositor/operations/COM_InvertOperation.cpp
source/blender/compositor/operations/COM_LensGhostOperation.cpp
source/blender/compositor/operations/COM_LuminanceMatteOperation.cpp
source/blender/compositor/operations/COM_MapUVOperation.cpp
source/blender/compositor/operations/COM_MapValueOperation.cpp
source/blender/compositor/operations/COM_MathBaseOperation.cpp
source/blender/compositor/operations/COM_MixBaseOperation.cpp
source/blender/compositor/operations/COM_MixColorOperation.cpp
source/blender/compositor/operations/COM_MixDarkenOperation.cpp
source/blender/compositor/operations/COM_MixDivideOperation.cpp
source/blender/compositor/operations/COM_MixHueOperation.cpp
source/blender/compositor/operations/COM_MixLightenOperation.cpp
source/blender/compositor/operations/COM_MixOverlayOperation.cpp
source/blender/compositor/operations/COM_MixSaturationOperation.cpp
source/blender/compositor/operations/COM_MovieClipOperation.cpp
source/blender/compositor/operations/COM_MovieDistortionOperation.cpp
source/blender/compositor/operations/COM_MultilayerImageOperation.cpp
source/blender/compositor/operations/COM_OpenCLKernels.cl.cpp
source/blender/compositor/operations/COM_PreviewOperation.cpp
source/blender/compositor/operations/COM_ReadBufferOperation.cpp
source/blender/compositor/operations/COM_RenderLayersAlphaProg.cpp
source/blender/compositor/operations/COM_RenderLayersBaseProg.cpp
source/blender/compositor/operations/COM_RotateOperation.cpp
source/blender/compositor/operations/COM_ScreenLensDistortionOperation.cpp
source/blender/compositor/operations/COM_SetVectorOperation.cpp
source/blender/compositor/operations/COM_SplitViewerOperation.cpp
source/blender/compositor/operations/COM_TextureOperation.cpp
source/blender/compositor/operations/COM_VariableSizeBokehBlurOperation.cpp
source/blender/compositor/operations/COM_VectorBlurOperation.cpp
source/blender/compositor/operations/COM_ViewerBaseOperation.cpp
source/blender/compositor/operations/COM_ViewerOperation.cpp
source/blender/compositor/operations/COM_WriteBufferOperation.cpp
source/blender/compositor/operations/COM_ZCombineOperation.cpp

index dbb05d4f493fc078ae637963d3e5b1922577b2ac..abab4edfc3fc610819651dbd1d10d54ee12f6e0c 100644 (file)
@@ -33,7 +33,8 @@ CompositorContext::CompositorContext() {
 const int CompositorContext::getFramenumber() const {
        if (this->scene) {
                return this->scene->r.cfra;
-       } else {
+       }
+       else {
                return -1; /* this should never happen */
        }
 }
@@ -41,7 +42,8 @@ const int CompositorContext::getFramenumber() const {
 const int CompositorContext::isColorManaged() const {
        if (this->scene) {
                return this->scene->r.color_mgt_flag & R_COLOR_MANAGEMENT;
-       } else {
+       }
+       else {
                return 0; /* this should never happen */
        }
 }
index 56b1da97df8afd339d893ab5a149a6b294f754fd..ac57bf1cadcab9ebdd7fe63e24f381912a43ad66 100644 (file)
@@ -361,15 +361,20 @@ void Converter::convertDataType(SocketConnection* connection, ExecutionSystem *s
        NodeOperation * converter = NULL;
        if (fromDatatype == COM_DT_VALUE && toDatatype == COM_DT_COLOR) {
                converter = new ConvertValueToColourProg();
-       } else if (fromDatatype == COM_DT_VALUE && toDatatype == COM_DT_VECTOR) {
+       }
+       else if (fromDatatype == COM_DT_VALUE && toDatatype == COM_DT_VECTOR) {
                converter = new ConvertValueToVectorOperation();
-       } else if (fromDatatype == COM_DT_COLOR && toDatatype == COM_DT_VALUE) {
+       }
+       else if (fromDatatype == COM_DT_COLOR && toDatatype == COM_DT_VALUE) {
                converter = new ConvertColourToValueProg();
-       } else if (fromDatatype == COM_DT_COLOR && toDatatype == COM_DT_VECTOR) {
+       }
+       else if (fromDatatype == COM_DT_COLOR && toDatatype == COM_DT_VECTOR) {
                converter = new ConvertColorToVectorOperation();
-       } else if (fromDatatype == COM_DT_VECTOR && toDatatype == COM_DT_VALUE) {
+       }
+       else if (fromDatatype == COM_DT_VECTOR && toDatatype == COM_DT_VALUE) {
                converter = new ConvertVectorToValueOperation();
-       } else if (fromDatatype == COM_DT_VECTOR && toDatatype == COM_DT_COLOR) {
+       }
+       else if (fromDatatype == COM_DT_VECTOR && toDatatype == COM_DT_COLOR) {
                converter = new ConvertVectorToColorOperation();
        }
        if (converter != NULL) {
@@ -418,7 +423,8 @@ void Converter::convertResolution(SocketConnection *connection, ExecutionSystem
                scaleY = toHeight/fromHeight;
                if (scaleX < scaleY) {
                        scaleX = scaleY;
-               } else {
+               }
+               else {
                        scaleY = scaleX;
                }
                break;
@@ -435,7 +441,7 @@ void Converter::convertResolution(SocketConnection *connection, ExecutionSystem
                NodeOperation *first = NULL;
                SocketConnection *c;
                ScaleOperation * scaleOperation = NULL;
-               if(doScale) {
+               if (doScale) {
                        scaleOperation = new ScaleOperation();
                        first = scaleOperation;
                        SetValueOperation * sxop = new SetValueOperation();
index 22d4366a1a8d1dcfd2c17759875f5c9917a8e3a3..bce31658a8dfde9ee7633e23830167ded272e728 100644 (file)
@@ -83,7 +83,8 @@ bool ExecutionGroup::canContainOperation(NodeOperation* operation) {
 
        if (!this->isComplex()) {
                return (!operation->isComplex());
-       } else {
+       }
+       else {
                return false;
        }
 }
@@ -101,7 +102,8 @@ void ExecutionGroup::addOperation(ExecutionSystem *system, NodeOperation *operat
                        ReadBufferOperation* readOperation = (ReadBufferOperation*)operation;
                        WriteBufferOperation* writeOperation = readOperation->getMemoryProxy()->getWriteBufferOperation();
                        this->addOperation(system, writeOperation);
-               } else {
+               }
+               else {
                        unsigned int index;
                        for (index = 0 ; index < operation->getNumberOfInputSockets(); index ++) {
                                InputSocket * inputSocket = operation->getInputSocket(index);
@@ -111,7 +113,8 @@ void ExecutionGroup::addOperation(ExecutionSystem *system, NodeOperation *operat
                                }
                        }
                }
-       } else {
+       }
+       else {
                if (operation->isWriteBufferOperation()) {
                        WriteBufferOperation * writeoperation = (WriteBufferOperation*)operation;
                        if (writeoperation->getMemoryProxy()->getExecutor() == NULL) {
@@ -124,7 +127,7 @@ void ExecutionGroup::addOperation(ExecutionSystem *system, NodeOperation *operat
        }
 }
 
-NodeOperation* ExecutionGroup::getOutputNodeOperation() const{
+NodeOperation* ExecutionGroup::getOutputNodeOperation() const {
        return this->operations[0]; // the first operation of the group is always the output operation.
 }
 
@@ -328,11 +331,13 @@ void ExecutionGroup::execute(ExecutionSystem* graph) {
                                finished=false;
                                startEvaluated = true;
                                numberEvaluated++;
-                       } else if (state == COM_ES_SCHEDULED) {
+                       }
+                       else if (state == COM_ES_SCHEDULED) {
                                finished=false;
                                startEvaluated = true;
                                numberEvaluated++;
-                       } else if (state == COM_ES_EXECUTED && !startEvaluated) {
+                       }
+                       else if (state == COM_ES_EXECUTED && !startEvaluated) {
                                startIndex = index+1;
                        }
                }
@@ -533,7 +538,8 @@ bool ExecutionGroup::scheduleChunkWhenPossible(ExecutionSystem * graph, int xChu
                        if (!group->scheduleAreaWhenPossible(graph, &area)) {
                                canBeExecuted = false;
                        }
-               } else {
+               }
+               else {
                        throw "ERROR";
                }
        }
index d82d725d234a867a3d53bf14338016db71d317d6..b66a6a036b59237c986ff5dcb28c4712eaa4b1dc 100644 (file)
@@ -46,7 +46,8 @@ ExecutionSystem::ExecutionSystem(bNodeTree* editingtree, bool rendering) {
        /* initialize the CompositorContext */
        if (rendering) {
                context.setQuality((CompositorQuality)editingtree->render_quality);
-       } else {
+       }
+       else {
                context.setQuality((CompositorQuality)editingtree->edit_quality);
        }
        context.setRendering(rendering);
@@ -77,22 +78,22 @@ ExecutionSystem::ExecutionSystem(bNodeTree* editingtree, bool rendering) {
 
 ExecutionSystem::~ExecutionSystem() {
        unsigned int index;
-       for(index = 0; index < this->connections.size(); index++) {
+       for (index = 0; index < this->connections.size(); index++) {
                SocketConnection* connection = this->connections[index];
                delete connection;
        }
        this->connections.clear();
-       for(index = 0; index < this->nodes.size(); index++) {
+       for (index = 0; index < this->nodes.size(); index++) {
                Node* node = this->nodes[index];
                delete node;
        }
        this->nodes.clear();
-       for(index = 0; index < this->operations.size(); index++) {
+       for (index = 0; index < this->operations.size(); index++) {
                NodeOperation* operation = this->operations[index];
                delete operation;
        }
        this->operations.clear();
-       for(index = 0; index < this->groups.size(); index++) {
+       for (index = 0; index < this->groups.size(); index++) {
                ExecutionGroup* group = this->groups[index];
                delete group;
        }
@@ -101,7 +102,7 @@ ExecutionSystem::~ExecutionSystem() {
 
 void ExecutionSystem::execute() {
        unsigned int order = 0;
-       for( vector<NodeOperation*>::iterator iter = this->operations.begin(); iter != operations.end(); ++iter ) {
+       for ( vector<NodeOperation*>::iterator iter = this->operations.begin(); iter != operations.end(); ++iter ) {
                NodeBase* node = *iter;
                NodeOperation *operation = (NodeOperation*) node;
                if (operation->isReadBufferOperation()) {
@@ -214,7 +215,7 @@ void ExecutionSystem::convertToOperations() {
        unsigned int index;
        // first determine data types of the nodes, this can be used by the node to convert to a different operation system
        this->determineActualSocketDataTypes((vector<NodeBase*>&)this->nodes);
-       for(index = 0; index < this->nodes.size(); index++) {
+       for (index = 0; index < this->nodes.size(); index++) {
                Node* node = (Node*)this->nodes[index];
                node->convertToOperations(this, &this->context);
        }
@@ -258,14 +259,14 @@ void ExecutionSystem::groupOperations() {
        NodeOperation * operation;
        unsigned int index;
        // surround complex operations with ReadBufferOperation and WriteBufferOperation
-       for(index = 0; index < this->operations.size(); index++) {
+       for (index = 0; index < this->operations.size(); index++) {
                operation = this->operations[index];
                if (operation->isComplex()) {
                        this->addReadWriteBufferOperations(operation);
                }
        }
        ExecutionSystemHelper::findOutputNodeOperations(&outputOperations, this->getOperations(), this->context.isRendering());
-       for( vector<NodeOperation*>::iterator iter = outputOperations.begin(); iter != outputOperations.end(); ++iter ) {
+       for ( vector<NodeOperation*>::iterator iter = outputOperations.begin(); iter != outputOperations.end(); ++iter ) {
                operation = *iter;
                ExecutionGroup *group = new ExecutionGroup();
                group->addOperation(this, operation);
@@ -283,7 +284,7 @@ void ExecutionSystem::addSocketConnection(SocketConnection *connection)
 void ExecutionSystem::determineActualSocketDataTypes(vector<NodeBase*> &nodes) {
        unsigned int index;
        /* first do all input nodes */
-       for(index = 0; index < nodes.size(); index++) {
+       for (index = 0; index < nodes.size(); index++) {
                NodeBase* node = nodes[index];
                if (node->isInputNode()) {
                        node->determineActualSocketDataTypes();
@@ -291,7 +292,7 @@ void ExecutionSystem::determineActualSocketDataTypes(vector<NodeBase*> &nodes) {
        }
 
        /* then all other nodes */
-       for(index = 0; index < nodes.size(); index++) {
+       for (index = 0; index < nodes.size(); index++) {
                NodeBase* node = nodes[index];
                if (!node->isInputNode()) {
                        node->determineActualSocketDataTypes();
index d6b03b41105a3a6f6eb28af0866932756e248e7c..4a739ba6a9def355b93603d894f01efacc5e24f4 100644 (file)
@@ -107,13 +107,14 @@ void ExecutionSystemHelper::findOutputNodeOperations(vector<NodeOperation*>* res
 
 static InputSocket* find_input(NodeRange &node_range, bNode *bnode, bNodeSocket* bsocket) {
        if (bnode != NULL) {
-               for(NodeIterator it=node_range.first; it!=node_range.second; ++it) {
+               for (NodeIterator it=node_range.first; it!=node_range.second; ++it) {
                        Node* node = *it;
                        if (node->getbNode() == bnode)
                                return node->findInputSocketBybNodeSocket(bsocket);
                }
-       } else {
-               for(NodeIterator it=node_range.first; it!=node_range.second; ++it) {
+       }
+       else {
+               for (NodeIterator it=node_range.first; it!=node_range.second; ++it) {
                        Node* node = *it;
                        if (node->isProxyNode()) {
                                InputSocket *proxySocket = node->getInputSocket(0);
@@ -126,13 +127,14 @@ static InputSocket* find_input(NodeRange &node_range, bNode *bnode, bNodeSocket*
 }
 static OutputSocket* find_output(NodeRange &node_range, bNode *bnode, bNodeSocket* bsocket) {
        if (bnode != NULL) {
-               for(NodeIterator it=node_range.first; it!=node_range.second; ++it) {
+               for (NodeIterator it=node_range.first; it!=node_range.second; ++it) {
                        Node* node = *it;
                        if (node->getbNode() == bnode)
                                return node->findOutputSocketBybNodeSocket(bsocket);
                }
-       } else {
-               for(NodeIterator it=node_range.first; it!=node_range.second; ++it) {
+       }
+       else {
+               for (NodeIterator it=node_range.first; it!=node_range.second; ++it) {
                        Node* node = *it;
                        if (node->isProxyNode()) {
                                OutputSocket *proxySocket = node->getOutputSocket(0);
@@ -146,7 +148,7 @@ static OutputSocket* find_output(NodeRange &node_range, bNode *bnode, bNodeSocke
 SocketConnection* ExecutionSystemHelper::addNodeLink(NodeRange &node_range, vector<SocketConnection*>& links, bNodeLink *bNodeLink) {
        /// @note: cyclic lines will be ignored. This has been copied from node.c
        if (bNodeLink->tonode != 0 && bNodeLink->fromnode != 0) {
-               if(!(bNodeLink->fromnode->level >= bNodeLink->tonode->level && bNodeLink->tonode->level!=0xFFF)) { // only add non cyclic lines! so execution will procede
+               if (!(bNodeLink->fromnode->level >= bNodeLink->tonode->level && bNodeLink->tonode->level!=0xFFF)) { // only add non cyclic lines! so execution will procede
                        return NULL;
                }
        }
@@ -221,15 +223,20 @@ void ExecutionSystemHelper::debugDump(ExecutionSystem* system) {
                }
                if (operation->isViewerOperation()) {
                        printf("Viewer");
-               } else if (operation->isOutputOperation(system->getContext().isRendering())) {
+               }
+               else if (operation->isOutputOperation(system->getContext().isRendering())) {
                        printf("Output");
-               } else if (operation->isSetOperation()) {
+               }
+               else if (operation->isSetOperation()) {
                        printf("Set");
-               } else if (operation->isReadBufferOperation()) {
+               }
+               else if (operation->isReadBufferOperation()) {
                        printf("ReadBuffer");
-               } else if (operation->isWriteBufferOperation()) {
+               }
+               else if (operation->isWriteBufferOperation()) {
                        printf("WriteBuffer");
-               } else {
+               }
+               else {
                        printf("O_%p", operation);
                }
                tot2 = operation->getNumberOfOutputSockets();
@@ -287,7 +294,8 @@ void ExecutionSystemHelper::debugDump(ExecutionSystem* system) {
                printf("\t\"O_%p\":\"OUT_%p\" -> \"O_%p\":\"IN_%p\"", connection->getFromNode(), connection->getFromSocket(), connection->getToNode(), connection->getToSocket());
                if (!connection->isValid()) {
                        printf(" [color=red]");
-               } else {
+               }
+               else {
                        switch (connection->getFromSocket()->getActualDataType()) {
                        case COM_DT_VALUE:
                                printf(" [color=grey]");
index 9596d5b73b022a2f933054dd7c27edde57ea39e9..8428544cbc26fdd9450c1fa7c68342618471848a 100644 (file)
@@ -48,9 +48,10 @@ void InputSocket::setConnection(SocketConnection *connection) {
 SocketConnection* InputSocket::getConnection() {return this->connection;}
 
 void InputSocket::determineResolution(unsigned int resolution[],unsigned int preferredResolution[]) {
-       if (this->isConnected()){
+       if (this->isConnected()) {
                this->connection->getFromSocket()->determineResolution(resolution, preferredResolution);
-       } else {
+       }
+       else {
                return;
        }
 }
@@ -67,19 +68,24 @@ DataType InputSocket::convertToSupportedDataType(DataType datatype) {
        if (datatype == COM_DT_VALUE) {
                if (candoColor) {
                        return COM_DT_COLOR;
-               } else if (candoVector) {
+               }
+               else if (candoVector) {
                        return COM_DT_VECTOR;
                }
-       } else if (datatype == COM_DT_VECTOR) {
+       }
+       else if (datatype == COM_DT_VECTOR) {
                if (candoColor) {
                        return COM_DT_COLOR;
-               } else if (candoValue) {
+               }
+               else if (candoValue) {
                        return COM_DT_VALUE;
                }
-       } else if (datatype == COM_DT_COLOR) {
+       }
+       else if (datatype == COM_DT_COLOR) {
                if (candoVector) {
                        return COM_DT_VECTOR;
-               } else if (candoValue) {
+               }
+               else if (candoValue) {
                        return COM_DT_VALUE;
                }
        }
@@ -115,7 +121,8 @@ void InputSocket::relinkConnections(InputSocket *relinkToSocket) {
 void InputSocket::relinkConnections(InputSocket *relinkToSocket, bool autoconnect, int editorNodeInputSocketIndex, bool duplicate, ExecutionSystem* graph) {
        if (!duplicate) {
                this->relinkConnections(relinkToSocket, autoconnect, editorNodeInputSocketIndex, graph);
-       } else {
+       }
+       else {
                if (!this->isConnected() && autoconnect) {
                        Node* node = (Node*)this->getNode();
                        switch (this->getActualDataType()) {
@@ -170,7 +177,8 @@ void InputSocket::relinkConnections(InputSocket *relinkToSocket, bool autoconnec
 const ChannelInfo* InputSocket::getChannelInfo(const int channelnumber) {
        if (this->isConnected() && this->connection->getFromSocket()) {
                return this->connection->getFromSocket()->getChannelInfo(channelnumber);
-       } else {
+       }
+       else {
                return NULL;
        }
 }
@@ -191,7 +199,8 @@ SocketReader* InputSocket::getReader() {
 NodeOperation* InputSocket::getOperation() const {
        if (isConnected()) {
                return (NodeOperation*)this->connection->getFromSocket()->getNode();
-       } else {
+       }
+       else {
                return NULL;
        }
 }
index 53357b8ec506f2797755af8b8379512032c1ab9a..bfa206562771a07c28e877b44a68a14bbbe91543 100644 (file)
@@ -247,7 +247,7 @@ static void imp2radangle(float A, float B, float C, float F, float* a, float* b,
        }
 }
 
-float clipuv(float x, float limit){
+float clipuv(float x, float limit) {
        x = (x < 0) ? 0 : ((x >= limit) ? (limit - 1) : x);
        return x;
 }
index fa587e8c7d684196608662f2c563e1d627009224..661afb20d53bfcf06509498da451df017a9cb422 100644 (file)
@@ -46,7 +46,7 @@ void MemoryManager::addMemoryProxy(MemoryProxy *memoryProxy) {
                memoryProxy->setState(state);
        }
 }
-MemoryBuffer* MemoryManager::getMemoryBuffer(MemoryProxy *id, unsigned int chunkNumber){
+MemoryBuffer* MemoryManager::getMemoryBuffer(MemoryProxy *id, unsigned int chunkNumber) {
        MemoryManagerState * state = MemoryManager::getState(id);
        if (!state) {
                return NULL;
index 56946c3f0f26ee59bf0a1e788a16c79efa3ceb97..620092b2825f79fdfed6208e398e560f2b7749b1 100644 (file)
@@ -36,7 +36,7 @@ MemoryProxy * MemoryManagerState::getMemoryProxy() {
 MemoryManagerState::~MemoryManagerState() {
        this->memoryProxy = NULL;
        unsigned int index;
-       for (index = 0 ; index < this->currentSize; index ++){
+       for (index = 0 ; index < this->currentSize; index ++) {
                MemoryBuffer* buffer = this->chunkBuffers[index];
                if (buffer) {
                        delete buffer;
@@ -69,7 +69,8 @@ void MemoryManagerState::addMemoryBuffer(MemoryBuffer *buffer) {
        
        if (this->chunkBuffers[chunkNumber] == NULL) {
                this->chunkBuffers[chunkNumber] = buffer;
-       } else {
+       }
+       else {
                throw "ALREADY ALLOCATED!";
        }
        BLI_mutex_unlock(&this->mutex);
@@ -77,7 +78,7 @@ void MemoryManagerState::addMemoryBuffer(MemoryBuffer *buffer) {
 
 MemoryBuffer* MemoryManagerState::getMemoryBuffer(unsigned int chunkNumber) {
        MemoryBuffer* result = NULL;
-       if (chunkNumber< this->currentSize){
+       if (chunkNumber< this->currentSize) {
                result = this->chunkBuffers[chunkNumber];
                if (result) {
                        return result;
@@ -85,7 +86,7 @@ MemoryBuffer* MemoryManagerState::getMemoryBuffer(unsigned int chunkNumber) {
        }
        
        BLI_mutex_lock(&this->mutex);
-       if (chunkNumber< this->currentSize){
+       if (chunkNumber< this->currentSize) {
                result = this->chunkBuffers[chunkNumber];
        }
        
index 2587eaa5195adf64c31b7049ba60031db2b176d9..4e127c61d4e156c8340dfa44beb539841ae3bac7 100644 (file)
@@ -52,7 +52,7 @@ Node::Node(bNode* editorNode, bool create_sockets) {
                        input = (bNodeSocket*)input->next;
                }
                bNodeSocket *output = (bNodeSocket*)editorNode->outputs.first;
-               while(output != NULL) {
+               while (output != NULL) {
                        DataType dt = COM_DT_VALUE;
                        if (output->type == SOCK_RGBA) dt = COM_DT_COLOR;
                        if (output->type == SOCK_VECTOR) dt = COM_DT_VECTOR;
index 6e6be889572d5f11dcf27a8cf534ee3f467b302b..b6990ec0d79f580b7038a51d62368e70c96a8568 100644 (file)
@@ -33,7 +33,7 @@ NodeBase::NodeBase() {
 }
 
 
-NodeBase::~NodeBase(){
+NodeBase::~NodeBase() {
        while (!this->outputsockets.empty()) {
                delete (this->outputsockets.back());
                this->outputsockets.pop_back();
@@ -101,7 +101,8 @@ DataType NodeBase::determineActualDataType(OutputSocket *outputsocket) {
        const int inputIndex = outputsocket->getInputSocketDataTypeDeterminatorIndex();
        if (inputIndex != -1) {
                return this->getInputSocket(inputIndex)->getActualDataType();
-       } else {
+       }
+       else {
                return outputsocket->getDataType();
        }
 }
index b02bcb6676ed76a6865f7638f386da503a645ef4..71aaceb1b48e4418fa9c960c7b6053f8e274e036 100644 (file)
@@ -95,7 +95,8 @@ bool NodeOperation::determineDependingAreaOfInterest(rcti * input, ReadBufferOpe
        if (this->isInputNode()) {
                BLI_init_rcti(output, input->xmin, input->xmax, input->ymin, input->ymax);
                return false;
-       } else {
+       }
+       else {
                unsigned int index;
                vector<InputSocket*> &inputsockets = this->getInputSockets();
        
index acf3bf3789dde43d53249cbcc410de212e90b3fa..b986865ecf3fc3f59d2929a6ff595da6a04cfb35 100644 (file)
 #include "COM_WorkScheduler.h"
 
 
-OpenCLDevice::OpenCLDevice(cl_context context, cl_device_id device, cl_program program){
+OpenCLDevice::OpenCLDevice(cl_context context, cl_device_id device, cl_program program) {
        this->device = device;
        this->context = context;
        this->program = program;
        this->queue = NULL;
 }
 
-bool OpenCLDevice::initialize(){
+bool OpenCLDevice::initialize() {
        cl_int error;
        queue = clCreateCommandQueue(context, device, 0, &error);
        return false;
 }
 
-void OpenCLDevice::deinitialize(){
-       if(queue){
+void OpenCLDevice::deinitialize() {
+       if (queue) {
                clReleaseCommandQueue(queue);
        }
 }
index a262ad5f6ea11b6c897faf156b4db2272d7785a4..5380a7ec49224a1c1a54e5fe5c550ac2770da465 100644 (file)
@@ -98,7 +98,8 @@ void OutputSocket::relinkConnections(OutputSocket *relinkToSocket, bool single)
                        relinkToSocket->addConnection(connection);
 //                     relinkToSocket->setActualDataType(this->getActualDataType());
                        this->connections.erase(this->connections.begin());
-               } else {
+               }
+               else {
                        unsigned int index;
                        for (index = 0 ; index < this->connections.size();index ++) {
                                SocketConnection *connection = this->connections[index];
index 6c6c673501ad90cbfaa102079df935bef3bb5c59..e3e52005add623085e4cb91f28c89f7b49e47915 100644 (file)
@@ -29,7 +29,7 @@ SocketConnection::SocketConnection() {
        this->setIgnoreResizeCheck(false);
 }
 
-void SocketConnection::setFromSocket(OutputSocket* fromsocket){
+void SocketConnection::setFromSocket(OutputSocket* fromsocket) {
        if (fromsocket == NULL) {
                throw "ERROR";
        }
@@ -49,14 +49,16 @@ InputSocket* SocketConnection::getToSocket() const {return this->toSocket;}
 NodeBase* SocketConnection::getFromNode() const {
        if (this->getFromSocket() == NULL) {
                return NULL;
-       } else {
+       }
+       else {
                return this->getFromSocket()->getNode();
        }
 }
 NodeBase* SocketConnection::getToNode() const {
        if (this->getToSocket() == NULL) {
                return NULL;
-       } else {
+       }
+       else {
                return this->getToSocket()->getNode();
        }
 }
index e7c1e00dd961164aefc1ac8661146cb025c0aa45..5130525853bb3e082b288204dceb14d87984c704 100644 (file)
@@ -114,9 +114,10 @@ void WorkScheduler::schedule(ExecutionGroup *group, int chunkNumber) {
        delete package;
 #elif COM_CURRENT_THREADING_MODEL == COM_TM_QUEUE
 #ifdef COM_OPENCL_ENABLED
-       if (group->isOpenCL() && openclActive){
+       if (group->isOpenCL() && openclActive) {
                BLI_thread_queue_push(gpuqueue, package);
-       } else{
+       }
+       else {
                BLI_thread_queue_push(cpuqueue, package);
        }
 #else
@@ -145,7 +146,8 @@ void WorkScheduler::start(CompositorContext &context) {
                        BLI_insert_thread(&gputhreads, device);
                }
                openclActive = true;
-       } else {
+       }
+       else {
                openclActive = false;
        }
 #endif
@@ -159,7 +161,8 @@ void WorkScheduler::finish() {
                while (BLI_thread_queue_size(gpuqueue) + BLI_thread_queue_size(cpuqueue) > 0) {
                        PIL_sleep_ms(10);
                }
-       } else {
+       }
+       else {
                while (BLI_thread_queue_size(cpuqueue) > 0) {
                        PIL_sleep_ms(10);
                }
@@ -286,14 +289,14 @@ void WorkScheduler::initialize() {
 void WorkScheduler::deinitialize() {
 #if COM_CURRENT_THREADING_MODEL == COM_TM_QUEUE
        Device* device;
-       while(cpudevices.size()>0) {
+       while (cpudevices.size()>0) {
                device = cpudevices.back();
                cpudevices.pop_back();
                device->deinitialize();
                delete device;
        }
 #ifdef COM_OPENCL_ENABLED
-       while(gpudevices.size()>0) {
+       while (gpudevices.size()>0) {
                device = gpudevices.back();
                gpudevices.pop_back();
                device->deinitialize();
index 7cd26bc79b757f0370b1d34f0d26cfdbdfe6cc1c..23acaee7b9398fa1a79d3017b9f4834dc9d8dccc 100644 (file)
@@ -45,18 +45,22 @@ void AlphaOverNode::convertToOperations(ExecutionSystem *graph, CompositorContex
                mixOperation->setX(ntf->x);
                convertProg = mixOperation;
        
-       } else if (editorNode->custom1) {
+       }
+       else if (editorNode->custom1) {
                convertProg = new AlphaOverKeyOperation();
-       } else {
+       }
+       else {
                convertProg = new AlphaOverPremultiplyOperation();
        }
        
        convertProg->setUseValueAlphaMultiply(false);
        if (color1Socket->isConnected()) {
                convertProg->setResolutionInputSocketIndex(1);
-       } else if (color2Socket->isConnected()) {
+       }
+       else if (color2Socket->isConnected()) {
                convertProg->setResolutionInputSocketIndex(2);
-       } else {
+       }
+       else {
                convertProg->setResolutionInputSocketIndex(0);
        }
        valueSocket->relinkConnections(convertProg->getInputSocket(0), true, 0, graph);
index 8c1923b32362c07fed43106b1aa836220653859a..5e29650a5ca68b79ee792fb8e9704af6095e7fa9 100644 (file)
@@ -53,7 +53,8 @@ void BlurNode::convertToOperations(ExecutionSystem *graph, CompositorContext * c
                this->getOutputSocket(0)->relinkConnections(operationfgb->getOutputSocket(0));
                graph->addOperation(operationfgb);
                addPreviewOperation(graph, operationfgb->getOutputSocket(), 5);
-       }else if (!data->bokeh) {
+       }
+       else if (!data->bokeh) {
                GaussianXBlurOperation *operationx = new GaussianXBlurOperation();
                operationx->setData(data);
                operationx->setQuality(quality);
@@ -68,7 +69,8 @@ void BlurNode::convertToOperations(ExecutionSystem *graph, CompositorContext * c
                addLink(graph, operationx->getOutputSocket(), operationy->getInputSocket(0));
                addLink(graph, operationx->getInputSocket(1)->getConnection()->getFromSocket(), operationy->getInputSocket(1));
                addPreviewOperation(graph, operationy->getOutputSocket(), 5);
-       } else {
+       }
+       else {
                GaussianBokehBlurOperation *operation = new GaussianBokehBlurOperation();
                operation->setData(data);
                this->getInputSocket(0)->relinkConnections(operation->getInputSocket(0), true, 0, graph);
index c40bcab3ffb67d320f978088490418ebdbdd06fe..68e9b067f0799bb731d7ad4c98181be719ee9ff7 100644 (file)
@@ -50,7 +50,8 @@ void BokehBlurNode::convertToOperations(ExecutionSystem *graph, CompositorContex
                graph->addOperation(operation);
                graph->addOperation(converter);
                this->getOutputSocket(0)->relinkConnections(operation->getOutputSocket());
-       } else {
+       }
+       else {
                BokehBlurOperation *operation = new BokehBlurOperation();
                this->getInputSocket(0)->relinkConnections(operation->getInputSocket(0), true, 0, graph);
                this->getInputSocket(1)->relinkConnections(operation->getInputSocket(1), true, 1, graph);
index bf3def056436c5514e6db06ee7bd451a078d7828..9ab6c6250db417d08a06bfee762a531d0b27ce54 100644 (file)
@@ -39,7 +39,7 @@ void ChannelMatteNode::convertToOperations(ExecutionSystem *graph, CompositorCon
        bNode* node = this->getbNode();
 
        /* colorspace */
-       switch(node->custom1) {
+       switch (node->custom1) {
        case CMP_NODE_CHANNEL_MATTE_CS_RGB:
                break;
        case CMP_NODE_CHANNEL_MATTE_CS_HSV: /*HSV*/
index 73d10d4b1ca985e91c0036c27f5ee6b028ccd0ca..8d5e8a2788eac97172f71523fc09118ff3a216e0 100644 (file)
@@ -53,7 +53,8 @@ void ColorBalanceNode::convertToOperations(ExecutionSystem *graph, CompositorCon
                operationLGG->setLift(n->lift_lgg);
                operationLGG->setGammaInv(n->gamma_inv);
                operation = operationLGG;
-       } else {
+       }
+       else {
                ColorBalanceASCCDLOperation *operationCDL = new ColorBalanceASCCDLOperation();
                operationCDL->setGain(n->gain);
                operationCDL->setLift(n->lift);
index 011a2cb12cc4700a27367ba15fe650b20f4802d6..5935167d88e68d06bc915745a71e60fbc1ea051a 100644 (file)
@@ -39,7 +39,8 @@ void ColorSpillNode::convertToOperations(ExecutionSystem *graph, CompositorConte
        if (editorsnode->custom2 == 0) {
                // Simple color spill
                operation = new ColorSpillOperation();
-       } else {
+       }
+       else {
                // Average color spill
                operation = new ColorSpillAverageOperation();
        }
index 8a1a34589a50946741287dcfece4fdbbed98041d..6bef0441e5ec977a75bf68dad6056ca0f8a1a81e 100644 (file)
@@ -43,11 +43,14 @@ void CombineRGBANode::convertToOperations(ExecutionSystem *graph, CompositorCont
        CombineChannelsOperation *operation = new CombineChannelsOperation();
        if (inputRSocket->isConnected()) {
                operation->setResolutionInputSocketIndex(0);
-       } else if (inputGSocket->isConnected()) {
+       }
+       else if (inputGSocket->isConnected()) {
                operation->setResolutionInputSocketIndex(1);
-       } else if (inputBSocket->isConnected()) {
+       }
+       else if (inputBSocket->isConnected()) {
                operation->setResolutionInputSocketIndex(2);
-       } else {
+       }
+       else {
                operation->setResolutionInputSocketIndex(3);
        }
        inputRSocket->relinkConnections(operation->getInputSocket(0), true, 0, graph);
index 4e20b3a5d3abcececb51123cdc9b04443109537a..775fa1ad0fdf55f4e927236914da0c0e3e5c89b6 100644 (file)
@@ -29,7 +29,7 @@ void ConvertAlphaNode::convertToOperations(ExecutionSystem *graph, CompositorCon
        bNode* node = this->getbNode();
 
        /* value hardcoded in rna_nodetree.c */
-       if (node->custom1 == 1){
+       if (node->custom1 == 1) {
                operation = new ConvertPremulToKeyOperation();
        }
        else {
index fdbb1529c604b18d5f63da6ebea1e00e25fffa62..9d48922d0d659cd4a4a36a2d5083cc015b9ff87a 100644 (file)
 CropNode::CropNode(bNode *editorNode) : Node(editorNode) {
 }
 
-void CropNode::convertToOperations(ExecutionSystem *graph, CompositorContext * context){
+void CropNode::convertToOperations(ExecutionSystem *graph, CompositorContext * context) {
        bNode* node = getbNode();
        NodeTwoXYs *cropSettings = (NodeTwoXYs*)node->storage;
        bool relative = (bool)node->custom2;
        bool cropImage = (bool)node->custom1;
        CropBaseOperation *operation;
-       if (cropImage){
+       if (cropImage) {
                operation = new CropImageOperation();
-       } else {
+       }
+       else {
                operation = new CropOperation();        
        }
        operation->setCropSettings(cropSettings);
index 7f5c9896bbe410ceb9262dd295ddb98f19f65256..40adc3793b0dfb26026d027f7e0fd264c8ff7d6e 100644 (file)
@@ -60,7 +60,8 @@ void DefocusNode::convertToOperations(ExecutionSystem *graph, CompositorContext
                graph->addOperation(maxRadius);
                graph->addOperation(minimize);
                radiusOperation = minimize;
-       } else {
+       }
+       else {
                ConvertDepthToRadiusOperation *converter = new ConvertDepthToRadiusOperation();
                converter->setCameraObject(camob);
                converter->setfStop(data->fstop);
@@ -101,7 +102,8 @@ void DefocusNode::convertToOperations(ExecutionSystem *graph, CompositorContext
                this->getOutputSocket()->relinkConnections(inverse->getOutputSocket());
                graph->addOperation(correct);
                graph->addOperation(inverse);
-       } else {
+       }
+       else {
                this->getInputSocket(0)->relinkConnections(operation->getInputSocket(0), 0, true, graph);
                this->getOutputSocket()->relinkConnections(operation->getOutputSocket());
        }
index ce78e451f3089f220c71c515a89a1e843be835f8..f10d03913178783ee15990d9d0d3f0348905d08e 100644 (file)
@@ -37,7 +37,7 @@ void FilterNode::convertToOperations(ExecutionSystem *graph, CompositorContext *
        OutputSocket *outputSocket = this->getOutputSocket(0);
        ConvolutionFilterOperation *operation = NULL;
        
-       switch(this->getbNode()->custom1) {
+       switch (this->getbNode()->custom1) {
        case CMP_FILT_SOFT:
                operation = new ConvolutionFilterOperation();
                operation->set3x3Filter(1/16.0f, 2/16.0f, 1/16.0f, 2/16.0f, 4/16.0f, 2/16.0f, 1/16.0f, 2/16.0f, 1/16.0f);
index dcb8691524a6a8c28ed371f3f97ac55804c1a974..14718909de9e4fb70a028b22a4dda9a8713e9560 100644 (file)
@@ -46,7 +46,8 @@ void GroupNode::ungroup(ExecutionSystem &system) {
                                SocketProxyNode * proxy = new SocketProxyNode(this->getbNode(), editorInput, editorInput->groupsock);
                                inputSocket->relinkConnections(proxy->getInputSocket(0), true, index, &system);
                                ExecutionSystemHelper::addNode(system.getNodes(), proxy);
-                       } else {
+                       }
+                       else {
                                OutputSocketProxyNode * proxy = new OutputSocketProxyNode(this->getbNode(), editorInput, editorInput->groupsock);
                                inputSocket->relinkConnections(proxy->getInputSocket(0), true, index, &system);
                                ExecutionSystemHelper::addNode(system.getNodes(), proxy);
index 440468afd46cd4eeca4fd7eb850f9b570d9e74aa..d66657e489cff0c5c441b7618d031b637819534e 100644 (file)
@@ -37,7 +37,8 @@ void IDMaskNode::convertToOperations(ExecutionSystem *graph, CompositorContext *
        this->getInputSocket(0)->relinkConnections(operation->getInputSocket(0));
        if (bnode->custom2==0 || context->getScene()->r.scemode & R_FULL_SAMPLE) {
                this->getOutputSocket(0)->relinkConnections(operation->getOutputSocket(0));
-       } else {
+       }
+       else {
                AntiAliasOperation * antiAliasOperation = new AntiAliasOperation();
                addLink(graph, operation->getOutputSocket(), antiAliasOperation->getInputSocket(0));
                this->getOutputSocket(0)->relinkConnections(antiAliasOperation->getOutputSocket(0));
index 20e6069b60aa3e68682272103a4c979a14affc49..ea2e99ed686276df9970ef9356982ec02fb1f5d6 100644 (file)
@@ -65,9 +65,9 @@ void ImageNode::convertToOperations(ExecutionSystem *graph, CompositorContext *
        int numberOfOutputs = this->getNumberOfOutputSockets();
 
        /* force a load, we assume iuser index will be set OK anyway */
-       if(image && image->type==IMA_TYPE_MULTILAYER) {
+       if (image && image->type==IMA_TYPE_MULTILAYER) {
                BKE_image_get_ibuf(image, imageuser);
-               if(image->rr) {
+               if (image->rr) {
                        OutputSocket * socket;
                        int index;
                        for (index = 0 ; index < numberOfOutputs ; index ++) {
@@ -110,7 +110,8 @@ void ImageNode::convertToOperations(ExecutionSystem *graph, CompositorContext *
                                }
                        }
                }
-       } else {
+       }
+       else {
                if (numberOfOutputs >  0) {
                        ImageOperation *operation = new ImageOperation();
                        if (outputImage->isConnected()) {
index edaa0a9009ea096919dcbf40b69aa5231585df84..cee2b133eeef8f7b96678666896a509bad141c05 100644 (file)
@@ -42,7 +42,8 @@ void LensDistortionNode::convertToOperations(ExecutionSystem *graph, CompositorC
                operation->setData(data);
                graph->addOperation(operation);
 
-       } else {
+       }
+       else {
                ScreenLensDistortionOperation *operation = new ScreenLensDistortionOperation();
 
                this->getInputSocket(0)->relinkConnections(operation->getInputSocket(0), true, 0, graph);
index 075b90c0f2b3f53d1a65be8f6f4ec97b63846b3d..e90767703a54ad0de001e10f5df8cf060c40065d 100644 (file)
@@ -27,7 +27,7 @@
 void MathNode::convertToOperations(ExecutionSystem *graph, CompositorContext * context) {
        MathBaseOperation* operation=NULL;
        
-       switch(this->getbNode()->custom1)
+       switch (this->getbNode()->custom1)
        {
        case 0: /* Add */
                        operation = new MathAddOperation();
index 7d11a06a24da9c77b21774e6eaed697abfa7c559..475a538670dda65e5b429a4fa623faf502c11ce4 100644 (file)
@@ -67,7 +67,8 @@ void MovieClipNode::convertToOperations(ExecutionSystem *graph, CompositorContex
                if (ibuf) {
                        converter->setPredivided(ibuf->flags & IB_cm_predivide);
                }
-       } else {
+       }
+       else {
                addPreviewOperation(graph, operation->getOutputSocket(), 9);
                if (outputMovieClip->isConnected()) {
                        outputMovieClip->relinkConnections(operation->getOutputSocket());
@@ -86,7 +87,7 @@ void MovieClipNode::convertToOperations(ExecutionSystem *graph, CompositorContex
        angle = 0.0f;
 
        if (ibuf) {
-               if(stab->flag&TRACKING_2D_STABILIZATION) {
+               if (stab->flag&TRACKING_2D_STABILIZATION) {
                        BKE_tracking_stabilization_data(&movieClip->tracking, context->getFramenumber(), ibuf->x, ibuf->y, loc, &scale, &angle);
                }
        }
index e22c2fd5910d0be7bfd708adb3201a7e1467f591..e4ce63e9193b2cc7b6adcff0ce9f7db8e767cb3c 100644 (file)
@@ -63,13 +63,15 @@ void RenderLayersNode::testSocketConnection(ExecutionSystem* system, int outputS
                if (outputSocketNumber == 0) { // only do for image socket if connected
                        addPreviewOperation(system, operation->getOutputSocket(), 9);
                }
-       } else {
+       }
+       else {
                if (outputSocketNumber == 0) {
                        system->addOperation(operation);
                        operation->setScene(scene);
                        operation->setLayerId(layerId);
                        addPreviewOperation(system, operation->getOutputSocket(), 9);
-               } else {
+               }
+               else {
                        delete operation;
                }
        }
index 1b15ae0e890fdca290267553c376b114425a3d41..83e0be7d3c0b012899b0cc33b0c9a110193572a0 100644 (file)
@@ -34,7 +34,8 @@ void SwitchNode::convertToOperations(ExecutionSystem *graph, CompositorContext *
 
        if (!switchFrame) {
                this->getInputSocket(0)->relinkConnections(operation->getInputSocket(0), true, 0, graph);
-       } else {
+       }
+       else {
                this->getInputSocket(1)->relinkConnections(operation->getInputSocket(0), true, 1, graph);
        }
        this->getOutputSocket(0)->relinkConnections(operation->getOutputSocket());
index 3e2c750d3aa91da8b6e9737226630b299f5d29fe..481840cbd58777d972107be589d10a7a051c3e9b 100644 (file)
@@ -43,9 +43,11 @@ void TimeNode::convertToOperations(ExecutionSystem *graph, CompositorContext * c
 
        if (framenumber < node->custom1) {
                fac = 0.0f;
-       } else if (framenumber > node->custom2) {
+       }
+       else if (framenumber > node->custom2) {
                fac = 1.0f;
-       } else  if(node->custom1 < node->custom2) {
+       }
+       else    if (node->custom1 < node->custom2) {
                fac= (context->getFramenumber() - node->custom1)/(float)(node->custom2-node->custom1);
        }
 
index b5b15b2ba702f06dede525fda8a751f7210874ba..42d019c4e93e7e4aeb538ffc5540f5dc702a37be 100644 (file)
@@ -52,7 +52,8 @@ void ViewLevelsNode::convertToOperations(ExecutionSystem *graph, CompositorConte
                        CalculateStandardDeviationOperation * operation = new CalculateStandardDeviationOperation();
                        if (firstOperationConnected) {
                                addLink(graph, inputSocket, operation->getInputSocket(0));
-                       }else{
+                       }
+                       else {
                                input->relinkConnections(operation->getInputSocket(0), true, 0, graph);
                        }
                        operation->setSetting(this->getbNode()->custom1);
index be7b6ebdc4566ba931fb460887f58e2304b31a33..8f512769d630f1a3a4060aa75bd57e534c6f90ab 100644 (file)
@@ -35,7 +35,8 @@ void ZCombineNode::convertToOperations(ExecutionSystem* system, CompositorContex
                ZCombineOperation * operation = NULL;
                if (this->getbNode()->custom1) {
                        operation = new ZCombineAlphaOperation();
-               } else {
+               }
+               else {
                        operation = new ZCombineOperation();
                }
 
@@ -52,7 +53,8 @@ void ZCombineNode::convertToOperations(ExecutionSystem* system, CompositorContex
                        this->getOutputSocket(1)->relinkConnections(zoperation->getOutputSocket());
                        system->addOperation(zoperation);
                }
-       } else {
+       }
+       else {
                if (this->getOutputSocket(1)->isConnected()) {
                        MathMinimumOperation * zoperation = new MathMinimumOperation();
                        this->getInputSocket(1)->relinkConnections(zoperation->getInputSocket(0), true, 1, system);
index 2dba9572ee856ba6ed29a0ea7a906c91e4725d57..3e80de7822320bcbcc0593d48ecc487aeb1106b9 100644 (file)
@@ -34,13 +34,13 @@ void AlphaOverKeyOperation::executePixel(float* outputValue, float x, float y, P
        inputColor1Operation->read(inputColor1, x, y, sampler, inputBuffers);
        inputColor2Operation->read(inputOverColor, x, y, sampler, inputBuffers);
        
-       if(inputOverColor[3]<=0.0f) {
+       if (inputOverColor[3]<=0.0f) {
                outputValue[0] = inputColor1[0];
                outputValue[1] = inputColor1[1];
                outputValue[2] = inputColor1[2];
                outputValue[3] = inputColor1[3];
        }
-       else if(value[0]==1.0f && inputOverColor[3]>=1.0f) {
+       else if (value[0]==1.0f && inputOverColor[3]>=1.0f) {
                outputValue[0] = inputOverColor[0];
                outputValue[1] = inputOverColor[1];
                outputValue[2] = inputOverColor[2];
index 9deb00ae71aff8230ed5888d07ece6352a309eba..48762e6370ead1bfa8ed6f781f80c078cc04c9ce 100644 (file)
@@ -35,13 +35,13 @@ void AlphaOverMixedOperation::executePixel(float* outputValue, float x, float y,
        inputColor1Operation->read(inputColor1, x, y, sampler, inputBuffers);
        inputColor2Operation->read(inputOverColor, x, y, sampler, inputBuffers);
        
-       if(inputOverColor[3]<=0.0f) {
+       if (inputOverColor[3]<=0.0f) {
                outputValue[0] = inputColor1[0];
                outputValue[1] = inputColor1[1];
                outputValue[2] = inputColor1[2];
                outputValue[3] = inputColor1[3];
        }
-       else if(value[0]==1.0f && inputOverColor[3]>=1.0f) {
+       else if (value[0]==1.0f && inputOverColor[3]>=1.0f) {
                outputValue[0] = inputOverColor[0];
                outputValue[1] = inputOverColor[1];
                outputValue[2] = inputOverColor[2];
index 635a630860183bbdda3a0cce30490271610ff154..c46f3a04113581be06dc46c59667193e3f74f419 100644 (file)
@@ -35,13 +35,13 @@ void AlphaOverPremultiplyOperation::executePixel(float* outputValue, float x, fl
        inputColor2Operation->read(inputOverColor, x, y, sampler, inputBuffers);
        
        /* Zero alpha values should still permit an add of RGB data */
-       if(inputOverColor[3]<0.0f) {
+       if (inputOverColor[3]<0.0f) {
                outputValue[0] = inputColor1[0];
                outputValue[1] = inputColor1[1];
                outputValue[2] = inputColor1[2];
                outputValue[3] = inputColor1[3];
        }
-       else if(value[0]==1.0f && inputOverColor[3]>=1.0f) {
+       else if (value[0]==1.0f && inputOverColor[3]>=1.0f) {
                outputValue[0] = inputOverColor[0];
                outputValue[1] = inputOverColor[1];
                outputValue[2] = inputOverColor[2];
index 729d04c182ee1731c655f70dd1fd04d6dc5e82ba..3d8cd13229f2dbe8dac48513e2c9f569dab37237 100644 (file)
@@ -43,7 +43,8 @@ void AntiAliasOperation::initExecution() {
 void AntiAliasOperation::executePixel(float* color, int x, int y, MemoryBuffer *inputBuffers[], void * data) {
        if (y < 0 || y >= this->height || x < 0 || x >= this->width) {
                color[0] = 0.0f;
-       } else {
+       }
+       else {
                int offset = y*this->width + x;
                color[0] = buffer[offset]/255.0f;
        }
@@ -62,7 +63,8 @@ bool AntiAliasOperation::determineDependingAreaOfInterest(rcti *input, ReadBuffe
        rcti imageInput;
        if (this->buffer) {
                return false;
-       } else {
+       }
+       else {
                NodeOperation* operation = getInputOperation(0);
                imageInput.xmax = operation->getWidth();
                imageInput.xmin = 0;
index 5743b38870510c9d0519d24559a8146a628ad855..8d507a754d5f8349ebeade2706ff43b31dc03b5e 100644 (file)
@@ -89,7 +89,8 @@ void BilateralBlurOperation::executePixel(float* color, int x, int y, MemoryBuff
                color[1] = blurColor[1]/blurDivider;
                color[2] = blurColor[2]/blurDivider;
                color[3] = blurColor[3]/blurDivider;
-       } else {
+       }
+       else {
                color[0] = 0.0f;
                color[1] = 0.0f;
                color[2] = 0.0f;
index b18c0762c1a964ac18793c0da7d1a025d1dc97bc..60954503949ff96134ee137be43e5e259b73350f 100644 (file)
@@ -42,7 +42,7 @@ void BlurBaseOperation::initExecution() {
        this->inputSize = this->getInputSocketReader(1);
        this->data->image_in_width= this->getWidth();
        this->data->image_in_height= this->getHeight();
-       if(this->data->relative) {
+       if (this->data->relative) {
                switch (this->data->aspect) {
                case CMP_NODE_BLUR_ASPECT_NONE:
                        this->data->sizex= (int)(this->data->percentx*0.01f*this->data->image_in_width);
@@ -80,7 +80,7 @@ float* BlurBaseOperation::make_gausstab(int rad)
        }
 
        sum= 1.0f/sum;
-       for(i=0; i<n; i++)
+       for (i=0; i<n; i++)
                gausstab[i]*= sum;
 
        return gausstab;
@@ -95,7 +95,7 @@ void BlurBaseOperation::deinitExecution() {
        this->data = NULL;
 }
 
-void BlurBaseOperation::updateSize(MemoryBuffer **memoryBuffers){
+void BlurBaseOperation::updateSize(MemoryBuffer **memoryBuffers) {
        float result[4];
        this->getInputSocketReader(1)->read(result, 0, 0, COM_PS_NEAREST, memoryBuffers);
        this->size = result[0];
index 31345dbaeff1d46bc471db359da08a36ebcfa2d1..1d5f4852340191a724d1eb14140a385655d513d1 100644 (file)
@@ -57,7 +57,8 @@ void BokehBlurOperation::initExecution() {
        float dimension;
        if (width<height) {
                dimension = width;
-       } else {
+       }
+       else {
                dimension = height;
        }
        this->bokehMidX = width/2.0f;
@@ -119,7 +120,8 @@ void BokehBlurOperation::executePixel(float* color, int x, int y, MemoryBuffer *
                color[1] = tempColor[1]*(1.0/overallmultiplyerg);
                color[2] = tempColor[2]*(1.0/overallmultiplyerb);
                color[3] = 1.0f;
-       } else {
+       }
+       else {
                inputProgram->read(color, x, y, COM_PS_NEAREST, inputBuffers);
        }
 }
index 3286217e71db3d3f0c5689e7e9a0acc10a1e26a8..22b73417778d1c70cf1c81741d7c1ab00c95aa54 100644 (file)
@@ -70,9 +70,11 @@ float BokehImageOperation::isInsideBokeh(float distance, float x, float y) {
        if (distanceRoundingToCenter>=distanceToCenter && catadioptricDistanceToCenter<=distanceToCenter) {
                if (distanceRoundingToCenter-distanceToCenter<1.0) {
                        insideBokeh = (distanceRoundingToCenter-distanceToCenter);
-               } else if (this->data->catadioptric != 0.0 && distanceToCenter-catadioptricDistanceToCenter<1.0) {
+               }
+               else if (this->data->catadioptric != 0.0 && distanceToCenter-catadioptricDistanceToCenter<1.0) {
                        insideBokeh = (distanceToCenter-catadioptricDistanceToCenter);
-               } else {
+               }
+               else {
                        insideBokeh = 1.0;
                }
        }
@@ -89,7 +91,8 @@ void BokehImageOperation::executePixel(float* color, float x, float y, PixelSamp
                color[0] = insideBokehMax;
                color[1] = insideBokehMed;
                color[2] = insideBokehMin;
-       } else {
+       }
+       else {
                color[0] = insideBokehMin;
                color[1] = insideBokehMed;
                color[2] = insideBokehMax;
index 44157051089a567e203208f333f0c8a7ab00a16e..5b769fef3ef99546b892294313f1180f12ca3e79 100644 (file)
@@ -68,7 +68,8 @@ void BoxMaskOperation::executePixel(float* color, float x, float y, PixelSampler
                case CMP_NODE_MASKTYPE_ADD:
                        if (inside) {
                                color[0] = max(inputMask[0],inputValue[0]);
-                       } else {
+                       }
+                       else {
                                color[0] = inputMask[0];
                        }
                        break;
@@ -76,14 +77,16 @@ void BoxMaskOperation::executePixel(float* color, float x, float y, PixelSampler
                        if (inside) {
                                color[0] = inputMask[0]-inputValue[0];
                                CLAMP(color[0], 0, 1);
-                       } else {
+                       }
+                       else {
                                color[0] = inputMask[0];
                        }
                        break;
                case CMP_NODE_MASKTYPE_MULTIPLY:
                        if (inside) {
                                color[0] = inputMask[0]*inputValue[0];
-                       } else {
+                       }
+                       else {
                                color[0] = 0;
                        }
                        break;
@@ -91,10 +94,12 @@ void BoxMaskOperation::executePixel(float* color, float x, float y, PixelSampler
                if (inside) {
                        if (inputMask[0]>0.0f) {
                                color[0] = 0;
-                       } else {
+                       }
+                       else {
                                color[0] = inputValue[0];
                        }
-               } else {
+               }
+               else {
                        color[0] = inputMask[0];
                }
                        break;
index bb481f71cc1cec9889592dc87aaaf3df3824050a..a62470e5b1d673be94f22858902eb7b2bc5e02a0 100644 (file)
@@ -53,13 +53,11 @@ void BrightnessOperation::executePixel(float* color, float x, float y, PixelSamp
        * (http://visca.com/ffactory/archives/5-99/msg00021.html)
        * Extracted of OpenCV demhist.c
        */
-       if( contrast > 0 )
-       {
+       if (contrast > 0) {
                a = 1.0f / a;
                b = a * (brightness - delta);
        }
-       else
-       {
+       else {
                delta *= -1;
                b = a * (brightness + delta);
        }
index 062e7fc69fef0a2fe301325eb7c94f02f6a55fe6..7a1fc5e511c62bca5bf5fc16741b39afc3c65aa2 100644 (file)
@@ -86,7 +86,7 @@ void CalculateMeanOperation::calculateMean(MemoryBuffer * tile) {
                if (buffer[offset+3] > 0) {
                        pixels ++;
        
-                       switch(this->setting)
+                       switch (this->setting)
                        {
                        case 1:
                                {
index 4cd990e417ecbfd4a7e3d754e503602de16a26cd..9d9dc46eb6caa7e0af17935a0748c894e61f29ec 100644 (file)
@@ -48,7 +48,7 @@ void* CalculateStandardDeviationOperation::initializeTileData(rcti *rect, Memory
                        if (buffer[offset+3] > 0) {
                                pixels ++;
                
-                               switch(this->setting)
+                               switch (this->setting)
                                {
                                case 1:
                                        {
index fd2bd3991ecb98ca74cdb7484f6b2195d429edc1..da59524586c6d2cabaa90a30a0bc5474c7979f7c 100644 (file)
@@ -42,7 +42,7 @@ void ChangeHSVOperation::executePixel(float* outputValue, float x, float y, Pixe
        inputOperation->read(inputColor1, x, y, sampler, inputBuffers);
        
        outputValue[0] = inputColor1[0] + (this->hue - 0.5f);
-       if (outputValue[0]>1.0f) outputValue[0]-=1.0; else if(outputValue[0]<0.0) outputValue[0]+= 1.0;
+       if (outputValue[0]>1.0f) outputValue[0]-=1.0; else if (outputValue[0]<0.0) outputValue[0]+= 1.0;
        outputValue[1] = inputColor1[1] * this->saturation;
        outputValue[2] = inputColor1[2] * this->value;
        outputValue[3] = inputColor1[3];
index b595aca3c4600f77de136e158b1ca05d5dcdbed7..10ff140f8bedd80dc32e7741abf337a30db38385 100644 (file)
@@ -97,10 +97,10 @@ void ChannelMatteOperation::executePixel(float* outputValue, float x, float y, P
        alpha = 1.f - alpha;
        
        /* test range*/
-       if(alpha > limit_max) {
+       if (alpha > limit_max) {
                alpha = inColor[3]; /*whatever it was prior */
        }
-       else if(alpha < limit_min){
+       else if (alpha < limit_min) {
                alpha = 0.f;
        }
        else {/*blend */
index 8e793f08a3b25075f8f65f93f696e7f5060ca6d1..9556b673c0fafcbbbe29c6fed3660f7477c468e8 100644 (file)
@@ -72,13 +72,13 @@ void ChromaMatteOperation::executePixel(float* outputValue, float x, float y, Pi
        /* if kfg is <0 then the pixel is outside of the key color */
        kfg= x_angle-(fabsf(z_angle)/tanf(acceptance/2.f));
 
-       if(kfg>0.f) {  /* found a pixel that is within key color */
+       if (kfg>0.f) {  /* found a pixel that is within key color */
                alpha=(1.f-kfg)*(gain);
 
                beta=atan2(z_angle,x_angle);
 
                /* if beta is within the cutoff angle */
-               if(fabsf(beta) < (cutoff/2.f)) {
+               if (fabsf(beta) < (cutoff/2.f)) {
                        alpha=0.f;
                }
 
index fef045481f7a1c7ce310a532b0cd756642b7f4bd..fb617549b1c727489740ca05528aa08dd8a05a70 100644 (file)
@@ -63,15 +63,19 @@ void ColorCorrectionOperation::executePixel(float* output, float x, float y, Pix
 #define MARGIN_DIV (0.5/MARGIN)
        if ( level < this->data->startmidtones-MARGIN) {
                levelShadows = 1.0f;
-       } else if (level < this->data->startmidtones+MARGIN) {
+       }
+       else if (level < this->data->startmidtones+MARGIN) {
                levelMidtones = ((level-this->data->startmidtones)*MARGIN_DIV)+0.5;
                levelShadows = 1.0- levelMidtones;
-       } else if (level < this->data->endmidtones-MARGIN) {
+       }
+       else if (level < this->data->endmidtones-MARGIN) {
                levelMidtones = 1.0f;
-       } else if (level < this->data->endmidtones+MARGIN) {
+       }
+       else if (level < this->data->endmidtones+MARGIN) {
                levelHighlights = ((level-this->data->endmidtones)*MARGIN_DIV)+0.5;
                levelMidtones = 1.0- levelHighlights;
-       } else {
+       }
+       else {
                levelHighlights = 1.0f;
        }
 #undef MARGIN
@@ -111,17 +115,20 @@ void ColorCorrectionOperation::executePixel(float* output, float x, float y, Pix
        
        if (this->redChannelEnabled) {
                output[0] = r;
-       } else {
+       }
+       else {
                output[0] = inputImageColor[0];
        }
        if (this->greenChannelEnabled) {
                output[1] = g;
-       } else {
+       }
+       else {
                output[1] = inputImageColor[1];
        }
        if (this->blueChannelEnabled) {
                output[2] = b;
-       } else {
+       }
+       else {
                output[2] = inputImageColor[2];
        }
        output[3] = inputImageColor[3];
index cb16b99f06b7ca290b61520150740361808b76d0..375d726912489dc103b1d1a435eff30688bf8c0d 100644 (file)
@@ -69,9 +69,9 @@ void ColorCurveOperation::executePixel(float* color, float x, float y, PixelSamp
        this->inputFacProgram->read(fac, x, y, sampler, inputBuffers);
        this->inputImageProgram->read(image, x, y, sampler, inputBuffers);
 
-       if(fac[0]>=1.0)
+       if (fac[0]>=1.0)
                curvemapping_evaluate_premulRGBF(this->curveMapping, color, image);
-       else if(*fac<=0.0) {
+       else if (*fac<=0.0) {
                color[0]= image[0];
                color[1]= image[1];
                color[2]= image[2];
index a80788ddd33e0c56916b7d67bf9346dfe82ccecf..6e9c1b0d48a2931ad37363811c76d96707f92ea9 100644 (file)
@@ -59,7 +59,7 @@ void ColorMatteOperation::executePixel(float* outputValue, float x, float y, Pix
         * COM_SetAlphaOperation and the Value output
         */
 
-       if(
+       if (
        /* do hue last because it needs to wrap, and does some more checks  */
 
        /* sat */       (fabsf(inColor[1]-inKey[1]) < sat) &&
index 9f0545403323c2512a903980c7c4a06554650e8e..56f45c0fdebd2f2d7dc49fb53e3ac7bd1d2bdbf6 100644 (file)
@@ -48,7 +48,8 @@ void ColorSpillOperation::initExecution() {
                        settings->uspillg = 0.0f;
                        settings->uspillb = 0.0f;
                }
-       } else if (spillChannel == 1) {
+       }
+       else if (spillChannel == 1) {
                rmut = 1.0f;
                gmut = -1.0f;
                bmut = 1.0f;
@@ -59,7 +60,8 @@ void ColorSpillOperation::initExecution() {
                        settings->uspillg = 1.0f;
                        settings->uspillb = 0.0f;
                }
-       } else {
+       }
+       else {
                rmut = 1.0f;
                gmut = 1.0f;
                bmut = -1.0f;
@@ -87,7 +89,7 @@ void ColorSpillOperation::executePixel(float* outputValue, float x, float y, Pix
        this->inputImageReader->read(input, x, y, sampler, inputBuffers);
        float rfac = min(1.0f, fac[0]);
        map = calculateMapValue(rfac, input);
-       if(map>0) {
+       if (map>0) {
                outputValue[0]=input[0]+rmut*(settings->uspillr*map);
                outputValue[1]=input[1]+gmut*(settings->uspillg*map);
                outputValue[2]=input[2]+bmut*(settings->uspillb*map);
index 7590b4be2999ab3984aee36b4aad5a68fa0008f0..6391fa2537df4e14c187c26024b33f5cfa89a6ef 100644 (file)
@@ -56,8 +56,8 @@ void CompositorOperation::initExecution() {
        const Scene * scene = this->scene;
        Render* re= RE_GetRender(scene->id.name);
        RenderResult *rr= RE_AcquireResultWrite(re);
-       if(rr) {
-               if(rr->rectf  != NULL) {
+       if (rr) {
+               if (rr->rectf  != NULL) {
                        MEM_freeN(rr->rectf);
                }
                rr->rectf= outputBuffer;
index 345fc37b34080f20e43fb6bd205dcf777bf57317..e262533b2f753a15c114435650ad30f6b0789a0d 100644 (file)
@@ -37,7 +37,8 @@ float ConvertDepthToRadiusOperation::determineFocalDistance() {
 
        if (cameraObject == NULL || cameraObject->type != OB_CAMERA) {
                return 10.0f;
-       } else {
+       }
+       else {
                Camera *camera= (Camera*)this->cameraObject->data;
                cam_lens = camera->lens;
                if (camera->dof_ob) {
index 6f676b1c404fce7c5a6962a3c675817244294688..c800587ab0c19ba4e3c40472187014bed1079004 100644 (file)
@@ -40,7 +40,7 @@ void ConvertPremulToKeyOperation::executePixel(float* outputValue, float x, floa
        this->inputColor->read(inputValue, x, y, sampler, inputBuffers);
        alpha = inputValue[3];
 
-       if(fabsf(alpha) < 1e-5f) {
+       if (fabsf(alpha) < 1e-5f) {
                outputValue[0]= 0.f;
                outputValue[1]= 0.f;
                outputValue[2]= 0.f;
index 623376d532f6ea5177446bd94f16626d3efd8b77..e1aa91e35da56b46e7298e4aa34255a9e9fc40de 100644 (file)
@@ -33,7 +33,7 @@ void ConvertRGBToYCCOperation::initExecution() {
 }
 
 void ConvertRGBToYCCOperation::setMode(int mode) {
-       switch(mode)
+       switch (mode)
        {
        case 1:
                this->mode = BLI_YCC_ITU_BT709;
index 1d8ee94491576c8c0503eb24885dbf3fd7110fb0..6f9c5244c294f116fe0e4c95c02b973537593c47 100644 (file)
@@ -33,7 +33,7 @@ void ConvertYCCToRGBOperation::initExecution() {
 }
 
 void ConvertYCCToRGBOperation::setMode(int mode) {
-       switch(mode)
+       switch (mode)
        {
        case 1:
                this->mode = BLI_YCC_ITU_BT709;
index a763ded7f523a90fbdd5f0fcac20e9fd3f047ae9..3c4e3428ec29e9137a230000d0a553a9529bc044 100644 (file)
@@ -23,7 +23,7 @@
 #include "COM_CropOperation.h"
 #include "BLI_math.h"
 
-CropBaseOperation::CropBaseOperation() :NodeOperation(){
+CropBaseOperation::CropBaseOperation() :NodeOperation() {
        this->addInputSocket(COM_DT_COLOR, COM_SC_NO_RESIZE);
        this->addOutputSocket(COM_DT_COLOR);
        this->inputOperation = NULL;
@@ -34,7 +34,7 @@ void CropBaseOperation::updateArea() {
        SocketReader * inputReference = this->getInputSocketReader(0);
        float width = inputReference->getWidth();
        float height = inputReference->getHeight();
-       if (this->relative){
+       if (this->relative) {
                settings->x1= width * settings->fac_x1;
                settings->x2= width * settings->fac_x2;
                settings->y1= height * settings->fac_y1;
@@ -55,22 +55,23 @@ void CropBaseOperation::updateArea() {
        this->ymin = MIN2(settings->y1, settings->y2);
 }
 
-void CropBaseOperation::initExecution(){
+void CropBaseOperation::initExecution() {
        this->inputOperation = this->getInputSocketReader(0);
        updateArea();
 }
 
-void CropBaseOperation::deinitExecution(){
+void CropBaseOperation::deinitExecution() {
        this->inputOperation = NULL;
 }
 
-CropOperation::CropOperation() :CropBaseOperation(){
+CropOperation::CropOperation() :CropBaseOperation() {
 }
 
-void CropOperation::executePixel(float *color, float x, float y, PixelSampler sampler, MemoryBuffer *inputBuffers[]){
-       if ((x < this->xmax && x >= xmin) && (y < ymax && y >= ymin)){
+void CropOperation::executePixel(float *color, float x, float y, PixelSampler sampler, MemoryBuffer *inputBuffers[]) {
+       if ((x < this->xmax && x >= xmin) && (y < ymax && y >= ymin)) {
                inputOperation->read(color, x, y, sampler, inputBuffers);
-       } else {
+       }
+       else {
                color[0] = 0.0f;
                color[1] = 0.0f;
                color[2] = 0.0f;
@@ -78,10 +79,10 @@ void CropOperation::executePixel(float *color, float x, float y, PixelSampler sa
        }
 }
 
-CropImageOperation::CropImageOperation() :CropBaseOperation(){
+CropImageOperation::CropImageOperation() :CropBaseOperation() {
 }
 
-bool CropImageOperation::determineDependingAreaOfInterest(rcti *input, ReadBufferOperation *readOperation, rcti *output){
+bool CropImageOperation::determineDependingAreaOfInterest(rcti *input, ReadBufferOperation *readOperation, rcti *output) {
        rcti newInput;
        
        newInput.xmax = input->xmax + this->xmin;
@@ -92,13 +93,13 @@ bool CropImageOperation::determineDependingAreaOfInterest(rcti *input, ReadBuffe
        return NodeOperation::determineDependingAreaOfInterest(&newInput, readOperation, output);
 }
 
-void CropImageOperation::determineResolution(unsigned int resolution[], unsigned int preferedResolution[]){
+void CropImageOperation::determineResolution(unsigned int resolution[], unsigned int preferedResolution[]) {
        NodeOperation::determineResolution(resolution, preferedResolution);
        updateArea();
        resolution[0] = this->xmax - this->xmin;
        resolution[1] = this->ymax - this->ymin;
 }
 
-void CropImageOperation::executePixel(float *color, float x, float y, PixelSampler sampler, MemoryBuffer *inputBuffers[]){
+void CropImageOperation::executePixel(float *color, float x, float y, PixelSampler sampler, MemoryBuffer *inputBuffers[]) {
        this->inputOperation->read(color, (x + this->xmin), (y + this->ymin), sampler, inputBuffers);
 }
index 92d9e29dcecb835141eac8f6f252b17066f0b7e4..c64f2593318a774118e9ace8fb5a448583484538 100644 (file)
@@ -61,15 +61,15 @@ void DifferenceMatteOperation::executePixel(float* outputValue, float x, float y
        difference=difference/3.0;
 
        /*make 100% transparent*/
-       if(difference < tolerence) {
+       if (difference < tolerence) {
                outputValue[0]=0.0;
        }
        /*in the falloff region, make partially transparent */
-       else if(difference < falloff+tolerence) {
+       else if (difference < falloff+tolerence) {
                difference=difference-tolerence;
                alpha=difference/falloff;
                /*only change if more transparent than before */
-               if(alpha < inColor1[3]) {
+               if (alpha < inColor1[3]) {
                        outputValue[0]=alpha;
                }
                else { /* leave as before */
index df3bf996c96c32c1f7dcbd54128ce004cce5c527..c34d897671985082020a2e1bf0ec2b9f9c924fe7 100644 (file)
@@ -36,10 +36,12 @@ void DilateErodeOperation::initExecution() {
        this->inputProgram = this->getInputSocketReader(0);
        if (this->distance < 0.0f) {
                this->scope = - this->distance + this->inset;
-       } else {
+       }
+       else {
                if (this->inset*2 > this->distance) {
                        this->scope = max(this->inset*2 - this->distance, this->distance);
-               } else {
+               }
+               else {
                        this->scope = distance;
                }
        }
@@ -87,7 +89,8 @@ void DilateErodeOperation::executePixel(float* color, int x, int y, MemoryBuffer
                        }
                }
                pixelvalue = -sqrtf(mindist);
-       } else {
+       }
+       else {
                for (int yi = miny ; yi<maxy;yi++) {
                        offset = ((yi-rect->ymin)*bufferWidth+(minx-rect->xmin))*4;
                        for (int xi = minx ; xi<maxx;xi++) {
@@ -109,21 +112,26 @@ void DilateErodeOperation::executePixel(float* color, int x, int y, MemoryBuffer
                if (delta >= 0.0f) {
                        if (delta >= inset) {
                                color[0] = 1.0f;
-                       } else {
+                       }
+                       else {
                                color[0] = delta/inset;
                        }
-               } else {
+               }
+               else {
                        color[0] = 0.0f;
                }
-       } else {
+       }
+       else {
                const float delta = -distance+pixelvalue;
                if (delta < 0.0f) {
                        if (delta < -inset) {
                                color[0] = 1.0f;
-                       } else {
+                       }
+                       else {
                                color[0] = (-delta)/inset;
                        }
-               } else {
+               }
+               else {
                        color[0] = 0.0f;
                }
        }
index 5b066d8f16ee43e0ca4ab684e235d8c0ec7bad56..4b4e9ce851a409ced91d23aad7d2dd0d83cbe8b7 100644 (file)
@@ -73,7 +73,7 @@ void DirectionalBlurOperation::executePixel(float* color, int x, int y, MemoryBu
        float lsc = sc;
        float lrot = rot;
        /* blur the image */
-       for(int i= 0; i < iterations; ++i) {
+       for (int i= 0; i < iterations; ++i) {
                const float cs= cos(lrot), ss= sin(lrot);
                const float isc= 1.f / (1.f + lsc);
 
index bef470ca9de5f38446377c0b68ca3884db44bc33..ab4df7bf1acc09b3a70bb7e712288cd8e50afe22 100644 (file)
@@ -63,15 +63,15 @@ void DistanceMatteOperation::executePixel(float* outputValue, float x, float y,
         */
  
        /*make 100% transparent */
-       if(distance < tolerence) {
+       if (distance < tolerence) {
                outputValue[0]=0.f;
        }
        /*in the falloff region, make partially transparent */
-       else if(distance < falloff+tolerence){
+       else if (distance < falloff+tolerence) {
                distance=distance-tolerence;
                alpha=distance/falloff;
                /*only change if more transparent than before */
-               if(alpha < inImage[3]) {
+               if (alpha < inImage[3]) {
                        outputValue[0]=alpha;
                }
                else { /* leave as before */
index cb6b27b9da179281d682ce4b792d0c1f470cfdcf..b42e676893a19abd4549313e1a4191a1ce9c9219 100644 (file)
@@ -26,7 +26,7 @@
 
 // this part has been copied from the double edge mask
 // Contributor(s): Peter Larabell.
-static void do_adjacentKeepBorders(unsigned int t, unsigned int rw, unsigned int *limask, unsigned int *lomask, unsigned int *lres, float *res, unsigned int *rsize){
+static void do_adjacentKeepBorders(unsigned int t, unsigned int rw, unsigned int *limask, unsigned int *lomask, unsigned int *lres, float *res, unsigned int *rsize) {
        int x;
        unsigned int isz=0; // inner edge size
        unsigned int osz=0; // outer edge size
@@ -35,134 +35,150 @@ static void do_adjacentKeepBorders(unsigned int t, unsigned int rw, unsigned int
        /* upper left corner */
        x=t-rw+1;
        // test if inner mask is filled
-       if(limask[x]){
+       if (limask[x]) {
                // test if pixel underneath, or to the right, are empty in the inner mask,
                // but filled in the outer mask
-               if((!limask[x-rw] && lomask[x-rw]) || (!limask[x+1] && lomask[x+1])){
+               if ((!limask[x-rw] && lomask[x-rw]) || (!limask[x+1] && lomask[x+1])) {
                        isz++;                               // increment inner edge size
                        lres[x]=4;                           // flag pixel as inner edge
-               } else {
-                       res[x]=1.0f;                         // pixel is just part of inner mask, and it's not an edge
                }
-       } else if(lomask[x]){                        // inner mask was empty, test if outer mask is filled
+               else {
+                       res[x] = 1.0f;                       // pixel is just part of inner mask, and it's not an edge
+               }
+       }
+       else if (lomask[x]) {                         // inner mask was empty, test if outer mask is filled
                osz++;                                   // increment outer edge size
-               lres[x]=3;                               // flag pixel as outer edge
+               lres[x] = 3;                             // flag pixel as outer edge
        }
        /* upper right corner */
        x=t;
        // test if inner mask is filled
-       if(limask[x]){
+       if (limask[x]) {
                // test if pixel underneath, or to the left, are empty in the inner mask,
                // but filled in the outer mask
-               if((!limask[x-rw] && lomask[x-rw]) || (!limask[x-1] && lomask[x-1])){
+               if ((!limask[x-rw] && lomask[x-rw]) || (!limask[x-1] && lomask[x-1])) {
                        isz++;                               // increment inner edge size
                        lres[x]=4;                           // flag pixel as inner edge
-               } else {
+               }
+               else {
                        res[x]=1.0f;                         // pixel is just part of inner mask, and it's not an edge
                }
-       } else if(lomask[x]){                        // inner mask was empty, test if outer mask is filled
+       }
+       else if (lomask[x]) {                        // inner mask was empty, test if outer mask is filled
                osz++;                                   // increment outer edge size
                lres[x]=3;                               // flag pixel as outer edge
        }
        /* lower left corner */
        x=0;
        // test if inner mask is filled
-       if(limask[x]){
+       if (limask[x]) {
                // test if pixel above, or to the right, are empty in the inner mask,
                // but filled in the outer mask
-               if((!limask[x+rw] && lomask[x+rw]) || (!limask[x+1] && lomask[x+1])){
+               if ((!limask[x+rw] && lomask[x+rw]) || (!limask[x+1] && lomask[x+1])) {
                        isz++;                               // increment inner edge size
                        lres[x]=4;                           // flag pixel as inner edge
-               } else {
+               }
+               else {
                        res[x]=1.0f;                         // pixel is just part of inner mask, and it's not an edge
                }
-       } else if(lomask[x]){                        // inner mask was empty, test if outer mask is filled
+       }
+       else if (lomask[x]) {                        // inner mask was empty, test if outer mask is filled
                osz++;                                   // increment outer edge size
                lres[x]=3;                               // flag pixel as outer edge
        }
        /* lower right corner */
        x=rw-1;
        // test if inner mask is filled
-       if(limask[x]){
+       if (limask[x]) {
                // test if pixel above, or to the left, are empty in the inner mask,
                // but filled in the outer mask
-               if((!limask[x+rw] && lomask[x+rw]) || (!limask[x-1] && lomask[x-1])){
+               if ((!limask[x+rw] && lomask[x+rw]) || (!limask[x-1] && lomask[x-1])) {
                        isz++;                               // increment inner edge size
                        lres[x]=4;                           // flag pixel as inner edge
-               } else {
+               }
+               else {
                        res[x]=1.0f;                         // pixel is just part of inner mask, and it's not an edge
                }
-       } else if(lomask[x]){                        // inner mask was empty, test if outer mask is filled
+       }
+       else if (lomask[x]) {                        // inner mask was empty, test if outer mask is filled
                osz++;                                   // increment outer edge size
                lres[x]=3;                               // flag pixel as outer edge
        }
        
        /* Test the TOP row of pixels in buffer, except corners */
-       for(x= t-1; x>=(t-rw)+2; x--) {
+       for (x= t-1; x>=(t-rw)+2; x--) {
                // test if inner mask is filled
-               if(limask[x]) {
+               if (limask[x]) {
                        // test if pixel to the right, or to the left, are empty in the inner mask,
                        // but filled in the outer mask
-                       if((!limask[x-1] && lomask[x-1]) || (!limask[x+1] && lomask[x+1])) {
+                       if ((!limask[x-1] && lomask[x-1]) || (!limask[x+1] && lomask[x+1])) {
                                isz++;                           // increment inner edge size
                                lres[x]=4;                       // flag pixel as inner edge
-                       } else {
+                       }
+                       else {
                                res[x]=1.0f;                     // pixel is just part of inner mask, and it's not an edge
                        }
-               } else if(lomask[x]) {                   // inner mask was empty, test if outer mask is filled
+               }
+               else if (lomask[x]) {                    // inner mask was empty, test if outer mask is filled
                        osz++;                               // increment outer edge size
                        lres[x]=3;                           // flag pixel as outer edge
                }
        }
        
        /* Test the BOTTOM row of pixels in buffer, except corners */
-       for(x= rw-2; x; x--) {
+       for (x= rw-2; x; x--) {
                // test if inner mask is filled
-               if(limask[x]) {
+               if (limask[x]) {
                        // test if pixel to the right, or to the left, are empty in the inner mask,
                        // but filled in the outer mask
-                       if((!limask[x-1] && lomask[x-1]) || (!limask[x+1] && lomask[x+1])) {
+                       if ((!limask[x-1] && lomask[x-1]) || (!limask[x+1] && lomask[x+1])) {
                                isz++;                           // increment inner edge size
                                lres[x]=4;                       // flag pixel as inner edge
-                       } else {
+                       }
+                       else {
                                res[x]=1.0f;                     // pixel is just part of inner mask, and it's not an edge
                        }
-               } else if(lomask[x]) {                   // inner mask was empty, test if outer mask is filled
+               }
+               else if (lomask[x]) {                    // inner mask was empty, test if outer mask is filled
                        osz++;                               // increment outer edge size
                        lres[x]=3;                           // flag pixel as outer edge
                }
        }
        /* Test the LEFT edge of pixels in buffer, except corners */
-       for(x= t-(rw<<1)+1; x>=rw; x-=rw) {
+       for (x= t-(rw<<1)+1; x>=rw; x-=rw) {
                // test if inner mask is filled
-               if(limask[x]) {
+               if (limask[x]) {
                        // test if pixel underneath, or above, are empty in the inner mask,
                        // but filled in the outer mask
-                       if((!limask[x-rw] && lomask[x-rw]) || (!limask[x+rw] && lomask[x+rw])) {
+                       if ((!limask[x-rw] && lomask[x-rw]) || (!limask[x+rw] && lomask[x+rw])) {
                                isz++;                           // increment inner edge size
                                lres[x]=4;                       // flag pixel as inner edge
-                       } else {
+                       }
+                       else {
                                res[x]=1.0f;                     // pixel is just part of inner mask, and it's not an edge
                        }
-               } else if(lomask[x]) {                   // inner mask was empty, test if outer mask is filled
+               }
+               else if (lomask[x]) {                   // inner mask was empty, test if outer mask is filled
                        osz++;                               // increment outer edge size
                        lres[x]=3;                           // flag pixel as outer edge
                }
        }
        
        /* Test the RIGHT edge of pixels in buffer, except corners */
-       for(x= t-rw; x>rw; x-=rw) {
+       for (x= t-rw; x>rw; x-=rw) {
                // test if inner mask is filled
-               if(limask[x]) {
+               if (limask[x]) {
                        // test if pixel underneath, or above, are empty in the inner mask,
                        // but filled in the outer mask
-                       if((!limask[x-rw] && lomask[x-rw]) || (!limask[x+rw] && lomask[x+rw])) {
+                       if ((!limask[x-rw] && lomask[x-rw]) || (!limask[x+rw] && lomask[x+rw])) {
                                isz++;                           // increment inner edge size
                                lres[x]=4;                       // flag pixel as inner edge
-                       } else {
+                       }
+                       else {
                                res[x]=1.0f;                     // pixel is just part of inner mask, and it's not an edge
                        }
-               } else if(lomask[x]) {                   // inner mask was empty, test if outer mask is filled
+               }
+               else if (lomask[x]) {                   // inner mask was empty, test if outer mask is filled
                        osz++;                               // increment outer edge size
                        lres[x]=3;                           // flag pixel as outer edge
                }
@@ -173,7 +189,7 @@ static void do_adjacentKeepBorders(unsigned int t, unsigned int rw, unsigned int
        rsize[2]=gsz;
 }
 
-static void do_adjacentBleedBorders(unsigned int t, unsigned int rw, unsigned int *limask, unsigned int *lomask, unsigned int *lres, float *res, unsigned int *rsize){
+static void do_adjacentBleedBorders(unsigned int t, unsigned int rw, unsigned int *limask, unsigned int *lomask, unsigned int *lres, float *res, unsigned int *rsize) {
        int x;
        unsigned int isz=0; // inner edge size
        unsigned int osz=0; // outer edge size
@@ -182,20 +198,23 @@ static void do_adjacentBleedBorders(unsigned int t, unsigned int rw, unsigned in
        /* upper left corner */
        x=t-rw+1;
        // test if inner mask is filled
-       if(limask[x]){
+       if (limask[x]) {
                // test if pixel underneath, or to the right, are empty in the inner mask,
                // but filled in the outer mask
-               if((!limask[x-rw] && lomask[x-rw]) || (!limask[x+1] && lomask[x+1])){
+               if ((!limask[x-rw] && lomask[x-rw]) || (!limask[x+1] && lomask[x+1])) {
                        isz++;                               // increment inner edge size
                        lres[x]=4;                           // flag pixel as inner edge
-               } else {
+               }
+               else {
                        res[x]=1.0f;                         // pixel is just part of inner mask, and it's not an edge
                }
-       } else if(lomask[x]){                        // inner mask was empty, test if outer mask is filled
-               if(!lomask[x-rw] || !lomask[x+1]) {      // test if outer mask is empty underneath or to the right
+       }
+       else if (lomask[x]) {                        // inner mask was empty, test if outer mask is filled
+               if (!lomask[x-rw] || !lomask[x+1]) {      // test if outer mask is empty underneath or to the right
                        osz++;                               // increment outer edge size
                        lres[x]=3;                           // flag pixel as outer edge
-               } else {
+               }
+               else {
                        gsz++;                               // increment the gradient pixel count
                        lres[x]=2;                           // flag pixel as gradient
                }
@@ -203,20 +222,23 @@ static void do_adjacentBleedBorders(unsigned int t, unsigned int rw, unsigned in
        /* upper right corner */
        x=t;
        // test if inner mask is filled
-       if(limask[x]){
+       if (limask[x]) {
                // test if pixel underneath, or to the left, are empty in the inner mask,
                // but filled in the outer mask
-               if((!limask[x-rw] && lomask[x-rw]) || (!limask[x-1] && lomask[x-1])){
+               if ((!limask[x-rw] && lomask[x-rw]) || (!limask[x-1] && lomask[x-1])) {
                        isz++;                               // increment inner edge size
                        lres[x]=4;                           // flag pixel as inner edge
-               } else {
+               }
+               else {
                        res[x]=1.0f;                         // pixel is just part of inner mask, and it's not an edge
                }
-       } else if(lomask[x]){                        // inner mask was empty, test if outer mask is filled
-               if(!lomask[x-rw] || !lomask[x-1]) {      // test if outer mask is empty underneath or to the left
+       }
+       else if (lomask[x]) {                        // inner mask was empty, test if outer mask is filled
+               if (!lomask[x-rw] || !lomask[x-1]) {      // test if outer mask is empty underneath or to the left
                        osz++;                               // increment outer edge size
                        lres[x]=3;                           // flag pixel as outer edge
-               } else {
+               }
+               else {
                        gsz++;                               // increment the gradient pixel count
                        lres[x]=2;                           // flag pixel as gradient
                }
@@ -224,20 +246,23 @@ static void do_adjacentBleedBorders(unsigned int t, unsigned int rw, unsigned in
        /* lower left corner */
        x=0;
        // test if inner mask is filled
-       if(limask[x]){
+       if (limask[x]) {
                // test if pixel above, or to the right, are empty in the inner mask,
                // but filled in the outer mask
-               if((!limask[x+rw] && lomask[x+rw]) || (!limask[x+1] && lomask[x+1])){
+               if ((!limask[x+rw] && lomask[x+rw]) || (!limask[x+1] && lomask[x+1])) {
                        isz++;                               // increment inner edge size
                        lres[x]=4;                           // flag pixel as inner edge
-               } else {
+               }
+               else {
                        res[x]=1.0f;                         // pixel is just part of inner mask, and it's not an edge
                }
-       } else if(lomask[x]){                        // inner mask was empty, test if outer mask is filled
-               if(!lomask[x+rw] || !lomask[x+1]) {      // test if outer mask is empty above or to the right
+       }
+       else if (lomask[x]) {                        // inner mask was empty, test if outer mask is filled
+               if (!lomask[x+rw] || !lomask[x+1]) {      // test if outer mask is empty above or to the right
                        osz++;                               // increment outer edge size
                        lres[x]=3;                           // flag pixel as outer edge
-               } else {
+               }
+               else {
                        gsz++;                               // increment the gradient pixel count
                        lres[x]=2;                           // flag pixel as gradient
                }
@@ -245,41 +270,47 @@ static void do_adjacentBleedBorders(unsigned int t, unsigned int rw, unsigned in
        /* lower right corner */
        x=rw-1;
        // test if inner mask is filled
-       if(limask[x]){
+       if (limask[x]) {
                // test if pixel above, or to the left, are empty in the inner mask,
                // but filled in the outer mask
-               if((!limask[x+rw] && lomask[x+rw]) || (!limask[x-1] && lomask[x-1])){
+               if ((!limask[x+rw] && lomask[x+rw]) || (!limask[x-1] && lomask[x-1])) {
                        isz++;                               // increment inner edge size
                        lres[x]=4;                           // flag pixel as inner edge
-               } else {
+               }
+               else {
                        res[x]=1.0f;                         // pixel is just part of inner mask, and it's not an edge
                }
-       } else if(lomask[x]){                        // inner mask was empty, test if outer mask is filled
-               if(!lomask[x+rw] || !lomask[x-1]) {      // test if outer mask is empty above or to the left
+       }
+       else if (lomask[x]) {                        // inner mask was empty, test if outer mask is filled
+               if (!lomask[x+rw] || !lomask[x-1]) {      // test if outer mask is empty above or to the left
                        osz++;                               // increment outer edge size
                        lres[x]=3;                           // flag pixel as outer edge
-               } else {
+               }
+               else {
                        gsz++;                               // increment the gradient pixel count
                        lres[x]=2;                           // flag pixel as gradient
                }
        }
        /* Test the TOP row of pixels in buffer, except corners */
-       for(x= t-1; x>=(t-rw)+2; x--) {
+       for (x= t-1; x>=(t-rw)+2; x--) {
                // test if inner mask is filled
-               if(limask[x]) {
+               if (limask[x]) {
                        // test if pixel to the left, or to the right, are empty in the inner mask,
                        // but filled in the outer mask
-                       if((!limask[x-1] && lomask[x-1]) || (!limask[x+1] && lomask[x+1])) {
+                       if ((!limask[x-1] && lomask[x-1]) || (!limask[x+1] && lomask[x+1])) {
                                isz++;                           // increment inner edge size
                                lres[x]=4;                       // flag pixel as inner edge
-                       } else {
+                       }
+                       else {
                                res[x]=1.0f;                     // pixel is just part of inner mask, and it's not an edge
                        }
-               } else if(lomask[x]) {                   // inner mask was empty, test if outer mask is filled
-                       if(!lomask[x-1] || !lomask[x+1]) {   // test if outer mask is empty to the left or to the right
+               }
+               else if (lomask[x]) {                   // inner mask was empty, test if outer mask is filled
+                       if (!lomask[x-1] || !lomask[x+1]) {   // test if outer mask is empty to the left or to the right
                                osz++;                           // increment outer edge size
                                lres[x]=3;                       // flag pixel as outer edge
-                       } else {
+                       }
+                       else {
                                gsz++;                           // increment the gradient pixel count
                                lres[x]=2;                       // flag pixel as gradient
                        }
@@ -287,44 +318,50 @@ static void do_adjacentBleedBorders(unsigned int t, unsigned int rw, unsigned in
        }
        
        /* Test the BOTTOM row of pixels in buffer, except corners */
-       for(x= rw-2; x; x--) {
+       for (x= rw-2; x; x--) {
                // test if inner mask is filled
-               if(limask[x]) {
+               if (limask[x]) {
                        // test if pixel to the left, or to the right, are empty in the inner mask,
                        // but filled in the outer mask
-                       if((!limask[x-1] && lomask[x-1]) || (!limask[x+1] && lomask[x+1])) {
+                       if ((!limask[x-1] && lomask[x-1]) || (!limask[x+1] && lomask[x+1])) {
                                isz++;                           // increment inner edge size
                                lres[x]=4;                       // flag pixel as inner edge
-                       } else {
+                       }
+                       else {
                                res[x]=1.0f;                     // pixel is just part of inner mask, and it's not an edge
                        }
-               } else if(lomask[x]) {                   // inner mask was empty, test if outer mask is filled
-                       if(!lomask[x-1] || !lomask[x+1]) {   // test if outer mask is empty to the left or to the right
+               }
+               else if (lomask[x]) {                   // inner mask was empty, test if outer mask is filled
+                       if (!lomask[x-1] || !lomask[x+1]) {   // test if outer mask is empty to the left or to the right
                                osz++;                           // increment outer edge size
                                lres[x]=3;                       // flag pixel as outer edge
-                       } else {
+                       }
+                       else {
                                gsz++;                           // increment the gradient pixel count
                                lres[x]=2;                       // flag pixel as gradient
                        }
                }
        }
        /* Test the LEFT edge of pixels in buffer, except corners */
-       for(x= t-(rw<<1)+1; x>=rw; x-=rw) {
+       for (x= t-(rw<<1)+1; x>=rw; x-=rw) {
                // test if inner mask is filled
-               if(limask[x]) {
+               if (limask[x]) {
                        // test if pixel underneath, or above, are empty in the inner mask,
                        // but filled in the outer mask
-                       if((!limask[x-rw] && lomask[x-rw]) || (!limask[x+rw] && lomask[x+rw])) {
+                       if ((!limask[x-rw] && lomask[x-rw]) || (!limask[x+rw] && lomask[x+rw])) {
                                isz++;                           // increment inner edge size
                                lres[x]=4;                       // flag pixel as inner edge
-                       } else {
+                       }
+                       else {
                                res[x]=1.0f;                     // pixel is just part of inner mask, and it's not an edge
                        }
-               } else if(lomask[x]) {                   // inner mask was empty, test if outer mask is filled
-                       if(!lomask[x-rw] || !lomask[x+rw]) { // test if outer mask is empty underneath or above
+               }
+               else if (lomask[x]) {                   // inner mask was empty, test if outer mask is filled
+                       if (!lomask[x-rw] || !lomask[x+rw]) { // test if outer mask is empty underneath or above
                                osz++;                           // increment outer edge size
                                lres[x]=3;                       // flag pixel as outer edge
-                       } else {
+                       }
+                       else {
                                gsz++;                           // increment the gradient pixel count
                                lres[x]=2;                       // flag pixel as gradient
                        }
@@ -332,22 +369,25 @@ static void do_adjacentBleedBorders(unsigned int t, unsigned int rw, unsigned in
        }
        
        /* Test the RIGHT edge of pixels in buffer, except corners */
-       for(x= t-rw; x>rw; x-=rw) {
+       for (x= t-rw; x>rw; x-=rw) {
                // test if inner mask is filled
-               if(limask[x]) {
+               if (limask[x]) {
                        // test if pixel underneath, or above, are empty in the inner mask,
                        // but filled in the outer mask
-                       if((!limask[x-rw] && lomask[x-rw]) || (!limask[x+rw] && lomask[x+rw])) {
+                       if ((!limask[x-rw] && lomask[x-rw]) || (!limask[x+rw] && lomask[x+rw])) {
                                isz++;                           // increment inner edge size
                                lres[x]=4;                       // flag pixel as inner edge
-                       } else {
+                       }
+                       else {
                                res[x]=1.0f;                     // pixel is just part of inner mask, and it's not an edge
                        }
-               } else if(lomask[x]) {                   // inner mask was empty, test if outer mask is filled
-                       if(!lomask[x-rw] || !lomask[x+rw]) { // test if outer mask is empty underneath or above
+               }
+               else if (lomask[x]) {                   // inner mask was empty, test if outer mask is filled
+                       if (!lomask[x-rw] || !lomask[x+rw]) { // test if outer mask is empty underneath or above
                                osz++;                           // increment outer edge size
                                lres[x]=3;                       // flag pixel as outer edge
-                       } else {
+                       }
+                       else {
                                gsz++;                           // increment the gradient pixel count
                                lres[x]=2;                       // flag pixel as gradient
                        }
@@ -359,7 +399,7 @@ static void do_adjacentBleedBorders(unsigned int t, unsigned int rw, unsigned in
        rsize[2]=gsz;
 }
 
-static void do_allKeepBorders(unsigned int t, unsigned int rw, unsigned int *limask, unsigned int *lomask, unsigned int *lres, float *res, unsigned int *rsize){
+static void do_allKeepBorders(unsigned int t, unsigned int rw, unsigned int *limask, unsigned int *lomask, unsigned int *lres, float *res, unsigned int *rsize) {
        int x;
        unsigned int isz=0; // inner edge size
        unsigned int osz=0; // outer edge size
@@ -368,126 +408,142 @@ static void do_allKeepBorders(unsigned int t, unsigned int rw, unsigned int *lim
        /* upper left corner */
        x=t-rw+1;
        // test if inner mask is filled
-       if(limask[x]){
+       if (limask[x]) {
                // test if the inner mask is empty underneath or to the right
-               if(!limask[x-rw] || !limask[x+1]){
+               if (!limask[x-rw] || !limask[x+1]) {
                        isz++;                               // increment inner edge size
                        lres[x]=4;                           // flag pixel as inner edge
-               } else {
+               }
+               else {
                        res[x]=1.0f;                         // pixel is just part of inner mask, and it's not an edge
                }
-       } else if(lomask[x]){                        // inner mask was empty, test if outer mask is filled
+       }
+       else if (lomask[x]) {                        // inner mask was empty, test if outer mask is filled
                osz++;                                   // increment outer edge size
                lres[x]=3;                               // flag pixel as outer edge
        }
        /* upper right corner */
        x=t;
        // test if inner mask is filled
-       if(limask[x]){
+       if (limask[x]) {
                // test if the inner mask is empty underneath or to the left
-               if(!limask[x-rw] || !limask[x-1]){
+               if (!limask[x-rw] || !limask[x-1]) {
                        isz++;                               // increment inner edge size
                        lres[x]=4;                           // flag pixel as inner edge
-               } else {
+               }
+               else {
                        res[x]=1.0f;                         // pixel is just part of inner mask, and it's not an edge
                }
-       } else if(lomask[x]){                        // inner mask was empty, test if outer mask is filled
+       }
+       else if (lomask[x]) {                        // inner mask was empty, test if outer mask is filled
                osz++;                                   // increment outer edge size
                lres[x]=3;                               // flag pixel as outer edge
        }
        /* lower left corner */
        x=0;
        // test if inner mask is filled
-       if(limask[x]){
+       if (limask[x]) {
                // test if inner mask is empty above or to the right
-               if(!limask[x+rw] || !limask[x+1]){
+               if (!limask[x+rw] || !limask[x+1]) {
                        isz++;                               // increment inner edge size
                        lres[x]=4;                           // flag pixel as inner edge
-               } else {
+               }
+               else {
                        res[x]=1.0f;                         // pixel is just part of inner mask, and it's not an edge
                }
-       } else if(lomask[x]){                        // inner mask was empty, test if outer mask is filled
+       }
+       else if (lomask[x]) {                        // inner mask was empty, test if outer mask is filled
                osz++;                                   // increment outer edge size
                lres[x]=3;                               // flag pixel as outer edge
        }
        /* lower right corner */
        x=rw-1;
        // test if inner mask is filled
-       if(limask[x]){
+       if (limask[x]) {
                // test if inner mask is empty above or to the left
-               if(!limask[x+rw] || !limask[x-1]){
+               if (!limask[x+rw] || !limask[x-1]) {
                        isz++;                               // increment inner edge size
                        lres[x]=4;                           // flag pixel as inner edge
-               } else {
+               }
+               else {
                        res[x]=1.0f;                         // pixel is just part of inner mask, and it's not an edge
                }
-       } else if(lomask[x]){                        // inner mask was empty, test if outer mask is filled
+       }
+       else if (lomask[x]) {                        // inner mask was empty, test if outer mask is filled
                osz++;                                   // increment outer edge size
                lres[x]=3;                               // flag pixel as outer edge
        }
        
        /* Test the TOP row of pixels in buffer, except corners */
-       for(x= t-1; x>=(t-rw)+2; x--) {
+       for (x= t-1; x>=(t-rw)+2; x--) {
                // test if inner mask is filled
-               if(limask[x]) {
+               if (limask[x]) {
                        // test if inner mask is empty to the left or to the right
-                       if(!limask[x-1] || !limask[x+1]) {
+                       if (!limask[x-1] || !limask[x+1]) {
                                isz++;                           // increment inner edge size
                                lres[x]=4;                       // flag pixel as inner edge
-                       } else {
+                       }
+                       else {
                                res[x]=1.0f;                     // pixel is just part of inner mask, and it's not an edge
                        }
-               } else if(lomask[x]) {                   // inner mask was empty, test if outer mask is filled
+               }
+               else if (lomask[x]) {                   // inner mask was empty, test if outer mask is filled
                        osz++;                               // increment outer edge size
                        lres[x]=3;                           // flag pixel as outer edge
                }
        }
        
        /* Test the BOTTOM row of pixels in buffer, except corners */
-       for(x= rw-2; x; x--) {
+       for (x= rw-2; x; x--) {
                // test if inner mask is filled
-               if(limask[x]) {
+               if (limask[x]) {
                        // test if inner mask is empty to the left or to the right
-                       if(!limask[x-1] || !limask[x+1]) {
+                       if (!limask[x-1] || !limask[x+1]) {
                                isz++;                           // increment inner edge size
                                lres[x]=4;                       // flag pixel as inner edge
-                       } else {
+                       }
+                       else {
                                res[x]=1.0f;                     // pixel is just part of inner mask, and it's not an edge
                        }
-               } else if(lomask[x]) {                   // inner mask was empty, test if outer mask is filled
+               }
+               else if (lomask[x]) {                   // inner mask was empty, test if outer mask is filled
                        osz++;                               // increment outer edge size
                        lres[x]=3;                           // flag pixel as outer edge
                }
        }
        /* Test the LEFT edge of pixels in buffer, except corners */
-       for(x= t-(rw<<1)+1; x>=rw; x-=rw) {
+       for (x= t-(rw<<1)+1; x>=rw; x-=rw) {
                // test if inner mask is filled
-               if(limask[x]) {
+               if (limask[x]) {
                        // test if inner mask is empty underneath or above
-                       if(!limask[x-rw] || !limask[x+rw]) {
+                       if (!limask[x-rw] || !limask[x+rw]) {
                                isz++;                           // increment inner edge size
                                lres[x]=4;                       // flag pixel as inner edge
-                       } else {
+                       }
+                       else {
                                res[x]=1.0f;                     // pixel is just part of inner mask, and it's not an edge
                        }
-               } else if(lomask[x]) {                   // inner mask was empty, test if outer mask is filled
+               }
+               else if (lomask[x]) {                   // inner mask was empty, test if outer mask is filled
                        osz++;                               // increment outer edge size
                        lres[x]=3;                           // flag pixel as outer edge
                }
        }
        
        /* Test the RIGHT edge of pixels in buffer, except corners */
-       for(x= t-rw; x>rw; x-=rw) {
+       for (x= t-rw; x>rw; x-=rw) {
                // test if inner mask is filled
-               if(limask[x]) {
+               if (limask[x]) {
                        // test if inner mask is empty underneath or above
-                       if(!limask[x-rw] || !limask[x+rw]) {
+                       if (!limask[x-rw] || !limask[x+rw]) {
                                isz++;                           // increment inner edge size
                                lres[x]=4;                       // flag pixel as inner edge
-                       } else {
+                       }
+                       else {
                                res[x]=1.0f;                     // pixel is just part of inner mask, and it's not an edge
                        }
-               } else if(lomask[x]) {                   // inner mask was empty, test if outer mask is filled
+               }
+               else if (lomask[x]) {                   // inner mask was empty, test if outer mask is filled
                        osz++;                               // increment outer edge size
                        lres[x]=3;                           // flag pixel as outer edge
                }
@@ -498,7 +554,7 @@ static void do_allKeepBorders(unsigned int t, unsigned int rw, unsigned int *lim
        rsize[2]=gsz;
 }
 
-static void do_allBleedBorders(unsigned int t, unsigned int rw, unsigned int *limask, unsigned int *lomask, unsigned int *lres, float *res, unsigned int *rsize){
+static void do_allBleedBorders(unsigned int t, unsigned int rw, unsigned int *limask, unsigned int *lomask, unsigned int *lres, float *res, unsigned int *rsize) {
        int x;
        unsigned int isz=0; // inner edge size
        unsigned int osz=0; // outer edge size
@@ -507,19 +563,22 @@ static void do_allBleedBorders(unsigned int t, unsigned int rw, unsigned int *li
        /* upper left corner */
        x=t-rw+1;
        // test if inner mask is filled
-       if(limask[x]){
+       if (limask[x]) {
                // test if the inner mask is empty underneath or to the right
-               if(!limask[x-rw] || !limask[x+1]){
+               if (!limask[x-rw] || !limask[x+1]) {
                        isz++;                               // increment inner edge size
                        lres[x]=4;                           // flag pixel as inner edge
-               } else {
+               }
+               else {
                        res[x]=1.0f;                         // pixel is just part of inner mask, and it's not an edge
                }
-       } else if(lomask[x]){                        // inner mask was empty, test if outer mask is filled
-               if(!lomask[x-rw] || !lomask[x+1]) {      // test if outer mask is empty underneath or to the right
+       }
+       else if (lomask[x]) {                        // inner mask was empty, test if outer mask is filled
+               if (!lomask[x-rw] || !lomask[x+1]) {      // test if outer mask is empty underneath or to the right
                        osz++;                               // increment outer edge size
                        lres[x]=3;                           // flag pixel as outer edge
-               } else {
+               }
+               else {
                        gsz++;                               // increment the gradient pixel count
                        lres[x]=2;                           // flag pixel as gradient
                }
@@ -527,19 +586,22 @@ static void do_allBleedBorders(unsigned int t, unsigned int rw, unsigned int *li
        /* upper right corner */
        x=t;
        // test if inner mask is filled
-       if(limask[x]){
+       if (limask[x]) {
                // test if the inner mask is empty underneath or to the left
-               if(!limask[x-rw] || !limask[x-1]){
+               if (!limask[x-rw] || !limask[x-1]) {
                        isz++;                               // increment inner edge size
                        lres[x]=4;                           // flag pixel as inner edge
-               } else {
+               }
+               else {
                        res[x]=1.0f;                         // pixel is just part of inner mask, and it's not an edge
                }
-       } else if(lomask[x]){                        // inner mask was empty, test if outer mask is filled
-               if(!lomask[x-rw] || !lomask[x-1]) {      // test if outer mask is empty above or to the left
+       }
+       else if (lomask[x]) {                        // inner mask was empty, test if outer mask is filled
+               if (!lomask[x-rw] || !lomask[x-1]) {      // test if outer mask is empty above or to the left
                        osz++;                               // increment outer edge size
                        lres[x]=3;                           // flag pixel as outer edge
-               } else {
+               }
+               else {
                        gsz++;                               // increment the gradient pixel count
                        lres[x]=2;                           // flag pixel as gradient
                }
@@ -547,19 +609,22 @@ static void do_allBleedBorders(unsigned int t, unsigned int rw, unsigned int *li
        /* lower left corner */
        x=0;
        // test if inner mask is filled
-       if(limask[x]){
+       if (limask[x]) {
                // test if inner mask is empty above or to the right
-               if(!limask[x+rw] || !limask[x+1]){
+               if (!limask[x+rw] || !limask[x+1]) {
                        isz++;                               // increment inner edge size
                        lres[x]=4;                           // flag pixel as inner edge
-               } else {
+               }
+               else {
                        res[x]=1.0f;                         // pixel is just part of inner mask, and it's not an edge
                }
-       } else if(lomask[x]){                        // inner mask was empty, test if outer mask is filled
-               if(!lomask[x+rw] || !lomask[x+1]) {      // test if outer mask is empty underneath or to the right
+       }
+       else if (lomask[x]) {                        // inner mask was empty, test if outer mask is filled
+               if (!lomask[x+rw] || !lomask[x+1]) {      // test if outer mask is empty underneath or to the right
                        osz++;                               // increment outer edge size
                        lres[x]=3;                           // flag pixel as outer edge
-               } else {
+               }
+               else {
                        gsz++;                               // increment the gradient pixel count
                        lres[x]=2;                           // flag pixel as gradient
                }
@@ -567,39 +632,45 @@ static void do_allBleedBorders(unsigned int t, unsigned int rw, unsigned int *li
        /* lower right corner */
        x=rw-1;
        // test if inner mask is filled
-       if(limask[x]){
+       if (limask[x]) {
                // test if inner mask is empty above or to the left
-               if(!limask[x+rw] || !limask[x-1]){
+               if (!limask[x+rw] || !limask[x-1]) {
                        isz++;                               // increment inner edge size
                        lres[x]=4;                           // flag pixel as inner edge
-               } else {
+               }
+               else {
                        res[x]=1.0f;                         // pixel is just part of inner mask, and it's not an edge
                }
-       } else if(lomask[x]){                        // inner mask was empty, test if outer mask is filled
-               if(!lomask[x+rw] || !lomask[x-1]) {      // test if outer mask is empty underneath or to the left
+       }
+       else if (lomask[x]) {                        // inner mask was empty, test if outer mask is filled
+               if (!lomask[x+rw] || !lomask[x-1]) {      // test if outer mask is empty underneath or to the left
                        osz++;                               // increment outer edge size
                        lres[x]=3;                           // flag pixel as outer edge
-               } else {
+               }
+               else {
                        gsz++;                               // increment the gradient pixel count
                        lres[x]=2;                           // flag pixel as gradient
                }
        }
        /* Test the TOP row of pixels in buffer, except corners */
-       for(x= t-1; x>=(t-rw)+2; x--) {
+       for (x= t-1; x>=(t-rw)+2; x--) {
                // test if inner mask is filled
-               if(limask[x]) {
+               if (limask[x]) {
                        // test if inner mask is empty to the left or to the right
-                       if(!limask[x-1] || !limask[x+1]) {
+                       if (!limask[x-1] || !limask[x+1]) {
                                isz++;                           // increment inner edge size
                                lres[x]=4;                       // flag pixel as inner edge
-                       } else {
+                       }
+                       else {
                                res[x]=1.0f;                     // pixel is just part of inner mask, and it's not an edge
                        }
-               } else if(lomask[x]) {                   // inner mask was empty, test if outer mask is filled
-                       if(!lomask[x-1] || !lomask[x+1]) {   // test if outer mask is empty to the left or to the right
+               }
+               else if (lomask[x]) {                   // inner mask was empty, test if outer mask is filled
+                       if (!lomask[x-1] || !lomask[x+1]) {   // test if outer mask is empty to the left or to the right
                                osz++;                           // increment outer edge size
                                lres[x]=3;                       // flag pixel as outer edge
-                       } else {
+                       }
+                       else {
                                gsz++;                           // increment the gradient pixel count
                                lres[x]=2;                       // flag pixel as gradient
                        }
@@ -607,42 +678,48 @@ static void do_allBleedBorders(unsigned int t, unsigned int rw, unsigned int *li
        }
        
        /* Test the BOTTOM row of pixels in buffer, except corners */
-       for(x= rw-2; x; x--) {
+       for (x= rw-2; x; x--) {
                // test if inner mask is filled
-               if(limask[x]) {
+               if (limask[x]) {
                        // test if inner mask is empty to the left or to the right
-                       if(!limask[x-1] || !limask[x+1]) {
+                       if (!limask[x-1] || !limask[x+1]) {
                                isz++;                           // increment inner edge size
                                lres[x]=4;                       // flag pixel as inner edge
-                       } else {
+                       }
+                       else {
                                res[x]=1.0f;                     // pixel is just part of inner mask, and it's not an edge
                        }
-               } else if(lomask[x]) {                   // inner mask was empty, test if outer mask is filled
-                       if(!lomask[x-1] || !lomask[x+1]) {   // test if outer mask is empty to the left or to the right
+               }
+               else if (lomask[x]) {                   // inner mask was empty, test if outer mask is filled
+                       if (!lomask[x-1] || !lomask[x+1]) {   // test if outer mask is empty to the left or to the right
                                osz++;                           // increment outer edge size
                                lres[x]=3;                       // flag pixel as outer edge
-                       } else {
+                       }
+                       else {
                                gsz++;                           // increment the gradient pixel count
                                lres[x]=2;                       // flag pixel as gradient
                        }
                }
        }
        /* Test the LEFT edge of pixels in buffer, except corners */
-       for(x= t-(rw<<1)+1; x>=rw; x-=rw) {
+       for (x= t-(rw<<1)+1; x>=rw; x-=rw) {
                // test if inner mask is filled
-               if(limask[x]) {
+               if (limask[x]) {
                        // test if inner mask is empty underneath or above
-                       if(!limask[x-rw] || !limask[x+rw]) {
+                       if (!limask[x-rw] || !limask[x+rw]) {
                                isz++;                           // increment inner edge size
                                lres[x]=4;                       // flag pixel as inner edge
-                       } else {
+                       }
+                       else {
                                res[x]=1.0f;                     // pixel is just part of inner mask, and it's not an edge
                        }
-               } else if(lomask[x]) {                   // inner mask was empty, test if outer mask is filled
-                       if(!lomask[x-rw] || !lomask[x+rw]) { // test if outer mask is empty underneath or above
+               }
+               else if (lomask[x]) {                   // inner mask was empty, test if outer mask is filled
+                       if (!lomask[x-rw] || !lomask[x+rw]) { // test if outer mask is empty underneath or above
                                osz++;                           // increment outer edge size
                                lres[x]=3;                       // flag pixel as outer edge
-                       } else {
+                       }
+                       else {
                                gsz++;                           // increment the gradient pixel count
                                lres[x]=2;                       // flag pixel as gradient
                        }
@@ -650,21 +727,24 @@ static void do_allBleedBorders(unsigned int t, unsigned int rw, unsigned int *li
        }
        
        /* Test the RIGHT edge of pixels in buffer, except corners */
-       for(x= t-rw; x>rw; x-=rw) {
+       for (x= t-rw; x>rw; x-=rw) {
                // test if inner mask is filled
-               if(limask[x]) {
+               if (limask[x]) {
                        // test if inner mask is empty underneath or above
-                       if(!limask[x-rw] || !limask[x+rw]) {
+                       if (!limask[x-rw] || !limask[x+rw]) {
                                isz++;                           // increment inner edge size
                                lres[x]=4;                       // flag pixel as inner edge
-                       } else {
+                       }
+                       else {
                                res[x]=1.0f;                     // pixel is just part of inner mask, and it's not an edge
                        }
-               } else if(lomask[x]) {                   // inner mask was empty, test if outer mask is filled
-                       if(!lomask[x-rw] || !lomask[x+rw]) { // test if outer mask is empty underneath or above
+               }
+               else if (lomask[x]) {                   // inner mask was empty, test if outer mask is filled
+                       if (!lomask[x-rw] || !lomask[x+rw]) { // test if outer mask is empty underneath or above
                                osz++;                           // increment outer edge size
                                lres[x]=3;                       // flag pixel as outer edge
-                       } else {
+                       }
+                       else {
                                gsz++;                           // increment the gradient pixel count
                                lres[x]=2;                       // flag pixel as gradient
                        }
@@ -676,7 +756,7 @@ static void do_allBleedBorders(unsigned int t, unsigned int rw, unsigned int *li
        rsize[2]=gsz;
 }
 
-static void do_allEdgeDetection(unsigned int t, unsigned int rw, unsigned int *limask, unsigned int *lomask, unsigned int *lres, float *res, unsigned int *rsize, unsigned int in_isz, unsigned int in_osz, unsigned int in_gsz){
+static void do_allEdgeDetection(unsigned int t, unsigned int rw, unsigned int *limask, unsigned int *lomask, unsigned int *lres, float *res, unsigned int *rsize, unsigned int in_isz, unsigned int in_osz, unsigned int in_gsz) {
        int x;                             // x = pixel loop counter
        int a;                             // a = pixel loop counter
        int dx;                            // dx = delta x
@@ -685,39 +765,42 @@ static void do_allEdgeDetection(unsigned int t, unsigned int rw, unsigned int *l
        int pix_prevCol;                   // pix_prevCol = pixel one column behind the one we are testing in a loop
        int pix_nextCol;                   // pix_nextCol = pixel one column in front of the one we are testing in a loop
        /* Test all rows between the FIRST and LAST rows, excluding left and right edges */
-       for(x= (t-rw)+1, dx=x-(rw-2); dx>rw; x-=rw,dx-=rw) {
+       for (x= (t-rw)+1, dx=x-(rw-2); dx>rw; x-=rw,dx-=rw) {
                a=x-2;
                pix_prevRow=a+rw;
                pix_nextRow=a-rw;
                pix_prevCol=a+1;
                pix_nextCol=a-1;
-               while(a>dx-2) {
-                       if(!limask[a]) {             // if the inner mask is empty
-                               if(lomask[a]) {          // if the outer mask is full
+               while (a>dx-2) {
+                       if (!limask[a]) {             // if the inner mask is empty
+                               if (lomask[a]) {          // if the outer mask is full
                                        /*
           Next we test all 4 directions around the current pixel: next/prev/up/down
           The test ensures that the outer mask is empty and that the inner mask
           is also empty. If both conditions are true for any one of the 4 adjacent pixels
           then the current pixel is counted as being a true outer edge pixel.
          */
-                                       if((!lomask[pix_nextCol] && !limask[pix_nextCol]) ||
+                                       if ((!lomask[pix_nextCol] && !limask[pix_nextCol]) ||
                                                (!lomask[pix_prevCol] && !limask[pix_prevCol]) ||
                                                (!lomask[pix_nextRow] && !limask[pix_nextRow]) ||
                                                (!lomask[pix_prevRow] && !limask[pix_prevRow]))
                                        {
                                                in_osz++;           // increment the outer boundary pixel count
                                                lres[a]=3;       // flag pixel as part of outer edge
-                                       } else {             // it's not a boundary pixel, but it is a gradient pixel
+                                       }
+                                       else {             // it's not a boundary pixel, but it is a gradient pixel
                                                in_gsz++;           // increment the gradient pixel count
                                                lres[a]=2;       // flag pixel as gradient
                                        }
                                }
                                
-                       } else {
-                               if(!limask[pix_nextCol] || !limask[pix_prevCol] || !limask[pix_nextRow] || !limask[pix_prevRow]) {
+                       }
+                       else {
+                               if (!limask[pix_nextCol] || !limask[pix_prevCol] || !limask[pix_nextRow] || !limask[pix_prevRow]) {
                                        in_isz++;               // increment the inner boundary pixel count
                                        lres[a]=4;           // flag pixel as part of inner edge
-                               } else {
+                               }
+                               else {
                                        res[a]=1.0f;         // pixel is part of inner mask, but not at an edge
                                }
                        }
@@ -734,7 +817,7 @@ static void do_allEdgeDetection(unsigned int t, unsigned int rw, unsigned int *l
        rsize[2]=in_gsz;
 }
 
-static void do_adjacentEdgeDetection(unsigned int t, unsigned int rw, unsigned int *limask, unsigned int *lomask, unsigned int *lres, float *res, unsigned int *rsize, unsigned int in_isz, unsigned int in_osz, unsigned int in_gsz){
+static void do_adjacentEdgeDetection(unsigned int t, unsigned int rw, unsigned int *limask, unsigned int *lomask, unsigned int *lres, float *res, unsigned int *rsize, unsigned int in_isz, unsigned int in_osz, unsigned int in_gsz) {
        int x;                             // x = pixel loop counter
        int a;                             // a = pixel loop counter
        int dx;                            // dx = delta x
@@ -743,43 +826,46 @@ static void do_adjacentEdgeDetection(unsigned int t, unsigned int rw, unsigned i
        int pix_prevCol;                   // pix_prevCol = pixel one column behind the one we are testing in a loop
        int pix_nextCol;                   // pix_nextCol = pixel one column in front of the one we are testing in a loop
        /* Test all rows between the FIRST and LAST rows, excluding left and right edges */
-       for(x= (t-rw)+1, dx=x-(rw-2); dx>rw; x-=rw,dx-=rw) {
+       for (x= (t-rw)+1, dx=x-(rw-2); dx>rw; x-=rw,dx-=rw) {
                a=x-2;
                pix_prevRow=a+rw;
                pix_nextRow=a-rw;
                pix_prevCol=a+1;
                pix_nextCol=a-1;
-               while(a>dx-2) {
-                       if(!limask[a]) {             // if the inner mask is empty
-                               if(lomask[a]) {          // if the outer mask is full
+               while (a>dx-2) {
+                       if (!limask[a]) {             // if the inner mask is empty
+                               if (lomask[a]) {          // if the outer mask is full
                                        /*
           Next we test all 4 directions around the current pixel: next/prev/up/down
           The test ensures that the outer mask is empty and that the inner mask
           is also empty. If both conditions are true for any one of the 4 adjacent pixels
           then the current pixel is counted as being a true outer edge pixel.
          */
-                                       if((!lomask[pix_nextCol] && !limask[pix_nextCol]) ||
+                                       if ((!lomask[pix_nextCol] && !limask[pix_nextCol]) ||
                                                (!lomask[pix_prevCol] && !limask[pix_prevCol]) ||
                                                (!lomask[pix_nextRow] && !limask[pix_nextRow]) ||
                                                (!lomask[pix_prevRow] && !limask[pix_prevRow]))
                                        {
                                                in_osz++;           // increment the outer boundary pixel count
                                                lres[a]=3;       // flag pixel as part of outer edge
-                                       } else {             // it's not a boundary pixel, but it is a gradient pixel
+                                       }
+                                       else {             // it's not a boundary pixel, but it is a gradient pixel
                                                in_gsz++;           // increment the gradient pixel count
                                                lres[a]=2;       // flag pixel as gradient
                                        }
                                }
                                
-                       } else {
-                               if((!limask[pix_nextCol] && lomask[pix_nextCol]) ||
+                       }
+                       else {
+                               if ((!limask[pix_nextCol] && lomask[pix_nextCol]) ||
                                        (!limask[pix_prevCol] && lomask[pix_prevCol]) ||
                                        (!limask[pix_nextRow] && lomask[pix_nextRow]) ||
                                        (!limask[pix_prevRow] && lomask[pix_prevRow]))
                                {
                                        in_isz++;               // increment the inner boundary pixel count
                                        lres[a]=4;           // flag pixel as part of inner edge
-                               } else {
+                               }
+                               else {
                                        res[a]=1.0f;         // pixel is part of inner mask, but not at an edge
                                }
                        }
@@ -796,7 +882,7 @@ static void do_adjacentEdgeDetection(unsigned int t, unsigned int rw, unsigned i
        rsize[2]=in_gsz;
 }
 
-static void do_createEdgeLocationBuffer(unsigned int t, unsigned int rw, unsigned int *lres, float *res, unsigned short *gbuf, unsigned int *innerEdgeOffset, unsigned int *outerEdgeOffset, unsigned int isz, unsigned int gsz){
+static void do_createEdgeLocationBuffer(unsigned int t, unsigned int rw, unsigned int *lres, float *res, unsigned short *gbuf, unsigned int *innerEdgeOffset, unsigned int *outerEdgeOffset, unsigned int isz, unsigned int gsz) {
        int x;                             // x = pixel loop counter
        int a;                             // a = temporary pixel index buffer loop counter
        unsigned int ud;                   // ud = unscaled edge distance
@@ -878,21 +964,23 @@ static void do_createEdgeLocationBuffer(unsigned int t, unsigned int rw, unsigne
        innerAccum = *innerEdgeOffset;                     // section's offset so when we start filling, each
        outerAccum = *outerEdgeOffset;                     // section fills up it's allocated space in gbuf
        //uses dmin=row, rsl=col
-       for(x=0,dmin=0; x<t; x+=rw,dmin++) {
-               for(rsl=0; rsl<rw; rsl++) {
+       for (x=0,dmin=0; x<t; x+=rw,dmin++) {
+               for (rsl=0; rsl<rw; rsl++) {
                        a=x+rsl;
-                       if(lres[a]==2) {           // it is a gradient pixel flagged by 2
+                       if (lres[a]==2) {           // it is a gradient pixel flagged by 2
                                ud=gradientAccum<<1;   // double the index to reach correct unsigned short location
                                gbuf[ud]=dmin;         // insert pixel's row into gradient pixel location buffer
                                gbuf[ud+1]=rsl;        // insert pixel's column into gradient pixel location buffer
                                gradientAccum++;       // increment gradient index buffer pointer
-                       } else if(lres[a]==3) {    // it is an outer edge pixel flagged by 3
+                       }
+                       else if (lres[a]==3) {    // it is an outer edge pixel flagged by 3
                                ud=outerAccum<<1;      // double the index to reach correct unsigned short location
                                gbuf[ud]=dmin;         // insert pixel's row into outer edge pixel location buffer
                                gbuf[ud+1]=rsl;        // insert pixel's column into outer edge pixel location buffer
                                outerAccum++;          // increment outer edge index buffer pointer
                                res[a]=0.0f;           // set output pixel intensity now since it won't change later
-                       } else if(lres[a]==4) {    // it is an inner edge pixel flagged by 4
+                       }
+                       else if (lres[a]==4) {    // it is an inner edge pixel flagged by 4
                                ud=innerAccum<<1;      // double int index to reach correct unsigned short location
                                gbuf[ud]=dmin;         // insert pixel's row into inner edge pixel location buffer
                                gbuf[ud+1]=rsl;        // insert pixel's column into inner edge pixel location buffer
@@ -904,7 +992,7 @@ static void do_createEdgeLocationBuffer(unsigned int t, unsigned int rw, unsigne
        
 }
 
-static void do_fillGradientBuffer(unsigned int rw, float *res, unsigned short *gbuf, unsigned int isz, unsigned int osz, unsigned int gsz, unsigned int innerEdgeOffset, unsigned int outerEdgeOffset){
+static void do_fillGradientBuffer(unsigned int rw, float *res, unsigned short *gbuf, unsigned int isz, unsigned int osz, unsigned int gsz, unsigned int innerEdgeOffset, unsigned int outerEdgeOffset) {
        int x;                             // x = pixel loop counter
        int a;                             // a = temporary pixel index buffer loop counter
        int fsz;                           // size of the frame
@@ -980,17 +1068,17 @@ static void do_fillGradientBuffer(unsigned int rw, float *res, unsigned short *g
   Loop through all gradient pixels.
   */
        
-       for(x= gsz-1; x>=0; x--) {
+       for (x= gsz-1; x>=0; x--) {
                gradientFillOffset=x<<1;
                t=gbuf[gradientFillOffset];         // calculate column of pixel indexed by gbuf[x]
                fsz=gbuf[gradientFillOffset+1];     // calculate row of pixel indexed by gbuf[x]
                dmin=0xffffffff;                    // reset min distance to edge pixel
-               for(a=outerEdgeOffset+osz-1; a>=outerEdgeOffset; a--) {   // loop through all outer edge buffer pixels
+               for (a=outerEdgeOffset+osz-1; a>=outerEdgeOffset; a--) {   // loop through all outer edge buffer pixels
                        ud=a<<1;
                        dy=t-gbuf[ud];                  // set dx to gradient pixel column - outer edge pixel row
                        dx=fsz-gbuf[ud+1];              // set dy to gradient pixel row - outer edge pixel column
                        ud=dx*dx+dy*dy;                 // compute sum of squares
-                       if(ud<dmin) {                   // if our new sum of squares is less than the current minimum
+                       if (ud<dmin) {                   // if our new sum of squares is less than the current minimum
                                dmin=ud;                    // set a new minimum equal to the new lower value
                        }
                }
@@ -1001,12 +1089,12 @@ static void do_fillGradientBuffer(unsigned int rw, float *res, unsigned short *g
                odist=*(float*)&rsl;                     // reciprocal square root
                odist=odist*(rsopf-(rsf*odist*odist));   // -- ** this line can be iterated for more accuracy ** --
                dmin=0xffffffff;                         // reset min distance to edge pixel
-               for(a= innerEdgeOffset+isz-1; a>=innerEdgeOffset; a--) {   // loop through all inside edge pixels
+               for (a= innerEdgeOffset+isz-1; a>=innerEdgeOffset; a--) {   // loop through all inside edge pixels
                        ud=a<<1;
                        dy=t-gbuf[ud];         // compute delta in Y from gradient pixel to inside edge pixel
                        dx=fsz-gbuf[ud+1];     // compute delta in X from gradient pixel to inside edge pixel
                        ud=dx*dx+dy*dy;        // compute sum of squares
-                       if(ud<dmin) {          // if our new sum of squares is less than the current minimum we've found
+                       if (ud<dmin) {          // if our new sum of squares is less than the current minimum we've found
                                dmin=ud;           // set a new minimum equal to the new lower value
                        }
                }
@@ -1052,7 +1140,7 @@ void DoubleEdgeMaskOperation::doDoubleEdgeMask(float* imask, float *omask, float
        
        unsigned short *gbuf;              // gradient/inner/outer pixel location index buffer
        
-       if(true) {                    // if both input sockets have some data coming in...
+       if (true) {                    // if both input sockets have some data coming in...
                
                t=(this->getWidth()*this->getHeight())-1;                                // determine size of the frame
                
@@ -1087,10 +1175,11 @@ void DoubleEdgeMaskOperation::doDoubleEdgeMask(float* imask, float *omask, float
                         
                 Each version has slightly different criteria for detecting an edge pixel.
                 */
-               if(this->adjecentOnly) {            // if "adjacent only" inner edge mode is turned on
-                       if(this->keepInside) {        // if "keep inside" buffer edge mode is turned on
+               if (this->adjecentOnly) {            // if "adjacent only" inner edge mode is turned on
+                       if (this->keepInside) {          // if "keep inside" buffer edge mode is turned on
                                do_adjacentKeepBorders(t,rw,limask,lomask,lres,res,rsize);
-                       }else{                     // "bleed out" buffer edge mode is turned on
+                       }
+                       else {                     // "bleed out" buffer edge mode is turned on
                                do_adjacentBleedBorders(t,rw,limask,lomask,lres,res,rsize);
                        }
                        isz=rsize[0];              // set up inner edge, outer edge, and gradient buffer sizes after border pass
@@ -1098,10 +1187,12 @@ void DoubleEdgeMaskOperation::doDoubleEdgeMask(float* imask, float *omask, float
                        gsz=rsize[2];
                        // detect edges in all non-border pixels in the buffer
                        do_adjacentEdgeDetection(t,rw,limask,lomask,lres,res,rsize,isz,osz,gsz);
-               }else{                         // "all" inner edge mode is turned on
-                       if(this->keepInside) {        // if "keep inside" buffer edge mode is turned on
+               }
+               else {                            // "all" inner edge mode is turned on
+                       if (this->keepInside) {        // if "keep inside" buffer edge mode is turned on
                                do_allKeepBorders(t,rw,limask,lomask,lres,res,rsize);
-                       }else{                     // "bleed out" buffer edge mode is turned on
+                       }
+                       else {                     // "bleed out" buffer edge mode is turned on
                                do_allBleedBorders(t,rw,limask,lomask,lres,res,rsize);
                        }
                        isz=rsize[0];              // set up inner edge, outer edge, and gradient buffer sizes after border pass
@@ -1144,7 +1235,8 @@ bool DoubleEdgeMaskOperation::determineDependingAreaOfInterest(rcti *input, Read
                newInput.ymax = this->getHeight();
                newInput.ymin = 0;
                return NodeOperation::determineDependingAreaOfInterest(&newInput, readOperation, output);
-       } else {
+       }
+       else {
                return false;
        }
 }
index 033cb4da84d90a83e88be08c020cc45687f50f3c..bc15523c149aae9730fa2bead3d7bf3f27d1afc3 100644 (file)
@@ -72,7 +72,8 @@ void EllipseMaskOperation::executePixel(float* color, float x, float y, PixelSam
                case CMP_NODE_MASKTYPE_ADD:
                        if (inside) {
                                color[0] = max(inputMask[0],inputValue[0]);
-                       } else {
+                       }
+                       else {
                                color[0] = inputMask[0];
                        }
                        break;
@@ -80,14 +81,16 @@ void EllipseMaskOperation::executePixel(float* color, float x, float y, PixelSam
                        if (inside) {
                                color[0] = inputMask[0]-inputValue[0];
                                CLAMP(color[0], 0, 1);
-                       } else {
+                       }
+                       else {
                                color[0] = inputMask[0];
                        }
                        break;
                case CMP_NODE_MASKTYPE_MULTIPLY:
                        if (inside) {
                                color[0] = inputMask[0]*inputValue[0];
-                       } else {
+                       }
+                       else {
                                color[0] = 0;
                        }
                        break;
@@ -95,10 +98,12 @@ void EllipseMaskOperation::executePixel(float* color, float x, float y, PixelSam
                if (inside) {
                        if (inputMask[0]>0.0f) {
                                color[0] = 0;
-                       } else {
+                       }
+                       else {
                                color[0] = inputValue[0];
                        }
-               } else {
+               }
+               else {
                        color[0] = inputMask[0];
                }
                        break;
index aae396942209f85cbc2f8020489310b9059063d4..6194e1d66994aedb593e2e21c34cf2cba953b025 100644 (file)
@@ -24,7 +24,7 @@
 #include "MEM_guardedalloc.h"
 #include "BLI_utildefines.h"
 
-FastGaussianBlurOperation::FastGaussianBlurOperation(): BlurBaseOperation(){
+FastGaussianBlurOperation::FastGaussianBlurOperation(): BlurBaseOperation() {
        this->iirgaus = false;
 }
 
@@ -34,7 +34,7 @@ void FastGaussianBlurOperation::executePixel(float *color,int x, int y, MemoryBu
        newData->read(color, x, y);     
 }
 
-bool FastGaussianBlurOperation::determineDependingAreaOfInterest(rcti *input, ReadBufferOperation *readOperation, rcti *output){
+bool FastGaussianBlurOperation::determineDependingAreaOfInterest(rcti *input, ReadBufferOperation *readOperation, rcti *output) {
        rcti newInput;
        rcti sizeInput;
        sizeInput.xmin = 0;
@@ -45,13 +45,15 @@ bool FastGaussianBlurOperation::determineDependingAreaOfInterest(rcti *input, Re
        NodeOperation * operation = this->getInputOperation(1);
        if (operation->determineDependingAreaOfInterest(&sizeInput, readOperation, output)) {
                return true;
-       }else {
-               if(this->iirgaus){
+       }
+       else {
+               if (this->iirgaus) {
                        newInput.xmax = input->xmax + (sx);
                        newInput.xmin = input->xmin - (sx);
                        newInput.ymax = input->ymax + (sy);
                        newInput.ymin = input->ymin - (sy);
-               }else {
+               }
+               else {
                        newInput.xmin = 0;
                        newInput.ymin = 0;
                        newInput.xmax = this->getWidth();
@@ -61,7 +63,7 @@ bool FastGaussianBlurOperation::determineDependingAreaOfInterest(rcti *input, Re
        }
 }
 
-void* FastGaussianBlurOperation::initializeTileData(rcti *rect, MemoryBuffer **memoryBuffers){
+void* FastGaussianBlurOperation::initializeTileData(rcti *rect, MemoryBuffer **memoryBuffers) {
        MemoryBuffer *newBuf = (MemoryBuffer*)this->inputProgram->initializeTileData(rect, memoryBuffers);
        MemoryBuffer *copy = newBuf->duplicate();
        updateSize(memoryBuffers);
@@ -88,7 +90,7 @@ void* FastGaussianBlurOperation::initializeTileData(rcti *rect, MemoryBuffer **m
        return copy;
 }
 
-void FastGaussianBlurOperation::deinitializeTileData(rcti *rect, MemoryBuffer **memoryBuffers, void *data){
+void FastGaussianBlurOperation::deinitializeTileData(rcti *rect, MemoryBuffer **memoryBuffers, void *data) {
        MemoryBuffer *newData = (MemoryBuffer*)data;
        delete newData;
 }
index afe3173ab0f8e4e29ab05505484bcf5a1bad5b11..98acb4cfb5d011d6eb1b724a8b185a5dd9c7407d 100644 (file)
@@ -52,14 +52,16 @@ bool FlipOperation::determineDependingAreaOfInterest(rcti *input, ReadBufferOper
        if (this->flipX) {
                newInput.xmax = (this->getWidth()- 1 - input->xmin)+1;
                newInput.xmin = (this->getWidth()- 1 - input->xmax)-1;
-       } else {
+       }
+       else {
                newInput.xmin = input->xmin;
                newInput.xmax = input->xmax;
        }
        if (this->flipY) {
                newInput.ymax = (this->getHeight()- 1 - input->ymin)+1;
                newInput.ymin = (this->getHeight()- 1 - input->ymax)-1;
-       } else {
+       }
+       else {
                newInput.ymin = input->ymin;
                newInput.ymax = input->ymax;
        }
index 9b7df61143eeac4ca107f501aba9fbdc5888f6c5..faadad27a5516f99451490f277320b4d488f39ab 100644 (file)
@@ -51,16 +51,16 @@ void GaussianBokehBlurOperation::updateGauss(MemoryBuffer **memoryBuffers) {
                updateSize(memoryBuffers);
                
                radxf = size*(float)this->data->sizex;
-               if(radxf>width/2.0f)
+               if (radxf>width/2.0f)
                        radxf= width/2.0f;
-               else if(radxf<1.0f)
+               else if (radxf<1.0f)
                        radxf= 1.0f;
        
                /* vertical */
                radyf = size*(float)this->data->sizey;
-               if(radyf>height/2.0f)
+               if (radyf>height/2.0f)
                        radyf= height/2.0f;
-               else if(radyf<1.0f)
+               else if (radyf<1.0f)
                        radyf= 1.0f;
        
                radx= ceil(radxf);
@@ -72,8 +72,8 @@ void GaussianBokehBlurOperation::updateGauss(MemoryBuffer **memoryBuffers) {
                ddgauss= new float[n];
                dgauss= ddgauss;
                val= 0.0f;
-               for(j=-rady; j<=rady; j++) {
-                       for(i=-radx; i<=radx; i++, dgauss++) {
+               for (j=-rady; j<=rady; j++) {
+                       for (i=-radx; i<=radx; i++, dgauss++) {
                                float fj= (float)j/radyf;
                                float fi= (float)i/radxf;
                                float dist= sqrt(fj*fj + fi*fi);
@@ -82,9 +82,9 @@ void GaussianBokehBlurOperation::updateGauss(MemoryBuffer **memoryBuffers) {
                                val+= *dgauss;
                        }
                }
-               if(val!=0.0f) {
+               if (val!=0.0f) {
                        val= 1.0f/val;
-                       for(j= n -1; j>=0; j--)
+                       for (j= n -1; j>=0; j--)
                                ddgauss[j]*= val;
                }
                else ddgauss[4]= 1.0f;
@@ -155,7 +155,8 @@ bool GaussianBokehBlurOperation::determineDependingAreaOfInterest(rcti *input, R
        
        if (operation->determineDependingAreaOfInterest(&sizeInput, readOperation, output)) {
                return true;
-       } else {
+       }
+       else {
                if (this->gausstab) {
                        int addx = radx;
                        int addy = rady;
@@ -163,7 +164,8 @@ bool GaussianBokehBlurOperation::determineDependingAreaOfInterest(rcti *input, R
                        newInput.xmin = input->xmin - addx;
                        newInput.ymax = input->ymax + addy;
                        newInput.ymin = input->ymin - addy;
-               } else {
+               }
+               else {
                        newInput.xmin = 0;
                        newInput.ymin = 0;
                        newInput.xmax = this->getWidth();
index a93c0e44d18af21d88994db19173b75238c26521..7ac8fcb2d64559c8765c4366ab0b7a2e9f158c74 100644 (file)
@@ -43,7 +43,7 @@ void GaussianXBlurOperation::updateGauss(MemoryBuffer **memoryBuffers) {
        if (this->gausstab == NULL) {
                updateSize(memoryBuffers);
                float rad = size*this->data->sizex;
-               if(rad<1)
+               if (rad<1)
                        rad= 1;
 
                this->rad = rad;
@@ -111,13 +111,15 @@ bool GaussianXBlurOperation::determineDependingAreaOfInterest(rcti *input, ReadB
        NodeOperation * operation = this->getInputOperation(1);
        if (operation->determineDependingAreaOfInterest(&sizeInput, readOperation, output)) {
                return true;
-       }else {
+       }
+       else {
                if (this->gausstab == NULL) {
                        newInput.xmax = this->getWidth();
                        newInput.xmin = 0;
                        newInput.ymax = this->getHeight();
                        newInput.ymin = 0;
-               }else{
+               }
+               else {
                        newInput.xmax = input->xmax + rad;
                        newInput.xmin = input->xmin - rad;
                        newInput.ymax = input->ymax;
index 86f9dbf5c402583f3775401e450290afdedb1e9d..2218334bec81b06e86ea660665d4c8ddc1e17e46 100644 (file)
@@ -42,7 +42,7 @@ void GaussianYBlurOperation::updateGauss(MemoryBuffer **memoryBuffers) {
        if (this->gausstab == NULL) {
                updateSize(memoryBuffers);
                float rad = size*this->data->sizey;
-               if(rad<1)
+               if (rad<1)
                        rad= 1;
                
                this->rad = rad;
@@ -108,13 +108,15 @@ bool GaussianYBlurOperation::determineDependingAreaOfInterest(rcti *input, ReadB
        NodeOperation * operation = this->getInputOperation(1);
        if (operation->determineDependingAreaOfInterest(&sizeInput, readOperation, output)) {
                return true;
-       }else {
+       }
+       else {
                if (this->gausstab == NULL) {
                        newInput.xmax = this->getWidth();
                        newInput.xmin = 0;
                        newInput.ymax = this->getHeight();
                        newInput.ymin = 0;
-               } else {
+               }
+               else {
                        newInput.xmax = input->xmax;
                        newInput.xmin = input->xmin;
                        newInput.ymax = input->ymax + rad;
index 52c2e44f7d402dbe178c29a687bba13ee085700f..f4cea24cb207ed401204f3398c2d96765c95b3b3 100644 (file)
@@ -61,7 +61,7 @@ ImBuf* BaseImageOperation::getImBuf() {
        ImBuf *ibuf;
        
        ibuf= BKE_image_get_ibuf(this->image, this->imageUser);
-       if(ibuf==NULL || (ibuf->rect==NULL && ibuf->rect_float==NULL)) {
+       if (ibuf==NULL || (ibuf->rect==NULL && ibuf->rect_float==NULL)) {
                        return NULL;
        }
        
@@ -102,7 +102,8 @@ void ImageOperation::executePixel(float *color, float x, float y, PixelSampler s
                color[1] = 0.0f;
                color[2] = 0.0f;
                color[3] = 0.0f;
-       } else {
+       }
+       else {
                switch (sampler) {
                case COM_PS_NEAREST:
                        neareast_interpolation_color(this->buffer, NULL, color, x, y);
@@ -122,7 +123,8 @@ void ImageAlphaOperation::executePixel(float *color, float x, float y, PixelSamp
 
        if (this->imageBuffer == NULL || x < 0 || y < 0 || x >= this->getWidth() || y >= this->getHeight() ) {
                color[0] = 0.0f;
-       } else {
+       }
+       else {
                tempcolor[3] = 1.0f;
                switch (sampler) {
                case COM_PS_NEAREST:
@@ -142,7 +144,8 @@ void ImageAlphaOperation::executePixel(float *color, float x, float y, PixelSamp
 void ImageDepthOperation::executePixel(float *color, float x, float y, PixelSampler sampler, MemoryBuffer *inputBuffers[]) {
        if (this->depthBuffer == NULL || x < 0 || y < 0 || x >= this->getWidth() || y >= this->getHeight() ) {
                color[0] = 0.0f;
-       } else {
+       }
+       else {
                int offset = y * width + x;
                color[0] = this->depthBuffer[offset];
        }
index a90c7b6b8d277ff007e7f0b5ecb967c2882a7fb3..baf8699603c7035432651ae3ed0bde21b13d75ed 100644 (file)
@@ -46,17 +46,18 @@ void InvertOperation::executePixel(float* out, float x, float y, PixelSampler sa
        const float value = inputValue[0];
        const float invertedValue = 1.0f - value;
        
-       if(color) {
+       if (color) {
                out[0] = (1.0f - inputColor[0])*value + inputColor[0]*invertedValue;
                out[1] = (1.0f - inputColor[1])*value + inputColor[1]*invertedValue;
                out[2] = (1.0f - inputColor[2])*value + inputColor[2]*invertedValue;
-       } else {
+       }
+       else {
                out[0] = inputColor[0];
                out[1] = inputColor[1];
                out[2] = inputColor[2];
        }
        
-       if(alpha)
+       if (alpha)
                out[3] = (1.0f - inputColor[3])*value + inputColor[3]*invertedValue;
        else
                out[3] = inputColor[3];
index 6236708c9e13754abb95ef4340de92c1a4f77743..893876750904d5fa83a69fb18ff48070784b7df6 100644 (file)
@@ -119,7 +119,8 @@ public:
                float b2c = b*b-c;
                if (b2c < 0) {
                        result->hit = false;
-               } else {
+               }
+               else {
                        float sgn = (this->radius*ray->direction[2])>0?1.0f:-1.0f;
                        float t = sqrtf(b2c)*sgn-b;
                        result->position[0] = ray->direction[0]*t+ray->position[0];
@@ -137,7 +138,8 @@ public:
                                result->normal[0] = -p[0];
                                result->normal[1] = -p[1];
                                result->normal[2] = -p[2];
-                       } else {
+                       }
+                       else {
                                result->normal[0] = p[0];
                                result->normal[1] = p[1];
                                result->normal[2] = p[2];
@@ -168,7 +170,7 @@ public:
        bool valid;
        bool hasIntensity;
 };
-class Bounce{
+class Bounce {
 public:
        LensInterface *interface1;
        LensInterface *interface2;
@@ -245,15 +247,15 @@ public:
 
 //                dot= view[0]*n[0] + view[1]*n[1] + view[2]*n[2];
 
-//                if(dot>0.0f) {
+//                if (dot>0.0f) {
 //                        index = 1.0f/index;
 //                        fac= 1.0f - (1.0f - dot*dot)*index*index;
-//                        if(fac<= 0.0f) return 0;
+//                        if (fac<= 0.0f) return 0;
 //                        fac= -dot*index + sqrt(fac);
 //                }
 //                else {
 //                        fac= 1.0f - (1.0f - dot*dot)*index*index;
-//                        if(fac<= 0.0f) return 0;
+//                        if (fac<= 0.0f) return 0;
 //                        fac= -dot*index - sqrt(fac);
 //                }
 
@@ -281,7 +283,8 @@ public:
 //                double test = 1.0f - index*index*(1.0f-ni*ni);
 //                if (test < 0) {
 //                        return 0;
-//                } else {
+//                }
+//                else {
 //                        double mul = index*ni + sqrt(test);
 //                        refract[0] = index * view[0] - mul*n[0];
 //                        refract[1] = index * view[1] - mul*n[1];
@@ -348,7 +351,8 @@ public:
                                delta = -delta;
                                if (phase == 0) {
                                        next = bounce->interface2;
-                               } else {
+                               }
+                               else {
                                        next = NULL;
                                }
                                phase ++;
@@ -399,7 +403,8 @@ public:
                                        if (ref == 0) {
                                                break;
                                        }
-                               } else {
+                               }
+                               else {
                                        this->reflection(result->direction, intersection.normal, result->direction);
                                        float  fresnelMultiplyer = fresnelAR(intersection.theta, result->wavelength, f->thicknessCoathing, n0, n1, n2);
                                        if (isnan(fresnelMultiplyer)) {
@@ -412,7 +417,8 @@ public:
                }
                if (k < bounce->length-1) {
                        result->intensity = 0;
-               } else {
+               }
+               else {
                        result->valid = true;
                }
        }
@@ -446,7 +452,8 @@ void LensGhostProjectionOperation::initExecution() {
                        visualLampPosition[0] = 0;
                        visualLampPosition[1] = 0;
                        visualLampPosition[2] = 0;
-               } else {
+               }
+               else {
                        /* too simple, better to return the distance on the view axis only
                         * return len_v3v3(ob->obmat[3], cam->dof_ob->obmat[3]); */
                        float matt[4][4], imat[4][4], obmat[4][4];
@@ -612,21 +619,25 @@ void* LensGhostOperation::initializeTileData(rcti *rect, MemoryBuffer **memoryBu
                                                face->v2 = vertex4;
                                                face->v3 = vertex1;
                                                result->push_back(face);
-                                       } else if (number == 3) {
+                                       }
+                                       else if (number == 3) {
                                                LensFace *face = new LensFace();
                                                if (!vertex1->hasIntensity) {
                                                        face->v1 = vertex2;
                                                        face->v2 = vertex3;
                                                        face->v3 = vertex4;
-                                               } else if (!vertex2->hasIntensity) {
+                                               }
+                                               else if (!vertex2->hasIntensity) {
                                                        face->v1 = vertex1;
                                                        face->v2 = vertex3;
                                                        face->v3 = vertex4;
-                                               } else if (!vertex3->hasIntensity) {
+                                               }
+                                               else if (!vertex3->hasIntensity) {
                                                        face->v1 = vertex1;
                                                        face->v2 = vertex2;
                                                        face->v3 = vertex4;
-                                               } else {
+                                               }
+                                               else {
                                                        face->v1 = vertex1;
                                                        face->v2 = vertex2;
                                                        face->v3 = vertex3;
index 7850a63121224758d4fa7683aab1c23b33aa9436..3e8a5ed3344ca5093206cab7848303aa1e700221 100644 (file)
@@ -52,10 +52,10 @@ void LuminanceMatteOperation::executePixel(float* outputValue, float x, float y,
        */
                
        /* test range*/
-       if(inColor[0] > high) {
+       if (inColor[0] > high) {
                alpha=1.f;
        }
-       else if(inColor[0] < low){
+       else if (inColor[0] < low) {
                alpha=0.f;
        }
        else {/*blend */
index ef0c9004a7d43f08608e2fa44f38e2521542fab1..08790955d03eabe4467dc7e242e2c48479bed034 100644 (file)
@@ -110,7 +110,7 @@ void MapUVOperation::executePixel(float* color, float x, float y, PixelSampler s
        this->inputColorProgram->read(color, u, v, dx, dy, inputBuffers);
 
        /* "premul" */
-       if(alpha < 1.0f) {
+       if (alpha < 1.0f) {
                color[0]*= alpha;
                color[1]*= alpha;
                color[2]*= alpha;
index 33d38b8475d1904987a033572ceb1fd18b1479f1..5a7005af3823e79f9499383e06e2de2d443652ba 100644 (file)
@@ -37,11 +37,11 @@ void MapValueOperation::executePixel(float* outputValue, float x, float y, Pixel
        inputOperation->read(src, x, y, sampler, inputBuffers);
        TexMapping *texmap= this->settings;
        float value = (src[0] + texmap->loc[0])*texmap->size[0];
-       if(texmap->flag & TEXMAP_CLIP_MIN)
-               if(value<texmap->min[0])
+       if (texmap->flag & TEXMAP_CLIP_MIN)
+               if (value<texmap->min[0])
                        value= texmap->min[0];
-       if(texmap->flag & TEXMAP_CLIP_MAX)
-               if(value>texmap->max[0])
+       if (texmap->flag & TEXMAP_CLIP_MAX)
+               if (value>texmap->max[0])
                        value= texmap->max[0];
        
        outputValue[0] = value;
index 55880566bf2bf26baef2798291c4c5ae51ea13a9..d612361a7fea204d0e5235bdbd9f8ca1e5de1fab 100644 (file)
@@ -81,7 +81,7 @@ void MathDivideOperation::executePixel(float* outputValue, float x, float y, Pix
        inputValue1Operation->read(&inputValue1[0], x, y, sampler, inputBuffers);
        inputValue2Operation->read(&inputValue2[0], x, y, sampler, inputBuffers);
        
-       if(inputValue2[0]==0)   /* We don't want to divide by zero. */
+       if (inputValue2[0]==0)  /* We don't want to divide by zero. */
                outputValue[0]= 0.0;
        else
                outputValue[0]= inputValue1[0] / inputValue2[0];
@@ -124,7 +124,7 @@ void MathArcSineOperation::executePixel(float* outputValue, float x, float y, Pi
        inputValue1Operation->read(&inputValue1[0], x, y, sampler, inputBuffers);
        inputValue2Operation->read(&inputValue2[0], x, y, sampler, inputBuffers);
        
-       if(inputValue1[0] <= 1 && inputValue1[0] >= -1 )
+       if (inputValue1[0] <= 1 && inputValue1[0] >= -1 )
                outputValue[0]= asin(inputValue1[0]);
        else
                outputValue[0]= 0.0;
@@ -137,7 +137,7 @@ void MathArcCosineOperation::executePixel(float* outputValue, float x, float y,
        inputValue1Operation->read(&inputValue1[0], x, y, sampler, inputBuffers);
        inputValue2Operation->read(&inputValue2[0], x, y, sampler, inputBuffers);
        
-       if(inputValue1[0] <= 1 && inputValue1[0] >= -1 )
+       if (inputValue1[0] <= 1 && inputValue1[0] >= -1 )
                outputValue[0]= acos(inputValue1[0]);
        else
                outputValue[0]= 0.0;
@@ -160,14 +160,16 @@ void MathPowerOperation::executePixel(float* outputValue, float x, float y, Pixe
        inputValue1Operation->read(&inputValue1[0], x, y, sampler, inputBuffers);
        inputValue2Operation->read(&inputValue2[0], x, y, sampler, inputBuffers);
        
-       if( inputValue1[0] >= 0 ) {
+       if ( inputValue1[0] >= 0 ) {
                outputValue[0]= pow(inputValue1[0], inputValue2[0]);
-       } else {
+       }
+       else {
                float y_mod_1 = fmod(inputValue2[0], 1);
                /* if input value is not nearly an integer, fall back to zero, nicer than straight rounding */
                if (y_mod_1 > 0.999 || y_mod_1 < 0.001) {
                        outputValue[0]= pow(inputValue1[0], (float)floor(inputValue2[0] + 0.5));
-               } else {
+               }
+               else {
                        outputValue[0] = 0.0;
                }
        }
@@ -180,7 +182,7 @@ void MathLogarithmOperation::executePixel(float* outputValue, float x, float y,
        inputValue1Operation->read(&inputValue1[0], x, y, sampler, inputBuffers);
        inputValue2Operation->read(&inputValue2[0], x, y, sampler, inputBuffers);
        
-       if( inputValue1[0] > 0  && inputValue2[0] > 0 )
+       if ( inputValue1[0] > 0  && inputValue2[0] > 0 )
                outputValue[0]= log(inputValue1[0]) / log(inputValue2[0]);
        else
                outputValue[0]= 0.0;
index 9f8378defe9560b4e51442c32c9813e375d0b424..a84ecc6edf89c6b917bf01acd476454f9009d9bf 100644 (file)
@@ -64,23 +64,25 @@ void MixBaseOperation::deinitExecution() {
        this->inputColor2Operation = NULL;
 }
 
-void MixBaseOperation::determineResolution(unsigned int resolution[], unsigned int preferredResolution[]){
+void MixBaseOperation::determineResolution(unsigned int resolution[], unsigned int preferredResolution[]) {
        InputSocket* socket;
        unsigned int tempPreferredResolution[] = {0,0};
        unsigned int tempResolution[2];
        
        socket = this->getInputSocket(1);
        socket->determineResolution(tempResolution, tempPreferredResolution);
-       if((tempResolution[0] != 0) && (tempResolution[1] != 0)){
+       if ((tempResolution[0] != 0) && (tempResolution[1] != 0)) {
                this->setResolutionInputSocketIndex(1);
-       }else {
+       }
+       else {
                socket = this->getInputSocket(2);
                tempPreferredResolution[0] = 0;
                tempPreferredResolution[1] = 0;
                socket->determineResolution(tempResolution, tempPreferredResolution);
-               if((tempResolution[0] != 0) && (tempResolution[1] != 0)){
+               if ((tempResolution[0] != 0) && (tempResolution[1] != 0)) {
                        this->setResolutionInputSocketIndex(2);
-               }else {
+               }
+               else {
                        this->setResolutionInputSocketIndex(0);
                }
        }
index ebcb7056570af10fe4a75fd33723b7a3b28220dc..d5ec55daf077fc3f44022849e8c1108065e5a132 100644 (file)
@@ -45,7 +45,7 @@ void MixColorOperation::executePixel(float* outputValue, float x, float y, Pixel
        
        float colH,colS,colV;
        rgb_to_hsv(inputColor2[0], inputColor2[1], inputColor2[2], &colH, &colS, &colV);
-       if(colS!=0.0f){
+       if (colS!=0.0f) {
                float rH,rS,rV;
                float tmpr,tmpg,tmpb;
                rgb_to_hsv(inputColor1[0], inputColor1[1], inputColor1[2], &rH, &rS, &rV);
index 773a51e92cb0fc23308dfe0bfe8045cdd7ba8ead..7e8271a9c96b8b28f0ad3e62bd58d7a9864cee01 100644 (file)
@@ -40,13 +40,13 @@ void MixDarkenOperation::executePixel(float* outputValue, float x, float y, Pixe
        float valuem = 1.0f-value;
        float tmp;
        tmp=inputColor2[0]+((1.0f-inputColor2[0])*valuem);
-       if(tmp < inputColor1[0]) outputValue[0]= tmp;
+       if (tmp < inputColor1[0]) outputValue[0]= tmp;
        else outputValue[0] = inputColor1[0];
        tmp=inputColor2[1]+((1.0f-inputColor2[1])*valuem);
-       if(tmp < inputColor1[1]) outputValue[1]= tmp;
+       if (tmp < inputColor1[1]) outputValue[1]= tmp;
        else outputValue[1] = inputColor1[1];
        tmp=inputColor2[2]+((1.0f-inputColor2[2])*valuem);
-       if(tmp < inputColor1[2]) outputValue[2]= tmp;
+       if (tmp < inputColor1[2]) outputValue[2]= tmp;
        else outputValue[2] = inputColor1[2];
        
        outputValue[3] = inputColor1[3];
index c2579c6a89cf859cc02cc4e5fd23314642b3e2ff..6bab381c706e925f64250e9ccf5e92f56e19055f 100644 (file)
@@ -39,15 +39,15 @@ void MixDivideOperation::executePixel(float* outputValue, float x, float y, Pixe
        }
        float valuem= 1.0f-value;
        
-       if(inputColor2[0]!=0.0f)
+       if (inputColor2[0]!=0.0f)
                outputValue[0] = valuem*(inputColor1[0]) + value*(inputColor1[0])/inputColor2[0];
        else
                outputValue[0] = 0.0f;
-       if(inputColor2[1]!=0.0f)
+       if (inputColor2[1]!=0.0f)
                outputValue[1] = valuem*(inputColor1[1]) + value*(inputColor1[1])/inputColor2[1];
        else
                outputValue[1] = 0.0f;
-       if(inputColor2[2]!=0.0f)
+       if (inputColor2[2]!=0.0f)
                outputValue[2] = valuem*(inputColor1[2]) + value*(inputColor1[2])/inputColor2[2];
        else
                outputValue[2] = 0.0f;
index 386bd02ba2a09c310df79256d6ea5b56241eb22a..8454c694f65f6203d678359187af89db6c35d324 100644 (file)
@@ -45,7 +45,7 @@ void MixHueOperation::executePixel(float* outputValue, float x, float y, PixelSa
        
        float colH,colS,colV;
        rgb_to_hsv(inputColor2[0], inputColor2[1], inputColor2[2], &colH, &colS, &colV);
-       if(colS!=0.0f){
+       if (colS!=0.0f) {
                float rH,rS,rV;
                float tmpr,tmpg,tmpb;
                rgb_to_hsv(inputColor1[0], inputColor1[1], inputColor1[2], &rH, &rS, &rV);
index 32d28b785b7baf75a2476716ee20d724eb362a5c..6a06d5ab6e16f10e1a7bd141ea689f5add79b954 100644 (file)
@@ -39,13 +39,13 @@ void MixLightenOperation::executePixel(float* outputValue, float x, float y, Pix
        }
        float tmp;
        tmp=value * inputColor2[0];
-       if(tmp > inputColor1[0]) outputValue[0]= tmp;
+       if (tmp > inputColor1[0]) outputValue[0]= tmp;
        else outputValue[0] = inputColor1[0];
        tmp=value * inputColor2[1];
-       if(tmp > inputColor1[1]) outputValue[1]= tmp;
+       if (tmp > inputColor1[1]) outputValue[1]= tmp;
        else outputValue[1] = inputColor1[1];
        tmp=value * inputColor2[2];
-       if(tmp > inputColor1[2]) outputValue[2]= tmp;
+       if (tmp > inputColor1[2]) outputValue[2]= tmp;
        else outputValue[2] = inputColor1[2];
        outputValue[3] = inputColor1[3];
 }
index 8254701adadf394687e0dbb90170d28f449cb1e9..7a3030b92626310d64118210cb3d686235ef4557 100644 (file)
@@ -40,19 +40,22 @@ void MixOverlayOperation::executePixel(float* outputValue, float x, float y, Pix
        
        float valuem= 1.0f-value;
        
-       if(inputColor1[0] < 0.5f) {
+       if (inputColor1[0] < 0.5f) {
                        outputValue[0] = inputColor1[0] * (valuem + 2.0f*value*inputColor2[0]);
-       } else {
+       }
+       else {
                        outputValue[0] = 1.0f - (valuem + 2.0f*value*(1.0f - inputColor2[0])) * (1.0f - inputColor1[0]);
        }
-       if(inputColor1[1] < 0.5f) {
+       if (inputColor1[1] < 0.5f) {
                        outputValue[1] = inputColor1[1] * (valuem + 2.0f*value*inputColor2[1]);
-       } else {
+       }
+       else {
                        outputValue[1] = 1.0f - (valuem + 2.0f*value*(1.0f - inputColor2[1])) * (1.0f - inputColor1[1]);
        }
-       if(inputColor1[2] < 0.5f) {
+       if (inputColor1[2] < 0.5f) {
                        outputValue[2] = inputColor1[2] * (valuem + 2.0f*value*inputColor2[2]);
-       } else {
+       }
+       else {
                        outputValue[2] = 1.0f - (valuem + 2.0f*value*(1.0f - inputColor2[2])) * (1.0f - inputColor1[2]);
        }
        outputValue[3] = inputColor1[3];
index 18ff6f46c461d6b756fccc61a13629b96093f4e4..a8fe647828bb249056e156204fa10a1314602a64 100644 (file)
@@ -45,7 +45,7 @@ void MixSaturationOperation::executePixel(float* outputValue, float x, float y,
        
        float rH,rS,rV;
        rgb_to_hsv(inputColor1[0], inputColor1[1], inputColor1[2], &rH, &rS, &rV);
-       if(rS!=0.0f){
+       if (rS!=0.0f) {
                float colH,colS,colV;
                rgb_to_hsv(inputColor2[0], inputColor2[1], inputColor2[2], &colH, &colS, &colV);
                hsv_to_rgb(rH , (valuem*rS+value*colS), rV, &outputValue[0], &outputValue[1], &outputValue[2]);
index 74179293c6c11a7b0b909611c8793ecc0af24fb2..7597497acc734377b6bd43cc879463103c1e7785 100644 (file)
@@ -78,7 +78,8 @@ void MovieClipOperation::executePixel(float *color, float x, float y, PixelSampl
                color[1] = 0.0f;
                color[2] = 0.0f;
                color[3] = 0.0f;
-       } else {
+       }
+       else {
                switch (sampler) {
                case COM_PS_NEAREST:
                        neareast_interpolation_color(this->movieClipBuffer, NULL, color, x, y);
index 360719aa59ffee9446b2b1fdbd68dea727347f2f..b848192d40ba059dda0610b4f6a3b0ecef5ee7bc 100644 (file)
@@ -54,7 +54,8 @@ void MovieDistortionOperation::initExecution() {
                DistortionCache* newC = new DistortionCache(this->movieClip, this->width, this->height, this->distortion);
                s_cache.push_back(newC);
                this->cache = newC;
-       } else {
+       }
+       else {
                this->cache = NULL;
        }
 }
index 53b71ed528e404f5e8b9a09313c6c1459c957388..df2b762b563f2f510442b26706f6c9689c4f6e56 100644 (file)
@@ -33,7 +33,7 @@ MultilayerBaseOperation::MultilayerBaseOperation(int pass): BaseImageOperation()
 ImBuf* MultilayerBaseOperation::getImBuf() {
        RenderPass *rpass;
        rpass = (RenderPass *)BLI_findlink(&this->renderlayer->passes, this->passId);
-       if(rpass) {
+       if (rpass) {
                this->imageUser->pass= this->passId;
                BKE_image_multilayer_index(image->rr, this->imageUser);
                return BaseImageOperation::getImBuf();
@@ -49,7 +49,8 @@ void MultilayerColorOperation::executePixel(float *color, float x, float y, Pixe
                color[1] = 0.0f;
                color[2] = 0.0f;
                color[3] = 0.0f;
-       } else {
+       }
+       else {
                if (this->numberOfChannels == 4) {
                        switch (sampler) {
                        case COM_PS_NEAREST:
@@ -62,7 +63,8 @@ void MultilayerColorOperation::executePixel(float *color, float x, float y, Pixe
                                bicubic_interpolation_color(this->buffer, NULL, color, x, y);
                                break;
                        }
-               } else {
+               }
+               else {
                        int offset = (yi*this->getWidth()+xi)*3;
                        color[0] = this->imageBuffer[offset];
                        color[1] = this->imageBuffer[offset+1];
@@ -76,7 +78,8 @@ void MultilayerValueOperation::executePixel(float *color, float x, float y, Pixe
        int xi = x;
        if (this->imageBuffer == NULL || xi < 0 || yi < 0 || xi >= this->getWidth() || yi >= this->getHeight() ) {
                color[0] = 0.0f;
-       } else {
+       }
+       else {
                float result = this->imageBuffer[yi*this->getWidth()+xi];
                color[0] = result;
        }
@@ -87,7 +90,8 @@ void MultilayerVectorOperation::executePixel(float *color, float x, float y, Pix
        int xi = x;
        if (this->imageBuffer == NULL || xi < 0 || yi < 0 || xi >= this->getWidth() || yi >= this->getHeight() ) {
                color[0] = 0.0f;
-       } else {
+       }
+       else {
                int offset = (yi*this->getWidth()+xi)*3;
                color[0] = this->imageBuffer[offset];
                color[1] = this->imageBuffer[offset+1];
index 4cf50823c0080dabfa5360102040b1863a0d60c2..adaba8e333070c01f558057b57f70550c7858f55 100644 (file)
@@ -3,7 +3,7 @@
 
 const char* sourcecode = "/// This file contains all opencl kernels for node-operation implementations \n" \
 "\n" \
-"__kernel void testKernel(__global __write_only image2d_t output){\n" \
+"__kernel void testKernel(__global __write_only image2d_t output) {\n" \
 "      int x = get_global_id(0);\n" \
 "      int y = get_global_id(1);\n" \
 "      int2 coords = {x, y}; \n" \
index 5191c940f704ff50d7f181f274a5d97123f92bdc..4a9d08380ea754719a5ee181ee7a135a611c44fe 100644 (file)
@@ -52,7 +52,8 @@ void PreviewOperation::initExecution() {
        this->input = getInputSocketReader(0);
        if (!this->node->preview) {
                this->node->preview = (bNodePreview*)MEM_callocN(sizeof(bNodePreview), "node preview");
-       } else {
+       }
+       else {
                if (this->getWidth() == (unsigned int)this->node->preview->xsize && this->getHeight() == (unsigned int)this->node->preview->ysize) {
                        this->outputBuffer = this->node->preview->rect;
                }
@@ -60,7 +61,7 @@ void PreviewOperation::initExecution() {
 
        if (this->outputBuffer == NULL) {
                this->outputBuffer = (unsigned char*)MEM_callocN(sizeof(unsigned char)*4*getWidth()*getHeight(), "PreviewOperation");
-               if(this->node->preview->rect) {
+               if (this->node->preview->rect) {
                                MEM_freeN(this->node->preview->rect);
                }
                this->node->preview->xsize= getWidth();
@@ -112,7 +113,8 @@ void PreviewOperation::determineResolution(unsigned int resolution[], unsigned i
        this->divider = 0.0f;
        if (width > height) {
                divider = COM_PREVIEW_SIZE / (width-1);
-       } else {
+       }
+       else {
                divider = COM_PREVIEW_SIZE / (height-1);
        }
        width = width * divider;
index 483a75a69d280b0b88d63593cace38fb8e46188d..69405ef6d2349e3bb8b76f56ac6cb4f65598d495 100644 (file)
@@ -48,7 +48,8 @@ void ReadBufferOperation::executePixel(float* color, float x, float y, PixelSamp
        if (inputBuffer) {
                if (sampler == COM_PS_NEAREST) {
                        inputBuffer->read(color, x, y);
-               } else {
+               }
+               else {
                        inputBuffer->readCubic(color, x, y);
                }
        }
index d85d54489ac1bab4e40412b17df6c1d517a75fb0..d18915c593b65224b1324187724479731c8c4324 100644 (file)
@@ -36,7 +36,8 @@ void RenderLayersAlphaProg::executePixel(float* output, float x, float y, PixelS
                output[1] = 0.0f;
                output[2] = 0.0f;
                output[3] = 0.0f;
-       } else {
+       }
+       else {
                unsigned int offset = (iy*this->getWidth()+ix) * 4;
                output[0] = inputBuffer[offset+3];
                output[1] = 0.0f;
index e63fcd5df4d51fb4c3963adbeede6fb5c20c65a9..94ba8973314b3b069113de6462969ad7a16fef3b 100644 (file)
@@ -44,15 +44,15 @@ void RenderLayersBaseProg::initExecution() {
        Render *re= (scene)? RE_GetRender(scene->id.name): NULL;
        RenderResult *rr= NULL;
        
-       if(re)
+       if (re)
                        rr= RE_AcquireResultRead(re);
        
-       if(rr) {
+       if (rr) {
                SceneRenderLayer *srl= (SceneRenderLayer*)BLI_findlink(&scene->r.layers, getLayerId());
-               if(srl) {
+               if (srl) {
        
                           RenderLayer *rl= RE_GetRenderLayer(rr, srl->name);
-                          if(rl && rl->rectf) {
+                          if (rl && rl->rectf) {
                                   this->inputBuffer = RE_RenderLayerGetPass(rl, renderpass);
        
                                   if (this->inputBuffer == NULL || renderpass == SCE_PASS_COMBINED) {
@@ -76,19 +76,22 @@ void RenderLayersBaseProg::executePixel(float* output, float x, float y, PixelSa
                output[1] = 0.0f;
                output[2] = 0.0f;
                output[3] = 0.0f;
-       } else {
+       }
+       else {
                unsigned int offset = (iy*this->getWidth()+ix) * elementsize;
                if (elementsize == 1) {
                        output[0] = inputBuffer[offset];
                        output[1] = 0.0f;
                        output[2] = 0.0f;
                        output[3] = 0.0f;
-               } else if (elementsize == 3){
+               }
+               else if (elementsize == 3) {
                        output[0] = inputBuffer[offset];
                        output[1] = inputBuffer[offset+1];
                        output[2] = inputBuffer[offset+2];
                        output[3] = 1.0f;
-               } else {
+               }
+               else {
                        output[0] = inputBuffer[offset];
                        output[1] = inputBuffer[offset+1];
                        output[2] = inputBuffer[offset+2];
@@ -109,21 +112,21 @@ void RenderLayersBaseProg::determineResolution(unsigned int resolution[], unsign
        resolution[0] = 0;
        resolution[1] = 0;
        
-       if(re)
+       if (re)
                        rr= RE_AcquireResultRead(re);
        
-       if(rr) {
+       if (rr) {
                SceneRenderLayer *srl= (SceneRenderLayer*)BLI_findlink(&sce->r.layers, getLayerId());
-               if(srl) {
+               if (srl) {
                           RenderLayer *rl= RE_GetRenderLayer(rr, srl->name);
-                          if(rl && rl->rectf) {
+                          if (rl && rl->rectf) {
                                   resolution[0]=rl->rectx;
                                   resolution[1]=rl->recty;
                           }
                }
        }
        
-       if(re)
+       if (re)
                 RE_ReleaseResult(re);
 
 }
index ef6c5bee90a123d863df51b84c6198a3076dffe8..ac2e8c5e8a95e4c9a0a51e6e7bb660f9e702fd01 100644 (file)
@@ -42,7 +42,8 @@ void RotateOperation::initExecution() {
        double rad;
        if (this->doDegree2RadConversion) {
                rad = DEG2RAD(degree[0]);
-       } else {
+       }
+       else {
                rad = degree[0];
        }
        this->cosine = cos(rad);
index 87ef015384d68087e8a2fcdc9d691cb1433de061..474874d4bb4f58d028cbf3217e9793533eadddf5 100644 (file)
@@ -133,7 +133,8 @@ void ScreenLensDistortionOperation::executePixel(float* outputColor, int x, int
 
                /* set alpha */
                outputColor[3]= 1.0f;
-       } else {
+       }
+       else {
                outputColor[0]= 0.0f;
                outputColor[1]= 0.0f;
                outputColor[2]= 0.0f;
index b9c8f4bc369ccfeaee42174c14c8211507c7aa88..3e9b68ac9717db64834a5692dd1384e8b904d96f 100644 (file)
@@ -38,7 +38,8 @@ void SetVectorOperation::determineResolution(unsigned int resolution[], unsigned
        if (preferredResolution[0] == 0 ||preferredResolution[1]==0) {
                resolution[0] = COM_DEFAULT_RESOLUTION_WIDTH;
                resolution[1] = COM_DEFAULT_RESOLUTION_HEIGHT;
-       } else {
+       }
+       else {
                resolution[0] = preferredResolution[0];
                resolution[1] = preferredResolution[1];
        }
index f9000cc63daaf9f28c7c6eb322ffe43f8dc192ae..f2d5e4910016538603105674a0f62c0b346dd642 100644 (file)
@@ -77,17 +77,20 @@ void SplitViewerOperation::executeRegion(rcti *rect, unsigned int tileNumber, Me
                        image1 = xSplit?x>perc:y>perc;
                        if (image1) {
                                image1Input->read(&(buffer[offset]), x, y, COM_PS_NEAREST, memoryBuffers);
-                       } else {
+                       }
+                       else {
                                image2Input->read(&(buffer[offset]), x, y, COM_PS_NEAREST, memoryBuffers);
                        }
                        /// @todo: linear conversion only when scene color management is selected, also check predivide.
                        if (this->doColorManagement) {
-                               if(this->doColorPredivide) {
+                               if (this->doColorPredivide) {
                                        linearrgb_to_srgb_predivide_v4(srgb, buffer+offset);
-                               } else {
+                               }
+                               else {
                                        linearrgb_to_srgb_v4(srgb, buffer+offset);
                                }
-                       } else {
+                       }
+                       else {
                                copy_v4_v4(srgb, buffer+offset);
                        }
        
index 1ca986f8893c527c1a3ee4960445217af95cf040..3eb081409142244e0912a9968545c80e12b510d8 100644 (file)
@@ -52,7 +52,8 @@ void TextureBaseOperation::determineResolution(unsigned int resolution[], unsign
        if (preferredResolution[0] == 0 || preferredResolution[1] == 0) {
                resolution[0] = COM_DEFAULT_RESOLUTION_WIDTH;
                resolution[1] = COM_DEFAULT_RESOLUTION_HEIGHT;
-       } else {
+       }
+       else {
                resolution[0] = preferredResolution[0];
                resolution[1] = preferredResolution[1];
        }
@@ -86,12 +87,12 @@ void TextureBaseOperation::executePixel(float *color, float x, float y, PixelSam
 
        retval= multitex_ext(this->texture, vec, NULL, NULL, 0, &texres);
 
-       if(texres.talpha)
+       if (texres.talpha)
                color[3]= texres.ta;
        else
                color[3]= texres.tin;
 
-       if((retval & TEX_RGB)) {
+       if ((retval & TEX_RGB)) {
                color[0]= texres.tr;
                color[1]= texres.tg;
                color[2]= texres.tb;
index e97b1155e22001c5124702e877953586d0a7ba52..83b9f55b43158bc962c28eda26bcc93dda8042d6 100644 (file)
@@ -84,7 +84,9 @@ void VariableSizeBokehBlurOperation::executePixel(float* color, int x, int y, Me
                                        float dx = nx - x;
                                        float dy = ny - y;
                                        if (nx == x && ny == y) {
-                                       } else if (size>=  fabs(dx) && size >= fabs(dy)) {
+                                               /* pass */
+                                       }
+                                       else if (size>=  fabs(dx) && size >= fabs(dy)) {
                                                float u = 256+ dx*256/size;
                                                float v = 256+ dy*256/size;
                                                inputBokehProgram->read(bokeh, u, v, COM_PS_NEAREST, inputBuffers);
index 7d660177fbb2e8e9785a5255694e575194dfccb1..7b6ebe9728ffe7d27fb1039ab93ae0c3a9f713c9 100644 (file)
@@ -94,7 +94,8 @@ bool VectorBlurOperation::determineDependingAreaOfInterest(rcti *input, ReadBuff
                newInput.ymax = this->getHeight();
                newInput.ymin = 0;
                return NodeOperation::determineDependingAreaOfInterest(&newInput, readOperation, output);
-       } else {
+       }
+       else {
                return false;
        }
 }
index 16143af7165bbe224660510a3765c2163a81100f..85b5cc4c3a8a1331e3bc2a312449a6aebecc1bd6 100644 (file)
@@ -86,7 +86,8 @@ void ViewerBaseOperation::deinitExecution() {
 const int ViewerBaseOperation::getRenderPriority() const {
        if (this->isActiveViewerOutput()) {
                return 8;
-       } else {
+       }
+       else {
                return 0;
        }
 }
index b0d443f1cbde5f0346e210d7d8391ca8f6ce24e8..8fa63329e1f324031b93876f8ba4f4e045e7d96c 100644 (file)
@@ -85,12 +85,14 @@ void ViewerOperation::executeRegion(rcti *rect, unsigned int tileNumber, MemoryB
                        }
                        /// @todo: linear conversion only when scene color management is selected, also check predivide.
                        if (this->doColorManagement) {
-                               if(this->doColorPredivide) {
+                               if (this->doColorPredivide) {
                                        linearrgb_to_srgb_predivide_v4(srgb, buffer+offset);
-                               } else {
+                               }
+                               else {
                                        linearrgb_to_srgb_v4(srgb, buffer+offset);
                                }
-                       } else {
+                       }
+                       else {
                                copy_v4_v4(srgb, buffer+offset);
                        }
 
index 44a769ee9470cbe0f243a7f813c28134a7d39c2f..6bb38c007effd9948c27d1f9989c402192a5884c 100644 (file)
@@ -80,7 +80,8 @@ void WriteBufferOperation::executeRegion(rcti *rect, unsigned int tileNumber, Me
                        this->input->deinitializeTileData(rect, memoryBuffers, data);
                        data = NULL;
                }
-       } else {
+       }
+       else {
                int x1 = rect->xmin;
                int y1 = rect->ymin;
                int x2 = rect->xmax;
index 9aa06df1ead20a561dd2167646a1a6c0bdace1c4..e45d66dd597af016a7d546d7744638f14e085a67 100644 (file)
@@ -52,7 +52,8 @@ void ZCombineOperation::executePixel(float* color, float x, float y, PixelSample
        this->depth2Reader->read(depth2, x, y, sampler, inputBuffers);
        if (depth1[0]<depth2[0]) {
                this->image1Reader->read(color, x, y, sampler, inputBuffers);
-       } else {
+       }
+       else {
                this->image2Reader->read(color, x, y, sampler, inputBuffers);
        }
 }
@@ -67,7 +68,8 @@ void ZCombineAlphaOperation::executePixel(float* color, float x, float y, PixelS
        if (depth1[0]<depth2[0]) {
                this->image1Reader->read(color1, x, y, sampler, inputBuffers);
                this->image2Reader->read(color2, x, y, sampler, inputBuffers);
-       } else {
+       }
+       else {
                this->image1Reader->read(color2, x, y, sampler, inputBuffers);
                this->image2Reader->read(color1, x, y, sampler, inputBuffers);
        }