diff options
Diffstat (limited to 'source/blender/compositor/intern')
25 files changed, 59 insertions, 121 deletions
diff --git a/source/blender/compositor/intern/COM_CPUDevice.h b/source/blender/compositor/intern/COM_CPUDevice.h index 1d411569146..962380d7bc8 100644 --- a/source/blender/compositor/intern/COM_CPUDevice.h +++ b/source/blender/compositor/intern/COM_CPUDevice.h @@ -16,8 +16,7 @@ * Copyright 2011, Blender Foundation. */ -#ifndef __COM_CPUDEVICE_H__ -#define __COM_CPUDEVICE_H__ +#pragma once #include "COM_Device.h" @@ -44,5 +43,3 @@ class CPUDevice : public Device { protected: int m_thread_id; }; - -#endif diff --git a/source/blender/compositor/intern/COM_ChunkOrder.h b/source/blender/compositor/intern/COM_ChunkOrder.h index e75c07136b4..32d8c07de83 100644 --- a/source/blender/compositor/intern/COM_ChunkOrder.h +++ b/source/blender/compositor/intern/COM_ChunkOrder.h @@ -16,8 +16,7 @@ * Copyright 2011, Blender Foundation. */ -#ifndef __COM_CHUNKORDER_H__ -#define __COM_CHUNKORDER_H__ +#pragma once #include "COM_ChunkOrderHotspot.h" class ChunkOrder { @@ -53,5 +52,3 @@ class ChunkOrder { return this->m_distance; } }; - -#endif diff --git a/source/blender/compositor/intern/COM_ChunkOrderHotspot.h b/source/blender/compositor/intern/COM_ChunkOrderHotspot.h index f0bc92ad6d6..afacf5fc672 100644 --- a/source/blender/compositor/intern/COM_ChunkOrderHotspot.h +++ b/source/blender/compositor/intern/COM_ChunkOrderHotspot.h @@ -16,8 +16,7 @@ * Copyright 2011, Blender Foundation. */ -#ifndef __COM_CHUNKORDERHOTSPOT_H__ -#define __COM_CHUNKORDERHOTSPOT_H__ +#pragma once #ifdef WITH_CXX_GUARDEDALLOC # include "MEM_guardedalloc.h" @@ -37,5 +36,3 @@ class ChunkOrderHotspot { MEM_CXX_CLASS_ALLOC_FUNCS("COM:ChunkOrderHotspot") #endif }; - -#endif diff --git a/source/blender/compositor/intern/COM_CompositorContext.cpp b/source/blender/compositor/intern/COM_CompositorContext.cpp index e572fe7c99e..3d55fcba086 100644 --- a/source/blender/compositor/intern/COM_CompositorContext.cpp +++ b/source/blender/compositor/intern/COM_CompositorContext.cpp @@ -36,7 +36,6 @@ int CompositorContext::getFramenumber() const if (this->m_rd) { return this->m_rd->cfra; } - else { - return -1; /* this should never happen */ - } + + return -1; /* this should never happen */ } diff --git a/source/blender/compositor/intern/COM_CompositorContext.h b/source/blender/compositor/intern/COM_CompositorContext.h index 7e775b7beaf..e29a8f67187 100644 --- a/source/blender/compositor/intern/COM_CompositorContext.h +++ b/source/blender/compositor/intern/COM_CompositorContext.h @@ -16,8 +16,7 @@ * Copyright 2011, Blender Foundation. */ -#ifndef __COM_COMPOSITORCONTEXT_H__ -#define __COM_COMPOSITORCONTEXT_H__ +#pragma once #include "BLI_rect.h" #include "COM_defines.h" @@ -269,5 +268,3 @@ class CompositorContext { return (this->getbNodeTree()->flag & NTREE_COM_GROUPNODE_BUFFER) != 0; } }; - -#endif diff --git a/source/blender/compositor/intern/COM_Converter.cpp b/source/blender/compositor/intern/COM_Converter.cpp index edfeb3a3a04..60676ee42b7 100644 --- a/source/blender/compositor/intern/COM_Converter.cpp +++ b/source/blender/compositor/intern/COM_Converter.cpp @@ -416,19 +416,19 @@ NodeOperation *Converter::convertDataType(NodeOperationOutput *from, NodeOperati if (fromDatatype == COM_DT_VALUE && toDatatype == COM_DT_COLOR) { return new ConvertValueToColorOperation(); } - else if (fromDatatype == COM_DT_VALUE && toDatatype == COM_DT_VECTOR) { + if (fromDatatype == COM_DT_VALUE && toDatatype == COM_DT_VECTOR) { return new ConvertValueToVectorOperation(); } - else if (fromDatatype == COM_DT_COLOR && toDatatype == COM_DT_VALUE) { + if (fromDatatype == COM_DT_COLOR && toDatatype == COM_DT_VALUE) { return new ConvertColorToValueOperation(); } - else if (fromDatatype == COM_DT_COLOR && toDatatype == COM_DT_VECTOR) { + if (fromDatatype == COM_DT_COLOR && toDatatype == COM_DT_VECTOR) { return new ConvertColorToVectorOperation(); } - else if (fromDatatype == COM_DT_VECTOR && toDatatype == COM_DT_VALUE) { + if (fromDatatype == COM_DT_VECTOR && toDatatype == COM_DT_VALUE) { return new ConvertVectorToValueOperation(); } - else if (fromDatatype == COM_DT_VECTOR && toDatatype == COM_DT_COLOR) { + if (fromDatatype == COM_DT_VECTOR && toDatatype == COM_DT_COLOR) { return new ConvertVectorToColorOperation(); } diff --git a/source/blender/compositor/intern/COM_Converter.h b/source/blender/compositor/intern/COM_Converter.h index 1213246b9c9..fe3b8b75ccc 100644 --- a/source/blender/compositor/intern/COM_Converter.h +++ b/source/blender/compositor/intern/COM_Converter.h @@ -16,8 +16,7 @@ * Copyright 2011, Blender Foundation. */ -#ifndef __COM_CONVERTER_H__ -#define __COM_CONVERTER_H__ +#pragma once #ifdef WITH_CXX_GUARDEDALLOC # include "MEM_guardedalloc.h" @@ -85,4 +84,3 @@ class Converter { MEM_CXX_CLASS_ALLOC_FUNCS("COM:Converter") #endif }; -#endif diff --git a/source/blender/compositor/intern/COM_Debug.h b/source/blender/compositor/intern/COM_Debug.h index 250f360fa35..35e44506ef2 100644 --- a/source/blender/compositor/intern/COM_Debug.h +++ b/source/blender/compositor/intern/COM_Debug.h @@ -16,8 +16,7 @@ * Copyright 2013, Blender Foundation. */ -#ifndef __COM_DEBUG_H__ -#define __COM_DEBUG_H__ +#pragma once #include <map> #include <string> @@ -77,5 +76,3 @@ class DebugInfo { static GroupStateMap m_group_states; /**< for visualizing group states */ #endif }; - -#endif diff --git a/source/blender/compositor/intern/COM_Device.h b/source/blender/compositor/intern/COM_Device.h index 8573f69658e..bb95f1e953c 100644 --- a/source/blender/compositor/intern/COM_Device.h +++ b/source/blender/compositor/intern/COM_Device.h @@ -16,8 +16,7 @@ * Copyright 2011, Blender Foundation. */ -#ifndef __COM_DEVICE_H__ -#define __COM_DEVICE_H__ +#pragma once #include "COM_WorkPackage.h" @@ -62,5 +61,3 @@ class Device { MEM_CXX_CLASS_ALLOC_FUNCS("COM:Device") #endif }; - -#endif diff --git a/source/blender/compositor/intern/COM_ExecutionGroup.h b/source/blender/compositor/intern/COM_ExecutionGroup.h index 0299dad2ee8..f0dca4e9b34 100644 --- a/source/blender/compositor/intern/COM_ExecutionGroup.h +++ b/source/blender/compositor/intern/COM_ExecutionGroup.h @@ -16,8 +16,7 @@ * Copyright 2011, Blender Foundation. */ -#ifndef __COM_EXECUTIONGROUP_H__ -#define __COM_EXECUTIONGROUP_H__ +#pragma once #ifdef WITH_CXX_GUARDEDALLOC # include "MEM_guardedalloc.h" @@ -447,5 +446,3 @@ class ExecutionGroup { MEM_CXX_CLASS_ALLOC_FUNCS("COM:ExecutionGroup") #endif }; - -#endif diff --git a/source/blender/compositor/intern/COM_ExecutionSystem.h b/source/blender/compositor/intern/COM_ExecutionSystem.h index bf65594fc4f..44b47787b06 100644 --- a/source/blender/compositor/intern/COM_ExecutionSystem.h +++ b/source/blender/compositor/intern/COM_ExecutionSystem.h @@ -18,8 +18,7 @@ class ExecutionGroup; -#ifndef __COM_EXECUTIONSYSTEM_H__ -#define __COM_EXECUTIONSYSTEM_H__ +#pragma once #include "BKE_text.h" #include "COM_ExecutionGroup.h" @@ -196,5 +195,3 @@ class ExecutionSystem { MEM_CXX_CLASS_ALLOC_FUNCS("COM:ExecutionSystem") #endif }; - -#endif /* __COM_EXECUTIONSYSTEM_H__ */ diff --git a/source/blender/compositor/intern/COM_MemoryBuffer.cpp b/source/blender/compositor/intern/COM_MemoryBuffer.cpp index b958314d1b4..f58d7a768cc 100644 --- a/source/blender/compositor/intern/COM_MemoryBuffer.cpp +++ b/source/blender/compositor/intern/COM_MemoryBuffer.cpp @@ -136,10 +136,9 @@ float MemoryBuffer::getMaximumValue(rcti *rect) delete temp; return result; } - else { - BLI_assert(0); - return 0.0f; - } + + BLI_assert(0); + return 0.0f; } MemoryBuffer::~MemoryBuffer() diff --git a/source/blender/compositor/intern/COM_MemoryBuffer.h b/source/blender/compositor/intern/COM_MemoryBuffer.h index 6ba8f144482..fce1310f6ef 100644 --- a/source/blender/compositor/intern/COM_MemoryBuffer.h +++ b/source/blender/compositor/intern/COM_MemoryBuffer.h @@ -18,8 +18,7 @@ class MemoryBuffer; -#ifndef __COM_MEMORYBUFFER_H__ -#define __COM_MEMORYBUFFER_H__ +#pragma once #include "COM_ExecutionGroup.h" #include "COM_MemoryProxy.h" @@ -357,5 +356,3 @@ class MemoryBuffer { MEM_CXX_CLASS_ALLOC_FUNCS("COM:MemoryBuffer") #endif }; - -#endif diff --git a/source/blender/compositor/intern/COM_MemoryProxy.h b/source/blender/compositor/intern/COM_MemoryProxy.h index afbe0e3c166..a40e6f95dce 100644 --- a/source/blender/compositor/intern/COM_MemoryProxy.h +++ b/source/blender/compositor/intern/COM_MemoryProxy.h @@ -18,8 +18,8 @@ class MemoryProxy; -#ifndef __COM_MEMORYPROXY_H__ -#define __COM_MEMORYPROXY_H__ +#pragma once + #include "COM_ExecutionGroup.h" #include "COM_MemoryBuffer.h" @@ -129,5 +129,3 @@ class MemoryProxy { MEM_CXX_CLASS_ALLOC_FUNCS("COM:MemoryProxy") #endif }; - -#endif diff --git a/source/blender/compositor/intern/COM_Node.h b/source/blender/compositor/intern/COM_Node.h index a2ab1996a19..0a34eff3492 100644 --- a/source/blender/compositor/intern/COM_Node.h +++ b/source/blender/compositor/intern/COM_Node.h @@ -16,8 +16,7 @@ * Copyright 2011, Blender Foundation. */ -#ifndef __COM_NODE_H__ -#define __COM_NODE_H__ +#pragma once #include "DNA_node_types.h" #include <algorithm> @@ -329,5 +328,3 @@ class NodeOutput { void getEditorValueColor(float *value); void getEditorValueVector(float *value); }; - -#endif /* __COM_NODE_H__ */ diff --git a/source/blender/compositor/intern/COM_NodeConverter.h b/source/blender/compositor/intern/COM_NodeConverter.h index 56e9aa85010..e9b05184857 100644 --- a/source/blender/compositor/intern/COM_NodeConverter.h +++ b/source/blender/compositor/intern/COM_NodeConverter.h @@ -16,8 +16,7 @@ * Copyright 2013, Blender Foundation. */ -#ifndef __COM_NODECONVERTER_H__ -#define __COM_NODECONVERTER_H__ +#pragma once #ifdef WITH_CXX_GUARDEDALLOC # include "MEM_guardedalloc.h" @@ -121,5 +120,3 @@ class NodeConverter { MEM_CXX_CLASS_ALLOC_FUNCS("COM:NodeCompiler") #endif }; - -#endif /* __COM_NODECONVERTER_H__ */ diff --git a/source/blender/compositor/intern/COM_NodeGraph.h b/source/blender/compositor/intern/COM_NodeGraph.h index 531832c2c65..7cbd45bd0b5 100644 --- a/source/blender/compositor/intern/COM_NodeGraph.h +++ b/source/blender/compositor/intern/COM_NodeGraph.h @@ -16,8 +16,7 @@ * Copyright 2013, Blender Foundation. */ -#ifndef __COM_NODEGRAPH_H__ -#define __COM_NODEGRAPH_H__ +#pragma once #include <map> #include <set> @@ -135,5 +134,3 @@ class NodeGraph { MEM_CXX_CLASS_ALLOC_FUNCS("COM:NodeGraph") #endif }; - -#endif /* __COM_NODEGRAPH_H__ */ diff --git a/source/blender/compositor/intern/COM_NodeOperation.cpp b/source/blender/compositor/intern/COM_NodeOperation.cpp index fa4b5a07c65..4e3c5d2df6c 100644 --- a/source/blender/compositor/intern/COM_NodeOperation.cpp +++ b/source/blender/compositor/intern/COM_NodeOperation.cpp @@ -145,9 +145,8 @@ NodeOperation *NodeOperation::getInputOperation(unsigned int inputSocketIndex) if (input && input->isConnected()) { return &input->getLink()->getOperation(); } - else { - return NULL; - } + + return NULL; } void NodeOperation::getConnectedInputSockets(Inputs *sockets) @@ -168,30 +167,29 @@ bool NodeOperation::determineDependingAreaOfInterest(rcti *input, BLI_rcti_init(output, input->xmin, input->xmax, input->ymin, input->ymax); return false; } - else { - rcti tempOutput; - bool first = true; - for (int i = 0; i < getNumberOfInputSockets(); i++) { - NodeOperation *inputOperation = this->getInputOperation(i); - if (inputOperation && - inputOperation->determineDependingAreaOfInterest(input, readOperation, &tempOutput)) { - if (first) { - output->xmin = tempOutput.xmin; - output->ymin = tempOutput.ymin; - output->xmax = tempOutput.xmax; - output->ymax = tempOutput.ymax; - first = false; - } - else { - output->xmin = min(output->xmin, tempOutput.xmin); - output->ymin = min(output->ymin, tempOutput.ymin); - output->xmax = max(output->xmax, tempOutput.xmax); - output->ymax = max(output->ymax, tempOutput.ymax); - } + + rcti tempOutput; + bool first = true; + for (int i = 0; i < getNumberOfInputSockets(); i++) { + NodeOperation *inputOperation = this->getInputOperation(i); + if (inputOperation && + inputOperation->determineDependingAreaOfInterest(input, readOperation, &tempOutput)) { + if (first) { + output->xmin = tempOutput.xmin; + output->ymin = tempOutput.ymin; + output->xmax = tempOutput.xmax; + output->ymax = tempOutput.ymax; + first = false; + } + else { + output->xmin = min(output->xmin, tempOutput.xmin); + output->ymin = min(output->ymin, tempOutput.ymin); + output->xmax = max(output->xmax, tempOutput.xmax); + output->ymax = max(output->ymax, tempOutput.ymax); } } - return !first; } + return !first; } /***************** @@ -210,9 +208,8 @@ SocketReader *NodeOperationInput::getReader() if (isConnected()) { return &m_link->getOperation(); } - else { - return NULL; - } + + return NULL; } void NodeOperationInput::determineResolution(unsigned int resolution[2], diff --git a/source/blender/compositor/intern/COM_NodeOperation.h b/source/blender/compositor/intern/COM_NodeOperation.h index d2c896a2e56..d9324729560 100644 --- a/source/blender/compositor/intern/COM_NodeOperation.h +++ b/source/blender/compositor/intern/COM_NodeOperation.h @@ -16,8 +16,7 @@ * Copyright 2011, Blender Foundation. */ -#ifndef __COM_NODEOPERATION_H__ -#define __COM_NODEOPERATION_H__ +#pragma once #include <list> #include <sstream> @@ -521,5 +520,3 @@ class NodeOperationOutput { MEM_CXX_CLASS_ALLOC_FUNCS("COM:NodeOperation") #endif }; - -#endif diff --git a/source/blender/compositor/intern/COM_NodeOperationBuilder.h b/source/blender/compositor/intern/COM_NodeOperationBuilder.h index 917fa2888fd..5dd4022b127 100644 --- a/source/blender/compositor/intern/COM_NodeOperationBuilder.h +++ b/source/blender/compositor/intern/COM_NodeOperationBuilder.h @@ -16,8 +16,7 @@ * Copyright 2013, Blender Foundation. */ -#ifndef __COM_NODEOPERATIONBUILDER_H__ -#define __COM_NODEOPERATIONBUILDER_H__ +#pragma once #include <map> #include <set> @@ -176,5 +175,3 @@ class NodeOperationBuilder { MEM_CXX_CLASS_ALLOC_FUNCS("COM:NodeCompilerImpl") #endif }; - -#endif /* __COM_NODEOPERATIONBUILDER_H__ */ diff --git a/source/blender/compositor/intern/COM_OpenCLDevice.h b/source/blender/compositor/intern/COM_OpenCLDevice.h index 3f6e0fb55ef..d502f5aa34b 100644 --- a/source/blender/compositor/intern/COM_OpenCLDevice.h +++ b/source/blender/compositor/intern/COM_OpenCLDevice.h @@ -18,8 +18,7 @@ class OpenCLDevice; -#ifndef __COM_OPENCLDEVICE_H__ -#define __COM_OPENCLDEVICE_H__ +#pragma once #include "COM_Device.h" #include "COM_ReadBufferOperation.h" @@ -133,5 +132,3 @@ class OpenCLDevice : public Device { NodeOperation *operation); cl_kernel COM_clCreateKernel(const char *kernelname, list<cl_kernel> *clKernelsToCleanUp); }; - -#endif diff --git a/source/blender/compositor/intern/COM_SingleThreadedOperation.h b/source/blender/compositor/intern/COM_SingleThreadedOperation.h index 68c7f05a6c2..7a97d790afe 100644 --- a/source/blender/compositor/intern/COM_SingleThreadedOperation.h +++ b/source/blender/compositor/intern/COM_SingleThreadedOperation.h @@ -16,8 +16,8 @@ * Copyright 2011, Blender Foundation. */ -#ifndef __COM_SINGLETHREADEDOPERATION_H__ -#define __COM_SINGLETHREADEDOPERATION_H__ +#pragma once + #include "COM_NodeOperation.h" class SingleThreadedOperation : public NodeOperation { @@ -57,4 +57,3 @@ class SingleThreadedOperation : public NodeOperation { return true; } }; -#endif diff --git a/source/blender/compositor/intern/COM_SocketReader.h b/source/blender/compositor/intern/COM_SocketReader.h index 82bebd5e7b9..ee2a6e0e1bf 100644 --- a/source/blender/compositor/intern/COM_SocketReader.h +++ b/source/blender/compositor/intern/COM_SocketReader.h @@ -16,8 +16,8 @@ * Copyright 2011, Blender Foundation. */ -#ifndef __COM_SOCKETREADER_H__ -#define __COM_SOCKETREADER_H__ +#pragma once + #include "BLI_rect.h" #include "COM_defines.h" @@ -138,5 +138,3 @@ class SocketReader { MEM_CXX_CLASS_ALLOC_FUNCS("COM:SocketReader") #endif }; - -#endif /* __COM_SOCKETREADER_H__ */ diff --git a/source/blender/compositor/intern/COM_WorkPackage.h b/source/blender/compositor/intern/COM_WorkPackage.h index 2a0e47301f5..f4370aa41be 100644 --- a/source/blender/compositor/intern/COM_WorkPackage.h +++ b/source/blender/compositor/intern/COM_WorkPackage.h @@ -18,8 +18,8 @@ class WorkPackage; -#ifndef __COM_WORKPACKAGE_H__ -#define __COM_WORKPACKAGE_H__ +#pragma once + class ExecutionGroup; #include "COM_ExecutionGroup.h" @@ -67,5 +67,3 @@ class WorkPackage { MEM_CXX_CLASS_ALLOC_FUNCS("COM:WorkPackage") #endif }; - -#endif diff --git a/source/blender/compositor/intern/COM_WorkScheduler.h b/source/blender/compositor/intern/COM_WorkScheduler.h index 3a1b4c533bd..2424d1bdb72 100644 --- a/source/blender/compositor/intern/COM_WorkScheduler.h +++ b/source/blender/compositor/intern/COM_WorkScheduler.h @@ -16,8 +16,7 @@ * Copyright 2011, Blender Foundation. */ -#ifndef __COM_WORKSCHEDULER_H__ -#define __COM_WORKSCHEDULER_H__ +#pragma once #include "COM_ExecutionGroup.h" @@ -116,5 +115,3 @@ class WorkScheduler { MEM_CXX_CLASS_ALLOC_FUNCS("COM:WorkScheduler") #endif }; - -#endif /* __COM_WORKSCHEDULER_H__ */ |