diff options
author | Campbell Barton <ideasman42@gmail.com> | 2012-05-17 17:44:15 +0400 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2012-05-17 17:44:15 +0400 |
commit | 979f6bab9c1aba27b8d018d1481987d841f68ee1 (patch) | |
tree | 162419d475bf68326b3b5e88b25f27057fee6831 /source/blender/compositor/nodes | |
parent | fe0d1a381003408dedcd3142a727c77806617150 (diff) |
style cleanup: braces, compositor
Diffstat (limited to 'source/blender/compositor/nodes')
22 files changed, 65 insertions, 37 deletions
diff --git a/source/blender/compositor/nodes/COM_AlphaOverNode.cpp b/source/blender/compositor/nodes/COM_AlphaOverNode.cpp index 7cd26bc79b7..23acaee7b93 100644 --- a/source/blender/compositor/nodes/COM_AlphaOverNode.cpp +++ b/source/blender/compositor/nodes/COM_AlphaOverNode.cpp @@ -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); diff --git a/source/blender/compositor/nodes/COM_BlurNode.cpp b/source/blender/compositor/nodes/COM_BlurNode.cpp index 8c1923b3236..5e29650a5ca 100644 --- a/source/blender/compositor/nodes/COM_BlurNode.cpp +++ b/source/blender/compositor/nodes/COM_BlurNode.cpp @@ -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); diff --git a/source/blender/compositor/nodes/COM_BokehBlurNode.cpp b/source/blender/compositor/nodes/COM_BokehBlurNode.cpp index c40bcab3ffb..68e9b067f07 100644 --- a/source/blender/compositor/nodes/COM_BokehBlurNode.cpp +++ b/source/blender/compositor/nodes/COM_BokehBlurNode.cpp @@ -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); diff --git a/source/blender/compositor/nodes/COM_ChannelMatteNode.cpp b/source/blender/compositor/nodes/COM_ChannelMatteNode.cpp index bf3def05643..9ab6c6250db 100644 --- a/source/blender/compositor/nodes/COM_ChannelMatteNode.cpp +++ b/source/blender/compositor/nodes/COM_ChannelMatteNode.cpp @@ -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*/ diff --git a/source/blender/compositor/nodes/COM_ColorBalanceNode.cpp b/source/blender/compositor/nodes/COM_ColorBalanceNode.cpp index 73d10d4b1ca..8d5e8a2788e 100644 --- a/source/blender/compositor/nodes/COM_ColorBalanceNode.cpp +++ b/source/blender/compositor/nodes/COM_ColorBalanceNode.cpp @@ -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); diff --git a/source/blender/compositor/nodes/COM_ColorSpillNode.cpp b/source/blender/compositor/nodes/COM_ColorSpillNode.cpp index 011a2cb12cc..5935167d88e 100644 --- a/source/blender/compositor/nodes/COM_ColorSpillNode.cpp +++ b/source/blender/compositor/nodes/COM_ColorSpillNode.cpp @@ -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(); } diff --git a/source/blender/compositor/nodes/COM_CombineRGBANode.cpp b/source/blender/compositor/nodes/COM_CombineRGBANode.cpp index 8a1a34589a5..6bef0441e5e 100644 --- a/source/blender/compositor/nodes/COM_CombineRGBANode.cpp +++ b/source/blender/compositor/nodes/COM_CombineRGBANode.cpp @@ -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); diff --git a/source/blender/compositor/nodes/COM_ConvertAlphaNode.cpp b/source/blender/compositor/nodes/COM_ConvertAlphaNode.cpp index 4e20b3a5d3a..775fa1ad0fd 100644 --- a/source/blender/compositor/nodes/COM_ConvertAlphaNode.cpp +++ b/source/blender/compositor/nodes/COM_ConvertAlphaNode.cpp @@ -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 { diff --git a/source/blender/compositor/nodes/COM_CropNode.cpp b/source/blender/compositor/nodes/COM_CropNode.cpp index fdbb1529c60..9d48922d0d6 100644 --- a/source/blender/compositor/nodes/COM_CropNode.cpp +++ b/source/blender/compositor/nodes/COM_CropNode.cpp @@ -27,15 +27,16 @@ 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); diff --git a/source/blender/compositor/nodes/COM_DefocusNode.cpp b/source/blender/compositor/nodes/COM_DefocusNode.cpp index 7f5c9896bbe..40adc3793b0 100644 --- a/source/blender/compositor/nodes/COM_DefocusNode.cpp +++ b/source/blender/compositor/nodes/COM_DefocusNode.cpp @@ -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()); } diff --git a/source/blender/compositor/nodes/COM_FilterNode.cpp b/source/blender/compositor/nodes/COM_FilterNode.cpp index ce78e451f30..f10d0391317 100644 --- a/source/blender/compositor/nodes/COM_FilterNode.cpp +++ b/source/blender/compositor/nodes/COM_FilterNode.cpp @@ -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); diff --git a/source/blender/compositor/nodes/COM_GroupNode.cpp b/source/blender/compositor/nodes/COM_GroupNode.cpp index dcb8691524a..14718909de9 100644 --- a/source/blender/compositor/nodes/COM_GroupNode.cpp +++ b/source/blender/compositor/nodes/COM_GroupNode.cpp @@ -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); diff --git a/source/blender/compositor/nodes/COM_IDMaskNode.cpp b/source/blender/compositor/nodes/COM_IDMaskNode.cpp index 440468afd46..d66657e489c 100644 --- a/source/blender/compositor/nodes/COM_IDMaskNode.cpp +++ b/source/blender/compositor/nodes/COM_IDMaskNode.cpp @@ -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)); diff --git a/source/blender/compositor/nodes/COM_ImageNode.cpp b/source/blender/compositor/nodes/COM_ImageNode.cpp index 20e6069b60a..ea2e99ed686 100644 --- a/source/blender/compositor/nodes/COM_ImageNode.cpp +++ b/source/blender/compositor/nodes/COM_ImageNode.cpp @@ -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()) { diff --git a/source/blender/compositor/nodes/COM_LensDistortionNode.cpp b/source/blender/compositor/nodes/COM_LensDistortionNode.cpp index edaa0a9009e..cee2b133eee 100644 --- a/source/blender/compositor/nodes/COM_LensDistortionNode.cpp +++ b/source/blender/compositor/nodes/COM_LensDistortionNode.cpp @@ -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); diff --git a/source/blender/compositor/nodes/COM_MathNode.cpp b/source/blender/compositor/nodes/COM_MathNode.cpp index 075b90c0f2b..e90767703a5 100644 --- a/source/blender/compositor/nodes/COM_MathNode.cpp +++ b/source/blender/compositor/nodes/COM_MathNode.cpp @@ -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(); diff --git a/source/blender/compositor/nodes/COM_MovieClipNode.cpp b/source/blender/compositor/nodes/COM_MovieClipNode.cpp index 7d11a06a24d..475a538670d 100644 --- a/source/blender/compositor/nodes/COM_MovieClipNode.cpp +++ b/source/blender/compositor/nodes/COM_MovieClipNode.cpp @@ -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); } } diff --git a/source/blender/compositor/nodes/COM_RenderLayersNode.cpp b/source/blender/compositor/nodes/COM_RenderLayersNode.cpp index e22c2fd5910..e4ce63e9193 100644 --- a/source/blender/compositor/nodes/COM_RenderLayersNode.cpp +++ b/source/blender/compositor/nodes/COM_RenderLayersNode.cpp @@ -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; } } diff --git a/source/blender/compositor/nodes/COM_SwitchNode.cpp b/source/blender/compositor/nodes/COM_SwitchNode.cpp index 1b15ae0e890..83e0be7d3c0 100644 --- a/source/blender/compositor/nodes/COM_SwitchNode.cpp +++ b/source/blender/compositor/nodes/COM_SwitchNode.cpp @@ -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()); diff --git a/source/blender/compositor/nodes/COM_TimeNode.cpp b/source/blender/compositor/nodes/COM_TimeNode.cpp index 3e2c750d3aa..481840cbd58 100644 --- a/source/blender/compositor/nodes/COM_TimeNode.cpp +++ b/source/blender/compositor/nodes/COM_TimeNode.cpp @@ -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); } diff --git a/source/blender/compositor/nodes/COM_ViewLevelsNode.cpp b/source/blender/compositor/nodes/COM_ViewLevelsNode.cpp index b5b15b2ba70..42d019c4e93 100644 --- a/source/blender/compositor/nodes/COM_ViewLevelsNode.cpp +++ b/source/blender/compositor/nodes/COM_ViewLevelsNode.cpp @@ -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); diff --git a/source/blender/compositor/nodes/COM_ZCombineNode.cpp b/source/blender/compositor/nodes/COM_ZCombineNode.cpp index be7b6ebdc45..8f512769d63 100644 --- a/source/blender/compositor/nodes/COM_ZCombineNode.cpp +++ b/source/blender/compositor/nodes/COM_ZCombineNode.cpp @@ -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); |