From a262ea8c47f8106f66e16935c556f383ef306861 Mon Sep 17 00:00:00 2001 From: Campbell Barton Date: Sun, 17 Jun 2018 17:05:29 +0200 Subject: [PATCH] Cleanup: trailing space for compositor --- .../compositor/intern/COM_ChunkOrder.h | 2 +- .../compositor/intern/COM_CompositorContext.h | 4 +- .../compositor/intern/COM_Converter.cpp | 4 +- .../blender/compositor/intern/COM_Converter.h | 6 +- .../blender/compositor/intern/COM_Debug.cpp | 66 ++++---- source/blender/compositor/intern/COM_Debug.h | 16 +- source/blender/compositor/intern/COM_Device.h | 4 +- .../compositor/intern/COM_ExecutionGroup.cpp | 14 +- .../compositor/intern/COM_ExecutionGroup.h | 80 ++++----- .../compositor/intern/COM_ExecutionSystem.cpp | 2 +- .../compositor/intern/COM_ExecutionSystem.h | 4 +- .../compositor/intern/COM_MemoryBuffer.h | 44 ++--- .../compositor/intern/COM_MemoryProxy.h | 8 +- source/blender/compositor/intern/COM_Node.cpp | 6 +- source/blender/compositor/intern/COM_Node.h | 52 +++--- .../compositor/intern/COM_NodeConverter.cpp | 26 +-- .../compositor/intern/COM_NodeConverter.h | 24 +-- .../compositor/intern/COM_NodeGraph.cpp | 36 ++-- .../blender/compositor/intern/COM_NodeGraph.h | 34 ++-- .../compositor/intern/COM_NodeOperation.cpp | 2 +- .../compositor/intern/COM_NodeOperation.h | 54 +++--- .../intern/COM_NodeOperationBuilder.cpp | 160 +++++++++--------- .../intern/COM_NodeOperationBuilder.h | 50 +++--- .../compositor/intern/COM_OpenCLDevice.cpp | 4 +- .../compositor/intern/COM_OpenCLDevice.h | 14 +- .../intern/COM_SingleThreadedOperation.cpp | 2 +- .../intern/COM_SingleThreadedOperation.h | 10 +- .../compositor/intern/COM_WorkScheduler.cpp | 6 +- .../compositor/intern/COM_WorkScheduler.h | 2 +- .../compositor/intern/COM_compositor.cpp | 2 +- .../compositor/nodes/COM_AlphaOverNode.cpp | 8 +- .../nodes/COM_BilateralBlurNode.cpp | 2 +- .../blender/compositor/nodes/COM_BlurNode.cpp | 24 +-- .../compositor/nodes/COM_BokehBlurNode.cpp | 4 +- .../compositor/nodes/COM_BokehImageNode.cpp | 4 +- .../compositor/nodes/COM_BoxMaskNode.cpp | 4 +- .../compositor/nodes/COM_BrightnessNode.cpp | 2 +- .../compositor/nodes/COM_ChromaMatteNode.cpp | 14 +- .../compositor/nodes/COM_ColorBalanceNode.cpp | 6 +- .../nodes/COM_ColorCorrectionNode.cpp | 4 +- .../compositor/nodes/COM_ColorCurveNode.cpp | 6 +- .../compositor/nodes/COM_ColorMatteNode.cpp | 14 +- .../compositor/nodes/COM_ColorNode.cpp | 2 +- .../compositor/nodes/COM_ColorRampNode.cpp | 6 +- .../compositor/nodes/COM_ColorSpillNode.cpp | 6 +- .../compositor/nodes/COM_ColorToBWNode.cpp | 4 +- .../compositor/nodes/COM_CombineColorNode.cpp | 8 +- .../compositor/nodes/COM_CombineColorNode.h | 10 +- .../compositor/nodes/COM_CompositorNode.cpp | 4 +- .../compositor/nodes/COM_ConvertAlphaNode.cpp | 4 +- .../compositor/nodes/COM_CornerPinNode.cpp | 2 +- .../blender/compositor/nodes/COM_CropNode.cpp | 2 +- .../compositor/nodes/COM_DefocusNode.cpp | 30 ++-- .../compositor/nodes/COM_DespeckleNode.cpp | 6 +- .../nodes/COM_DifferenceMatteNode.cpp | 6 +- .../compositor/nodes/COM_DilateErodeNode.cpp | 24 +-- .../nodes/COM_DirectionalBlurNode.cpp | 2 +- .../nodes/COM_DistanceMatteNode.cpp | 24 +-- .../nodes/COM_DoubleEdgeMaskNode.cpp | 4 +- .../compositor/nodes/COM_EllipseMaskNode.cpp | 6 +- .../compositor/nodes/COM_FilterNode.cpp | 6 +- .../blender/compositor/nodes/COM_FlipNode.cpp | 2 +- .../compositor/nodes/COM_GammaNode.cpp | 2 +- .../compositor/nodes/COM_GlareNode.cpp | 12 +- .../COM_HueSaturationValueCorrectNode.cpp | 8 +- .../nodes/COM_HueSaturationValueNode.cpp | 6 +- .../compositor/nodes/COM_IDMaskNode.cpp | 6 +- .../compositor/nodes/COM_ImageNode.cpp | 16 +- .../compositor/nodes/COM_InpaintNode.cpp | 4 +- .../compositor/nodes/COM_InvertNode.cpp | 2 +- .../compositor/nodes/COM_KeyingNode.cpp | 74 ++++---- .../compositor/nodes/COM_KeyingScreenNode.cpp | 6 +- .../nodes/COM_LensDistortionNode.cpp | 6 +- .../nodes/COM_LuminanceMatteNode.cpp | 4 +- .../compositor/nodes/COM_MapRangeNode.cpp | 4 +- .../compositor/nodes/COM_MapUVNode.cpp | 2 +- .../compositor/nodes/COM_MapValueNode.cpp | 6 +- .../blender/compositor/nodes/COM_MathNode.cpp | 6 +- .../blender/compositor/nodes/COM_MixNode.cpp | 6 +- .../compositor/nodes/COM_MovieClipNode.cpp | 8 +- .../nodes/COM_MovieDistortionNode.cpp | 4 +- .../compositor/nodes/COM_NormalNode.cpp | 8 +- .../compositor/nodes/COM_OutputFileNode.cpp | 8 +- .../compositor/nodes/COM_PixelateNode.cpp | 4 +- .../nodes/COM_PlaneTrackDeformNode.cpp | 12 +- .../compositor/nodes/COM_RotateNode.cpp | 4 +- .../compositor/nodes/COM_ScaleNode.cpp | 8 +- .../nodes/COM_SeparateColorNode.cpp | 20 +-- .../compositor/nodes/COM_SeparateColorNode.h | 10 +- .../compositor/nodes/COM_SetAlphaNode.cpp | 6 +- .../compositor/nodes/COM_SocketProxyNode.cpp | 4 +- .../compositor/nodes/COM_SocketProxyNode.h | 4 +- .../compositor/nodes/COM_Stabilize2dNode.cpp | 8 +- .../compositor/nodes/COM_SwitchNode.cpp | 4 +- .../compositor/nodes/COM_TextureNode.cpp | 6 +- .../blender/compositor/nodes/COM_TimeNode.cpp | 2 +- .../compositor/nodes/COM_TonemapNode.cpp | 4 +- .../nodes/COM_TrackPositionNode.cpp | 2 +- .../compositor/nodes/COM_TransformNode.cpp | 16 +- .../compositor/nodes/COM_TranslateNode.cpp | 12 +- .../compositor/nodes/COM_ValueNode.cpp | 2 +- .../compositor/nodes/COM_VectorBlurNode.cpp | 4 +- .../compositor/nodes/COM_VectorCurveNode.cpp | 2 +- .../compositor/nodes/COM_ViewLevelsNode.cpp | 6 +- .../compositor/nodes/COM_ZCombineNode.cpp | 16 +- .../operations/COM_AlphaOverKeyOperation.cpp | 6 +- .../operations/COM_AlphaOverKeyOperation.h | 2 +- .../COM_AlphaOverMixedOperation.cpp | 4 +- .../operations/COM_AlphaOverMixedOperation.h | 4 +- .../COM_AlphaOverPremultiplyOperation.cpp | 6 +- .../COM_AlphaOverPremultiplyOperation.h | 2 +- .../operations/COM_AntiAliasOperation.h | 8 +- .../operations/COM_BilateralBlurOperation.cpp | 2 +- .../operations/COM_BilateralBlurOperation.h | 8 +- .../operations/COM_BlurBaseOperation.h | 4 +- .../operations/COM_BokehBlurOperation.cpp | 8 +- .../operations/COM_BokehBlurOperation.h | 8 +- .../operations/COM_BokehImageOperation.h | 20 +-- .../operations/COM_BoxMaskOperation.cpp | 10 +- .../operations/COM_BoxMaskOperation.h | 12 +- .../operations/COM_BrightnessOperation.h | 6 +- .../operations/COM_CalculateMeanOperation.cpp | 2 +- .../operations/COM_CalculateMeanOperation.h | 14 +- ...OM_CalculateStandardDeviationOperation.cpp | 2 +- .../operations/COM_ChangeHSVOperation.cpp | 4 +- .../operations/COM_ChangeHSVOperation.h | 4 +- .../operations/COM_ChannelMatteOperation.cpp | 6 +- .../COM_ColorBalanceASCCDLOperation.cpp | 6 +- .../COM_ColorBalanceASCCDLOperation.h | 10 +- .../COM_ColorBalanceLGGOperation.cpp | 6 +- .../operations/COM_ColorBalanceLGGOperation.h | 10 +- .../COM_ColorCorrectionOperation.cpp | 18 +- .../operations/COM_ColorCorrectionOperation.h | 10 +- .../operations/COM_ColorCurveOperation.cpp | 2 +- .../operations/COM_ColorCurveOperation.h | 16 +- .../operations/COM_ColorRampOperation.h | 8 +- .../operations/COM_ColorSpillOperation.cpp | 2 +- .../operations/COM_ColorSpillOperation.h | 2 +- .../COM_ConvertColorProfileOperation.h | 14 +- .../COM_ConvertDepthToRadiusOperation.cpp | 2 +- .../COM_ConvertDepthToRadiusOperation.h | 12 +- .../operations/COM_ConvertOperation.h | 36 ++-- .../COM_ConvolutionEdgeFilterOperation.cpp | 24 +-- .../COM_ConvolutionFilterOperation.cpp | 4 +- .../COM_ConvolutionFilterOperation.h | 2 +- .../operations/COM_CropOperation.cpp | 8 +- .../compositor/operations/COM_CropOperation.h | 2 +- .../operations/COM_CurveBaseOperation.h | 4 +- .../operations/COM_DifferenceMatteOperation.h | 6 +- .../operations/COM_DilateErodeOperation.cpp | 10 +- .../operations/COM_DilateErodeOperation.h | 48 +++--- .../COM_DirectionalBlurOperation.cpp | 8 +- .../operations/COM_DirectionalBlurOperation.h | 10 +- .../operations/COM_DisplaceOperation.cpp | 4 +- .../operations/COM_DisplaceOperation.h | 6 +- .../COM_DisplaceSimpleOperation.cpp | 2 +- .../operations/COM_DisplaceSimpleOperation.h | 4 +- .../COM_DistanceRGBMatteOperation.cpp | 4 +- .../COM_DistanceRGBMatteOperation.h | 6 +- .../operations/COM_DotproductOperation.h | 2 +- .../COM_DoubleEdgeMaskOperation.cpp | 76 ++++----- .../operations/COM_DoubleEdgeMaskOperation.h | 6 +- .../operations/COM_EllipseMaskOperation.cpp | 12 +- .../operations/COM_EllipseMaskOperation.h | 14 +- .../COM_FastGaussianBlurOperation.cpp | 26 +-- .../COM_FastGaussianBlurOperation.h | 4 +- .../operations/COM_FlipOperation.cpp | 6 +- .../compositor/operations/COM_FlipOperation.h | 2 +- .../operations/COM_GammaCorrectOperation.h | 12 +- .../operations/COM_GammaOperation.cpp | 4 +- .../operations/COM_GammaOperation.h | 6 +- .../COM_GaussianAlphaXBlurOperation.cpp | 6 +- .../COM_GaussianAlphaXBlurOperation.h | 4 +- .../COM_GaussianAlphaYBlurOperation.cpp | 6 +- .../COM_GaussianAlphaYBlurOperation.h | 6 +- .../COM_GaussianBokehBlurOperation.cpp | 22 +-- .../COM_GaussianBokehBlurOperation.h | 10 +- .../operations/COM_GaussianXBlurOperation.cpp | 2 +- .../operations/COM_GaussianXBlurOperation.h | 2 +- .../operations/COM_GaussianYBlurOperation.cpp | 2 +- .../operations/COM_GaussianYBlurOperation.h | 4 +- .../COM_GlareThresholdOperation.cpp | 2 +- .../operations/COM_GlareThresholdOperation.h | 2 +- .../COM_HueSaturationValueCorrectOperation.h | 6 +- .../operations/COM_ImageOperation.h | 4 +- .../operations/COM_InpaintOperation.cpp | 36 ++-- .../operations/COM_InpaintOperation.h | 14 +- .../operations/COM_InvertOperation.cpp | 6 +- .../operations/COM_InvertOperation.h | 10 +- .../COM_LuminanceMatteOperation.cpp | 4 +- .../operations/COM_LuminanceMatteOperation.h | 6 +- .../operations/COM_MapRangeOperation.cpp | 2 +- .../operations/COM_MapRangeOperation.h | 10 +- .../operations/COM_MapUVOperation.cpp | 2 +- .../operations/COM_MapUVOperation.h | 4 +- .../operations/COM_MapValueOperation.cpp | 2 +- .../operations/COM_MapValueOperation.h | 10 +- .../operations/COM_MathBaseOperation.cpp | 74 ++++---- .../operations/COM_MathBaseOperation.h | 4 +- .../operations/COM_MixOperation.cpp | 6 +- .../compositor/operations/COM_MixOperation.h | 10 +- .../operations/COM_MovieClipOperation.h | 4 +- .../operations/COM_NormalizeOperation.cpp | 2 +- .../operations/COM_OutputFileOperation.cpp | 32 ++-- .../operations/COM_OutputFileOperation.h | 20 +-- .../COM_PlaneCornerPinOperation.cpp | 28 +-- .../operations/COM_PlaneCornerPinOperation.h | 16 +- .../operations/COM_PreviewOperation.cpp | 6 +- .../operations/COM_PreviewOperation.h | 6 +- .../COM_ProjectorLensDistortionOperation.cpp | 2 +- .../COM_ProjectorLensDistortionOperation.h | 12 +- .../operations/COM_ReadBufferOperation.cpp | 4 +- .../operations/COM_ReadBufferOperation.h | 2 +- .../operations/COM_RenderLayersProg.cpp | 12 +- .../operations/COM_RotateOperation.cpp | 10 +- .../operations/COM_RotateOperation.h | 2 +- .../COM_ScreenLensDistortionOperation.cpp | 38 ++--- .../COM_ScreenLensDistortionOperation.h | 16 +- .../operations/COM_SetAlphaOperation.cpp | 6 +- .../operations/COM_SetAlphaOperation.h | 4 +- .../operations/COM_SetSamplerOperation.h | 4 +- .../operations/COM_SetValueOperation.h | 8 +- .../operations/COM_SetVectorOperation.h | 4 +- .../operations/COM_SocketProxyOperation.h | 6 +- .../operations/COM_SunBeamsOperation.cpp | 10 +- .../operations/COM_TextureOperation.h | 2 +- .../operations/COM_TonemapOperation.h | 16 +- .../operations/COM_TranslateOperation.h | 2 +- .../COM_VariableSizeBokehBlurOperation.cpp | 22 +-- .../COM_VariableSizeBokehBlurOperation.h | 22 +-- .../operations/COM_VectorBlurOperation.h | 16 +- .../operations/COM_VectorCurveOperation.h | 6 +- .../operations/COM_ViewerOperation.cpp | 4 +- .../operations/COM_ViewerOperation.h | 2 +- .../operations/COM_WriteBufferOperation.cpp | 4 +- .../operations/COM_WriteBufferOperation.h | 2 +- .../operations/COM_ZCombineOperation.h | 4 +- 237 files changed, 1297 insertions(+), 1297 deletions(-) diff --git a/source/blender/compositor/intern/COM_ChunkOrder.h b/source/blender/compositor/intern/COM_ChunkOrder.h index 0310933e5c5..4728b771e3c 100644 --- a/source/blender/compositor/intern/COM_ChunkOrder.h +++ b/source/blender/compositor/intern/COM_ChunkOrder.h @@ -34,7 +34,7 @@ public: ChunkOrder(); void determineDistance(ChunkOrderHotspot **hotspots, unsigned int numberOfHotspots); friend bool operator<(const ChunkOrder &a, const ChunkOrder &b); - + void setChunkNumber(unsigned int chunknumber) { this->m_number = chunknumber; } void setX(int x) { this->m_x = x; } void setY(int y) { this->m_y = y; } diff --git a/source/blender/compositor/intern/COM_CompositorContext.h b/source/blender/compositor/intern/COM_CompositorContext.h index d58e8502414..1c702503915 100644 --- a/source/blender/compositor/intern/COM_CompositorContext.h +++ b/source/blender/compositor/intern/COM_CompositorContext.h @@ -126,7 +126,7 @@ public: * @brief get the scene of the context */ const RenderData *getRenderData() const { return this->m_rd; } - + void setScene(Scene *scene) { m_scene = scene; } Scene *getScene() const { return m_scene; } @@ -196,7 +196,7 @@ public: void setViewName(const char *viewName) { this->m_viewName = viewName; } int getChunksize() const { return this->getbNodeTree()->chunksize; } - + void setFastCalculation(bool fastCalculation) {this->m_fastCalculation = fastCalculation;} bool isFastCalculation() const { return this->m_fastCalculation; } bool isGroupnodeBufferEnabled() const { return (this->getbNodeTree()->flag & NTREE_COM_GROUPNODE_BUFFER) != 0; } diff --git a/source/blender/compositor/intern/COM_Converter.cpp b/source/blender/compositor/intern/COM_Converter.cpp index 3d49443c146..58e0da04e5e 100644 --- a/source/blender/compositor/intern/COM_Converter.cpp +++ b/source/blender/compositor/intern/COM_Converter.cpp @@ -414,7 +414,7 @@ NodeOperation *Converter::convertDataType(NodeOperationOutput *from, NodeOperati { DataType fromDatatype = from->getDataType(); DataType toDatatype = to->getDataType(); - + if (fromDatatype == COM_DT_VALUE && toDatatype == COM_DT_COLOR) { return new ConvertValueToColorOperation(); } @@ -433,7 +433,7 @@ NodeOperation *Converter::convertDataType(NodeOperationOutput *from, NodeOperati else if (fromDatatype == COM_DT_VECTOR && toDatatype == COM_DT_COLOR) { return new ConvertVectorToColorOperation(); } - + return NULL; } diff --git a/source/blender/compositor/intern/COM_Converter.h b/source/blender/compositor/intern/COM_Converter.h index 7ed5616d899..b57220351e8 100644 --- a/source/blender/compositor/intern/COM_Converter.h +++ b/source/blender/compositor/intern/COM_Converter.h @@ -50,14 +50,14 @@ public: * @see Node */ static Node *convert(bNode *b_node); - + /** * @brief True if the node is considered 'fast'. * * Slow nodes will be skipped if fast execution is required. */ static bool is_fast_node(bNode *b_node); - + /** * @brief This method will add a datetype conversion rule when the to-socket does not support the from-socket actual data type. * @@ -68,7 +68,7 @@ public: * @see NodeLink - a link between two sockets */ static NodeOperation *convertDataType(NodeOperationOutput *from, NodeOperationInput *to); - + /** * @brief This method will add a resolution rule based on the settings of the NodeInput. * diff --git a/source/blender/compositor/intern/COM_Debug.cpp b/source/blender/compositor/intern/COM_Debug.cpp index b95b7500cca..6179bd26275 100644 --- a/source/blender/compositor/intern/COM_Debug.cpp +++ b/source/blender/compositor/intern/COM_Debug.cpp @@ -118,7 +118,7 @@ void DebugInfo::execution_group_finished(const ExecutionGroup *group) int DebugInfo::graphviz_operation(const ExecutionSystem *system, const NodeOperation *operation, const ExecutionGroup *group, char *str, int maxlen) { int len = 0; - + std::string fillcolor = "gainsboro"; if (operation->isViewerOperation()) { const ViewerOperation *viewer = (const ViewerOperation *)operation; @@ -141,14 +141,14 @@ int DebugInfo::graphviz_operation(const ExecutionSystem *system, const NodeOpera else if (operation->isWriteBufferOperation()) { fillcolor = "darkorange"; } - + len += snprintf(str + len, maxlen > len ? maxlen - len : 0, "// OPERATION: %p\r\n", operation); if (group) len += snprintf(str + len, maxlen > len ? maxlen - len : 0, "\"O_%p_%p\"", operation, group); else len += snprintf(str + len, maxlen > len ? maxlen - len : 0, "\"O_%p\"", operation); len += snprintf(str + len, maxlen > len ? maxlen - len : 0, " [fillcolor=%s,style=filled,shape=record,label=\"{", fillcolor.c_str()); - + int totinputs = operation->getNumberOfInputSockets(); if (totinputs != 0) { len += snprintf(str + len, maxlen > len ? maxlen - len : 0, "{"); @@ -173,11 +173,11 @@ int DebugInfo::graphviz_operation(const ExecutionSystem *system, const NodeOpera len += snprintf(str + len, maxlen > len ? maxlen - len : 0, "}"); len += snprintf(str + len, maxlen > len ? maxlen - len : 0, "|"); } - + len += snprintf(str + len, maxlen > len ? maxlen - len : 0, "%s\\n(%s)", m_op_names[operation].c_str(), typeid(*operation).name()); - + len += snprintf(str + len, maxlen > len ? maxlen - len : 0, " (%u,%u)", operation->getWidth(), operation->getHeight()); - + int totoutputs = operation->getNumberOfOutputSockets(); if (totoutputs != 0) { len += snprintf(str + len, maxlen > len ? maxlen - len : 0, "|"); @@ -204,7 +204,7 @@ int DebugInfo::graphviz_operation(const ExecutionSystem *system, const NodeOpera } len += snprintf(str + len, maxlen > len ? maxlen - len : 0, "}\"]"); len += snprintf(str + len, maxlen > len ? maxlen - len : 0, "\r\n"); - + return len; } @@ -233,7 +233,7 @@ int DebugInfo::graphviz_legend_group(const char *name, const char *color, const int DebugInfo::graphviz_legend(char *str, int maxlen) { int len = 0; - + len += snprintf(str + len, maxlen > len ? maxlen - len : 0, "{\r\n"); len += snprintf(str + len, maxlen > len ? maxlen - len : 0, "rank = sink;\r\n"); len += snprintf(str + len, maxlen > len ? maxlen - len : 0, "Legend [shape=none, margin=0, label=<\r\n"); @@ -266,12 +266,12 @@ bool DebugInfo::graphviz_system(const ExecutionSystem *system, char *str, int ma { char strbuf[64]; int len = 0; - + len += snprintf(str + len, maxlen > len ? maxlen - len : 0, "digraph compositorexecution {\r\n"); len += snprintf(str + len, maxlen > len ? maxlen - len : 0, "ranksep=1.5\r\n"); len += snprintf(str + len, maxlen > len ? maxlen - len : 0, "rankdir=LR\r\n"); len += snprintf(str + len, maxlen > len ? maxlen - len : 0, "splines=false\r\n"); - + #if 0 for (ExecutionSystem::Operations::const_iterator it = system->m_operations.begin(); it != system->m_operations.end(); ++it) { @@ -279,13 +279,13 @@ bool DebugInfo::graphviz_system(const ExecutionSystem *system, char *str, int ma len += snprintf(str + len, maxlen > len ? maxlen - len : 0, "// OPERATION: %s\r\n", node->getbNode()->typeinfo->ui_name); } #endif - + int totops = system->m_operations.size(); int totgroups = system->m_groups.size(); std::map > op_groups; for (int i = 0; i < totgroups; ++i) { const ExecutionGroup *group = system->m_groups[i]; - + len += snprintf(str + len, maxlen > len ? maxlen - len : 0, "// GROUP: %d\r\n", i); len += snprintf(str + len, maxlen > len ? maxlen - len : 0, "subgraph cluster_%d{\r\n", i); /* used as a check for executing group */ @@ -302,41 +302,41 @@ bool DebugInfo::graphviz_system(const ExecutionSystem *system, char *str, int ma len += snprintf(str + len, maxlen > len ? maxlen - len : 0, "color=black\r\n"); len += snprintf(str + len, maxlen > len ? maxlen - len : 0, "fillcolor=chartreuse4\r\n"); } - + for (ExecutionGroup::Operations::const_iterator it = group->m_operations.begin(); it != group->m_operations.end(); ++it) { NodeOperation *operation = *it; - + sprintf(strbuf, "_%p", group); op_groups[operation].push_back(std::string(strbuf)); - + len += graphviz_operation(system, operation, group, str + len, maxlen > len ? maxlen - len : 0); } - + // len += snprintf(str+len, maxlen>len ? maxlen-len : 0, "// OUTPUTOPERATION: %p\r\n", group->getOutputOperation()); // len += snprintf(str+len, maxlen>len ? maxlen-len : 0, " O_%p\r\n", group->getOutputOperation()); len += snprintf(str + len, maxlen > len ? maxlen - len : 0, "}\r\n"); } - + /* operations not included in any group */ for (int j = 0; j < totops; ++j) { NodeOperation *operation = system->m_operations[j]; if (op_groups.find(operation) != op_groups.end()) continue; - + op_groups[operation].push_back(std::string("")); - + len += graphviz_operation(system, operation, 0, str + len, maxlen > len ? maxlen - len : 0); } - + for (int i = 0; i < totops; i++) { NodeOperation *operation = system->m_operations[i]; - + if (operation->isReadBufferOperation()) { ReadBufferOperation *read = (ReadBufferOperation *)operation; WriteBufferOperation *write = read->getMemoryProxy()->getWriteBufferOperation(); std::vector &read_groups = op_groups[read]; std::vector &write_groups = op_groups[write]; - + for (int k = 0; k < write_groups.size(); ++k) { for (int l = 0; l < read_groups.size(); ++l) { len += snprintf(str + len, maxlen > len ? maxlen - len : 0, "\"O_%p%s\" -> \"O_%p%s\" [style=dotted]\r\n", write, write_groups[k].c_str(), read, read_groups[l].c_str()); @@ -344,17 +344,17 @@ bool DebugInfo::graphviz_system(const ExecutionSystem *system, char *str, int ma } } } - + for (int i = 0; i < totops; i++) { NodeOperation *op = system->m_operations[i]; - + for (NodeOperation::Inputs::const_iterator it = op->m_inputs.begin(); it != op->m_inputs.end(); ++it) { NodeOperationInput *to = *it; NodeOperationOutput *from = to->getLink(); - + if (!from) continue; - + std::string color; switch (from->getDataType()) { case COM_DT_VALUE: @@ -367,12 +367,12 @@ bool DebugInfo::graphviz_system(const ExecutionSystem *system, char *str, int ma color = "orange"; break; } - + NodeOperation *to_op = &to->getOperation(); NodeOperation *from_op = &from->getOperation(); std::vector &from_groups = op_groups[from_op]; std::vector &to_groups = op_groups[to_op]; - + len += snprintf(str + len, maxlen > len ? maxlen - len : 0, "// CONNECTION: %p.%p -> %p.%p\r\n", from_op, from, to_op, to); for (int k = 0; k < from_groups.size(); ++k) { @@ -385,11 +385,11 @@ bool DebugInfo::graphviz_system(const ExecutionSystem *system, char *str, int ma } } } - + len += graphviz_legend(str + len, maxlen > len ? maxlen - len : 0); - + len += snprintf(str + len, maxlen > len ? maxlen - len : 0, "}\r\n"); - + return (len < maxlen); } @@ -399,11 +399,11 @@ void DebugInfo::graphviz(const ExecutionSystem *system) if (graphviz_system(system, str, sizeof(str) - 1)) { char basename[FILE_MAX]; char filename[FILE_MAX]; - + BLI_snprintf(basename, sizeof(basename), "compositor_%d.dot", m_file_index); BLI_join_dirfile(filename, sizeof(filename), BKE_tempdir_session(), basename); ++m_file_index; - + FILE *fp = BLI_fopen(filename, "wb"); fputs(str, fp); fclose(fp); diff --git a/source/blender/compositor/intern/COM_Debug.h b/source/blender/compositor/intern/COM_Debug.h index 4b4894d36cf..f5db93e8825 100644 --- a/source/blender/compositor/intern/COM_Debug.h +++ b/source/blender/compositor/intern/COM_Debug.h @@ -39,27 +39,27 @@ public: EG_RUNNING, EG_FINISHED } GroupState; - + typedef std::map NodeNameMap; typedef std::map OpNameMap; typedef std::map GroupStateMap; - + static std::string node_name(const Node *node); static std::string operation_name(const NodeOperation *op); - + static void convert_started(); static void execute_started(const ExecutionSystem *system); - + static void node_added(const Node *node); static void node_to_operations(const Node *node); static void operation_added(const NodeOperation *operation); static void operation_read_write_buffer(const NodeOperation *operation); - + static void execution_group_started(const ExecutionGroup *group); static void execution_group_finished(const ExecutionGroup *group); - + static void graphviz(const ExecutionSystem *system); - + #ifdef COM_DEBUG protected: static int graphviz_operation(const ExecutionSystem *system, const NodeOperation *operation, const ExecutionGroup *group, char *str, int maxlen); @@ -68,7 +68,7 @@ protected: static int graphviz_legend_group(const char *name, const char *color, const char *style, char *str, int maxlen); static int graphviz_legend(char *str, int maxlen); static bool graphviz_system(const ExecutionSystem *system, char *str, int maxlen); - + private: static int m_file_index; static NodeNameMap m_node_names; /**< map nodes to usable names for debug output */ diff --git a/source/blender/compositor/intern/COM_Device.h b/source/blender/compositor/intern/COM_Device.h index 62653357fdf..4ab6e1e2f96 100644 --- a/source/blender/compositor/intern/COM_Device.h +++ b/source/blender/compositor/intern/COM_Device.h @@ -34,11 +34,11 @@ class Device { public: /** - * @brief Declaration of the virtual destructor + * @brief Declaration of the virtual destructor * @note resolve warning gcc 4.7 */ virtual ~Device() {} - + /** * @brief initialize the device */ diff --git a/source/blender/compositor/intern/COM_ExecutionGroup.cpp b/source/blender/compositor/intern/COM_ExecutionGroup.cpp index 8a8193bcb62..5a651f07868 100644 --- a/source/blender/compositor/intern/COM_ExecutionGroup.cpp +++ b/source/blender/compositor/intern/COM_ExecutionGroup.cpp @@ -73,16 +73,16 @@ CompositorPriority ExecutionGroup::getRenderPriotrity() bool ExecutionGroup::canContainOperation(NodeOperation *operation) { if (!this->m_initialized) { return true; } - + if (operation->isReadBufferOperation()) { return true; } if (operation->isWriteBufferOperation()) { return false; } if (operation->isSetOperation()) { return true; } - + /* complex groups don't allow further ops (except read buffer and values, see above) */ if (m_complex) { return false; } /* complex ops can't be added to other groups (except their own, which they initialize, see above) */ if (operation->isComplex()) { return false; } - + return true; } @@ -90,16 +90,16 @@ bool ExecutionGroup::addOperation(NodeOperation *operation) { if (!canContainOperation(operation)) return false; - + if (!operation->isReadBufferOperation() && !operation->isWriteBufferOperation()) { m_complex = operation->isComplex(); m_openCL = operation->isOpenCL(); m_singleThreaded = operation->isSingleThreaded(); m_initialized = true; } - + m_operations.push_back(operation); - + return true; } @@ -382,7 +382,7 @@ void ExecutionGroup::finalizeChunkExecution(int chunkNumber, MemoryBuffer **memo { if (this->m_chunkExecutionStates[chunkNumber] == COM_ES_SCHEDULED) this->m_chunkExecutionStates[chunkNumber] = COM_ES_EXECUTED; - + atomic_add_and_fetch_u(&this->m_chunksFinished, 1); if (memoryBuffers) { for (unsigned int index = 0; index < this->m_cachedMaxReadBufferOffset; index++) { diff --git a/source/blender/compositor/intern/COM_ExecutionGroup.h b/source/blender/compositor/intern/COM_ExecutionGroup.h index 0f84dccb711..20ffbeaa357 100644 --- a/source/blender/compositor/intern/COM_ExecutionGroup.h +++ b/source/blender/compositor/intern/COM_ExecutionGroup.h @@ -65,89 +65,89 @@ typedef enum ChunkExecutionState { class ExecutionGroup { public: typedef std::vector Operations; - + private: // fields - + /** * @brief list of operations in this ExecutionGroup */ Operations m_operations; - + /** * @brief is this ExecutionGroup an input ExecutionGroup * an input execution group is a group that is at the end of the calculation (the output is important for the user) */ int m_isOutput; - + /** * @brief Width of the output */ unsigned int m_width; - + /** * @brief Height of the output */ unsigned int m_height; - + /** * @brief size of a single chunk, being Width or of height * a chunk is always a square, except at the edges of the MemoryBuffer */ unsigned int m_chunkSize; - + /** * @brief number of chunks in the x-axis */ unsigned int m_numberOfXChunks; - + /** * @brief number of chunks in the y-axis */ unsigned int m_numberOfYChunks; - + /** * @brief total number of chunks */ unsigned int m_numberOfChunks; - + /** * @brief contains this ExecutionGroup a complex NodeOperation. */ bool m_complex; - + /** * @brief can this ExecutionGroup be scheduled on an OpenCLDevice */ bool m_openCL; - + /** * @brief Is this Execution group SingleThreaded */ bool m_singleThreaded; - + /** * @brief what is the maximum number field of all ReadBufferOperation in this ExecutionGroup. * @note this is used to construct the MemoryBuffers that will be passed during execution. */ unsigned int m_cachedMaxReadBufferOffset; - + /** * @brief a cached vector of all read operations in the execution group. */ Operations m_cachedReadOperations; - + /** * @brief reference to the original bNodeTree, this field is only set for the 'top' execution group. * @note can only be used to call the callbacks for progress, status and break */ const bNodeTree *m_bTree; - + /** * @brief total number of chunks that have been calculated for this ExecutionGroup */ unsigned int m_chunksFinished; - + /** * @brief the chunkExecutionStates holds per chunk the execution state. this state can be * - COM_ES_NOT_SCHEDULED: not scheduled @@ -155,7 +155,7 @@ private: * - COM_ES_EXECUTED: executed */ ChunkExecutionState *m_chunkExecutionStates; - + /** * @brief indicator when this ExecutionGroup has valid Operations in its vector for Execution * @note When building the ExecutionGroup Operations are added via recursion. First a WriteBufferOperations is added, then the @@ -184,7 +184,7 @@ private: * @param operation the operation to be added */ bool canContainOperation(NodeOperation *operation); - + /** * @brief calculate the actual chunk size of this execution group. * @note A chunk size is an unsigned int that is both the height and width of a chunk. @@ -192,21 +192,21 @@ private: * @note by the calling method. */ unsigned int determineChunkSize(); - - + + /** * @brief Determine the rect (minx, maxx, miny, maxy) of a chunk at a position. * @note Only gives useful results ater the determination of the chunksize * @see determineChunkSize() */ void determineChunkRect(rcti *rect, const unsigned int xChunk, const unsigned int yChunk) const; - + /** * @brief determine the number of chunks, based on the chunkSize, width and height. * @note The result are stored in the fields numberOfChunks, numberOfXChunks, numberOfYChunks */ void determineNumberOfChunks(); - + /** * @brief try to schedule a specific chunk. * @note scheduling succeeds when all input requirements are met and the chunks hasn't been scheduled yet. @@ -236,7 +236,7 @@ private: * @param chunknumber */ bool scheduleChunk(unsigned int chunkNumber); - + /** * @brief determine the area of interest of a certain input area * @note This method only evaluates a single ReadBufferOperation @@ -250,7 +250,7 @@ private: public: // constructors ExecutionGroup(); - + // methods /** * @brief add an operation to this ExecutionGroup @@ -261,7 +261,7 @@ public: * @return True if the operation was successfully added */ bool addOperation(NodeOperation *operation); - + /** * @brief is this ExecutionGroup an output ExecutionGroup * @note An OutputExecution group are groups containing a @@ -281,47 +281,47 @@ public: * @param resolution */ void determineResolution(unsigned int resolution[2]); - + /** * @brief set the resolution of this executiongroup * @param resolution */ void setResolution(unsigned int resolution[2]) { this->m_width = resolution[0]; this->m_height = resolution[1]; } - + /** * @brief get the width of this execution group */ unsigned int getWidth() const { return m_width; } - + /** * @brief get the height of this execution group */ unsigned int getHeight() const { return m_height; } - + /** * @brief does this ExecutionGroup contains a complex NodeOperation */ bool isComplex() const { return m_complex; } - - + + /** * @brief get the output operation of this ExecutionGroup * @return NodeOperation *output operation */ NodeOperation *getOutputOperation() const; - + /** * @brief compose multiple chunks into a single chunk * @return Memorybuffer *consolidated chunk */ MemoryBuffer *constructConsolidatedMemoryBuffer(MemoryProxy *memoryProxy, rcti *output); - + /** * @brief initExecution is called just before the execution of the whole graph will be done. * @note The implementation will calculate the chunkSize of this execution group. */ void initExecution(); - + /** * @brief get all inputbuffers needed to calculate an chunk * @note all inputbuffers must be executed @@ -352,14 +352,14 @@ public: * @param memorybuffers */ void finalizeChunkExecution(int chunkNumber, MemoryBuffer **memoryBuffers); - + /** * @brief deinitExecution is called just after execution the whole graph. * @note It will release all needed resources */ void deinitExecution(); - - + + /** * @brief schedule an ExecutionGroup * @note this method will return when all chunks have been calculated, or the execution has breaked (by user) @@ -375,7 +375,7 @@ public: * @param system */ void execute(ExecutionSystem *system); - + /** * @brief this method determines the MemoryProxy's where this execution group depends on. * @note After this method determineDependingAreaOfInterest can be called to determine @@ -383,7 +383,7 @@ public: * @param memoryProxies result */ void determineDependingMemoryProxies(vector *memoryProxies); - + /** * @brief Determine the rect (minx, maxx, miny, maxy) of a chunk. * @note Only gives useful results ater the determination of the chunksize diff --git a/source/blender/compositor/intern/COM_ExecutionSystem.cpp b/source/blender/compositor/intern/COM_ExecutionSystem.cpp index 8e8539e3016..07f7979629c 100644 --- a/source/blender/compositor/intern/COM_ExecutionSystem.cpp +++ b/source/blender/compositor/intern/COM_ExecutionSystem.cpp @@ -132,7 +132,7 @@ void ExecutionSystem::execute() editingtree->stats_draw(editingtree->sdh, IFACE_("Compositing | Initializing execution")); DebugInfo::execute_started(this); - + unsigned int order = 0; for (vector::iterator iter = this->m_operations.begin(); iter != this->m_operations.end(); ++iter) { NodeOperation *operation = *iter; diff --git a/source/blender/compositor/intern/COM_ExecutionSystem.h b/source/blender/compositor/intern/COM_ExecutionSystem.h index 2c67a5f7b7f..acde4a9b772 100644 --- a/source/blender/compositor/intern/COM_ExecutionSystem.h +++ b/source/blender/compositor/intern/COM_ExecutionSystem.h @@ -114,7 +114,7 @@ class ExecutionSystem { public: typedef std::vector Operations; typedef std::vector Groups; - + private: /** * @brief the context used during execution @@ -136,7 +136,7 @@ private: //methods * find all execution group with output nodes */ void findOutputExecutionGroup(vector *result, CompositorPriority priority) const; - + /** * find all execution group with output nodes */ diff --git a/source/blender/compositor/intern/COM_MemoryBuffer.h b/source/blender/compositor/intern/COM_MemoryBuffer.h index 27baca0ab6f..be948b3e99b 100644 --- a/source/blender/compositor/intern/COM_MemoryBuffer.h +++ b/source/blender/compositor/intern/COM_MemoryBuffer.h @@ -64,29 +64,29 @@ private: * @brief proxy of the memory (same for all chunks in the same buffer) */ MemoryProxy *m_memoryProxy; - + /** * @brief the type of buffer COM_DT_VALUE, COM_DT_VECTOR, COM_DT_COLOR */ DataType m_datatype; - - + + /** * @brief region of this buffer inside relative to the MemoryProxy */ rcti m_rect; - + /** * brief refers to the chunknumber within the executiongroup where related to the MemoryProxy * @see memoryProxy */ unsigned int m_chunkNumber; - + /** * @brief state of the buffer */ MemoryBufferState m_state; - + /** * @brief the actual float buffer/data */ @@ -106,7 +106,7 @@ public: * @brief construct new MemoryBuffer for a chunk */ MemoryBuffer(MemoryProxy *memoryProxy, unsigned int chunkNumber, rcti *rect); - + /** * @brief construct new temporarily MemoryBuffer for an area */ @@ -121,7 +121,7 @@ public: * @brief destructor */ ~MemoryBuffer(); - + /** * @brief read the ChunkNumber of this MemoryBuffer */ @@ -134,7 +134,7 @@ public: * @note buffer should already be available in memory */ float *getBuffer() { return this->m_buffer; } - + /** * @brief after execution the state will be set to available by calling this method */ @@ -142,14 +142,14 @@ public: { this->m_state = COM_MB_AVAILABLE; } - + inline void wrap_pixel(int &x, int &y, MemoryBufferExtend extend_x, MemoryBufferExtend extend_y) { int w = this->m_width; int h = this->m_height; x = x - m_rect.xmin; y = y - m_rect.ymin; - + switch (extend_x) { case COM_MB_CLIP: break; @@ -161,7 +161,7 @@ public: x = (x >= 0.0f ? (x % w) : (x % w) + w); break; } - + switch (extend_y) { case COM_MB_CLIP: break; @@ -174,7 +174,7 @@ public: break; } } - + inline void wrap_pixel(float &x, float &y, MemoryBufferExtend extend_x, MemoryBufferExtend extend_y) { float w = (float)this->m_width; @@ -249,7 +249,7 @@ public: float *buffer = &this->m_buffer[offset]; memcpy(result, buffer, sizeof(float) * this->m_num_channels); } - + void writePixel(int x, int y, const float color[4]); void addPixel(int x, int y, const float color[4]); inline void readBilinear(float *result, float x, float y, @@ -271,12 +271,12 @@ public: } void readEWA(float *result, const float uv[2], const float derivatives[2][2]); - + /** * @brief is this MemoryBuffer a temporarily buffer (based on an area, not on a chunk) */ inline const bool isTemporarily() const { return this->m_state == COM_MB_TEMPORARILY; } - + /** * @brief add the content from otherBuffer to this MemoryBuffer * @param otherBuffer source buffer @@ -285,29 +285,29 @@ public: * uninitialized values in areas where the buffers don't overlap. */ void copyContentFrom(MemoryBuffer *otherBuffer); - + /** * @brief get the rect of this MemoryBuffer */ rcti *getRect() { return &this->m_rect; } - + /** * @brief get the width of this MemoryBuffer */ int getWidth() const; - + /** * @brief get the height of this MemoryBuffer */ int getHeight() const; - + /** * @brief clear the buffer. Make all pixels black transparent. */ void clear(); - + MemoryBuffer *duplicate(); - + float getMaximumValue(); float getMaximumValue(rcti *rect); private: diff --git a/source/blender/compositor/intern/COM_MemoryProxy.h b/source/blender/compositor/intern/COM_MemoryProxy.h index 755d513c72f..b732db37db2 100644 --- a/source/blender/compositor/intern/COM_MemoryProxy.h +++ b/source/blender/compositor/intern/COM_MemoryProxy.h @@ -42,17 +42,17 @@ private: * @brief reference to the ouput operation of the executiongroup */ WriteBufferOperation *m_writeBufferOperation; - + /** * @brief reference to the executor. the Execution group that can fill a chunk */ ExecutionGroup *m_executor; - + /** * @brief datatype of this MemoryProxy */ /* DataType m_datatype; */ /* UNUSED */ - + /** * @brief channel information of this buffer */ @@ -70,7 +70,7 @@ private: public: MemoryProxy(DataType type); - + /** * @brief set the ExecutionGroup that can be scheduled to calculate a certain chunk. * @param group the ExecutionGroup to set diff --git a/source/blender/compositor/intern/COM_Node.cpp b/source/blender/compositor/intern/COM_Node.cpp index a374403fef7..67b64baa26e 100644 --- a/source/blender/compositor/intern/COM_Node.cpp +++ b/source/blender/compositor/intern/COM_Node.cpp @@ -54,7 +54,7 @@ Node::Node(bNode *editorNode, bool create_sockets) : DataType dt = COM_DT_VALUE; if (input->type == SOCK_RGBA) dt = COM_DT_COLOR; if (input->type == SOCK_VECTOR) dt = COM_DT_VECTOR; - + this->addInputSocket(dt, input); input = input->next; } @@ -63,7 +63,7 @@ Node::Node(bNode *editorNode, bool create_sockets) : DataType dt = COM_DT_VALUE; if (output->type == SOCK_RGBA) dt = COM_DT_COLOR; if (output->type == SOCK_VECTOR) dt = COM_DT_VECTOR; - + this->addOutputSocket(dt, output); output = output->next; } @@ -96,7 +96,7 @@ void Node::addInputSocket(DataType datatype, bNodeSocket *bSocket) void Node::addOutputSocket(DataType datatype) { this->addOutputSocket(datatype, NULL); - + } void Node::addOutputSocket(DataType datatype, bNodeSocket *bSocket) { diff --git a/source/blender/compositor/intern/COM_Node.h b/source/blender/compositor/intern/COM_Node.h index 1c28292fb2e..1b78e7fec6d 100644 --- a/source/blender/compositor/intern/COM_Node.h +++ b/source/blender/compositor/intern/COM_Node.h @@ -45,13 +45,13 @@ class Node { public: typedef std::vector Inputs; typedef std::vector Outputs; - + private: /** * @brief stores the reference to the SDNA bNode struct */ bNodeTree *m_editorNodeTree; - + /** * @brief stores the reference to the SDNA bNode struct */ @@ -82,7 +82,7 @@ protected: * @brief get access to the vector of input sockets */ const Inputs &getInputSockets() const { return this->m_inputsockets; } - + /** * @brief get access to the vector of input sockets */ @@ -101,14 +101,14 @@ public: * @brief get the reference to the SDNA bNodeTree struct */ bNodeTree *getbNodeTree() const {return m_editorNodeTree;} - + /** * @brief set the reference to the bNode * @note used in Node instances to receive the storage/settings and complex node for highlight during execution * @param bNode */ void setbNode(bNode *node) {this->m_editorNode = node;} - + /** * @brief set the reference to the bNodeTree * @param bNodeTree @@ -131,35 +131,35 @@ public: * the index of the needed outputsocket */ NodeOutput *getOutputSocket(const unsigned int index) const; - + /** * get the reference to the first outputsocket * @param index * the index of the needed outputsocket */ inline NodeOutput *getOutputSocket() const { return getOutputSocket(0); } - + /** * get the reference to a certain inputsocket * @param index * the index of the needed inputsocket */ NodeInput *getInputSocket(const unsigned int index) const; - + /** Check if this is an input node * An input node is a node that only has output sockets and no input sockets */ bool isInputNode() const { return m_inputsockets.empty(); } - + /** * @brief Is this node in the active group (the group that is being edited) * @param isInActiveGroup */ void setIsInActiveGroup(bool value) { this->m_inActiveGroup = value; } - + /** * @brief Is this node part of the active group - * the active group is the group that is currently being edited. When no group is edited, + * the active group is the group that is currently being edited. When no group is edited, * the active group will be the main tree (all nodes that are not part of a group will be active) * @return bool [false:true] */ @@ -174,7 +174,7 @@ public: * @param context reference to the CompositorContext */ virtual void convertToOperations(NodeConverter &converter, const CompositorContext &context) const = 0; - + /** * Create dummy warning operation, use when we can't get the source data. */ @@ -185,10 +185,10 @@ public: * into valid outputs, without this the compositor system gets confused and crashes, see [#32490] */ void convertToOperations_invalid(NodeConverter *compiler) const; - + void setInstanceKey(bNodeInstanceKey instance_key) { m_instanceKey = instance_key; } bNodeInstanceKey getInstanceKey() const { return m_instanceKey; } - + protected: /** * @brief add an NodeInput to the collection of inputsockets @@ -197,7 +197,7 @@ protected: */ void addInputSocket(DataType datatype); void addInputSocket(DataType datatype, bNodeSocket *socket); - + /** * @brief add an NodeOutput to the collection of outputsockets * @note may only be called in an constructor @@ -205,7 +205,7 @@ protected: */ void addOutputSocket(DataType datatype); void addOutputSocket(DataType datatype, bNodeSocket *socket); - + bNodeSocket *getEditorInputSocket(int editorNodeInputSocketIndex); bNodeSocket *getEditorOutputSocket(int editorNodeOutputSocketIndex); }; @@ -219,26 +219,26 @@ class NodeInput { private: Node *m_node; bNodeSocket *m_editorSocket; - + DataType m_datatype; - + /** * @brief link connected to this NodeInput. * An input socket can only have a single link */ NodeOutput *m_link; - + public: NodeInput(Node *node, bNodeSocket *b_socket, DataType datatype); - + Node *getNode() const { return this->m_node; } DataType getDataType() const { return m_datatype; } bNodeSocket *getbNodeSocket() const { return this->m_editorSocket; } - + void setLink(NodeOutput *link); bool isLinked() const { return m_link; } NodeOutput *getLink() { return m_link; } - + float getEditorValueFloat(); void getEditorValueColor(float *value); void getEditorValueVector(float *value); @@ -253,16 +253,16 @@ class NodeOutput { private: Node *m_node; bNodeSocket *m_editorSocket; - + DataType m_datatype; - + public: NodeOutput(Node *node, bNodeSocket *b_socket, DataType datatype); - + Node *getNode() const { return this->m_node; } DataType getDataType() const { return m_datatype; } bNodeSocket *getbNodeSocket() const { return this->m_editorSocket; } - + float getEditorValueFloat(); void getEditorValueColor(float *value); void getEditorValueVector(float *value); diff --git a/source/blender/compositor/intern/COM_NodeConverter.cpp b/source/blender/compositor/intern/COM_NodeConverter.cpp index df8a7e6353c..1b62466f81f 100644 --- a/source/blender/compositor/intern/COM_NodeConverter.cpp +++ b/source/blender/compositor/intern/COM_NodeConverter.cpp @@ -73,13 +73,13 @@ NodeOperation *NodeConverter::setInvalidOutput(NodeOutput *output) { /* this is a really bad situation - bring on the pink! - so artists know this is bad */ const float warning_color[4] = {1.0f, 0.0f, 1.0f, 1.0f}; - + SetColorOperation *operation = new SetColorOperation(); operation->setChannels(warning_color); - + m_builder->addOperation(operation); m_builder->mapOutputSocket(output, operation->getOutputSocket()); - + return operation; } @@ -87,9 +87,9 @@ NodeOperationOutput *NodeConverter::addInputProxy(NodeInput *input, bool use_con { SocketProxyOperation *proxy = new SocketProxyOperation(input->getDataType(), use_conversion); m_builder->addOperation(proxy); - + m_builder->mapInputSocket(input, proxy->getInputSocket(0)); - + return proxy->getOutputSocket(); } @@ -97,9 +97,9 @@ NodeOperationInput *NodeConverter::addOutputProxy(NodeOutput *output, bool use_c { SocketProxyOperation *proxy = new SocketProxyOperation(output->getDataType(), use_conversion); m_builder->addOperation(proxy); - + m_builder->mapOutputSocket(output, proxy->getOutputSocket()); - + return proxy->getInputSocket(0); } @@ -107,7 +107,7 @@ void NodeConverter::addInputValue(NodeOperationInput *input, float value) { SetValueOperation *operation = new SetValueOperation(); operation->setValue(value); - + m_builder->addOperation(operation); m_builder->addLink(operation->getOutputSocket(), input); } @@ -116,7 +116,7 @@ void NodeConverter::addInputColor(NodeOperationInput *input, const float value[4 { SetColorOperation *operation = new SetColorOperation(); operation->setChannels(value); - + m_builder->addOperation(operation); m_builder->addLink(operation->getOutputSocket(), input); } @@ -125,7 +125,7 @@ void NodeConverter::addInputVector(NodeOperationInput *input, const float value[ { SetVectorOperation *operation = new SetVectorOperation(); operation->setVector(value); - + m_builder->addOperation(operation); m_builder->addLink(operation->getOutputSocket(), input); } @@ -134,7 +134,7 @@ void NodeConverter::addOutputValue(NodeOutput *output, float value) { SetValueOperation *operation = new SetValueOperation(); operation->setValue(value); - + m_builder->addOperation(operation); m_builder->mapOutputSocket(output, operation->getOutputSocket()); } @@ -143,7 +143,7 @@ void NodeConverter::addOutputColor(NodeOutput *output, const float value[4]) { SetColorOperation *operation = new SetColorOperation(); operation->setChannels(value); - + m_builder->addOperation(operation); m_builder->mapOutputSocket(output, operation->getOutputSocket()); } @@ -152,7 +152,7 @@ void NodeConverter::addOutputVector(NodeOutput *output, const float value[3]) { SetVectorOperation *operation = new SetVectorOperation(); operation->setVector(value); - + m_builder->addOperation(operation); m_builder->mapOutputSocket(output, operation->getOutputSocket()); } diff --git a/source/blender/compositor/intern/COM_NodeConverter.h b/source/blender/compositor/intern/COM_NodeConverter.h index fb7529ae2a7..825c26bb7af 100644 --- a/source/blender/compositor/intern/COM_NodeConverter.h +++ b/source/blender/compositor/intern/COM_NodeConverter.h @@ -44,28 +44,28 @@ class ViewerOperation; class NodeConverter { public: NodeConverter(NodeOperationBuilder *builder); - + /** Insert a new operation into the operations graph. * The operation must be created by the node. */ void addOperation(NodeOperation *operation); - + /** Map input socket of the node to an operation socket. * Links between nodes will then generate equivalent links between * the mapped operation sockets. - * + * * \note A \a Node input can be mapped to multiple \a NodeOperation inputs. */ void mapInputSocket(NodeInput *node_socket, NodeOperationInput *operation_socket); /** Map output socket of the node to an operation socket. * Links between nodes will then generate equivalent links between * the mapped operation sockets. - * + * * \note A \a Node output can only be mapped to one \a NodeOperation output. * Any existing operation output mapping will be replaced. */ void mapOutputSocket(NodeOutput *node_socket, NodeOperationOutput *operation_socket); - + /** Create a proxy operation for a node input. * This operation will be removed later and replaced * by direct links between the connected operations. @@ -76,39 +76,39 @@ public: * by direct links between the connected operations. */ NodeOperationInput *addOutputProxy(NodeOutput *output, bool use_conversion); - + /** Define a constant input value. */ void addInputValue(NodeOperationInput *input, float value); /** Define a constant input color. */ void addInputColor(NodeOperationInput *input, const float value[4]); /** Define a constant input vector. */ void addInputVector(NodeOperationInput *input, const float value[3]); - + /** Define a constant output value. */ void addOutputValue(NodeOutput *output, float value); /** Define a constant output color. */ void addOutputColor(NodeOutput *output, const float value[4]); /** Define a constant output vector. */ void addOutputVector(NodeOutput *output, const float value[3]); - + /** Add an explicit link between two operations. */ void addLink(NodeOperationOutput *from, NodeOperationInput *to); - + /** Add a preview operation for a operation output. */ void addPreview(NodeOperationOutput *output); /** Add a preview operation for a node input. */ void addNodeInputPreview(NodeInput *input); - + /** When a node has no valid data * @note missing image / group pointer, or missing renderlayer from EXR */ NodeOperation *setInvalidOutput(NodeOutput *output); - + /** Define a viewer operation as the active output, if possible */ void registerViewer(ViewerOperation *viewer); /** The currently active viewer output operation */ ViewerOperation *active_viewer() const; - + private: /** The internal builder for storing the results of the graph construction. */ NodeOperationBuilder *m_builder; diff --git a/source/blender/compositor/intern/COM_NodeGraph.cpp b/source/blender/compositor/intern/COM_NodeGraph.cpp index 5196108818b..d78450074ed 100644 --- a/source/blender/compositor/intern/COM_NodeGraph.cpp +++ b/source/blender/compositor/intern/COM_NodeGraph.cpp @@ -82,16 +82,16 @@ void NodeGraph::add_node(Node *node, bNodeTree *b_ntree, bNodeInstanceKey key, b node->setbNodeTree(b_ntree); node->setInstanceKey(key); node->setIsInActiveGroup(is_active_group); - + m_nodes.push_back(node); - + DebugInfo::node_added(node); } void NodeGraph::add_link(NodeOutput *fromSocket, NodeInput *toSocket) { m_links.push_back(Link(fromSocket, toSocket)); - + /* register with the input */ toSocket->setLink(fromSocket); } @@ -99,10 +99,10 @@ void NodeGraph::add_link(NodeOutput *fromSocket, NodeInput *toSocket) void NodeGraph::add_bNodeTree(const CompositorContext &context, int nodes_start, bNodeTree *tree, bNodeInstanceKey parent_key) { const bNodeTree *basetree = context.getbNodeTree(); - + /* update viewers in the active edittree as well the base tree (for backdrop) */ bool is_active_group = (parent_key.value == basetree->active_viewer_key.value); - + /* add all nodes of the tree to the node list */ for (bNode *node = (bNode *)tree->nodes.first; node; node = node->next) { bNodeInstanceKey key = BKE_node_instance_key(parent_key, tree, node); @@ -123,13 +123,13 @@ void NodeGraph::add_bNode(const CompositorContext &context, bNodeTree *b_ntree, add_proxies_mute(b_ntree, b_node, key, is_active_group); return; } - + /* replace slow nodes with proxies for fast execution */ if (context.isFastCalculation() && !Converter::is_fast_node(b_node)) { add_proxies_skip(b_ntree, b_node, key, is_active_group); return; } - + /* special node types */ if (b_node->type == NODE_GROUP) { add_proxies_group(context, b_node, key); @@ -181,15 +181,15 @@ void NodeGraph::add_bNodeLink(const NodeRange &node_range, bNodeLink *b_nodelink return; if ((b_nodelink->fromsock->flag & SOCK_UNAVAIL) || (b_nodelink->tosock->flag & SOCK_UNAVAIL)) return; - + /* Note: a DNA input socket can have multiple NodeInput in the compositor tree! (proxies) * The output then gets linked to each one of them. */ - + NodeOutput *output = find_output(node_range, b_nodelink->fromsock); if (!output) return; - + NodeInputs inputs = find_inputs(node_range, b_nodelink->tosock); for (NodeInputs::const_iterator it = inputs.begin(); it != inputs.end(); ++it) { NodeInput *input = *it; @@ -213,13 +213,13 @@ void NodeGraph::add_proxies_skip(bNodeTree *b_ntree, bNode *b_node, bNodeInstanc { for (bNodeSocket *output = (bNodeSocket *)b_node->outputs.first; output; output = output->next) { bNodeSocket *input; - + /* look for first input with matching datatype for each output */ for (input = (bNodeSocket *)b_node->inputs.first; input; input = input->next) { if (input->type == output->type) break; } - + if (input) { SocketProxyNode *proxy = new SocketProxyNode(b_node, input, output, true); add_node(proxy, b_ntree, key, is_active_group); @@ -231,11 +231,11 @@ void NodeGraph::add_proxies_group_inputs(bNode *b_node, bNode *b_node_io) { bNodeTree *b_group_tree = (bNodeTree *)b_node->id; BLI_assert(b_group_tree); /* should have been checked in advance */ - + /* not important for proxies */ bNodeInstanceKey key = NODE_INSTANCE_KEY_BASE; bool is_active_group = false; - + for (bNodeSocket *b_sock_io = (bNodeSocket *)b_node_io->outputs.first; b_sock_io; b_sock_io = b_sock_io->next) { bNodeSocket *b_sock_group = find_b_node_input(b_node, b_sock_io->identifier); if (b_sock_group) { @@ -249,11 +249,11 @@ void NodeGraph::add_proxies_group_outputs(bNode *b_node, bNode *b_node_io, bool { bNodeTree *b_group_tree = (bNodeTree *)b_node->id; BLI_assert(b_group_tree); /* should have been checked in advance */ - + /* not important for proxies */ bNodeInstanceKey key = NODE_INSTANCE_KEY_BASE; bool is_active_group = false; - + for (bNodeSocket *b_sock_io = (bNodeSocket *)b_node_io->inputs.first; b_sock_io; b_sock_io = b_sock_io->next) { bNodeSocket *b_sock_group = find_b_node_output(b_node, b_sock_io->identifier); if (b_sock_group) { @@ -286,11 +286,11 @@ void NodeGraph::add_proxies_group(const CompositorContext &context, bNode *b_nod for (bNode *b_node_io = (bNode *)b_group_tree->nodes.first; b_node_io; b_node_io = b_node_io->next) { if (b_node_io->type == NODE_GROUP_INPUT) add_proxies_group_inputs(b_node, b_node_io); - + if (b_node_io->type == NODE_GROUP_OUTPUT && (b_node_io->flag & NODE_DO_OUTPUT)) add_proxies_group_outputs(b_node, b_node_io, context.isGroupnodeBufferEnabled()); } - + add_bNodeTree(context, nodes_start, b_group_tree, key); } diff --git a/source/blender/compositor/intern/COM_NodeGraph.h b/source/blender/compositor/intern/COM_NodeGraph.h index fe8740fee97..7c6322d2a42 100644 --- a/source/blender/compositor/intern/COM_NodeGraph.h +++ b/source/blender/compositor/intern/COM_NodeGraph.h @@ -48,66 +48,66 @@ public: private: NodeOutput *m_from; NodeInput *m_to; - + public: Link(NodeOutput *from, NodeInput *to) : m_from(from), m_to(to) {} - + NodeOutput *getFromSocket() const { return m_from; } NodeInput *getToSocket() const { return m_to; } }; - + typedef std::vector Nodes; typedef Nodes::iterator NodeIterator; typedef std::vector Links; - + private: Nodes m_nodes; Links m_links; - + public: NodeGraph(); ~NodeGraph(); - + const Nodes &nodes() const { return m_nodes; } const Links &links() const { return m_links; } - + void from_bNodeTree(const CompositorContext &context, bNodeTree *tree); - + protected: typedef std::pair NodeRange; typedef std::vector NodeInputs; - + static bNodeSocket *find_b_node_input(bNode *b_node, const char *identifier); static bNodeSocket *find_b_node_output(bNode *b_node, const char *identifier); - + void add_node(Node *node, bNodeTree *b_ntree, bNodeInstanceKey key, bool is_active_group); void add_link(NodeOutput *fromSocket, NodeInput *toSocket); - + void add_bNodeTree(const CompositorContext &context, int nodes_start, bNodeTree *tree, bNodeInstanceKey parent_key); - + void add_bNode(const CompositorContext &context, bNodeTree *b_ntree, bNode *b_node, bNodeInstanceKey key, bool is_active_group); - + NodeInputs find_inputs(const NodeRange &node_range, bNodeSocket *b_socket); NodeOutput *find_output(const NodeRange &node_range, bNodeSocket *b_socket); void add_bNodeLink(const NodeRange &node_range, bNodeLink *bNodeLink); - + /* **** Special proxy node type conversions **** */ /* These nodes are not represented in the node graph themselves, * but converted into a number of proxy links */ - + void add_proxies_mute(bNodeTree *b_ntree, bNode *b_node, bNodeInstanceKey key, bool is_active_group); void add_proxies_skip(bNodeTree *b_ntree, bNode *b_node, bNodeInstanceKey key, bool is_active_group); - + void add_proxies_group_inputs(bNode *b_node, bNode *b_node_io); void add_proxies_group_outputs(bNode *b_node, bNode *b_node_io, bool use_buffer); void add_proxies_group(const CompositorContext &context, bNode *b_node, bNodeInstanceKey key); void add_proxies_reroute(bNodeTree *b_ntree, bNode *b_node, bNodeInstanceKey key, bool is_active_group); - + #ifdef WITH_CXX_GUARDEDALLOC MEM_CXX_CLASS_ALLOC_FUNCS("COM:NodeGraph") #endif diff --git a/source/blender/compositor/intern/COM_NodeOperation.cpp b/source/blender/compositor/intern/COM_NodeOperation.cpp index 496a27b379c..1063386aa58 100644 --- a/source/blender/compositor/intern/COM_NodeOperation.cpp +++ b/source/blender/compositor/intern/COM_NodeOperation.cpp @@ -83,7 +83,7 @@ void NodeOperation::determineResolution(unsigned int resolution[2], unsigned int { unsigned int temp[2]; unsigned int temp2[2]; - + for (unsigned int index = 0; index < m_inputs.size(); index++) { NodeOperationInput *input = m_inputs[index]; if (input->isConnected()) { diff --git a/source/blender/compositor/intern/COM_NodeOperation.h b/source/blender/compositor/intern/COM_NodeOperation.h index 1f3c72a820e..5ee3cc22b53 100644 --- a/source/blender/compositor/intern/COM_NodeOperation.h +++ b/source/blender/compositor/intern/COM_NodeOperation.h @@ -81,11 +81,11 @@ class NodeOperation : public SocketReader { public: typedef std::vector Inputs; typedef std::vector Outputs; - + private: Inputs m_inputs; Outputs m_outputs; - + /** * @brief the index of the input socket that will be used to determine the resolution */ @@ -115,7 +115,7 @@ private: * @see NodeOperation.getMutex retrieve a pointer to this mutex. */ ThreadMutex m_mutex; - + /** * @brief reference to the editing bNodeTree, used for break and update callback */ @@ -125,21 +125,21 @@ private: * @brief set to truth when resolution for this operation is set */ bool m_isResolutionSet; - + public: virtual ~NodeOperation(); - + unsigned int getNumberOfInputSockets() const { return m_inputs.size(); } unsigned int getNumberOfOutputSockets() const { return m_outputs.size(); } NodeOperationOutput *getOutputSocket(unsigned int index) const; NodeOperationOutput *getOutputSocket() const { return getOutputSocket(0); } NodeOperationInput *getInputSocket(unsigned int index) const; - + /** Check if this is an input operation * An input operation is an operation that only has output sockets and no input sockets */ bool isInputOperation() const { return m_inputs.empty(); } - + /** * @brief determine the resolution of this node * @note this method will not set the resolution, this is the responsibility of the caller @@ -167,7 +167,7 @@ public: void setbNodeTree(const bNodeTree *tree) { this->m_btree = tree; } virtual void initExecution(); - + /** * @brief when a chunk is executed by a CPUDevice, this method is called * @ingroup execution @@ -231,7 +231,7 @@ public: this->m_isResolutionSet = true; } } - + void getConnectedInputSockets(Inputs *sockets); @@ -288,14 +288,14 @@ public: * @see ExecutionGroup.addOperation */ bool isOpenCL() const { return this->m_openCL; } - + virtual bool isViewerOperation() const { return false; } virtual bool isPreviewOperation() const { return false; } virtual bool isFileOutputOperation() const { return false; } virtual bool isProxyOperation() const { return false; } - + virtual bool useDatatypeConversion() const { return true; } - + inline bool isBreaked() const { return this->m_btree->test_break(this->m_btree->tbh); } @@ -319,7 +319,7 @@ protected: void initMutex(); void lockMutex(); void unlockMutex(); - + /** * @brief set whether this operation is complex * @@ -345,35 +345,35 @@ protected: class NodeOperationInput { private: NodeOperation *m_operation; - + /** Datatype of this socket. Is used for automatically data transformation. * @section data-conversion */ DataType m_datatype; - + /** Resize mode of this socket */ InputResizeMode m_resizeMode; - + /** Connected output */ NodeOperationOutput *m_link; - + public: NodeOperationInput(NodeOperation *op, DataType datatype, InputResizeMode resizeMode = COM_SC_CENTER); - + NodeOperation &getOperation() const { return *m_operation; } DataType getDataType() const { return m_datatype; } - + void setLink(NodeOperationOutput *link) { m_link = link; } NodeOperationOutput *getLink() const { return m_link; } bool isConnected() const { return m_link; } - + void setResizeMode(InputResizeMode resizeMode) { this->m_resizeMode = resizeMode; } InputResizeMode getResizeMode() const { return this->m_resizeMode; } - + SocketReader *getReader(); - + void determineResolution(unsigned int resolution[2], unsigned int preferredResolution[2]); - + #ifdef WITH_CXX_GUARDEDALLOC MEM_CXX_CLASS_ALLOC_FUNCS("COM:NodeOperation") #endif @@ -383,18 +383,18 @@ public: class NodeOperationOutput { private: NodeOperation *m_operation; - + /** Datatype of this socket. Is used for automatically data transformation. * @section data-conversion */ DataType m_datatype; - + public: NodeOperationOutput(NodeOperation *op, DataType datatype); - + NodeOperation &getOperation() const { return *m_operation; } DataType getDataType() const { return m_datatype; } - + /** * @brief determine the resolution of this data going through this socket * @param resolution the result of this operation diff --git a/source/blender/compositor/intern/COM_NodeOperationBuilder.cpp b/source/blender/compositor/intern/COM_NodeOperationBuilder.cpp index fc1584e3dbb..f282037823a 100644 --- a/source/blender/compositor/intern/COM_NodeOperationBuilder.cpp +++ b/source/blender/compositor/intern/COM_NodeOperationBuilder.cpp @@ -58,18 +58,18 @@ void NodeOperationBuilder::convertToOperations(ExecutionSystem *system) { /* interface handle for nodes */ NodeConverter converter(this); - + for (int index = 0; index < m_graph.nodes().size(); index++) { Node *node = (Node *)m_graph.nodes()[index]; - + m_current_node = node; - + DebugInfo::node_to_operations(node); node->convertToOperations(converter, *m_context); } - + m_current_node = NULL; - + /* The input map constructed by nodes maps operation inputs to node inputs. * Inverting yields a map of node inputs to all connected operation inputs, * so multiple operations can use the same node input. @@ -77,12 +77,12 @@ void NodeOperationBuilder::convertToOperations(ExecutionSystem *system) OpInputInverseMap inverse_input_map; for (InputSocketMap::const_iterator it = m_input_map.begin(); it != m_input_map.end(); ++it) inverse_input_map[it->second].push_back(it->first); - + for (NodeGraph::Links::const_iterator it = m_graph.links().begin(); it != m_graph.links().end(); ++it) { const NodeGraph::Link &link = *it; NodeOutput *from = link.getFromSocket(); NodeInput *to = link.getToSocket(); - + NodeOperationOutput *op_from = find_operation_output(m_output_map, from); const OpInputs &op_to_list = find_operation_inputs(inverse_input_map, to); if (!op_from || op_to_list.empty()) { @@ -94,36 +94,36 @@ void NodeOperationBuilder::convertToOperations(ExecutionSystem *system) */ continue; } - + for (OpInputs::const_iterator it = op_to_list.begin(); it != op_to_list.end(); ++it) { NodeOperationInput *op_to = *it; addLink(op_from, op_to); } } - + add_operation_input_constants(); - + resolve_proxies(); - + add_datatype_conversions(); - + determineResolutions(); - + /* surround complex ops with read/write buffer */ add_complex_operation_buffers(); - + /* links not available from here on */ /* XXX make m_links a local variable to avoid confusion! */ m_links.clear(); - + prune_operations(); - + /* ensure topological (link-based) order of nodes */ /*sort_operations();*/ /* not needed yet */ - + /* create execution groups */ group_operations(); - + /* transfer resulting operations to the system */ system->set_operations(m_operations, m_groups); } @@ -137,7 +137,7 @@ void NodeOperationBuilder::mapInputSocket(NodeInput *node_socket, NodeOperationI { BLI_assert(m_current_node); BLI_assert(node_socket->getNode() == m_current_node); - + /* note: this maps operation sockets to node sockets. * for resolving links the map will be inverted first in convertToOperations, * to get a list of links for each node input socket. @@ -149,7 +149,7 @@ void NodeOperationBuilder::mapOutputSocket(NodeOutput *node_socket, NodeOperatio { BLI_assert(m_current_node); BLI_assert(node_socket->getNode() == m_current_node); - + m_output_map[node_socket] = operation_socket; } @@ -157,9 +157,9 @@ void NodeOperationBuilder::addLink(NodeOperationOutput *from, NodeOperationInput { if (to->isConnected()) return; - + m_links.push_back(Link(from, to)); - + /* register with the input */ to->setLink(from); } @@ -171,7 +171,7 @@ void NodeOperationBuilder::removeInputLink(NodeOperationInput *to) if (link.to() == to) { /* unregister with the input */ to->setLink(NULL); - + m_links.erase(it); return; } @@ -200,7 +200,7 @@ NodeOperationOutput *NodeOperationBuilder::find_operation_output(const OutputSoc PreviewOperation *NodeOperationBuilder::make_preview_operation() const { BLI_assert(m_current_node); - + if (!(m_current_node->getbNode()->flag & NODE_PREVIEW)) return NULL; /* previews only in the active group */ @@ -209,7 +209,7 @@ PreviewOperation *NodeOperationBuilder::make_preview_operation() const /* do not calculate previews of hidden nodes */ if (m_current_node->getbNode()->flag & NODE_HIDDEN) return NULL; - + bNodeInstanceHash *previews = m_context->getPreviewHash(); if (previews) { PreviewOperation *operation = new PreviewOperation(m_context->getViewSettings(), m_context->getDisplaySettings()); @@ -217,7 +217,7 @@ PreviewOperation *NodeOperationBuilder::make_preview_operation() const operation->verifyPreview(previews, m_current_node->getInstanceKey()); return operation; } - + return NULL; } @@ -226,7 +226,7 @@ void NodeOperationBuilder::addPreview(NodeOperationOutput *output) PreviewOperation *operation = make_preview_operation(); if (operation) { addOperation(operation); - + addLink(output, operation->getInputSocket(0)); } } @@ -236,7 +236,7 @@ void NodeOperationBuilder::addNodeInputPreview(NodeInput *input) PreviewOperation *operation = make_preview_operation(); if (operation) { addOperation(operation); - + mapInputSocket(input, operation->getInputSocket(0)); } } @@ -247,7 +247,7 @@ void NodeOperationBuilder::registerViewer(ViewerOperation *viewer) if (m_current_node->isInActiveGroup()) { /* deactivate previous viewer */ m_active_viewer->setActive(false); - + m_active_viewer = viewer; viewer->setActive(true); } @@ -269,13 +269,13 @@ void NodeOperationBuilder::add_datatype_conversions() Links convert_links; for (Links::const_iterator it = m_links.begin(); it != m_links.end(); ++it) { const Link &link = *it; - + /* proxy operations can skip data type conversion */ NodeOperation *from_op = &link.from()->getOperation(); NodeOperation *to_op = &link.to()->getOperation(); if (!(from_op->useDatatypeConversion() || to_op->useDatatypeConversion())) continue; - + if (link.from()->getDataType() != link.to()->getDataType()) convert_links.push_back(link); } @@ -284,7 +284,7 @@ void NodeOperationBuilder::add_datatype_conversions() NodeOperation *converter = Converter::convertDataType(link.from(), link.to()); if (converter) { addOperation(converter); - + removeInputLink(link.to()); addLink(link.from(), converter->getInputSocket(0)); addLink(converter->getOutputSocket(0), link.to()); @@ -322,7 +322,7 @@ void NodeOperationBuilder::add_input_constant_value(NodeOperationInput *input, N value = node_input->getEditorValueFloat(); else value = 0.0f; - + SetValueOperation *op = new SetValueOperation(); op->setValue(value); addOperation(op); @@ -335,7 +335,7 @@ void NodeOperationBuilder::add_input_constant_value(NodeOperationInput *input, N node_input->getEditorValueColor(value); else zero_v4(value); - + SetColorOperation *op = new SetColorOperation(); op->setChannels(value); addOperation(op); @@ -348,7 +348,7 @@ void NodeOperationBuilder::add_input_constant_value(NodeOperationInput *input, N node_input->getEditorValueVector(value); else zero_v3(value); - + SetVectorOperation *op = new SetVectorOperation(); op->setVector(value); addOperation(op); @@ -370,17 +370,17 @@ void NodeOperationBuilder::resolve_proxies() proxy_links.push_back(link); } } - + for (Links::const_iterator it = proxy_links.begin(); it != proxy_links.end(); ++it) { const Link &link = *it; - + NodeOperationInput *to = link.to(); NodeOperationOutput *from = link.from(); do { /* walk upstream bypassing the proxy operation */ from = from->getOperation().getInputSocket(0)->getLink(); } while (from && from->getOperation().isProxyOperation()); - + removeInputLink(to); /* we may not have a final proxy input link, * in that case it just gets dropped @@ -395,7 +395,7 @@ void NodeOperationBuilder::determineResolutions() /* determine all resolutions of the operations (Width/Height) */ for (Operations::const_iterator it = m_operations.begin(); it != m_operations.end(); ++it) { NodeOperation *op = *it; - + if (op->isOutputOperation(m_context->isRendering()) && !op->isPreviewOperation()) { unsigned int resolution[2] = {0, 0}; unsigned int preferredResolution[2] = {0, 0}; @@ -403,10 +403,10 @@ void NodeOperationBuilder::determineResolutions() op->setResolution(resolution); } } - + for (Operations::const_iterator it = m_operations.begin(); it != m_operations.end(); ++it) { NodeOperation *op = *it; - + if (op->isOutputOperation(m_context->isRendering()) && op->isPreviewOperation()) { unsigned int resolution[2] = {0, 0}; unsigned int preferredResolution[2] = {0, 0}; @@ -414,13 +414,13 @@ void NodeOperationBuilder::determineResolutions() op->setResolution(resolution); } } - + /* add convert resolution operations when needed */ { Links convert_links; for (Links::const_iterator it = m_links.begin(); it != m_links.end(); ++it) { const Link &link = *it; - + if (link.to()->getResizeMode() != COM_SC_NO_RESIZE) { NodeOperation &from_op = link.from()->getOperation(); NodeOperation &to_op = link.to()->getOperation(); @@ -464,35 +464,35 @@ void NodeOperationBuilder::add_input_buffers(NodeOperation * /*operation*/, { if (!input->isConnected()) return; - + NodeOperationOutput *output = input->getLink(); if (output->getOperation().isReadBufferOperation()) { /* input is already buffered, no need to add another */ return; } - + /* this link will be replaced below */ removeInputLink(input); - + /* check of other end already has write operation, otherwise add a new one */ WriteBufferOperation *writeoperation = find_attached_write_buffer_operation(output); if (!writeoperation) { writeoperation = new WriteBufferOperation(output->getDataType()); writeoperation->setbNodeTree(m_context->getbNodeTree()); addOperation(writeoperation); - + addLink(output, writeoperation->getInputSocket(0)); - + writeoperation->readResolutionFromInputSocket(); } - + /* add readbuffer op for the input */ ReadBufferOperation *readoperation = new ReadBufferOperation(output->getDataType()); readoperation->setMemoryProxy(writeoperation->getMemoryProxy()); this->addOperation(readoperation); - + addLink(readoperation->getOutputSocket(), input); - + readoperation->readResolutionFromWriteBuffer(); } @@ -502,11 +502,11 @@ void NodeOperationBuilder::add_output_buffers(NodeOperation *operation, NodeOper OpInputs targets = cache_output_links(output); if (targets.empty()) return; - + WriteBufferOperation *writeOperation = NULL; for (OpInputs::const_iterator it = targets.begin(); it != targets.end(); ++it) { NodeOperationInput *target = *it; - + /* try to find existing write buffer operation */ if (target->getOperation().isWriteBufferOperation()) { BLI_assert(writeOperation == NULL); /* there should only be one write op connected */ @@ -517,30 +517,30 @@ void NodeOperationBuilder::add_output_buffers(NodeOperation *operation, NodeOper removeInputLink(target); } } - + /* if no write buffer operation exists yet, create a new one */ if (!writeOperation) { writeOperation = new WriteBufferOperation(operation->getOutputSocket()->getDataType()); writeOperation->setbNodeTree(m_context->getbNodeTree()); addOperation(writeOperation); - + addLink(output, writeOperation->getInputSocket(0)); } - + writeOperation->readResolutionFromInputSocket(); - + /* add readbuffer op for every former connected input */ for (OpInputs::const_iterator it = targets.begin(); it != targets.end(); ++it) { NodeOperationInput *target = *it; if (&target->getOperation() == writeOperation) continue; /* skip existing write op links */ - + ReadBufferOperation *readoperation = new ReadBufferOperation(operation->getOutputSocket()->getDataType()); readoperation->setMemoryProxy(writeOperation->getMemoryProxy()); addOperation(readoperation); - + addLink(readoperation->getOutputSocket(), target); - + readoperation->readResolutionFromWriteBuffer(); } } @@ -554,15 +554,15 @@ void NodeOperationBuilder::add_complex_operation_buffers() for (Operations::const_iterator it = m_operations.begin(); it != m_operations.end(); ++it) if ((*it)->isComplex()) complex_ops.push_back(*it); - + for (Operations::const_iterator it = complex_ops.begin(); it != complex_ops.end(); ++it) { NodeOperation *op = *it; - + DebugInfo::operation_read_write_buffer(op); - + for (int index = 0; index < op->getNumberOfInputSockets(); index++) add_input_buffers(op, op->getInputSocket(index)); - + for (int index = 0; index < op->getNumberOfOutputSockets(); index++) add_output_buffers(op, op->getOutputSocket(index)); } @@ -575,13 +575,13 @@ static void find_reachable_operations_recursive(Tags &reachable, NodeOperation * if (reachable.find(op) != reachable.end()) return; reachable.insert(op); - + for (int i = 0; i < op->getNumberOfInputSockets(); ++i) { NodeOperationInput *input = op->getInputSocket(i); if (input->isConnected()) find_reachable_operations_recursive(reachable, &input->getLink()->getOperation()); } - + /* associated write-buffer operations are executed as well */ if (op->isReadBufferOperation()) { ReadBufferOperation *read_op = (ReadBufferOperation *)op; @@ -595,17 +595,17 @@ void NodeOperationBuilder::prune_operations() Tags reachable; for (Operations::const_iterator it = m_operations.begin(); it != m_operations.end(); ++it) { NodeOperation *op = *it; - + /* output operations are primary executed operations */ if (op->isOutputOperation(m_context->isRendering())) find_reachable_operations_recursive(reachable, op); } - + /* delete unreachable operations */ Operations reachable_ops; for (Operations::const_iterator it = m_operations.begin(); it != m_operations.end(); ++it) { NodeOperation *op = *it; - + if (reachable.find(op) != reachable.end()) reachable_ops.push_back(op); else @@ -621,13 +621,13 @@ static void sort_operations_recursive(NodeOperationBuilder::Operations &sorted, if (visited.find(op) != visited.end()) return; visited.insert(op); - + for (int i = 0; i < op->getNumberOfInputSockets(); ++i) { NodeOperationInput *input = op->getInputSocket(i); if (input->isConnected()) sort_operations_recursive(sorted, visited, &input->getLink()->getOperation()); } - + sorted.push_back(op); } @@ -636,10 +636,10 @@ void NodeOperationBuilder::sort_operations() Operations sorted; sorted.reserve(m_operations.size()); Tags visited; - + for (Operations::const_iterator it = m_operations.begin(); it != m_operations.end(); ++it) sort_operations_recursive(sorted, visited, *it); - + m_operations = sorted; } @@ -648,10 +648,10 @@ static void add_group_operations_recursive(Tags &visited, NodeOperation *op, Exe if (visited.find(op) != visited.end()) return; visited.insert(op); - + if (!group->addOperation(op)) return; - + /* add all eligible input ops to the group */ for (int i = 0; i < op->getNumberOfInputSockets(); ++i) { NodeOperationInput *input = op->getInputSocket(i); @@ -664,10 +664,10 @@ ExecutionGroup *NodeOperationBuilder::make_group(NodeOperation *op) { ExecutionGroup *group = new ExecutionGroup(); m_groups.push_back(group); - + Tags visited; add_group_operations_recursive(visited, op, group); - + return group; } @@ -675,17 +675,17 @@ void NodeOperationBuilder::group_operations() { for (Operations::const_iterator it = m_operations.begin(); it != m_operations.end(); ++it) { NodeOperation *op = *it; - + if (op->isOutputOperation(m_context->isRendering())) { ExecutionGroup *group = make_group(op); group->setOutputExecutionGroup(true); } - + /* add new groups for associated memory proxies where needed */ if (op->isReadBufferOperation()) { ReadBufferOperation *read_op = (ReadBufferOperation *)op; MemoryProxy *memproxy = read_op->getMemoryProxy(); - + if (memproxy->getExecutor() == NULL) { ExecutionGroup *group = make_group(memproxy->getWriteBufferOperation()); memproxy->setExecutor(group); diff --git a/source/blender/compositor/intern/COM_NodeOperationBuilder.h b/source/blender/compositor/intern/COM_NodeOperationBuilder.h index 2bb5b94c57f..0eafd27b46a 100644 --- a/source/blender/compositor/intern/COM_NodeOperationBuilder.h +++ b/source/blender/compositor/intern/COM_NodeOperationBuilder.h @@ -52,48 +52,48 @@ public: private: NodeOperationOutput *m_from; NodeOperationInput *m_to; - + public: Link(NodeOperationOutput *from, NodeOperationInput *to) : m_from(from), m_to(to) {} - + NodeOperationOutput *from() const { return m_from; } NodeOperationInput *to() const { return m_to; } }; - + typedef std::vector Operations; typedef std::vector Links; typedef std::vector Groups; - + typedef std::map InputSocketMap; typedef std::map OutputSocketMap; - + typedef std::vector OpInputs; typedef std::map OpInputInverseMap; - + private: const CompositorContext *m_context; NodeGraph m_graph; - + Operations m_operations; Links m_links; Groups m_groups; - + /** Maps operation inputs to node inputs */ InputSocketMap m_input_map; /** Maps node outputs to operation outputs */ OutputSocketMap m_output_map; - + Node *m_current_node; - + /** Operation that will be writing to the viewer image * Only one operation can occupy this place at a time, * to avoid race conditions */ ViewerOperation *m_active_viewer; - + public: NodeOperationBuilder(const CompositorContext *context, bNodeTree *b_nodetree); ~NodeOperationBuilder(); @@ -103,43 +103,43 @@ public: void convertToOperations(ExecutionSystem *system); void addOperation(NodeOperation *operation); - + /** Map input socket of the current node to an operation socket */ void mapInputSocket(NodeInput *node_socket, NodeOperationInput *operation_socket); /** Map output socket of the current node to an operation socket */ void mapOutputSocket(NodeOutput *node_socket, NodeOperationOutput *operation_socket); - + void addLink(NodeOperationOutput *from, NodeOperationInput *to); void removeInputLink(NodeOperationInput *to); - + /** Add a preview operation for a operation output */ void addPreview(NodeOperationOutput *output); /** Add a preview operation for a node input */ void addNodeInputPreview(NodeInput *input); - + /** Define a viewer operation as the active output, if possible */ void registerViewer(ViewerOperation *viewer); /** The currently active viewer output operation */ ViewerOperation *active_viewer() const { return m_active_viewer; } - + protected: static NodeInput *find_node_input(const InputSocketMap &map, NodeOperationInput *op_input); static const OpInputs &find_operation_inputs(const OpInputInverseMap &map, NodeInput *node_input); static NodeOperationOutput *find_operation_output(const OutputSocketMap &map, NodeOutput *node_output); - + /** Add datatype conversion where needed */ void add_datatype_conversions(); - + /** Construct a constant value operation for every unconnected input */ void add_operation_input_constants(); void add_input_constant_value(NodeOperationInput *input, NodeInput *node_input); - + /** Replace proxy operations with direct links */ void resolve_proxies(); - + /** Calculate resolution for each operation */ void determineResolutions(); - + /** Helper function to store connected inputs for replacement */ OpInputs cache_output_links(NodeOperationOutput *output) const; /** Find a connected write buffer operation to an OpOutput */ @@ -148,17 +148,17 @@ protected: void add_complex_operation_buffers(); void add_input_buffers(NodeOperation *operation, NodeOperationInput *input); void add_output_buffers(NodeOperation *operation, NodeOperationOutput *output); - + /** Remove unreachable operations */ void prune_operations(); - + /** Sort operations by link dependencies */ void sort_operations(); - + /** Create execution groups */ void group_operations(); ExecutionGroup *make_group(NodeOperation *op); - + private: PreviewOperation *make_preview_operation() const; diff --git a/source/blender/compositor/intern/COM_OpenCLDevice.cpp b/source/blender/compositor/intern/COM_OpenCLDevice.cpp index 54044f747fb..881c7b8f49a 100644 --- a/source/blender/compositor/intern/COM_OpenCLDevice.cpp +++ b/source/blender/compositor/intern/COM_OpenCLDevice.cpp @@ -74,7 +74,7 @@ void OpenCLDevice::execute(WorkPackage *work) chunkNumber, inputBuffers, outputBuffer); delete outputBuffer; - + executionGroup->finalizeChunkExecution(chunkNumber, inputBuffers); } cl_mem OpenCLDevice::COM_clAttachMemoryBufferToKernelParameter(cl_kernel kernel, int parameterIndex, int offsetIndex, @@ -106,7 +106,7 @@ cl_mem OpenCLDevice::COM_clAttachMemoryBufferToKernelParameter(cl_kernel kernel, ReadBufferOperation *reader) { cl_int error; - + MemoryBuffer *result = reader->getInputMemoryBuffer(inputMemoryBuffers); const cl_image_format *imageFormat = determineImageFormat(result); diff --git a/source/blender/compositor/intern/COM_OpenCLDevice.h b/source/blender/compositor/intern/COM_OpenCLDevice.h index 78d3c66cb5c..fa358f65ddf 100644 --- a/source/blender/compositor/intern/COM_OpenCLDevice.h +++ b/source/blender/compositor/intern/COM_OpenCLDevice.h @@ -42,17 +42,17 @@ private: * @brief opencl context */ cl_context m_context; - + /** * @brief opencl device */ cl_device_id m_device; - + /** * @brief opencl program */ cl_program m_program; - + /** * @brief opencl command queue */ @@ -72,8 +72,8 @@ public: * @param vendorID */ OpenCLDevice(cl_context context, cl_device_id device, cl_program program, cl_int vendorId); - - + + /** * @brief initialize the device * During initialization the OpenCL cl_command_queue is created @@ -81,13 +81,13 @@ public: * @see queue */ bool initialize(); - + /** * @brief deinitialize the device * During deintiialization the command queue is cleared */ void deinitialize(); - + /** * @brief execute a WorkPackage * @param work the WorkPackage to execute diff --git a/source/blender/compositor/intern/COM_SingleThreadedOperation.cpp b/source/blender/compositor/intern/COM_SingleThreadedOperation.cpp index 27d4d0951e8..9ab67a40055 100644 --- a/source/blender/compositor/intern/COM_SingleThreadedOperation.cpp +++ b/source/blender/compositor/intern/COM_SingleThreadedOperation.cpp @@ -49,7 +49,7 @@ void SingleThreadedOperation::deinitExecution() void *SingleThreadedOperation::initializeTileData(rcti *rect) { if (this->m_cachedInstance) return this->m_cachedInstance; - + lockMutex(); if (this->m_cachedInstance == NULL) { // diff --git a/source/blender/compositor/intern/COM_SingleThreadedOperation.h b/source/blender/compositor/intern/COM_SingleThreadedOperation.h index 82d0b04e064..e0dc06ef733 100644 --- a/source/blender/compositor/intern/COM_SingleThreadedOperation.h +++ b/source/blender/compositor/intern/COM_SingleThreadedOperation.h @@ -27,7 +27,7 @@ class SingleThreadedOperation : public NodeOperation { private: MemoryBuffer *m_cachedInstance; - + protected: inline bool isCached() { return this->m_cachedInstance != NULL; @@ -35,17 +35,17 @@ protected: public: SingleThreadedOperation(); - + /** * the inner loop of this program */ void executePixel(float output[4], int x, int y, void *data); - + /** * Initialize the execution */ void initExecution(); - + /** * Deinitialize the execution */ @@ -54,7 +54,7 @@ public: void *initializeTileData(rcti *rect); virtual MemoryBuffer *createMemoryBuffer(rcti *rect) = 0; - + int isSingleThreaded() { return true; } }; #endif diff --git a/source/blender/compositor/intern/COM_WorkScheduler.cpp b/source/blender/compositor/intern/COM_WorkScheduler.cpp index ce45b9fdbe9..4136983e13c 100644 --- a/source/blender/compositor/intern/COM_WorkScheduler.cpp +++ b/source/blender/compositor/intern/COM_WorkScheduler.cpp @@ -85,7 +85,7 @@ void *WorkScheduler::thread_execute_cpu(void *data) device->execute(work); delete work; } - + return NULL; } @@ -93,12 +93,12 @@ void *WorkScheduler::thread_execute_gpu(void *data) { Device *device = (Device *)data; WorkPackage *work; - + while ((work = (WorkPackage *)BLI_thread_queue_pop(g_gpuqueue))) { device->execute(work); delete work; } - + return NULL; } #endif diff --git a/source/blender/compositor/intern/COM_WorkScheduler.h b/source/blender/compositor/intern/COM_WorkScheduler.h index 7f07978a9c7..14b02e70913 100644 --- a/source/blender/compositor/intern/COM_WorkScheduler.h +++ b/source/blender/compositor/intern/COM_WorkScheduler.h @@ -53,7 +53,7 @@ class WorkScheduler { * inside this loop new work is queried and being executed */ static void *thread_execute_gpu(void *data); -#endif +#endif public: /** * @brief schedule a chunk of a group to be calculated. diff --git a/source/blender/compositor/intern/COM_compositor.cpp b/source/blender/compositor/intern/COM_compositor.cpp index 467286084f9..4599832b433 100644 --- a/source/blender/compositor/intern/COM_compositor.cpp +++ b/source/blender/compositor/intern/COM_compositor.cpp @@ -94,7 +94,7 @@ void COM_execute(RenderData *rd, Scene *scene, bNodeTree *editingtree, int rende ExecutionSystem *system = new ExecutionSystem(rd, scene, editingtree, rendering, twopass, viewSettings, displaySettings, viewName); system->execute(); delete system; - + if (editingtree->test_break(editingtree->tbh)) { // during editing multiple calls to this method can be triggered. // make sure one the last one will be doing the work. diff --git a/source/blender/compositor/nodes/COM_AlphaOverNode.cpp b/source/blender/compositor/nodes/COM_AlphaOverNode.cpp index 0c35f079a8b..3481fd1addd 100644 --- a/source/blender/compositor/nodes/COM_AlphaOverNode.cpp +++ b/source/blender/compositor/nodes/COM_AlphaOverNode.cpp @@ -35,14 +35,14 @@ void AlphaOverNode::convertToOperations(NodeConverter &converter, const Composit NodeInput *color1Socket = this->getInputSocket(1); NodeInput *color2Socket = this->getInputSocket(2); bNode *editorNode = this->getbNode(); - + MixBaseOperation *convertProg; NodeTwoFloats *ntf = (NodeTwoFloats *)editorNode->storage; if (ntf->x != 0.0f) { AlphaOverMixedOperation *mixOperation = new AlphaOverMixedOperation(); mixOperation->setX(ntf->x); convertProg = mixOperation; - + } else if (editorNode->custom1) { convertProg = new AlphaOverKeyOperation(); @@ -50,7 +50,7 @@ void AlphaOverNode::convertToOperations(NodeConverter &converter, const Composit else { convertProg = new AlphaOverPremultiplyOperation(); } - + convertProg->setUseValueAlphaMultiply(false); if (color1Socket->isLinked()) { convertProg->setResolutionInputSocketIndex(1); @@ -61,7 +61,7 @@ void AlphaOverNode::convertToOperations(NodeConverter &converter, const Composit else { convertProg->setResolutionInputSocketIndex(0); } - + converter.addOperation(convertProg); converter.mapInputSocket(getInputSocket(0), convertProg->getInputSocket(0)); converter.mapInputSocket(getInputSocket(1), convertProg->getInputSocket(1)); diff --git a/source/blender/compositor/nodes/COM_BilateralBlurNode.cpp b/source/blender/compositor/nodes/COM_BilateralBlurNode.cpp index fe6b447b23b..dba1a009417 100644 --- a/source/blender/compositor/nodes/COM_BilateralBlurNode.cpp +++ b/source/blender/compositor/nodes/COM_BilateralBlurNode.cpp @@ -36,7 +36,7 @@ void BilateralBlurNode::convertToOperations(NodeConverter &converter, const Comp BilateralBlurOperation *operation = new BilateralBlurOperation(); operation->setQuality(context.getQuality()); operation->setData(data); - + converter.addOperation(operation); converter.mapInputSocket(getInputSocket(0), operation->getInputSocket(0)); converter.mapInputSocket(getInputSocket(1), operation->getInputSocket(1)); diff --git a/source/blender/compositor/nodes/COM_BlurNode.cpp b/source/blender/compositor/nodes/COM_BlurNode.cpp index 66ccbaa4de8..ed1c15d15a2 100644 --- a/source/blender/compositor/nodes/COM_BlurNode.cpp +++ b/source/blender/compositor/nodes/COM_BlurNode.cpp @@ -56,9 +56,9 @@ void BlurNode::convertToOperations(NodeConverter &converter, const CompositorCon operationfgb->setData(data); operationfgb->setExtendBounds(extend_bounds); converter.addOperation(operationfgb); - + converter.mapInputSocket(getInputSocket(1), operationfgb->getInputSocket(1)); - + input_operation = operationfgb; output_operation = operationfgb; } @@ -67,12 +67,12 @@ void BlurNode::convertToOperations(NodeConverter &converter, const CompositorCon SetValueOperation *zero = new SetValueOperation(); zero->setValue(0.0f); clamp->setUseClamp(true); - + converter.addOperation(clamp); converter.addOperation(zero); converter.mapInputSocket(getInputSocket(1), clamp->getInputSocket(0)); converter.addLink(zero->getOutputSocket(), clamp->getInputSocket(1)); - + GaussianAlphaXBlurOperation *operationx = new GaussianAlphaXBlurOperation(); operationx->setData(data); operationx->setQuality(quality); @@ -80,10 +80,10 @@ void BlurNode::convertToOperations(NodeConverter &converter, const CompositorCon operationx->setFalloff(PROP_SMOOTH); operationx->setSubtract(false); operationx->setExtendBounds(extend_bounds); - + converter.addOperation(operationx); converter.addLink(clamp->getOutputSocket(), operationx->getInputSocket(0)); - + GaussianAlphaYBlurOperation *operationy = new GaussianAlphaYBlurOperation(); operationy->setData(data); operationy->setQuality(quality); @@ -94,7 +94,7 @@ void BlurNode::convertToOperations(NodeConverter &converter, const CompositorCon converter.addOperation(operationy); converter.addLink(operationx->getOutputSocket(), operationy->getInputSocket(0)); - + GaussianBlurReferenceOperation *operation = new GaussianBlurReferenceOperation(); operation->setData(data); operation->setQuality(quality); @@ -102,7 +102,7 @@ void BlurNode::convertToOperations(NodeConverter &converter, const CompositorCon converter.addOperation(operation); converter.addLink(operationy->getOutputSocket(), operation->getInputSocket(1)); - + output_operation = operation; input_operation = operation; } @@ -115,7 +115,7 @@ void BlurNode::convertToOperations(NodeConverter &converter, const CompositorCon converter.addOperation(operationx); converter.mapInputSocket(getInputSocket(1), operationx->getInputSocket(1)); - + GaussianYBlurOperation *operationy = new GaussianYBlurOperation(); operationy->setData(data); operationy->setQuality(quality); @@ -156,18 +156,18 @@ void BlurNode::convertToOperations(NodeConverter &converter, const CompositorCon GammaUncorrectOperation *inverse = new GammaUncorrectOperation(); converter.addOperation(correct); converter.addOperation(inverse); - + converter.mapInputSocket(getInputSocket(0), correct->getInputSocket(0)); converter.addLink(correct->getOutputSocket(), input_operation->getInputSocket(0)); converter.addLink(output_operation->getOutputSocket(), inverse->getInputSocket(0)); converter.mapOutputSocket(getOutputSocket(), inverse->getOutputSocket()); - + converter.addPreview(inverse->getOutputSocket()); } else { converter.mapInputSocket(getInputSocket(0), input_operation->getInputSocket(0)); converter.mapOutputSocket(getOutputSocket(), output_operation->getOutputSocket()); - + converter.addPreview(output_operation->getOutputSocket()); } } diff --git a/source/blender/compositor/nodes/COM_BokehBlurNode.cpp b/source/blender/compositor/nodes/COM_BokehBlurNode.cpp index b71f2f5fa07..b36e8cc4c53 100644 --- a/source/blender/compositor/nodes/COM_BokehBlurNode.cpp +++ b/source/blender/compositor/nodes/COM_BokehBlurNode.cpp @@ -49,7 +49,7 @@ void BokehBlurNode::convertToOperations(NodeConverter &converter, const Composit operation->setThreshold(0.0f); operation->setMaxBlur(b_node->custom4); operation->setDoScaleSize(true); - + converter.addOperation(operation); converter.mapInputSocket(getInputSocket(0), operation->getInputSocket(0)); converter.mapInputSocket(getInputSocket(1), operation->getInputSocket(1)); @@ -60,7 +60,7 @@ void BokehBlurNode::convertToOperations(NodeConverter &converter, const Composit BokehBlurOperation *operation = new BokehBlurOperation(); operation->setQuality(context.getQuality()); operation->setExtendBounds(extend_bounds); - + converter.addOperation(operation); converter.mapInputSocket(getInputSocket(0), operation->getInputSocket(0)); converter.mapInputSocket(getInputSocket(1), operation->getInputSocket(1)); diff --git a/source/blender/compositor/nodes/COM_BokehImageNode.cpp b/source/blender/compositor/nodes/COM_BokehImageNode.cpp index 7f25a19ee37..7a388f80def 100644 --- a/source/blender/compositor/nodes/COM_BokehImageNode.cpp +++ b/source/blender/compositor/nodes/COM_BokehImageNode.cpp @@ -33,9 +33,9 @@ void BokehImageNode::convertToOperations(NodeConverter &converter, const Composi { BokehImageOperation *operation = new BokehImageOperation(); operation->setData((NodeBokehImage *)this->getbNode()->storage); - + converter.addOperation(operation); converter.mapOutputSocket(getOutputSocket(0), operation->getOutputSocket(0)); - + converter.addPreview(operation->getOutputSocket(0)); } diff --git a/source/blender/compositor/nodes/COM_BoxMaskNode.cpp b/source/blender/compositor/nodes/COM_BoxMaskNode.cpp index b3cffb90459..f798c95b1b1 100644 --- a/source/blender/compositor/nodes/COM_BoxMaskNode.cpp +++ b/source/blender/compositor/nodes/COM_BoxMaskNode.cpp @@ -36,13 +36,13 @@ void BoxMaskNode::convertToOperations(NodeConverter &converter, const Compositor { NodeInput *inputSocket = this->getInputSocket(0); NodeOutput *outputSocket = this->getOutputSocket(0); - + BoxMaskOperation *operation; operation = new BoxMaskOperation(); operation->setData((NodeBoxMask *)this->getbNode()->storage); operation->setMaskType(this->getbNode()->custom1); converter.addOperation(operation); - + if (inputSocket->isLinked()) { converter.mapInputSocket(inputSocket, operation->getInputSocket(0)); converter.mapOutputSocket(outputSocket, operation->getOutputSocket()); diff --git a/source/blender/compositor/nodes/COM_BrightnessNode.cpp b/source/blender/compositor/nodes/COM_BrightnessNode.cpp index fc7294eb6b1..b2422a230cd 100644 --- a/source/blender/compositor/nodes/COM_BrightnessNode.cpp +++ b/source/blender/compositor/nodes/COM_BrightnessNode.cpp @@ -35,7 +35,7 @@ void BrightnessNode::convertToOperations(NodeConverter &converter, const Composi BrightnessOperation *operation = new BrightnessOperation(); operation->setUsePremultiply((bnode->custom1 & 1) != 0); converter.addOperation(operation); - + converter.mapInputSocket(getInputSocket(0), operation->getInputSocket(0)); converter.mapInputSocket(getInputSocket(1), operation->getInputSocket(1)); converter.mapInputSocket(getInputSocket(2), operation->getInputSocket(2)); diff --git a/source/blender/compositor/nodes/COM_ChromaMatteNode.cpp b/source/blender/compositor/nodes/COM_ChromaMatteNode.cpp index 2c985cd5bd1..d725ad135a5 100644 --- a/source/blender/compositor/nodes/COM_ChromaMatteNode.cpp +++ b/source/blender/compositor/nodes/COM_ChromaMatteNode.cpp @@ -33,35 +33,35 @@ ChromaMatteNode::ChromaMatteNode(bNode *editorNode) : Node(editorNode) void ChromaMatteNode::convertToOperations(NodeConverter &converter, const CompositorContext &/*context*/) const { bNode *editorsnode = getbNode(); - + NodeInput *inputSocketImage = this->getInputSocket(0); NodeInput *inputSocketKey = this->getInputSocket(1); NodeOutput *outputSocketImage = this->getOutputSocket(0); NodeOutput *outputSocketMatte = this->getOutputSocket(1); - + ConvertRGBToYCCOperation *operationRGBToYCC_Image = new ConvertRGBToYCCOperation(); ConvertRGBToYCCOperation *operationRGBToYCC_Key = new ConvertRGBToYCCOperation(); operationRGBToYCC_Image->setMode(BLI_YCC_ITU_BT709); operationRGBToYCC_Key->setMode(BLI_YCC_ITU_BT709); converter.addOperation(operationRGBToYCC_Image); converter.addOperation(operationRGBToYCC_Key); - + ChromaMatteOperation *operation = new ChromaMatteOperation(); operation->setSettings((NodeChroma *)editorsnode->storage); converter.addOperation(operation); - + SetAlphaOperation *operationAlpha = new SetAlphaOperation(); converter.addOperation(operationAlpha); - + converter.mapInputSocket(inputSocketImage, operationRGBToYCC_Image->getInputSocket(0)); converter.mapInputSocket(inputSocketKey, operationRGBToYCC_Key->getInputSocket(0)); converter.addLink(operationRGBToYCC_Image->getOutputSocket(), operation->getInputSocket(0)); converter.addLink(operationRGBToYCC_Key->getOutputSocket(), operation->getInputSocket(1)); converter.mapOutputSocket(outputSocketMatte, operation->getOutputSocket()); - + converter.mapInputSocket(inputSocketImage, operationAlpha->getInputSocket(0)); converter.addLink(operation->getOutputSocket(), operationAlpha->getInputSocket(1)); converter.mapOutputSocket(outputSocketImage, operationAlpha->getOutputSocket()); - + converter.addPreview(operationAlpha->getOutputSocket()); } diff --git a/source/blender/compositor/nodes/COM_ColorBalanceNode.cpp b/source/blender/compositor/nodes/COM_ColorBalanceNode.cpp index 98d2e048807..28966beb4f4 100644 --- a/source/blender/compositor/nodes/COM_ColorBalanceNode.cpp +++ b/source/blender/compositor/nodes/COM_ColorBalanceNode.cpp @@ -36,11 +36,11 @@ void ColorBalanceNode::convertToOperations(NodeConverter &converter, const Compo { bNode *node = this->getbNode(); NodeColorBalance *n = (NodeColorBalance *)node->storage; - + NodeInput *inputSocket = this->getInputSocket(0); NodeInput *inputImageSocket = this->getInputSocket(1); NodeOutput *outputSocket = this->getOutputSocket(0); - + NodeOperation *operation; if (node->custom1 == 0) { ColorBalanceLGGOperation *operationLGG = new ColorBalanceLGGOperation(); @@ -69,7 +69,7 @@ void ColorBalanceNode::convertToOperations(NodeConverter &converter, const Compo operation = operationCDL; } converter.addOperation(operation); - + converter.mapInputSocket(inputSocket, operation->getInputSocket(0)); converter.mapInputSocket(inputImageSocket, operation->getInputSocket(1)); converter.mapOutputSocket(outputSocket, operation->getOutputSocket(0)); diff --git a/source/blender/compositor/nodes/COM_ColorCorrectionNode.cpp b/source/blender/compositor/nodes/COM_ColorCorrectionNode.cpp index c4eefe038a5..72943f6b53f 100644 --- a/source/blender/compositor/nodes/COM_ColorCorrectionNode.cpp +++ b/source/blender/compositor/nodes/COM_ColorCorrectionNode.cpp @@ -32,14 +32,14 @@ ColorCorrectionNode::ColorCorrectionNode(bNode *editorNode) : Node(editorNode) void ColorCorrectionNode::convertToOperations(NodeConverter &converter, const CompositorContext &/*context*/) const { bNode *editorNode = getbNode(); - + ColorCorrectionOperation *operation = new ColorCorrectionOperation(); operation->setData((NodeColorCorrection *)editorNode->storage); operation->setRedChannelEnabled((editorNode->custom1 & 1) > 0); operation->setGreenChannelEnabled((editorNode->custom1 & 2) > 0); operation->setBlueChannelEnabled((editorNode->custom1 & 4) > 0); converter.addOperation(operation); - + converter.mapInputSocket(getInputSocket(0), operation->getInputSocket(0)); converter.mapInputSocket(getInputSocket(1), operation->getInputSocket(1)); converter.mapOutputSocket(getOutputSocket(0), operation->getOutputSocket(0)); diff --git a/source/blender/compositor/nodes/COM_ColorCurveNode.cpp b/source/blender/compositor/nodes/COM_ColorCurveNode.cpp index 41052ef536d..fb8587adabb 100644 --- a/source/blender/compositor/nodes/COM_ColorCurveNode.cpp +++ b/source/blender/compositor/nodes/COM_ColorCurveNode.cpp @@ -35,12 +35,12 @@ void ColorCurveNode::convertToOperations(NodeConverter &converter, const Composi ColorCurveOperation *operation = new ColorCurveOperation(); operation->setCurveMapping((CurveMapping *)this->getbNode()->storage); converter.addOperation(operation); - + converter.mapInputSocket(getInputSocket(0), operation->getInputSocket(0)); converter.mapInputSocket(getInputSocket(1), operation->getInputSocket(1)); converter.mapInputSocket(getInputSocket(2), operation->getInputSocket(2)); converter.mapInputSocket(getInputSocket(3), operation->getInputSocket(3)); - + converter.mapOutputSocket(getOutputSocket(0), operation->getOutputSocket()); } else { @@ -52,7 +52,7 @@ void ColorCurveNode::convertToOperations(NodeConverter &converter, const Composi operation->setWhiteLevel(col); operation->setCurveMapping((CurveMapping *)this->getbNode()->storage); converter.addOperation(operation); - + converter.mapInputSocket(getInputSocket(0), operation->getInputSocket(0)); converter.mapInputSocket(getInputSocket(1), operation->getInputSocket(1)); converter.mapOutputSocket(getOutputSocket(0), operation->getOutputSocket()); diff --git a/source/blender/compositor/nodes/COM_ColorMatteNode.cpp b/source/blender/compositor/nodes/COM_ColorMatteNode.cpp index f7c20894087..477fdddff8a 100644 --- a/source/blender/compositor/nodes/COM_ColorMatteNode.cpp +++ b/source/blender/compositor/nodes/COM_ColorMatteNode.cpp @@ -33,33 +33,33 @@ ColorMatteNode::ColorMatteNode(bNode *editorNode) : Node(editorNode) void ColorMatteNode::convertToOperations(NodeConverter &converter, const CompositorContext &/*context*/) const { bNode *editorsnode = getbNode(); - + NodeInput *inputSocketImage = this->getInputSocket(0); NodeInput *inputSocketKey = this->getInputSocket(1); NodeOutput *outputSocketImage = this->getOutputSocket(0); NodeOutput *outputSocketMatte = this->getOutputSocket(1); - + ConvertRGBToHSVOperation *operationRGBToHSV_Image = new ConvertRGBToHSVOperation(); ConvertRGBToHSVOperation *operationRGBToHSV_Key = new ConvertRGBToHSVOperation(); converter.addOperation(operationRGBToHSV_Image); converter.addOperation(operationRGBToHSV_Key); - + ColorMatteOperation *operation = new ColorMatteOperation(); operation->setSettings((NodeChroma *)editorsnode->storage); converter.addOperation(operation); - + SetAlphaOperation *operationAlpha = new SetAlphaOperation(); converter.addOperation(operationAlpha); - + converter.mapInputSocket(inputSocketImage, operationRGBToHSV_Image->getInputSocket(0)); converter.mapInputSocket(inputSocketKey, operationRGBToHSV_Key->getInputSocket(0)); converter.addLink(operationRGBToHSV_Image->getOutputSocket(), operation->getInputSocket(0)); converter.addLink(operationRGBToHSV_Key->getOutputSocket(), operation->getInputSocket(1)); converter.mapOutputSocket(outputSocketMatte, operation->getOutputSocket(0)); - + converter.mapInputSocket(inputSocketImage, operationAlpha->getInputSocket(0)); converter.addLink(operation->getOutputSocket(), operationAlpha->getInputSocket(1)); converter.mapOutputSocket(outputSocketImage, operationAlpha->getOutputSocket()); - + converter.addPreview(operationAlpha->getOutputSocket()); } diff --git a/source/blender/compositor/nodes/COM_ColorNode.cpp b/source/blender/compositor/nodes/COM_ColorNode.cpp index 2c37a927e46..c9254b30e8e 100644 --- a/source/blender/compositor/nodes/COM_ColorNode.cpp +++ b/source/blender/compositor/nodes/COM_ColorNode.cpp @@ -37,6 +37,6 @@ void ColorNode::convertToOperations(NodeConverter &converter, const CompositorCo output->getEditorValueColor(col); operation->setChannels(col); converter.addOperation(operation); - + converter.mapOutputSocket(output, operation->getOutputSocket()); } diff --git a/source/blender/compositor/nodes/COM_ColorRampNode.cpp b/source/blender/compositor/nodes/COM_ColorRampNode.cpp index 175267a3a4f..3e5128fa0fa 100644 --- a/source/blender/compositor/nodes/COM_ColorRampNode.cpp +++ b/source/blender/compositor/nodes/COM_ColorRampNode.cpp @@ -42,14 +42,14 @@ void ColorRampNode::convertToOperations(NodeConverter &converter, const Composit ColorRampOperation *operation = new ColorRampOperation(); operation->setColorBand((ColorBand *)editorNode->storage); converter.addOperation(operation); - + converter.mapInputSocket(inputSocket, operation->getInputSocket(0)); converter.mapOutputSocket(outputSocket, operation->getOutputSocket(0)); - + SeparateChannelOperation *operation2 = new SeparateChannelOperation(); operation2->setChannel(3); converter.addOperation(operation2); - + converter.addLink(operation->getOutputSocket(), operation2->getInputSocket(0)); converter.mapOutputSocket(outputSocketAlpha, operation2->getOutputSocket()); } diff --git a/source/blender/compositor/nodes/COM_ColorSpillNode.cpp b/source/blender/compositor/nodes/COM_ColorSpillNode.cpp index f33f2858397..bef518bb186 100644 --- a/source/blender/compositor/nodes/COM_ColorSpillNode.cpp +++ b/source/blender/compositor/nodes/COM_ColorSpillNode.cpp @@ -32,18 +32,18 @@ ColorSpillNode::ColorSpillNode(bNode *editorNode) : Node(editorNode) void ColorSpillNode::convertToOperations(NodeConverter &converter, const CompositorContext &/*context*/) const { bNode *editorsnode = getbNode(); - + NodeInput *inputSocketImage = this->getInputSocket(0); NodeInput *inputSocketFac = this->getInputSocket(1); NodeOutput *outputSocketImage = this->getOutputSocket(0); - + ColorSpillOperation *operation; operation = new ColorSpillOperation(); operation->setSettings((NodeColorspill *)editorsnode->storage); operation->setSpillChannel(editorsnode->custom1 - 1); // Channel for spilling operation->setSpillMethod(editorsnode->custom2); // Channel method converter.addOperation(operation); - + converter.mapInputSocket(inputSocketImage, operation->getInputSocket(0)); converter.mapInputSocket(inputSocketFac, operation->getInputSocket(1)); converter.mapOutputSocket(outputSocketImage, operation->getOutputSocket()); diff --git a/source/blender/compositor/nodes/COM_ColorToBWNode.cpp b/source/blender/compositor/nodes/COM_ColorToBWNode.cpp index 2ce4dd5d3a8..1b26354117a 100644 --- a/source/blender/compositor/nodes/COM_ColorToBWNode.cpp +++ b/source/blender/compositor/nodes/COM_ColorToBWNode.cpp @@ -34,10 +34,10 @@ void ColorToBWNode::convertToOperations(NodeConverter &converter, const Composit { NodeInput *colorSocket = this->getInputSocket(0); NodeOutput *valueSocket = this->getOutputSocket(0); - + ConvertColorToBWOperation *convertProg = new ConvertColorToBWOperation(); converter.addOperation(convertProg); - + converter.mapInputSocket(colorSocket, convertProg->getInputSocket(0)); converter.mapOutputSocket(valueSocket, convertProg->getOutputSocket(0)); } diff --git a/source/blender/compositor/nodes/COM_CombineColorNode.cpp b/source/blender/compositor/nodes/COM_CombineColorNode.cpp index b7b84b9986c..ad410038c65 100644 --- a/source/blender/compositor/nodes/COM_CombineColorNode.cpp +++ b/source/blender/compositor/nodes/COM_CombineColorNode.cpp @@ -38,7 +38,7 @@ void CombineColorNode::convertToOperations(NodeConverter &converter, const Compo NodeInput *inputBSocket = this->getInputSocket(2); NodeInput *inputASocket = this->getInputSocket(3); NodeOutput *outputSocket = this->getOutputSocket(0); - + CombineChannelsOperation *operation = new CombineChannelsOperation(); if (inputRSocket->isLinked()) { operation->setResolutionInputSocketIndex(0); @@ -53,16 +53,16 @@ void CombineColorNode::convertToOperations(NodeConverter &converter, const Compo operation->setResolutionInputSocketIndex(3); } converter.addOperation(operation); - + converter.mapInputSocket(inputRSocket, operation->getInputSocket(0)); converter.mapInputSocket(inputGSocket, operation->getInputSocket(1)); converter.mapInputSocket(inputBSocket, operation->getInputSocket(2)); converter.mapInputSocket(inputASocket, operation->getInputSocket(3)); - + NodeOperation *color_conv = getColorConverter(context); if (color_conv) { converter.addOperation(color_conv); - + converter.addLink(operation->getOutputSocket(), color_conv->getInputSocket(0)); converter.mapOutputSocket(outputSocket, color_conv->getOutputSocket()); } diff --git a/source/blender/compositor/nodes/COM_CombineColorNode.h b/source/blender/compositor/nodes/COM_CombineColorNode.h index 4cb626ea384..d5439e0056c 100644 --- a/source/blender/compositor/nodes/COM_CombineColorNode.h +++ b/source/blender/compositor/nodes/COM_CombineColorNode.h @@ -30,7 +30,7 @@ class CombineColorNode : public Node { public: CombineColorNode(bNode *editorNode); void convertToOperations(NodeConverter &converter, const CompositorContext &context) const; - + protected: virtual NodeOperation *getColorConverter(const CompositorContext &context) const = 0; }; @@ -40,7 +40,7 @@ public: CombineRGBANode(bNode *editorNode) : CombineColorNode(editorNode) {} - + NodeOperation *getColorConverter(const CompositorContext &context) const; }; @@ -49,7 +49,7 @@ public: CombineHSVANode(bNode *editorNode) : CombineColorNode(editorNode) {} - + NodeOperation *getColorConverter(const CompositorContext &context) const; }; @@ -58,7 +58,7 @@ public: CombineYCCANode(bNode *editorNode) : CombineColorNode(editorNode) {} - + NodeOperation *getColorConverter(const CompositorContext &context) const; }; @@ -67,7 +67,7 @@ public: CombineYUVANode(bNode *editorNode) : CombineColorNode(editorNode) {} - + NodeOperation *getColorConverter(const CompositorContext &context) const; }; diff --git a/source/blender/compositor/nodes/COM_CompositorNode.cpp b/source/blender/compositor/nodes/COM_CompositorNode.cpp index b2a1df7ee9e..002f28f3135 100644 --- a/source/blender/compositor/nodes/COM_CompositorNode.cpp +++ b/source/blender/compositor/nodes/COM_CompositorNode.cpp @@ -49,7 +49,7 @@ void CompositorNode::convertToOperations(NodeConverter &converter, const Composi /* alpha socket gives either 1 or a custom alpha value if "use alpha" is enabled */ compositorOperation->setUseAlphaInput(ignore_alpha || alphaSocket->isLinked()); compositorOperation->setActive(is_active); - + converter.addOperation(compositorOperation); converter.mapInputSocket(imageSocket, compositorOperation->getInputSocket(0)); /* only use alpha link if "use alpha" is enabled */ @@ -58,6 +58,6 @@ void CompositorNode::convertToOperations(NodeConverter &converter, const Composi else converter.mapInputSocket(alphaSocket, compositorOperation->getInputSocket(1)); converter.mapInputSocket(depthSocket, compositorOperation->getInputSocket(2)); - + converter.addNodeInputPreview(imageSocket); } diff --git a/source/blender/compositor/nodes/COM_ConvertAlphaNode.cpp b/source/blender/compositor/nodes/COM_ConvertAlphaNode.cpp index fbf5dbb6253..75f72669e1e 100644 --- a/source/blender/compositor/nodes/COM_ConvertAlphaNode.cpp +++ b/source/blender/compositor/nodes/COM_ConvertAlphaNode.cpp @@ -35,9 +35,9 @@ void ConvertAlphaNode::convertToOperations(NodeConverter &converter, const Compo else { operation = new ConvertStraightToPremulOperation(); } - + converter.addOperation(operation); - + converter.mapInputSocket(getInputSocket(0), operation->getInputSocket(0)); converter.mapOutputSocket(getOutputSocket(0), operation->getOutputSocket()); } diff --git a/source/blender/compositor/nodes/COM_CornerPinNode.cpp b/source/blender/compositor/nodes/COM_CornerPinNode.cpp index 5e4e463595a..b03a3e64f83 100644 --- a/source/blender/compositor/nodes/COM_CornerPinNode.cpp +++ b/source/blender/compositor/nodes/COM_CornerPinNode.cpp @@ -46,7 +46,7 @@ void CornerPinNode::convertToOperations(NodeConverter &converter, const Composit converter.addOperation(warp_image_operation); PlaneCornerPinMaskOperation *plane_mask_operation = new PlaneCornerPinMaskOperation(); converter.addOperation(plane_mask_operation); - + converter.mapInputSocket(input_image, warp_image_operation->getInputSocket(0)); for (int i = 0; i < 4; ++i) { NodeInput *corner_input = getInputSocket(node_corner_index[i]); diff --git a/source/blender/compositor/nodes/COM_CropNode.cpp b/source/blender/compositor/nodes/COM_CropNode.cpp index 12eb5268be4..4f80b868f3a 100644 --- a/source/blender/compositor/nodes/COM_CropNode.cpp +++ b/source/blender/compositor/nodes/COM_CropNode.cpp @@ -45,7 +45,7 @@ void CropNode::convertToOperations(NodeConverter &converter, const CompositorCon operation->setCropSettings(cropSettings); operation->setRelative(relative); converter.addOperation(operation); - + converter.mapInputSocket(getInputSocket(0), operation->getInputSocket(0)); converter.mapOutputSocket(getOutputSocket(), operation->getOutputSocket()); } diff --git a/source/blender/compositor/nodes/COM_DefocusNode.cpp b/source/blender/compositor/nodes/COM_DefocusNode.cpp index 5df246db1d2..19bb42327f5 100644 --- a/source/blender/compositor/nodes/COM_DefocusNode.cpp +++ b/source/blender/compositor/nodes/COM_DefocusNode.cpp @@ -54,17 +54,17 @@ void DefocusNode::convertToOperations(NodeConverter &converter, const Compositor SetValueOperation *maxRadius = new SetValueOperation(); maxRadius->setValue(data->maxblur); MathMinimumOperation *minimize = new MathMinimumOperation(); - + converter.addOperation(multiply); converter.addOperation(multiplier); converter.addOperation(maxRadius); converter.addOperation(minimize); - + converter.mapInputSocket(getInputSocket(1), multiply->getInputSocket(0)); converter.addLink(multiplier->getOutputSocket(), multiply->getInputSocket(1)); converter.addLink(multiply->getOutputSocket(), minimize->getInputSocket(0)); converter.addLink(maxRadius->getOutputSocket(), minimize->getInputSocket(1)); - + radiusOperation = minimize; } else { @@ -73,20 +73,20 @@ void DefocusNode::convertToOperations(NodeConverter &converter, const Compositor radius_op->setfStop(data->fstop); radius_op->setMaxRadius(data->maxblur); converter.addOperation(radius_op); - + converter.mapInputSocket(getInputSocket(1), radius_op->getInputSocket(0)); - + FastGaussianBlurValueOperation *blur = new FastGaussianBlurValueOperation(); /* maintain close pixels so far Z values don't bleed into the foreground */ blur->setOverlay(FAST_GAUSS_OVERLAY_MIN); converter.addOperation(blur); - + converter.addLink(radius_op->getOutputSocket(0), blur->getInputSocket(0)); radius_op->setPostBlur(blur); - + radiusOperation = blur; } - + NodeBokehImage *bokehdata = new NodeBokehImage(); bokehdata->angle = data->rotation; bokehdata->rounding = 0.0f; @@ -97,20 +97,20 @@ void DefocusNode::convertToOperations(NodeConverter &converter, const Compositor } bokehdata->catadioptric = 0.0f; bokehdata->lensshift = 0.0f; - + BokehImageOperation *bokeh = new BokehImageOperation(); bokeh->setData(bokehdata); bokeh->deleteDataOnFinish(); converter.addOperation(bokeh); - + #ifdef COM_DEFOCUS_SEARCH InverseSearchRadiusOperation *search = new InverseSearchRadiusOperation(); search->setMaxBlur(data->maxblur); converter.addOperation(search); - + converter.addLink(radiusOperation->getOutputSocket(0), search->getInputSocket(0)); #endif - + VariableSizeBokehBlurOperation *operation = new VariableSizeBokehBlurOperation(); if (data->preview) operation->setQuality(COM_QUALITY_LOW); @@ -119,19 +119,19 @@ void DefocusNode::convertToOperations(NodeConverter &converter, const Compositor operation->setMaxBlur(data->maxblur); operation->setThreshold(data->bthresh); converter.addOperation(operation); - + converter.addLink(bokeh->getOutputSocket(), operation->getInputSocket(1)); converter.addLink(radiusOperation->getOutputSocket(), operation->getInputSocket(2)); #ifdef COM_DEFOCUS_SEARCH converter.addLink(search->getOutputSocket(), operation->getInputSocket(3)); #endif - + if (data->gamco) { GammaCorrectOperation *correct = new GammaCorrectOperation(); converter.addOperation(correct); GammaUncorrectOperation *inverse = new GammaUncorrectOperation(); converter.addOperation(inverse); - + converter.mapInputSocket(getInputSocket(0), correct->getInputSocket(0)); converter.addLink(correct->getOutputSocket(), operation->getInputSocket(0)); converter.addLink(operation->getOutputSocket(), inverse->getInputSocket(0)); diff --git a/source/blender/compositor/nodes/COM_DespeckleNode.cpp b/source/blender/compositor/nodes/COM_DespeckleNode.cpp index a21885bf42d..d211050389e 100644 --- a/source/blender/compositor/nodes/COM_DespeckleNode.cpp +++ b/source/blender/compositor/nodes/COM_DespeckleNode.cpp @@ -35,15 +35,15 @@ void DespeckleNode::convertToOperations(NodeConverter &converter, const Composit NodeInput *inputSocket = this->getInputSocket(0); NodeInput *inputImageSocket = this->getInputSocket(1); NodeOutput *outputSocket = this->getOutputSocket(0); - + DespeckleOperation *operation = new DespeckleOperation(); operation->setThreshold(editorNode->custom3); operation->setThresholdNeighbor(editorNode->custom4); converter.addOperation(operation); - + converter.mapInputSocket(inputImageSocket, operation->getInputSocket(0)); converter.mapInputSocket(inputSocket, operation->getInputSocket(1)); converter.mapOutputSocket(outputSocket, operation->getOutputSocket()); - + converter.addPreview(operation->getOutputSocket(0)); } diff --git a/source/blender/compositor/nodes/COM_DifferenceMatteNode.cpp b/source/blender/compositor/nodes/COM_DifferenceMatteNode.cpp index f19cfd443a8..3867a543063 100644 --- a/source/blender/compositor/nodes/COM_DifferenceMatteNode.cpp +++ b/source/blender/compositor/nodes/COM_DifferenceMatteNode.cpp @@ -41,17 +41,17 @@ void DifferenceMatteNode::convertToOperations(NodeConverter &converter, const Co DifferenceMatteOperation *operationSet = new DifferenceMatteOperation(); operationSet->setSettings((NodeChroma *)editorNode->storage); converter.addOperation(operationSet); - + converter.mapInputSocket(inputSocket, operationSet->getInputSocket(0)); converter.mapInputSocket(inputSocket2, operationSet->getInputSocket(1)); converter.mapOutputSocket(outputSocketMatte, operationSet->getOutputSocket(0)); SetAlphaOperation *operation = new SetAlphaOperation(); converter.addOperation(operation); - + converter.mapInputSocket(inputSocket, operation->getInputSocket(0)); converter.addLink(operationSet->getOutputSocket(), operation->getInputSocket(1)); converter.mapOutputSocket(outputSocketImage, operation->getOutputSocket()); - + converter.addPreview(operation->getOutputSocket()); } diff --git a/source/blender/compositor/nodes/COM_DilateErodeNode.cpp b/source/blender/compositor/nodes/COM_DilateErodeNode.cpp index 6e78fcb38f1..102dba3b957 100644 --- a/source/blender/compositor/nodes/COM_DilateErodeNode.cpp +++ b/source/blender/compositor/nodes/COM_DilateErodeNode.cpp @@ -45,20 +45,20 @@ DilateErodeNode::DilateErodeNode(bNode *editorNode) : Node(editorNode) void DilateErodeNode::convertToOperations(NodeConverter &converter, const CompositorContext &context) const { - + bNode *editorNode = this->getbNode(); if (editorNode->custom1 == CMP_NODE_DILATEERODE_DISTANCE_THRESH) { DilateErodeThresholdOperation *operation = new DilateErodeThresholdOperation(); operation->setDistance(editorNode->custom2); operation->setInset(editorNode->custom3); converter.addOperation(operation); - + converter.mapInputSocket(getInputSocket(0), operation->getInputSocket(0)); - + if (editorNode->custom3 < 2.0f) { AntiAliasOperation *antiAlias = new AntiAliasOperation(); converter.addOperation(antiAlias); - + converter.addLink(operation->getOutputSocket(), antiAlias->getInputSocket(0)); converter.mapOutputSocket(getOutputSocket(0), antiAlias->getOutputSocket(0)); } @@ -71,7 +71,7 @@ void DilateErodeNode::convertToOperations(NodeConverter &converter, const Compos DilateDistanceOperation *operation = new DilateDistanceOperation(); operation->setDistance(editorNode->custom2); converter.addOperation(operation); - + converter.mapInputSocket(getInputSocket(0), operation->getInputSocket(0)); converter.mapOutputSocket(getOutputSocket(0), operation->getOutputSocket(0)); } @@ -79,7 +79,7 @@ void DilateErodeNode::convertToOperations(NodeConverter &converter, const Compos ErodeDistanceOperation *operation = new ErodeDistanceOperation(); operation->setDistance(-editorNode->custom2); converter.addOperation(operation); - + converter.mapInputSocket(getInputSocket(0), operation->getInputSocket(0)); converter.mapOutputSocket(getOutputSocket(0), operation->getOutputSocket(0)); } @@ -93,20 +93,20 @@ void DilateErodeNode::convertToOperations(NodeConverter &converter, const Compos operationx->setQuality(quality); operationx->setFalloff(PROP_SMOOTH); converter.addOperation(operationx); - + converter.mapInputSocket(getInputSocket(0), operationx->getInputSocket(0)); // converter.mapInputSocket(getInputSocket(1), operationx->getInputSocket(1)); // no size input yet - + GaussianAlphaYBlurOperation *operationy = new GaussianAlphaYBlurOperation(); operationy->setData(&m_alpha_blur); operationy->setQuality(quality); operationy->setFalloff(PROP_SMOOTH); converter.addOperation(operationy); - + converter.addLink(operationx->getOutputSocket(), operationy->getInputSocket(0)); // converter.mapInputSocket(getInputSocket(1), operationy->getInputSocket(1)); // no size input yet converter.mapOutputSocket(getOutputSocket(0), operationy->getOutputSocket()); - + converter.addPreview(operationy->getOutputSocket()); /* TODO? */ @@ -134,7 +134,7 @@ void DilateErodeNode::convertToOperations(NodeConverter &converter, const Compos DilateStepOperation *operation = new DilateStepOperation(); operation->setIterations(editorNode->custom2); converter.addOperation(operation); - + converter.mapInputSocket(getInputSocket(0), operation->getInputSocket(0)); converter.mapOutputSocket(getOutputSocket(0), operation->getOutputSocket(0)); } @@ -142,7 +142,7 @@ void DilateErodeNode::convertToOperations(NodeConverter &converter, const Compos ErodeStepOperation *operation = new ErodeStepOperation(); operation->setIterations(-editorNode->custom2); converter.addOperation(operation); - + converter.mapInputSocket(getInputSocket(0), operation->getInputSocket(0)); converter.mapOutputSocket(getOutputSocket(0), operation->getOutputSocket(0)); } diff --git a/source/blender/compositor/nodes/COM_DirectionalBlurNode.cpp b/source/blender/compositor/nodes/COM_DirectionalBlurNode.cpp index 9a4ced2bf96..9f846c67b1d 100644 --- a/source/blender/compositor/nodes/COM_DirectionalBlurNode.cpp +++ b/source/blender/compositor/nodes/COM_DirectionalBlurNode.cpp @@ -37,7 +37,7 @@ void DirectionalBlurNode::convertToOperations(NodeConverter &converter, const Co operation->setQuality(context.getQuality()); operation->setData(data); converter.addOperation(operation); - + converter.mapInputSocket(getInputSocket(0), operation->getInputSocket(0)); converter.mapOutputSocket(getOutputSocket(0), operation->getOutputSocket()); } diff --git a/source/blender/compositor/nodes/COM_DistanceMatteNode.cpp b/source/blender/compositor/nodes/COM_DistanceMatteNode.cpp index 52c764f2223..fc05e0564bc 100644 --- a/source/blender/compositor/nodes/COM_DistanceMatteNode.cpp +++ b/source/blender/compositor/nodes/COM_DistanceMatteNode.cpp @@ -35,27 +35,27 @@ void DistanceMatteNode::convertToOperations(NodeConverter &converter, const Comp { bNode *editorsnode = getbNode(); NodeChroma *storage = (NodeChroma *)editorsnode->storage; - + NodeInput *inputSocketImage = this->getInputSocket(0); NodeInput *inputSocketKey = this->getInputSocket(1); NodeOutput *outputSocketImage = this->getOutputSocket(0); NodeOutput *outputSocketMatte = this->getOutputSocket(1); - + SetAlphaOperation *operationAlpha = new SetAlphaOperation(); converter.addOperation(operationAlpha); - + /* work in RGB color space */ NodeOperation *operation; if (storage->channel == 1) { DistanceRGBMatteOperation *matte = new DistanceRGBMatteOperation(); matte->setSettings(storage); converter.addOperation(matte); - + converter.mapInputSocket(inputSocketImage, matte->getInputSocket(0)); converter.mapInputSocket(inputSocketImage, operationAlpha->getInputSocket(0)); - + converter.mapInputSocket(inputSocketKey, matte->getInputSocket(1)); - + operation = matte; } /* work in YCbCr color space */ @@ -63,27 +63,27 @@ void DistanceMatteNode::convertToOperations(NodeConverter &converter, const Comp DistanceYCCMatteOperation *matte = new DistanceYCCMatteOperation(); matte->setSettings(storage); converter.addOperation(matte); - + ConvertRGBToYCCOperation *operationYCCImage = new ConvertRGBToYCCOperation(); ConvertRGBToYCCOperation *operationYCCMatte = new ConvertRGBToYCCOperation(); operationYCCImage->setMode(BLI_YCC_ITU_BT709); operationYCCMatte->setMode(BLI_YCC_ITU_BT709); converter.addOperation(operationYCCImage); converter.addOperation(operationYCCMatte); - + converter.mapInputSocket(inputSocketImage, operationYCCImage->getInputSocket(0)); converter.addLink(operationYCCImage->getOutputSocket(), matte->getInputSocket(0)); converter.addLink(operationYCCImage->getOutputSocket(), operationAlpha->getInputSocket(0)); - + converter.mapInputSocket(inputSocketKey, operationYCCMatte->getInputSocket(0)); converter.addLink(operationYCCMatte->getOutputSocket(), matte->getInputSocket(1)); - + operation = matte; } - + converter.mapOutputSocket(outputSocketMatte, operation->getOutputSocket(0)); converter.addLink(operation->getOutputSocket(), operationAlpha->getInputSocket(1)); - + if (storage->channel != 1) { ConvertYCCToRGBOperation *inv_convert = new ConvertYCCToRGBOperation(); inv_convert->setMode(BLI_YCC_ITU_BT709); diff --git a/source/blender/compositor/nodes/COM_DoubleEdgeMaskNode.cpp b/source/blender/compositor/nodes/COM_DoubleEdgeMaskNode.cpp index 913d97a6395..1a10b912b23 100644 --- a/source/blender/compositor/nodes/COM_DoubleEdgeMaskNode.cpp +++ b/source/blender/compositor/nodes/COM_DoubleEdgeMaskNode.cpp @@ -33,12 +33,12 @@ void DoubleEdgeMaskNode::convertToOperations(NodeConverter &converter, const Com { DoubleEdgeMaskOperation *operation; bNode *bnode = this->getbNode(); - + operation = new DoubleEdgeMaskOperation(); operation->setAdjecentOnly(bnode->custom1); operation->setKeepInside(bnode->custom2); converter.addOperation(operation); - + converter.mapInputSocket(getInputSocket(0), operation->getInputSocket(0)); converter.mapInputSocket(getInputSocket(1), operation->getInputSocket(1)); converter.mapOutputSocket(getOutputSocket(0), operation->getOutputSocket(0)); diff --git a/source/blender/compositor/nodes/COM_EllipseMaskNode.cpp b/source/blender/compositor/nodes/COM_EllipseMaskNode.cpp index c0c99a2efe8..60dc377518b 100644 --- a/source/blender/compositor/nodes/COM_EllipseMaskNode.cpp +++ b/source/blender/compositor/nodes/COM_EllipseMaskNode.cpp @@ -36,13 +36,13 @@ void EllipseMaskNode::convertToOperations(NodeConverter &converter, const Compos { NodeInput *inputSocket = this->getInputSocket(0); NodeOutput *outputSocket = this->getOutputSocket(0); - + EllipseMaskOperation *operation; operation = new EllipseMaskOperation(); operation->setData((NodeEllipseMask *)this->getbNode()->storage); operation->setMaskType(this->getbNode()->custom1); converter.addOperation(operation); - + if (inputSocket->isLinked()) { converter.mapInputSocket(inputSocket, operation->getInputSocket(0)); converter.mapOutputSocket(outputSocket, operation->getOutputSocket()); @@ -68,6 +68,6 @@ void EllipseMaskNode::convertToOperations(NodeConverter &converter, const Compos converter.addLink(scaleOperation->getOutputSocket(0), operation->getInputSocket(0)); converter.mapOutputSocket(outputSocket, operation->getOutputSocket(0)); } - + converter.mapInputSocket(getInputSocket(1), operation->getInputSocket(1)); } diff --git a/source/blender/compositor/nodes/COM_FilterNode.cpp b/source/blender/compositor/nodes/COM_FilterNode.cpp index 627f2a30f6e..ad25894929e 100644 --- a/source/blender/compositor/nodes/COM_FilterNode.cpp +++ b/source/blender/compositor/nodes/COM_FilterNode.cpp @@ -38,7 +38,7 @@ void FilterNode::convertToOperations(NodeConverter &converter, const CompositorC NodeInput *inputImageSocket = this->getInputSocket(1); NodeOutput *outputSocket = this->getOutputSocket(0); ConvolutionFilterOperation *operation = NULL; - + switch (this->getbNode()->custom1) { case CMP_FILT_SOFT: operation = new ConvolutionFilterOperation(); @@ -74,10 +74,10 @@ void FilterNode::convertToOperations(NodeConverter &converter, const CompositorC break; } converter.addOperation(operation); - + converter.mapInputSocket(inputImageSocket, operation->getInputSocket(0)); converter.mapInputSocket(inputSocket, operation->getInputSocket(1)); converter.mapOutputSocket(outputSocket, operation->getOutputSocket()); - + converter.addPreview(operation->getOutputSocket(0)); } diff --git a/source/blender/compositor/nodes/COM_FlipNode.cpp b/source/blender/compositor/nodes/COM_FlipNode.cpp index 4cbae9bab66..2d1b60b784e 100644 --- a/source/blender/compositor/nodes/COM_FlipNode.cpp +++ b/source/blender/compositor/nodes/COM_FlipNode.cpp @@ -49,7 +49,7 @@ void FlipNode::convertToOperations(NodeConverter &converter, const CompositorCon operation->setFlipY(true); break; } - + converter.addOperation(operation); converter.mapInputSocket(inputSocket, operation->getInputSocket(0)); converter.mapOutputSocket(outputSocket, operation->getOutputSocket(0)); diff --git a/source/blender/compositor/nodes/COM_GammaNode.cpp b/source/blender/compositor/nodes/COM_GammaNode.cpp index 383231ff326..fdee02b2d02 100644 --- a/source/blender/compositor/nodes/COM_GammaNode.cpp +++ b/source/blender/compositor/nodes/COM_GammaNode.cpp @@ -33,7 +33,7 @@ void GammaNode::convertToOperations(NodeConverter &converter, const CompositorCo { GammaOperation *operation = new GammaOperation(); converter.addOperation(operation); - + converter.mapInputSocket(getInputSocket(0), operation->getInputSocket(0)); converter.mapInputSocket(getInputSocket(1), operation->getInputSocket(1)); converter.mapOutputSocket(getOutputSocket(0), operation->getOutputSocket(0)); diff --git a/source/blender/compositor/nodes/COM_GlareNode.cpp b/source/blender/compositor/nodes/COM_GlareNode.cpp index b52ef9ebb33..2e012b097b3 100644 --- a/source/blender/compositor/nodes/COM_GlareNode.cpp +++ b/source/blender/compositor/nodes/COM_GlareNode.cpp @@ -40,7 +40,7 @@ void GlareNode::convertToOperations(NodeConverter &converter, const CompositorCo { bNode *node = this->getbNode(); NodeGlare *glare = (NodeGlare *)node->storage; - + GlareBaseOperation *glareoperation = NULL; switch (glare->type) { default: @@ -59,17 +59,17 @@ void GlareNode::convertToOperations(NodeConverter &converter, const CompositorCo } BLI_assert(glareoperation); glareoperation->setGlareSettings(glare); - + GlareThresholdOperation *thresholdOperation = new GlareThresholdOperation(); thresholdOperation->setGlareSettings(glare); - + SetValueOperation *mixvalueoperation = new SetValueOperation(); mixvalueoperation->setValue(0.5f + glare->mix * 0.5f); - + MixGlareOperation *mixoperation = new MixGlareOperation(); mixoperation->setResolutionInputSocketIndex(1); mixoperation->getInputSocket(2)->setResizeMode(COM_SC_FIT); - + converter.addOperation(glareoperation); converter.addOperation(thresholdOperation); converter.addOperation(mixvalueoperation); @@ -77,7 +77,7 @@ void GlareNode::convertToOperations(NodeConverter &converter, const CompositorCo converter.mapInputSocket(getInputSocket(0), thresholdOperation->getInputSocket(0)); converter.addLink(thresholdOperation->getOutputSocket(), glareoperation->getInputSocket(0)); - + converter.addLink(mixvalueoperation->getOutputSocket(), mixoperation->getInputSocket(0)); converter.mapInputSocket(getInputSocket(0), mixoperation->getInputSocket(1)); converter.addLink(glareoperation->getOutputSocket(), mixoperation->getInputSocket(2)); diff --git a/source/blender/compositor/nodes/COM_HueSaturationValueCorrectNode.cpp b/source/blender/compositor/nodes/COM_HueSaturationValueCorrectNode.cpp index 0c572c1ddc7..3542bc7f36e 100644 --- a/source/blender/compositor/nodes/COM_HueSaturationValueCorrectNode.cpp +++ b/source/blender/compositor/nodes/COM_HueSaturationValueCorrectNode.cpp @@ -42,17 +42,17 @@ void HueSaturationValueCorrectNode::convertToOperations(NodeConverter &converter NodeOutput *outputSocket = this->getOutputSocket(0); bNode *editorsnode = getbNode(); CurveMapping *storage = (CurveMapping *)editorsnode->storage; - + ConvertRGBToHSVOperation *rgbToHSV = new ConvertRGBToHSVOperation(); converter.addOperation(rgbToHSV); - + ConvertHSVToRGBOperation *hsvToRGB = new ConvertHSVToRGBOperation(); converter.addOperation(hsvToRGB); - + HueSaturationValueCorrectOperation *changeHSV = new HueSaturationValueCorrectOperation(); changeHSV->setCurveMapping(storage); converter.addOperation(changeHSV); - + MixBlendOperation *blend = new MixBlendOperation(); blend->setResolutionInputSocketIndex(1); converter.addOperation(blend); diff --git a/source/blender/compositor/nodes/COM_HueSaturationValueNode.cpp b/source/blender/compositor/nodes/COM_HueSaturationValueNode.cpp index b31fe7ac030..7da8c5b3d3d 100644 --- a/source/blender/compositor/nodes/COM_HueSaturationValueNode.cpp +++ b/source/blender/compositor/nodes/COM_HueSaturationValueNode.cpp @@ -46,16 +46,16 @@ void HueSaturationValueNode::convertToOperations(NodeConverter &converter, const ConvertRGBToHSVOperation *rgbToHSV = new ConvertRGBToHSVOperation(); converter.addOperation(rgbToHSV); - + ConvertHSVToRGBOperation *hsvToRGB = new ConvertHSVToRGBOperation(); converter.addOperation(hsvToRGB); - + ChangeHSVOperation *changeHSV = new ChangeHSVOperation(); converter.mapInputSocket(hueSocket, changeHSV->getInputSocket(1)); converter.mapInputSocket(saturationSocket, changeHSV->getInputSocket(2)); converter.mapInputSocket(valueSocket, changeHSV->getInputSocket(3)); converter.addOperation(changeHSV); - + MixBlendOperation *blend = new MixBlendOperation(); blend->setResolutionInputSocketIndex(1); converter.addOperation(blend); diff --git a/source/blender/compositor/nodes/COM_IDMaskNode.cpp b/source/blender/compositor/nodes/COM_IDMaskNode.cpp index 47137352226..ab5931ea566 100644 --- a/source/blender/compositor/nodes/COM_IDMaskNode.cpp +++ b/source/blender/compositor/nodes/COM_IDMaskNode.cpp @@ -32,12 +32,12 @@ IDMaskNode::IDMaskNode(bNode *editorNode) : Node(editorNode) void IDMaskNode::convertToOperations(NodeConverter &converter, const CompositorContext &context) const { bNode *bnode = this->getbNode(); - + IDMaskOperation *operation; operation = new IDMaskOperation(); operation->setObjectIndex(bnode->custom1); converter.addOperation(operation); - + converter.mapInputSocket(getInputSocket(0), operation->getInputSocket(0)); if (bnode->custom2 == 0 || context.getRenderData()->scemode & R_FULL_SAMPLE) { converter.mapOutputSocket(getOutputSocket(0), operation->getOutputSocket(0)); @@ -45,7 +45,7 @@ void IDMaskNode::convertToOperations(NodeConverter &converter, const CompositorC else { AntiAliasOperation *antiAliasOperation = new AntiAliasOperation(); converter.addOperation(antiAliasOperation); - + converter.addLink(operation->getOutputSocket(), antiAliasOperation->getInputSocket(0)); converter.mapOutputSocket(getOutputSocket(0), antiAliasOperation->getOutputSocket(0)); } diff --git a/source/blender/compositor/nodes/COM_ImageNode.cpp b/source/blender/compositor/nodes/COM_ImageNode.cpp index 337169ba748..36e71aa1203 100644 --- a/source/blender/compositor/nodes/COM_ImageNode.cpp +++ b/source/blender/compositor/nodes/COM_ImageNode.cpp @@ -61,10 +61,10 @@ NodeOperation *ImageNode::doMultilayerCheck(NodeConverter &converter, RenderLaye operation->setRenderLayer(rl); operation->setImageUser(user); operation->setFramenumber(framenumber); - + converter.addOperation(operation); converter.mapOutputSocket(outputSocket, operation->getOutputSocket()); - + return operation; } @@ -189,10 +189,10 @@ void ImageNode::convertToOperations(NodeConverter &converter, const CompositorCo operation->setRenderData(context.getRenderData()); operation->setViewName(context.getViewName()); converter.addOperation(operation); - + if (outputStraightAlpha) { NodeOperation *alphaConvertOperation = new ConvertPremulToStraightOperation(); - + converter.addOperation(alphaConvertOperation); converter.mapOutputSocket(outputImage, alphaConvertOperation->getOutputSocket()); converter.addLink(operation->getOutputSocket(0), alphaConvertOperation->getInputSocket(0)); @@ -200,10 +200,10 @@ void ImageNode::convertToOperations(NodeConverter &converter, const CompositorCo else { converter.mapOutputSocket(outputImage, operation->getOutputSocket()); } - + converter.addPreview(operation->getOutputSocket()); } - + if (numberOfOutputs > 1) { NodeOutput *alphaImage = this->getOutputSocket(1); ImageAlphaOperation *alphaOperation = new ImageAlphaOperation(); @@ -213,7 +213,7 @@ void ImageNode::convertToOperations(NodeConverter &converter, const CompositorCo alphaOperation->setRenderData(context.getRenderData()); alphaOperation->setViewName(context.getViewName()); converter.addOperation(alphaOperation); - + converter.mapOutputSocket(alphaImage, alphaOperation->getOutputSocket()); } if (numberOfOutputs > 2) { @@ -225,7 +225,7 @@ void ImageNode::convertToOperations(NodeConverter &converter, const CompositorCo depthOperation->setRenderData(context.getRenderData()); depthOperation->setViewName(context.getViewName()); converter.addOperation(depthOperation); - + converter.mapOutputSocket(depthImage, depthOperation->getOutputSocket()); } if (numberOfOutputs > 3) { diff --git a/source/blender/compositor/nodes/COM_InpaintNode.cpp b/source/blender/compositor/nodes/COM_InpaintNode.cpp index 17cc2fa653e..41cc65e2fee 100644 --- a/source/blender/compositor/nodes/COM_InpaintNode.cpp +++ b/source/blender/compositor/nodes/COM_InpaintNode.cpp @@ -33,7 +33,7 @@ InpaintNode::InpaintNode(bNode *editorNode) : Node(editorNode) void InpaintNode::convertToOperations(NodeConverter &converter, const CompositorContext &/*context*/) const { - + bNode *editorNode = this->getbNode(); /* if (editorNode->custom1 == CMP_NODE_INPAINT_SIMPLE) { */ @@ -41,7 +41,7 @@ void InpaintNode::convertToOperations(NodeConverter &converter, const Compositor InpaintSimpleOperation *operation = new InpaintSimpleOperation(); operation->setIterations(editorNode->custom2); converter.addOperation(operation); - + converter.mapInputSocket(getInputSocket(0), operation->getInputSocket(0)); converter.mapOutputSocket(getOutputSocket(0), operation->getOutputSocket(0)); } diff --git a/source/blender/compositor/nodes/COM_InvertNode.cpp b/source/blender/compositor/nodes/COM_InvertNode.cpp index ebdb2cdb7c5..c83db3fe78f 100644 --- a/source/blender/compositor/nodes/COM_InvertNode.cpp +++ b/source/blender/compositor/nodes/COM_InvertNode.cpp @@ -37,7 +37,7 @@ void InvertNode::convertToOperations(NodeConverter &converter, const CompositorC operation->setColor(node->custom1 & CMP_CHAN_RGB); operation->setAlpha(node->custom1 & CMP_CHAN_A); converter.addOperation(operation); - + converter.mapInputSocket(getInputSocket(0), operation->getInputSocket(0)); converter.mapInputSocket(getInputSocket(1), operation->getInputSocket(1)); converter.mapOutputSocket(getOutputSocket(0), operation->getOutputSocket(0)); diff --git a/source/blender/compositor/nodes/COM_KeyingNode.cpp b/source/blender/compositor/nodes/COM_KeyingNode.cpp index ddfba07d9f7..261bdb93adb 100644 --- a/source/blender/compositor/nodes/COM_KeyingNode.cpp +++ b/source/blender/compositor/nodes/COM_KeyingNode.cpp @@ -52,9 +52,9 @@ NodeOperationOutput *KeyingNode::setupPreBlur(NodeConverter &converter, NodeInpu ConvertRGBToYCCOperation *convertRGBToYCCOperation = new ConvertRGBToYCCOperation(); convertRGBToYCCOperation->setMode(BLI_YCC_ITU_BT709); converter.addOperation(convertRGBToYCCOperation); - + converter.mapInputSocket(inputImage, convertRGBToYCCOperation->getInputSocket(0)); - + CombineChannelsOperation *combineOperation = new CombineChannelsOperation(); converter.addOperation(combineOperation); @@ -62,9 +62,9 @@ NodeOperationOutput *KeyingNode::setupPreBlur(NodeConverter &converter, NodeInpu SeparateChannelOperation *separateOperation = new SeparateChannelOperation(); separateOperation->setChannel(channel); converter.addOperation(separateOperation); - + converter.addLink(convertRGBToYCCOperation->getOutputSocket(0), separateOperation->getInputSocket(0)); - + if (channel == 0 || channel == 3) { converter.addLink(separateOperation->getOutputSocket(0), combineOperation->getInputSocket(channel)); } @@ -73,24 +73,24 @@ NodeOperationOutput *KeyingNode::setupPreBlur(NodeConverter &converter, NodeInpu blurXOperation->setSize(size); blurXOperation->setAxis(KeyingBlurOperation::BLUR_AXIS_X); converter.addOperation(blurXOperation); - + KeyingBlurOperation *blurYOperation = new KeyingBlurOperation(); blurYOperation->setSize(size); blurYOperation->setAxis(KeyingBlurOperation::BLUR_AXIS_Y); converter.addOperation(blurYOperation); - + converter.addLink(separateOperation->getOutputSocket(), blurXOperation->getInputSocket(0)); converter.addLink(blurXOperation->getOutputSocket(), blurYOperation->getInputSocket(0)); converter.addLink(blurYOperation->getOutputSocket(0), combineOperation->getInputSocket(channel)); } } - + ConvertYCCToRGBOperation *convertYCCToRGBOperation = new ConvertYCCToRGBOperation(); convertYCCToRGBOperation->setMode(BLI_YCC_ITU_BT709); converter.addOperation(convertYCCToRGBOperation); - + converter.addLink(combineOperation->getOutputSocket(0), convertYCCToRGBOperation->getInputSocket(0)); - + return convertYCCToRGBOperation->getOutputSocket(0); } @@ -100,15 +100,15 @@ NodeOperationOutput *KeyingNode::setupPostBlur(NodeConverter &converter, NodeOpe blurXOperation->setSize(size); blurXOperation->setAxis(KeyingBlurOperation::BLUR_AXIS_X); converter.addOperation(blurXOperation); - + KeyingBlurOperation *blurYOperation = new KeyingBlurOperation(); blurYOperation->setSize(size); blurYOperation->setAxis(KeyingBlurOperation::BLUR_AXIS_Y); converter.addOperation(blurYOperation); - + converter.addLink(postBlurInput, blurXOperation->getInputSocket(0)); converter.addLink(blurXOperation->getOutputSocket(), blurYOperation->getInputSocket(0)); - + return blurYOperation->getOutputSocket(); } @@ -124,9 +124,9 @@ NodeOperationOutput *KeyingNode::setupDilateErode(NodeConverter &converter, Node dilateErodeOperation->setDistance(-distance); } converter.addOperation(dilateErodeOperation); - + converter.addLink(dilateErodeInput, dilateErodeOperation->getInputSocket(0)); - + return dilateErodeOperation->getOutputSocket(0); } @@ -154,7 +154,7 @@ NodeOperationOutput *KeyingNode::setupFeather(NodeConverter &converter, const Co operationx->setSubtract(distance < 0); operationx->setFalloff(falloff); converter.addOperation(operationx); - + GaussianAlphaYBlurOperation *operationy = new GaussianAlphaYBlurOperation(); operationy->setData(&data); operationy->setQuality(quality); @@ -176,10 +176,10 @@ NodeOperationOutput *KeyingNode::setupDespill(NodeConverter &converter, NodeOper despillOperation->setDespillFactor(factor); despillOperation->setColorBalance(colorBalance); converter.addOperation(despillOperation); - + converter.addLink(despillInput, despillOperation->getInputSocket(0)); converter.mapInputSocket(inputScreen, despillOperation->getInputSocket(1)); - + return despillOperation->getOutputSocket(0); } @@ -193,9 +193,9 @@ NodeOperationOutput *KeyingNode::setupClip(NodeConverter &converter, NodeOperati clipOperation->setClipWhite(clipWhite); clipOperation->setIsEdgeMatte(edgeMatte); converter.addOperation(clipOperation); - + converter.addLink(clipInput, clipOperation->getInputSocket(0)); - + return clipOperation->getOutputSocket(0); } @@ -203,7 +203,7 @@ void KeyingNode::convertToOperations(NodeConverter &converter, const CompositorC { bNode *editorNode = this->getbNode(); NodeKeyingData *keying_data = (NodeKeyingData *) editorNode->storage; - + NodeInput *inputImage = this->getInputSocket(0); NodeInput *inputScreen = this->getInputSocket(1); NodeInput *inputGarbageMatte = this->getInputSocket(2); @@ -212,14 +212,14 @@ void KeyingNode::convertToOperations(NodeConverter &converter, const CompositorC NodeOutput *outputMatte = this->getOutputSocket(1); NodeOutput *outputEdges = this->getOutputSocket(2); NodeOperationOutput *postprocessedMatte = NULL, *postprocessedImage = NULL, *edgesMatte = NULL; - + /* keying operation */ KeyingOperation *keyingOperation = new KeyingOperation(); keyingOperation->setScreenBalance(keying_data->screen_balance); converter.addOperation(keyingOperation); - + converter.mapInputSocket(inputScreen, keyingOperation->getInputSocket(1)); - + if (keying_data->blur_pre) { /* chroma preblur operation for input of keying operation */ NodeOperationOutput *preBluredImage = setupPreBlur(converter, inputImage, keying_data->blur_pre); @@ -228,53 +228,53 @@ void KeyingNode::convertToOperations(NodeConverter &converter, const CompositorC else { converter.mapInputSocket(inputImage, keyingOperation->getInputSocket(0)); } - + postprocessedMatte = keyingOperation->getOutputSocket(); - + /* black / white clipping */ if (keying_data->clip_black > 0.0f || keying_data->clip_white < 1.0f) { postprocessedMatte = setupClip(converter, postprocessedMatte, keying_data->edge_kernel_radius, keying_data->edge_kernel_tolerance, keying_data->clip_black, keying_data->clip_white, false); } - + /* output edge matte */ edgesMatte = setupClip(converter, postprocessedMatte, keying_data->edge_kernel_radius, keying_data->edge_kernel_tolerance, keying_data->clip_black, keying_data->clip_white, true); - + /* apply garbage matte */ if (inputGarbageMatte->isLinked()) { SetValueOperation *valueOperation = new SetValueOperation(); valueOperation->setValue(1.0f); converter.addOperation(valueOperation); - + MathSubtractOperation *subtractOperation = new MathSubtractOperation(); converter.addOperation(subtractOperation); - + MathMinimumOperation *minOperation = new MathMinimumOperation(); converter.addOperation(minOperation); - + converter.addLink(valueOperation->getOutputSocket(), subtractOperation->getInputSocket(0)); converter.mapInputSocket(inputGarbageMatte, subtractOperation->getInputSocket(1)); - + converter.addLink(subtractOperation->getOutputSocket(), minOperation->getInputSocket(0)); converter.addLink(postprocessedMatte, minOperation->getInputSocket(1)); - + postprocessedMatte = minOperation->getOutputSocket(); } - + /* apply core matte */ if (inputCoreMatte->isLinked()) { MathMaximumOperation *maxOperation = new MathMaximumOperation(); converter.addOperation(maxOperation); - + converter.mapInputSocket(inputCoreMatte, maxOperation->getInputSocket(0)); converter.addLink(postprocessedMatte, maxOperation->getInputSocket(1)); - + postprocessedMatte = maxOperation->getOutputSocket(); } - + /* apply blur on matte if needed */ if (keying_data->blur_post) postprocessedMatte = setupPostBlur(converter, postprocessedMatte, keying_data->blur_post); @@ -293,7 +293,7 @@ void KeyingNode::convertToOperations(NodeConverter &converter, const CompositorC /* set alpha channel to output image */ SetAlphaOperation *alphaOperation = new SetAlphaOperation(); converter.addOperation(alphaOperation); - + converter.mapInputSocket(inputImage, alphaOperation->getInputSocket(0)); converter.addLink(postprocessedMatte, alphaOperation->getInputSocket(1)); diff --git a/source/blender/compositor/nodes/COM_KeyingScreenNode.cpp b/source/blender/compositor/nodes/COM_KeyingScreenNode.cpp index 70b3b696e37..df9668883e8 100644 --- a/source/blender/compositor/nodes/COM_KeyingScreenNode.cpp +++ b/source/blender/compositor/nodes/COM_KeyingScreenNode.cpp @@ -39,15 +39,15 @@ void KeyingScreenNode::convertToOperations(NodeConverter &converter, const Compo bNode *editorNode = this->getbNode(); MovieClip *clip = (MovieClip *) editorNode->id; NodeKeyingScreenData *keyingscreen_data = (NodeKeyingScreenData *) editorNode->storage; - + NodeOutput *outputScreen = this->getOutputSocket(0); - + // always connect the output image KeyingScreenOperation *operation = new KeyingScreenOperation(); operation->setMovieClip(clip); operation->setTrackingObject(keyingscreen_data->tracking_object); operation->setFramenumber(context.getFramenumber()); converter.addOperation(operation); - + converter.mapOutputSocket(outputScreen, operation->getOutputSocket()); } diff --git a/source/blender/compositor/nodes/COM_LensDistortionNode.cpp b/source/blender/compositor/nodes/COM_LensDistortionNode.cpp index b6cc2acb9a6..2bad80839e1 100644 --- a/source/blender/compositor/nodes/COM_LensDistortionNode.cpp +++ b/source/blender/compositor/nodes/COM_LensDistortionNode.cpp @@ -37,7 +37,7 @@ void LensDistortionNode::convertToOperations(NodeConverter &converter, const Com if (data->proj) { ProjectorLensDistortionOperation *operation = new ProjectorLensDistortionOperation(); converter.addOperation(operation); - + converter.mapInputSocket(getInputSocket(0), operation->getInputSocket(0)); converter.mapInputSocket(getInputSocket(2), operation->getInputSocket(1)); converter.mapOutputSocket(getOutputSocket(0), operation->getOutputSocket(0)); @@ -51,9 +51,9 @@ void LensDistortionNode::convertToOperations(NodeConverter &converter, const Com operation->setDistortion(getInputSocket(1)->getEditorValueFloat()); if (!getInputSocket(2)->isLinked()) operation->setDispersion(getInputSocket(2)->getEditorValueFloat()); - + converter.addOperation(operation); - + converter.mapInputSocket(getInputSocket(0), operation->getInputSocket(0)); converter.mapInputSocket(getInputSocket(1), operation->getInputSocket(1)); converter.mapInputSocket(getInputSocket(2), operation->getInputSocket(2)); diff --git a/source/blender/compositor/nodes/COM_LuminanceMatteNode.cpp b/source/blender/compositor/nodes/COM_LuminanceMatteNode.cpp index de6ad3df030..12f3b1bc410 100644 --- a/source/blender/compositor/nodes/COM_LuminanceMatteNode.cpp +++ b/source/blender/compositor/nodes/COM_LuminanceMatteNode.cpp @@ -46,10 +46,10 @@ void LuminanceMatteNode::convertToOperations(NodeConverter &converter, const Com SetAlphaOperation *operation = new SetAlphaOperation(); converter.addOperation(operation); - + converter.mapInputSocket(inputSocket, operation->getInputSocket(0)); converter.addLink(operationSet->getOutputSocket(), operation->getInputSocket(1)); converter.mapOutputSocket(outputSocketImage, operation->getOutputSocket()); - + converter.addPreview(operation->getOutputSocket()); } diff --git a/source/blender/compositor/nodes/COM_MapRangeNode.cpp b/source/blender/compositor/nodes/COM_MapRangeNode.cpp index 81ee4f0d7a9..6590cf04306 100644 --- a/source/blender/compositor/nodes/COM_MapRangeNode.cpp +++ b/source/blender/compositor/nodes/COM_MapRangeNode.cpp @@ -38,11 +38,11 @@ void MapRangeNode::convertToOperations(NodeConverter &converter, const Composito NodeInput *destMinSocket = this->getInputSocket(3); NodeInput *destMaxSocket = this->getInputSocket(4); NodeOutput *outputSocket = this->getOutputSocket(0); - + MapRangeOperation *operation = new MapRangeOperation(); operation->setUseClamp(this->getbNode()->custom1); converter.addOperation(operation); - + converter.mapInputSocket(valueSocket, operation->getInputSocket(0)); converter.mapInputSocket(sourceMinSocket, operation->getInputSocket(1)); converter.mapInputSocket(sourceMaxSocket, operation->getInputSocket(2)); diff --git a/source/blender/compositor/nodes/COM_MapUVNode.cpp b/source/blender/compositor/nodes/COM_MapUVNode.cpp index c593805c940..dc477ad9da0 100644 --- a/source/blender/compositor/nodes/COM_MapUVNode.cpp +++ b/source/blender/compositor/nodes/COM_MapUVNode.cpp @@ -31,7 +31,7 @@ MapUVNode::MapUVNode(bNode *editorNode) : Node(editorNode) void MapUVNode::convertToOperations(NodeConverter &converter, const CompositorContext &/*context*/) const { bNode *node = this->getbNode(); - + MapUVOperation *operation = new MapUVOperation(); operation->setAlpha((float)node->custom1); operation->setResolutionInputSocketIndex(1); diff --git a/source/blender/compositor/nodes/COM_MapValueNode.cpp b/source/blender/compositor/nodes/COM_MapValueNode.cpp index 9a4c4880b62..6276548c7a7 100644 --- a/source/blender/compositor/nodes/COM_MapValueNode.cpp +++ b/source/blender/compositor/nodes/COM_MapValueNode.cpp @@ -33,14 +33,14 @@ MapValueNode::MapValueNode(bNode *editorNode) : Node(editorNode) void MapValueNode::convertToOperations(NodeConverter &converter, const CompositorContext &/*context*/) const { TexMapping *storage = (TexMapping *)this->getbNode()->storage; - + NodeInput *colorSocket = this->getInputSocket(0); NodeOutput *valueSocket = this->getOutputSocket(0); - + MapValueOperation *convertProg = new MapValueOperation(); convertProg->setSettings(storage); converter.addOperation(convertProg); - + converter.mapInputSocket(colorSocket, convertProg->getInputSocket(0)); converter.mapOutputSocket(valueSocket, convertProg->getOutputSocket(0)); } diff --git a/source/blender/compositor/nodes/COM_MathNode.cpp b/source/blender/compositor/nodes/COM_MathNode.cpp index e9bed136a37..d16300ebff4 100644 --- a/source/blender/compositor/nodes/COM_MathNode.cpp +++ b/source/blender/compositor/nodes/COM_MathNode.cpp @@ -27,7 +27,7 @@ void MathNode::convertToOperations(NodeConverter &converter, const CompositorContext &/*context*/) const { MathBaseOperation *operation = NULL; - + switch (this->getbNode()->custom1) { case NODE_MATH_ADD: operation = new MathAddOperation(); @@ -90,12 +90,12 @@ void MathNode::convertToOperations(NodeConverter &converter, const CompositorCon operation = new MathArcTan2Operation(); break; } - + if (operation) { bool useClamp = getbNode()->custom2; operation->setUseClamp(useClamp); converter.addOperation(operation); - + converter.mapInputSocket(getInputSocket(0), operation->getInputSocket(0)); converter.mapInputSocket(getInputSocket(1), operation->getInputSocket(1)); converter.mapOutputSocket(getOutputSocket(0), operation->getOutputSocket()); diff --git a/source/blender/compositor/nodes/COM_MixNode.cpp b/source/blender/compositor/nodes/COM_MixNode.cpp index e807365d9db..e0af0106513 100644 --- a/source/blender/compositor/nodes/COM_MixNode.cpp +++ b/source/blender/compositor/nodes/COM_MixNode.cpp @@ -43,7 +43,7 @@ void MixNode::convertToOperations(NodeConverter &converter, const CompositorCont bNode *editorNode = this->getbNode(); bool useAlphaPremultiply = (this->getbNode()->custom2 & 1) != 0; bool useClamp = (this->getbNode()->custom2 & 2) != 0; - + MixBaseOperation *convertProg; switch (editorNode->custom1) { case MA_RAMP_ADD: @@ -106,11 +106,11 @@ void MixNode::convertToOperations(NodeConverter &converter, const CompositorCont convertProg->setUseValueAlphaMultiply(useAlphaPremultiply); convertProg->setUseClamp(useClamp); converter.addOperation(convertProg); - + converter.mapInputSocket(valueSocket, convertProg->getInputSocket(0)); converter.mapInputSocket(color1Socket, convertProg->getInputSocket(1)); converter.mapInputSocket(color2Socket, convertProg->getInputSocket(2)); converter.mapOutputSocket(outputSocket, convertProg->getOutputSocket(0)); - + converter.addPreview(convertProg->getOutputSocket(0)); } diff --git a/source/blender/compositor/nodes/COM_MovieClipNode.cpp b/source/blender/compositor/nodes/COM_MovieClipNode.cpp index 269d7f2cafe..18e6f811fff 100644 --- a/source/blender/compositor/nodes/COM_MovieClipNode.cpp +++ b/source/blender/compositor/nodes/COM_MovieClipNode.cpp @@ -46,7 +46,7 @@ void MovieClipNode::convertToOperations(NodeConverter &converter, const Composit NodeOutput *offsetYMovieClip = this->getOutputSocket(3); NodeOutput *scaleMovieClip = this->getOutputSocket(4); NodeOutput *angleMovieClip = this->getOutputSocket(5); - + bNode *editorNode = this->getbNode(); MovieClip *movieClip = (MovieClip *)editorNode->id; MovieClipUser *movieClipUser = (MovieClipUser *)editorNode->storage; @@ -59,7 +59,7 @@ void MovieClipNode::convertToOperations(NodeConverter &converter, const Composit else ibuf = BKE_movieclip_get_ibuf_flag(movieClip, movieClipUser, movieClip->flag, MOVIECLIP_CACHE_SKIP); } - + // always connect the output image MovieClipOperation *operation = new MovieClipOperation(); operation->setMovieClip(movieClip); @@ -76,7 +76,7 @@ void MovieClipNode::convertToOperations(NodeConverter &converter, const Composit alphaOperation->setMovieClipUser(movieClipUser); alphaOperation->setFramenumber(context.getFramenumber()); alphaOperation->setCacheFrame(cacheFrame); - + converter.addOperation(alphaOperation); converter.mapOutputSocket(alphaMovieClip, alphaOperation->getOutputSocket()); @@ -99,7 +99,7 @@ void MovieClipNode::convertToOperations(NodeConverter &converter, const Composit converter.addOutputValue(offsetYMovieClip, loc[1]); converter.addOutputValue(scaleMovieClip, scale); converter.addOutputValue(angleMovieClip, angle); - + if (ibuf) { IMB_freeImBuf(ibuf); } diff --git a/source/blender/compositor/nodes/COM_MovieDistortionNode.cpp b/source/blender/compositor/nodes/COM_MovieDistortionNode.cpp index c4277354b43..e3009e068ab 100644 --- a/source/blender/compositor/nodes/COM_MovieDistortionNode.cpp +++ b/source/blender/compositor/nodes/COM_MovieDistortionNode.cpp @@ -35,10 +35,10 @@ void MovieDistortionNode::convertToOperations(NodeConverter &converter, const Co { bNode *bnode = this->getbNode(); MovieClip *clip = (MovieClip *)bnode->id; - + NodeInput *inputSocket = this->getInputSocket(0); NodeOutput *outputSocket = this->getOutputSocket(0); - + MovieDistortionOperation *operation = new MovieDistortionOperation(bnode->custom1 == 1); operation->setMovieClip(clip); operation->setFramenumber(context.getFramenumber()); diff --git a/source/blender/compositor/nodes/COM_NormalNode.cpp b/source/blender/compositor/nodes/COM_NormalNode.cpp index bde5a126325..64231d116fa 100644 --- a/source/blender/compositor/nodes/COM_NormalNode.cpp +++ b/source/blender/compositor/nodes/COM_NormalNode.cpp @@ -36,7 +36,7 @@ void NormalNode::convertToOperations(NodeConverter &converter, const CompositorC NodeInput *inputSocket = this->getInputSocket(0); NodeOutput *outputSocket = this->getOutputSocket(0); NodeOutput *outputSocketDotproduct = this->getOutputSocket(1); - + SetVectorOperation *operationSet = new SetVectorOperation(); float normal[3]; outputSocket->getEditorValueVector(normal); @@ -47,12 +47,12 @@ void NormalNode::convertToOperations(NodeConverter &converter, const CompositorC operationSet->setZ(normal[2]); operationSet->setW(0.0f); converter.addOperation(operationSet); - + converter.mapOutputSocket(outputSocket, operationSet->getOutputSocket(0)); - + DotproductOperation *operation = new DotproductOperation(); converter.addOperation(operation); - + converter.mapInputSocket(inputSocket, operation->getInputSocket(0)); converter.addLink(operationSet->getOutputSocket(0), operation->getInputSocket(1)); converter.mapOutputSocket(outputSocketDotproduct, operation->getOutputSocket(0)); diff --git a/source/blender/compositor/nodes/COM_OutputFileNode.cpp b/source/blender/compositor/nodes/COM_OutputFileNode.cpp index 46e7f7fe790..5a7e5e2c623 100644 --- a/source/blender/compositor/nodes/COM_OutputFileNode.cpp +++ b/source/blender/compositor/nodes/COM_OutputFileNode.cpp @@ -39,7 +39,7 @@ void OutputFileNode::convertToOperations(NodeConverter &converter, const Composi { NodeImageMultiFile *storage = (NodeImageMultiFile *)this->getbNode()->storage; const bool is_multiview = (context.getRenderData()->scemode & R_MULTIVIEW) != 0; - + if (!context.isRendering()) { /* only output files when rendering a sequence - * otherwise, it overwrites the output files just @@ -70,12 +70,12 @@ void OutputFileNode::convertToOperations(NodeConverter &converter, const Composi for (int i = 0; i < num_inputs; ++i) { NodeInput *input = getInputSocket(i); NodeImageMultiFileSocket *sockdata = (NodeImageMultiFileSocket *)input->getbNodeSocket()->storage; - + /* note: layer becomes an empty placeholder if the input is not linked */ outputOperation->add_layer(sockdata->layer, input->getDataType(), input->isLinked()); - + converter.mapInputSocket(input, outputOperation->getInputSocket(i)); - + if (!previewAdded) { converter.addNodeInputPreview(input); previewAdded = true; diff --git a/source/blender/compositor/nodes/COM_PixelateNode.cpp b/source/blender/compositor/nodes/COM_PixelateNode.cpp index fe806dbf307..2b7ab0ea4e8 100644 --- a/source/blender/compositor/nodes/COM_PixelateNode.cpp +++ b/source/blender/compositor/nodes/COM_PixelateNode.cpp @@ -35,7 +35,7 @@ void PixelateNode::convertToOperations(NodeConverter &converter, const Composito NodeInput *inputSocket = this->getInputSocket(0); NodeOutput *outputSocket = this->getOutputSocket(0); DataType datatype = inputSocket->getDataType(); - + if (inputSocket->isLinked()) { NodeOutput *link = inputSocket->getLink(); datatype = link->getDataType(); @@ -43,7 +43,7 @@ void PixelateNode::convertToOperations(NodeConverter &converter, const Composito PixelateOperation *operation = new PixelateOperation(datatype); converter.addOperation(operation); - + converter.mapInputSocket(inputSocket, operation->getInputSocket(0)); converter.mapOutputSocket(outputSocket, operation->getOutputSocket(0)); } diff --git a/source/blender/compositor/nodes/COM_PlaneTrackDeformNode.cpp b/source/blender/compositor/nodes/COM_PlaneTrackDeformNode.cpp index 379b9f193e8..d8e4655b84e 100644 --- a/source/blender/compositor/nodes/COM_PlaneTrackDeformNode.cpp +++ b/source/blender/compositor/nodes/COM_PlaneTrackDeformNode.cpp @@ -42,13 +42,13 @@ void PlaneTrackDeformNode::convertToOperations(NodeConverter &converter, const C bNode *editorNode = this->getbNode(); MovieClip *clip = (MovieClip *) editorNode->id; NodePlaneTrackDeformData *data = (NodePlaneTrackDeformData *) editorNode->storage; - + int frame_number = context.getFramenumber(); - + NodeInput *input_image = this->getInputSocket(0); NodeOutput *output_warped_image = this->getOutputSocket(0); NodeOutput *output_plane = this->getOutputSocket(1); - + PlaneTrackWarpImageOperation *warp_image_operation = new PlaneTrackWarpImageOperation(); warp_image_operation->setMovieClip(clip); warp_image_operation->setTrackingObject(data->tracking_object); @@ -59,10 +59,10 @@ void PlaneTrackDeformNode::convertToOperations(NodeConverter &converter, const C warp_image_operation->setMotionBlurShutter(data->motion_blur_shutter); } converter.addOperation(warp_image_operation); - + converter.mapInputSocket(input_image, warp_image_operation->getInputSocket(0)); converter.mapOutputSocket(output_warped_image, warp_image_operation->getOutputSocket()); - + PlaneTrackMaskOperation *plane_mask_operation = new PlaneTrackMaskOperation(); plane_mask_operation->setMovieClip(clip); plane_mask_operation->setTrackingObject(data->tracking_object); @@ -73,6 +73,6 @@ void PlaneTrackDeformNode::convertToOperations(NodeConverter &converter, const C plane_mask_operation->setMotionBlurShutter(data->motion_blur_shutter); } converter.addOperation(plane_mask_operation); - + converter.mapOutputSocket(output_plane, plane_mask_operation->getOutputSocket()); } diff --git a/source/blender/compositor/nodes/COM_RotateNode.cpp b/source/blender/compositor/nodes/COM_RotateNode.cpp index 77638d66987..fe85d5db255 100644 --- a/source/blender/compositor/nodes/COM_RotateNode.cpp +++ b/source/blender/compositor/nodes/COM_RotateNode.cpp @@ -39,10 +39,10 @@ void RotateNode::convertToOperations(NodeConverter &converter, const CompositorC RotateOperation *operation = new RotateOperation(); SetSamplerOperation *sampler = new SetSamplerOperation(); sampler->setSampler((PixelSampler)this->getbNode()->custom1); - + converter.addOperation(sampler); converter.addOperation(operation); - + converter.addLink(sampler->getOutputSocket(), operation->getInputSocket(0)); converter.mapInputSocket(inputSocket, sampler->getInputSocket(0)); converter.mapInputSocket(inputDegreeSocket, operation->getInputSocket(1)); diff --git a/source/blender/compositor/nodes/COM_ScaleNode.cpp b/source/blender/compositor/nodes/COM_ScaleNode.cpp index ef4128a78b4..dc512684ce6 100644 --- a/source/blender/compositor/nodes/COM_ScaleNode.cpp +++ b/source/blender/compositor/nodes/COM_ScaleNode.cpp @@ -36,7 +36,7 @@ ScaleNode::ScaleNode(bNode *editorNode) : Node(editorNode) void ScaleNode::convertToOperations(NodeConverter &converter, const CompositorContext &context) const { bNode *bnode = this->getbNode(); - + NodeInput *inputSocket = this->getInputSocket(0); NodeInput *inputXSocket = this->getInputSocket(1); NodeInput *inputYSocket = this->getInputSocket(2); @@ -47,7 +47,7 @@ void ScaleNode::convertToOperations(NodeConverter &converter, const CompositorCo { ScaleOperation *operation = new ScaleOperation(); converter.addOperation(operation); - + converter.mapInputSocket(inputSocket, operation->getInputSocket(0)); converter.mapInputSocket(inputXSocket, operation->getInputSocket(1)); converter.mapInputSocket(inputYSocket, operation->getInputSocket(2)); @@ -62,10 +62,10 @@ void ScaleNode::convertToOperations(NodeConverter &converter, const CompositorCo SetValueOperation *scaleFactorOperation = new SetValueOperation(); scaleFactorOperation->setValue(context.getRenderData()->size / 100.0f); converter.addOperation(scaleFactorOperation); - + ScaleOperation *operation = new ScaleOperation(); converter.addOperation(operation); - + converter.mapInputSocket(inputSocket, operation->getInputSocket(0)); converter.addLink(scaleFactorOperation->getOutputSocket(), operation->getInputSocket(1)); converter.addLink(scaleFactorOperation->getOutputSocket(), operation->getInputSocket(2)); diff --git a/source/blender/compositor/nodes/COM_SeparateColorNode.cpp b/source/blender/compositor/nodes/COM_SeparateColorNode.cpp index 68fdaf01f5c..b3f9ab46f35 100644 --- a/source/blender/compositor/nodes/COM_SeparateColorNode.cpp +++ b/source/blender/compositor/nodes/COM_SeparateColorNode.cpp @@ -38,55 +38,55 @@ void SeparateColorNode::convertToOperations(NodeConverter &converter, const Comp NodeOutput *outputGSocket = this->getOutputSocket(1); NodeOutput *outputBSocket = this->getOutputSocket(2); NodeOutput *outputASocket = this->getOutputSocket(3); - + NodeOperation *color_conv = getColorConverter(context); if (color_conv) { converter.addOperation(color_conv); - + converter.mapInputSocket(imageSocket, color_conv->getInputSocket(0)); } - + { SeparateChannelOperation *operation = new SeparateChannelOperation(); operation->setChannel(0); converter.addOperation(operation); - + if (color_conv) converter.addLink(color_conv->getOutputSocket(), operation->getInputSocket(0)); else converter.mapInputSocket(imageSocket, operation->getInputSocket(0)); converter.mapOutputSocket(outputRSocket, operation->getOutputSocket(0)); } - + { SeparateChannelOperation *operation = new SeparateChannelOperation(); operation->setChannel(1); converter.addOperation(operation); - + if (color_conv) converter.addLink(color_conv->getOutputSocket(), operation->getInputSocket(0)); else converter.mapInputSocket(imageSocket, operation->getInputSocket(0)); converter.mapOutputSocket(outputGSocket, operation->getOutputSocket(0)); } - + { SeparateChannelOperation *operation = new SeparateChannelOperation(); operation->setChannel(2); converter.addOperation(operation); - + if (color_conv) converter.addLink(color_conv->getOutputSocket(), operation->getInputSocket(0)); else converter.mapInputSocket(imageSocket, operation->getInputSocket(0)); converter.mapOutputSocket(outputBSocket, operation->getOutputSocket(0)); } - + { SeparateChannelOperation *operation = new SeparateChannelOperation(); operation->setChannel(3); converter.addOperation(operation); - + if (color_conv) converter.addLink(color_conv->getOutputSocket(), operation->getInputSocket(0)); else diff --git a/source/blender/compositor/nodes/COM_SeparateColorNode.h b/source/blender/compositor/nodes/COM_SeparateColorNode.h index d378a311e73..0e47a98a1aa 100644 --- a/source/blender/compositor/nodes/COM_SeparateColorNode.h +++ b/source/blender/compositor/nodes/COM_SeparateColorNode.h @@ -30,7 +30,7 @@ class SeparateColorNode : public Node { public: SeparateColorNode(bNode *editorNode); void convertToOperations(NodeConverter &converter, const CompositorContext &context) const; - + protected: virtual NodeOperation *getColorConverter(const CompositorContext &context) const = 0; }; @@ -40,7 +40,7 @@ public: SeparateRGBANode(bNode *editorNode) : SeparateColorNode(editorNode) {} - + NodeOperation *getColorConverter(const CompositorContext &context) const; }; @@ -49,7 +49,7 @@ public: SeparateHSVANode(bNode *editorNode) : SeparateColorNode(editorNode) {} - + NodeOperation *getColorConverter(const CompositorContext &context) const; }; @@ -58,7 +58,7 @@ public: SeparateYCCANode(bNode *editorNode) : SeparateColorNode(editorNode) {} - + NodeOperation *getColorConverter(const CompositorContext &context) const; }; @@ -67,7 +67,7 @@ public: SeparateYUVANode(bNode *editorNode) : SeparateColorNode(editorNode) {} - + NodeOperation *getColorConverter(const CompositorContext &context) const; }; diff --git a/source/blender/compositor/nodes/COM_SetAlphaNode.cpp b/source/blender/compositor/nodes/COM_SetAlphaNode.cpp index 4c55a4bdc0a..b5d5bf9d9d9 100644 --- a/source/blender/compositor/nodes/COM_SetAlphaNode.cpp +++ b/source/blender/compositor/nodes/COM_SetAlphaNode.cpp @@ -27,13 +27,13 @@ void SetAlphaNode::convertToOperations(NodeConverter &converter, const CompositorContext &/*context*/) const { SetAlphaOperation *operation = new SetAlphaOperation(); - + if (!this->getInputSocket(0)->isLinked() && this->getInputSocket(1)->isLinked()) { operation->setResolutionInputSocketIndex(1); } - + converter.addOperation(operation); - + converter.mapInputSocket(getInputSocket(0), operation->getInputSocket(0)); converter.mapInputSocket(getInputSocket(1), operation->getInputSocket(1)); converter.mapOutputSocket(getOutputSocket(0), operation->getOutputSocket()); diff --git a/source/blender/compositor/nodes/COM_SocketProxyNode.cpp b/source/blender/compositor/nodes/COM_SocketProxyNode.cpp index c76b057577c..230c27dd9a0 100644 --- a/source/blender/compositor/nodes/COM_SocketProxyNode.cpp +++ b/source/blender/compositor/nodes/COM_SocketProxyNode.cpp @@ -72,14 +72,14 @@ void SocketBufferNode::convertToOperations(NodeConverter &converter, const Compo { NodeOutput *output = this->getOutputSocket(0); NodeInput *input = this->getInputSocket(0); - + DataType datatype = output->getDataType(); WriteBufferOperation *writeOperation = new WriteBufferOperation(datatype); ReadBufferOperation *readOperation = new ReadBufferOperation(datatype); readOperation->setMemoryProxy(writeOperation->getMemoryProxy()); converter.addOperation(writeOperation); converter.addOperation(readOperation); - + converter.mapInputSocket(input, writeOperation->getInputSocket(0)); converter.mapOutputSocket(output, readOperation->getOutputSocket()); } diff --git a/source/blender/compositor/nodes/COM_SocketProxyNode.h b/source/blender/compositor/nodes/COM_SocketProxyNode.h index 410cbf94842..faa458492cb 100644 --- a/source/blender/compositor/nodes/COM_SocketProxyNode.h +++ b/source/blender/compositor/nodes/COM_SocketProxyNode.h @@ -33,10 +33,10 @@ class SocketProxyNode : public Node { public: SocketProxyNode(bNode *editorNode, bNodeSocket *editorInput, bNodeSocket *editorOutput, bool use_conversion); void convertToOperations(NodeConverter &converter, const CompositorContext &context) const; - + bool getUseConversion() const { return m_use_conversion; } void setUseConversion(bool use_conversion) { m_use_conversion = use_conversion; } - + private: /** If true, the proxy will convert input and output data to/from the proxy socket types. */ bool m_use_conversion; diff --git a/source/blender/compositor/nodes/COM_Stabilize2dNode.cpp b/source/blender/compositor/nodes/COM_Stabilize2dNode.cpp index a575cf65b99..38b8a466369 100644 --- a/source/blender/compositor/nodes/COM_Stabilize2dNode.cpp +++ b/source/blender/compositor/nodes/COM_Stabilize2dNode.cpp @@ -44,7 +44,7 @@ void Stabilize2dNode::convertToOperations(NodeConverter &converter, const Compos NodeInput *imageInput = this->getInputSocket(0); MovieClip *clip = (MovieClip *)editorNode->id; bool invert = (editorNode->custom2 & CMP_NODEFLAG_STABILIZE_INVERSE) != 0; - + ScaleOperation *scaleOperation = new ScaleOperation(); scaleOperation->setSampler((PixelSampler)editorNode->custom1); RotateOperation *rotateOperation = new RotateOperation(); @@ -85,18 +85,18 @@ void Stabilize2dNode::convertToOperations(NodeConverter &converter, const Compos converter.addOperation(translateOperation); converter.addOperation(rotateOperation); converter.addOperation(psoperation); - + converter.mapInputSocket(imageInput, scaleOperation->getInputSocket(0)); converter.addLink(scaleAttribute->getOutputSocket(), scaleOperation->getInputSocket(1)); converter.addLink(scaleAttribute->getOutputSocket(), scaleOperation->getInputSocket(2)); - + converter.addLink(scaleOperation->getOutputSocket(), rotateOperation->getInputSocket(0)); converter.addLink(angleAttribute->getOutputSocket(), rotateOperation->getInputSocket(1)); converter.addLink(rotateOperation->getOutputSocket(), translateOperation->getInputSocket(0)); converter.addLink(xAttribute->getOutputSocket(), translateOperation->getInputSocket(1)); converter.addLink(yAttribute->getOutputSocket(), translateOperation->getInputSocket(2)); - + converter.addLink(translateOperation->getOutputSocket(), psoperation->getInputSocket(0)); converter.mapOutputSocket(getOutputSocket(), psoperation->getOutputSocket()); } diff --git a/source/blender/compositor/nodes/COM_SwitchNode.cpp b/source/blender/compositor/nodes/COM_SwitchNode.cpp index e0c12e4dbea..7e1eaabc886 100644 --- a/source/blender/compositor/nodes/COM_SwitchNode.cpp +++ b/source/blender/compositor/nodes/COM_SwitchNode.cpp @@ -30,12 +30,12 @@ SwitchNode::SwitchNode(bNode *editorNode) : Node(editorNode) void SwitchNode::convertToOperations(NodeConverter &converter, const CompositorContext &/*context*/) const { bool condition = this->getbNode()->custom1; - + NodeOperationOutput *result; if (!condition) result = converter.addInputProxy(getInputSocket(0), false); else result = converter.addInputProxy(getInputSocket(1), false); - + converter.mapOutputSocket(getOutputSocket(0), result); } diff --git a/source/blender/compositor/nodes/COM_TextureNode.cpp b/source/blender/compositor/nodes/COM_TextureNode.cpp index 411dea2925f..47b32f6e04d 100644 --- a/source/blender/compositor/nodes/COM_TextureNode.cpp +++ b/source/blender/compositor/nodes/COM_TextureNode.cpp @@ -40,11 +40,11 @@ void TextureNode::convertToOperations(NodeConverter &converter, const Compositor operation->setRenderData(context.getRenderData()); operation->setSceneColorManage(sceneColorManage); converter.addOperation(operation); - + converter.mapInputSocket(getInputSocket(0), operation->getInputSocket(0)); converter.mapInputSocket(getInputSocket(1), operation->getInputSocket(1)); converter.mapOutputSocket(getOutputSocket(1), operation->getOutputSocket()); - + converter.addPreview(operation->getOutputSocket()); TextureAlphaOperation *alphaOperation = new TextureAlphaOperation(); @@ -52,7 +52,7 @@ void TextureNode::convertToOperations(NodeConverter &converter, const Compositor alphaOperation->setRenderData(context.getRenderData()); alphaOperation->setSceneColorManage(sceneColorManage); converter.addOperation(alphaOperation); - + converter.mapInputSocket(getInputSocket(0), alphaOperation->getInputSocket(0)); converter.mapInputSocket(getInputSocket(1), alphaOperation->getInputSocket(1)); converter.mapOutputSocket(getOutputSocket(0), alphaOperation->getOutputSocket()); diff --git a/source/blender/compositor/nodes/COM_TimeNode.cpp b/source/blender/compositor/nodes/COM_TimeNode.cpp index 0185b85e772..883ff72229d 100644 --- a/source/blender/compositor/nodes/COM_TimeNode.cpp +++ b/source/blender/compositor/nodes/COM_TimeNode.cpp @@ -56,6 +56,6 @@ void TimeNode::convertToOperations(NodeConverter &converter, const CompositorCon fac = curvemapping_evaluateF((CurveMapping *)node->storage, 0, fac); operation->setValue(clamp_f(fac, 0.0f, 1.0f)); converter.addOperation(operation); - + converter.mapOutputSocket(getOutputSocket(0), operation->getOutputSocket()); } diff --git a/source/blender/compositor/nodes/COM_TonemapNode.cpp b/source/blender/compositor/nodes/COM_TonemapNode.cpp index 1ecc42a0a27..a01be6acb7b 100644 --- a/source/blender/compositor/nodes/COM_TonemapNode.cpp +++ b/source/blender/compositor/nodes/COM_TonemapNode.cpp @@ -32,11 +32,11 @@ TonemapNode::TonemapNode(bNode *editorNode) : Node(editorNode) void TonemapNode::convertToOperations(NodeConverter &converter, const CompositorContext &/*context*/) const { NodeTonemap *data = (NodeTonemap *)this->getbNode()->storage; - + TonemapOperation *operation = data->type == 1 ? new PhotoreceptorTonemapOperation() : new TonemapOperation(); operation->setData(data); converter.addOperation(operation); - + converter.mapInputSocket(getInputSocket(0), operation->getInputSocket(0)); converter.mapOutputSocket(getOutputSocket(0), operation->getOutputSocket(0)); } diff --git a/source/blender/compositor/nodes/COM_TrackPositionNode.cpp b/source/blender/compositor/nodes/COM_TrackPositionNode.cpp index 490f72b4aa1..cddb3557498 100644 --- a/source/blender/compositor/nodes/COM_TrackPositionNode.cpp +++ b/source/blender/compositor/nodes/COM_TrackPositionNode.cpp @@ -63,7 +63,7 @@ void TrackPositionNode::convertToOperations(NodeConverter &converter, const Comp bNode *editorNode = this->getbNode(); MovieClip *clip = (MovieClip *) editorNode->id; NodeTrackPosData *trackpos_data = (NodeTrackPosData *) editorNode->storage; - + NodeOutput *outputX = this->getOutputSocket(0); NodeOutput *outputY = this->getOutputSocket(1); NodeOutput *outputSpeed = this->getOutputSocket(2); diff --git a/source/blender/compositor/nodes/COM_TransformNode.cpp b/source/blender/compositor/nodes/COM_TransformNode.cpp index 5b772d1ce56..288f394a10f 100644 --- a/source/blender/compositor/nodes/COM_TransformNode.cpp +++ b/source/blender/compositor/nodes/COM_TransformNode.cpp @@ -40,32 +40,32 @@ void TransformNode::convertToOperations(NodeConverter &converter, const Composit NodeInput *yInput = this->getInputSocket(2); NodeInput *angleInput = this->getInputSocket(3); NodeInput *scaleInput = this->getInputSocket(4); - + ScaleOperation *scaleOperation = new ScaleOperation(); converter.addOperation(scaleOperation); - + RotateOperation *rotateOperation = new RotateOperation(); rotateOperation->setDoDegree2RadConversion(false); converter.addOperation(rotateOperation); - + TranslateOperation *translateOperation = new TranslateOperation(); converter.addOperation(translateOperation); - + SetSamplerOperation *sampler = new SetSamplerOperation(); sampler->setSampler((PixelSampler)this->getbNode()->custom1); converter.addOperation(sampler); - + converter.mapInputSocket(imageInput, sampler->getInputSocket(0)); converter.addLink(sampler->getOutputSocket(), scaleOperation->getInputSocket(0)); converter.mapInputSocket(scaleInput, scaleOperation->getInputSocket(1)); converter.mapInputSocket(scaleInput, scaleOperation->getInputSocket(2)); // xscale = yscale - + converter.addLink(scaleOperation->getOutputSocket(), rotateOperation->getInputSocket(0)); converter.mapInputSocket(angleInput, rotateOperation->getInputSocket(1)); - + converter.addLink(rotateOperation->getOutputSocket(), translateOperation->getInputSocket(0)); converter.mapInputSocket(xInput, translateOperation->getInputSocket(1)); converter.mapInputSocket(yInput, translateOperation->getInputSocket(2)); - + converter.mapOutputSocket(getOutputSocket(), translateOperation->getOutputSocket()); } diff --git a/source/blender/compositor/nodes/COM_TranslateNode.cpp b/source/blender/compositor/nodes/COM_TranslateNode.cpp index 0e658e09931..ac09b38951b 100644 --- a/source/blender/compositor/nodes/COM_TranslateNode.cpp +++ b/source/blender/compositor/nodes/COM_TranslateNode.cpp @@ -36,32 +36,32 @@ void TranslateNode::convertToOperations(NodeConverter &converter, const Composit { bNode *bnode = this->getbNode(); NodeTranslateData *data = (NodeTranslateData *)bnode->storage; - + NodeInput *inputSocket = this->getInputSocket(0); NodeInput *inputXSocket = this->getInputSocket(1); NodeInput *inputYSocket = this->getInputSocket(2); NodeOutput *outputSocket = this->getOutputSocket(0); - + TranslateOperation *operation = new TranslateOperation(); if (data->relative) { const RenderData *rd = context.getRenderData(); float fx = rd->xsch * rd->size / 100.0f; float fy = rd->ysch * rd->size / 100.0f; - + operation->setFactorXY(fx, fy); } - + converter.addOperation(operation); converter.mapInputSocket(inputXSocket, operation->getInputSocket(1)); converter.mapInputSocket(inputYSocket, operation->getInputSocket(2)); converter.mapOutputSocket(outputSocket, operation->getOutputSocket(0)); - + if (data->wrap_axis) { WriteBufferOperation *writeOperation = new WriteBufferOperation(COM_DT_COLOR); WrapOperation *wrapOperation = new WrapOperation(COM_DT_COLOR); wrapOperation->setMemoryProxy(writeOperation->getMemoryProxy()); wrapOperation->setWrapping(data->wrap_axis); - + converter.addOperation(writeOperation); converter.addOperation(wrapOperation); converter.mapInputSocket(inputSocket, writeOperation->getInputSocket(0)); diff --git a/source/blender/compositor/nodes/COM_ValueNode.cpp b/source/blender/compositor/nodes/COM_ValueNode.cpp index f2eef188861..b7484eb4ed6 100644 --- a/source/blender/compositor/nodes/COM_ValueNode.cpp +++ b/source/blender/compositor/nodes/COM_ValueNode.cpp @@ -35,6 +35,6 @@ void ValueNode::convertToOperations(NodeConverter &converter, const CompositorCo NodeOutput *output = this->getOutputSocket(0); operation->setValue(output->getEditorValueFloat()); converter.addOperation(operation); - + converter.mapOutputSocket(output, operation->getOutputSocket()); } diff --git a/source/blender/compositor/nodes/COM_VectorBlurNode.cpp b/source/blender/compositor/nodes/COM_VectorBlurNode.cpp index 5cfd83360c7..5a6b49c9bd1 100644 --- a/source/blender/compositor/nodes/COM_VectorBlurNode.cpp +++ b/source/blender/compositor/nodes/COM_VectorBlurNode.cpp @@ -33,12 +33,12 @@ void VectorBlurNode::convertToOperations(NodeConverter &converter, const Composi { bNode *node = this->getbNode(); NodeBlurData *vectorBlurSettings = (NodeBlurData *)node->storage; - + VectorBlurOperation *operation = new VectorBlurOperation(); operation->setVectorBlurSettings(vectorBlurSettings); operation->setQuality(context.getQuality()); converter.addOperation(operation); - + converter.mapInputSocket(getInputSocket(0), operation->getInputSocket(0)); converter.mapInputSocket(getInputSocket(1), operation->getInputSocket(1)); converter.mapInputSocket(getInputSocket(2), operation->getInputSocket(2)); diff --git a/source/blender/compositor/nodes/COM_VectorCurveNode.cpp b/source/blender/compositor/nodes/COM_VectorCurveNode.cpp index db7e1597bf3..dc4b2f66a0a 100644 --- a/source/blender/compositor/nodes/COM_VectorCurveNode.cpp +++ b/source/blender/compositor/nodes/COM_VectorCurveNode.cpp @@ -34,7 +34,7 @@ void VectorCurveNode::convertToOperations(NodeConverter &converter, const Compos VectorCurveOperation *operation = new VectorCurveOperation(); operation->setCurveMapping((CurveMapping *)this->getbNode()->storage); converter.addOperation(operation); - + converter.mapInputSocket(getInputSocket(0), operation->getInputSocket(0)); converter.mapOutputSocket(getOutputSocket(0), operation->getOutputSocket()); } diff --git a/source/blender/compositor/nodes/COM_ViewLevelsNode.cpp b/source/blender/compositor/nodes/COM_ViewLevelsNode.cpp index b7e4c9e8a1d..134ab5628ec 100644 --- a/source/blender/compositor/nodes/COM_ViewLevelsNode.cpp +++ b/source/blender/compositor/nodes/COM_ViewLevelsNode.cpp @@ -36,12 +36,12 @@ void ViewLevelsNode::convertToOperations(NodeConverter &converter, const Composi NodeInput *input = this->getInputSocket(0); if (input->isLinked()) { // add preview to inputSocket; - + /* calculate mean operation */ { CalculateMeanOperation *operation = new CalculateMeanOperation(); operation->setSetting(this->getbNode()->custom1); - + converter.addOperation(operation); converter.mapInputSocket(input, operation->getInputSocket(0)); converter.mapOutputSocket(this->getOutputSocket(0), operation->getOutputSocket()); @@ -51,7 +51,7 @@ void ViewLevelsNode::convertToOperations(NodeConverter &converter, const Composi { CalculateStandardDeviationOperation *operation = new CalculateStandardDeviationOperation(); operation->setSetting(this->getbNode()->custom1); - + converter.addOperation(operation); converter.mapInputSocket(input, operation->getInputSocket(0)); converter.mapOutputSocket(this->getOutputSocket(1), operation->getOutputSocket()); diff --git a/source/blender/compositor/nodes/COM_ZCombineNode.cpp b/source/blender/compositor/nodes/COM_ZCombineNode.cpp index c77bd031824..a5d42bb0333 100644 --- a/source/blender/compositor/nodes/COM_ZCombineNode.cpp +++ b/source/blender/compositor/nodes/COM_ZCombineNode.cpp @@ -43,16 +43,16 @@ void ZCombineNode::convertToOperations(NodeConverter &converter, const Composito operation = new ZCombineOperation(); } converter.addOperation(operation); - + converter.mapInputSocket(getInputSocket(0), operation->getInputSocket(0)); converter.mapInputSocket(getInputSocket(1), operation->getInputSocket(1)); converter.mapInputSocket(getInputSocket(2), operation->getInputSocket(2)); converter.mapInputSocket(getInputSocket(3), operation->getInputSocket(3)); converter.mapOutputSocket(getOutputSocket(0), operation->getOutputSocket()); - + MathMinimumOperation *zoperation = new MathMinimumOperation(); converter.addOperation(zoperation); - + converter.mapInputSocket(getInputSocket(1), zoperation->getInputSocket(0)); converter.mapInputSocket(getInputSocket(3), zoperation->getInputSocket(1)); converter.mapOutputSocket(getOutputSocket(1), zoperation->getOutputSocket()); @@ -65,14 +65,14 @@ void ZCombineNode::convertToOperations(NodeConverter &converter, const Composito if (this->getbNode()->custom1) { maskoperation = new MathGreaterThanOperation(); converter.addOperation(maskoperation); - + converter.mapInputSocket(getInputSocket(1), maskoperation->getInputSocket(0)); converter.mapInputSocket(getInputSocket(3), maskoperation->getInputSocket(1)); } else { maskoperation = new MathLessThanOperation(); converter.addOperation(maskoperation); - + converter.mapInputSocket(getInputSocket(1), maskoperation->getInputSocket(0)); converter.mapInputSocket(getInputSocket(3), maskoperation->getInputSocket(1)); } @@ -80,13 +80,13 @@ void ZCombineNode::convertToOperations(NodeConverter &converter, const Composito // step 2 anti alias mask bit of an expensive operation, but does the trick AntiAliasOperation *antialiasoperation = new AntiAliasOperation(); converter.addOperation(antialiasoperation); - + converter.addLink(maskoperation->getOutputSocket(), antialiasoperation->getInputSocket(0)); // use mask to blend between the input colors. ZCombineMaskOperation *zcombineoperation = this->getbNode()->custom1 ? new ZCombineMaskAlphaOperation() : new ZCombineMaskOperation(); converter.addOperation(zcombineoperation); - + converter.addLink(antialiasoperation->getOutputSocket(), zcombineoperation->getInputSocket(0)); converter.mapInputSocket(getInputSocket(0), zcombineoperation->getInputSocket(1)); converter.mapInputSocket(getInputSocket(2), zcombineoperation->getInputSocket(2)); @@ -94,7 +94,7 @@ void ZCombineNode::convertToOperations(NodeConverter &converter, const Composito MathMinimumOperation *zoperation = new MathMinimumOperation(); converter.addOperation(zoperation); - + converter.mapInputSocket(getInputSocket(1), zoperation->getInputSocket(0)); converter.mapInputSocket(getInputSocket(3), zoperation->getInputSocket(1)); converter.mapOutputSocket(getOutputSocket(1), zoperation->getOutputSocket()); diff --git a/source/blender/compositor/operations/COM_AlphaOverKeyOperation.cpp b/source/blender/compositor/operations/COM_AlphaOverKeyOperation.cpp index 928525f2594..e6ae9b5fc8b 100644 --- a/source/blender/compositor/operations/COM_AlphaOverKeyOperation.cpp +++ b/source/blender/compositor/operations/COM_AlphaOverKeyOperation.cpp @@ -32,11 +32,11 @@ void AlphaOverKeyOperation::executePixelSampled(float output[4], float x, float float inputColor1[4]; float inputOverColor[4]; float value[4]; - + this->m_inputValueOperation->readSampled(value, x, y, sampler); this->m_inputColor1Operation->readSampled(inputColor1, x, y, sampler); this->m_inputColor2Operation->readSampled(inputOverColor, x, y, sampler); - + if (inputOverColor[3] <= 0.0f) { copy_v4_v4(output, inputColor1); } @@ -46,7 +46,7 @@ void AlphaOverKeyOperation::executePixelSampled(float output[4], float x, float else { float premul = value[0] * inputOverColor[3]; float mul = 1.0f - premul; - + output[0] = (mul * inputColor1[0]) + premul * inputOverColor[0]; output[1] = (mul * inputColor1[1]) + premul * inputOverColor[1]; output[2] = (mul * inputColor1[2]) + premul * inputOverColor[2]; diff --git a/source/blender/compositor/operations/COM_AlphaOverKeyOperation.h b/source/blender/compositor/operations/COM_AlphaOverKeyOperation.h index 8e4a0c93202..144c60f2966 100644 --- a/source/blender/compositor/operations/COM_AlphaOverKeyOperation.h +++ b/source/blender/compositor/operations/COM_AlphaOverKeyOperation.h @@ -35,7 +35,7 @@ public: * Default constructor */ AlphaOverKeyOperation(); - + /** * the inner loop of this program */ diff --git a/source/blender/compositor/operations/COM_AlphaOverMixedOperation.cpp b/source/blender/compositor/operations/COM_AlphaOverMixedOperation.cpp index 990ec5f5370..748b5c63409 100644 --- a/source/blender/compositor/operations/COM_AlphaOverMixedOperation.cpp +++ b/source/blender/compositor/operations/COM_AlphaOverMixedOperation.cpp @@ -32,11 +32,11 @@ void AlphaOverMixedOperation::executePixelSampled(float output[4], float x, floa float inputColor1[4]; float inputOverColor[4]; float value[4]; - + this->m_inputValueOperation->readSampled(value, x, y, sampler); this->m_inputColor1Operation->readSampled(inputColor1, x, y, sampler); this->m_inputColor2Operation->readSampled(inputOverColor, x, y, sampler); - + if (inputOverColor[3] <= 0.0f) { copy_v4_v4(output, inputColor1); } diff --git a/source/blender/compositor/operations/COM_AlphaOverMixedOperation.h b/source/blender/compositor/operations/COM_AlphaOverMixedOperation.h index 8c97b065792..a76bf12481d 100644 --- a/source/blender/compositor/operations/COM_AlphaOverMixedOperation.h +++ b/source/blender/compositor/operations/COM_AlphaOverMixedOperation.h @@ -37,12 +37,12 @@ public: * Default constructor */ AlphaOverMixedOperation(); - + /** * the inner loop of this program */ void executePixelSampled(float output[4], float x, float y, PixelSampler sampler); - + void setX(float x) { this->m_x = x; } }; #endif diff --git a/source/blender/compositor/operations/COM_AlphaOverPremultiplyOperation.cpp b/source/blender/compositor/operations/COM_AlphaOverPremultiplyOperation.cpp index 1f397e8a126..b6a1ab57b14 100644 --- a/source/blender/compositor/operations/COM_AlphaOverPremultiplyOperation.cpp +++ b/source/blender/compositor/operations/COM_AlphaOverPremultiplyOperation.cpp @@ -32,11 +32,11 @@ void AlphaOverPremultiplyOperation::executePixelSampled(float output[4], float x float inputColor1[4]; float inputOverColor[4]; float value[4]; - + this->m_inputValueOperation->readSampled(value, x, y, sampler); this->m_inputColor1Operation->readSampled(inputColor1, x, y, sampler); this->m_inputColor2Operation->readSampled(inputOverColor, x, y, sampler); - + /* Zero alpha values should still permit an add of RGB data */ if (inputOverColor[3] < 0.0f) { copy_v4_v4(output, inputColor1); @@ -46,7 +46,7 @@ void AlphaOverPremultiplyOperation::executePixelSampled(float output[4], float x } else { float mul = 1.0f - value[0] * inputOverColor[3]; - + output[0] = (mul * inputColor1[0]) + value[0] * inputOverColor[0]; output[1] = (mul * inputColor1[1]) + value[0] * inputOverColor[1]; output[2] = (mul * inputColor1[2]) + value[0] * inputOverColor[2]; diff --git a/source/blender/compositor/operations/COM_AlphaOverPremultiplyOperation.h b/source/blender/compositor/operations/COM_AlphaOverPremultiplyOperation.h index 1dad453ca4e..8551dba7b7c 100644 --- a/source/blender/compositor/operations/COM_AlphaOverPremultiplyOperation.h +++ b/source/blender/compositor/operations/COM_AlphaOverPremultiplyOperation.h @@ -35,7 +35,7 @@ public: * Default constructor */ AlphaOverPremultiplyOperation(); - + /** * the inner loop of this program */ diff --git a/source/blender/compositor/operations/COM_AntiAliasOperation.h b/source/blender/compositor/operations/COM_AntiAliasOperation.h index 13632a81084..a6f74eb214c 100644 --- a/source/blender/compositor/operations/COM_AntiAliasOperation.h +++ b/source/blender/compositor/operations/COM_AntiAliasOperation.h @@ -38,19 +38,19 @@ protected: SocketReader *m_valueReader; public: AntiAliasOperation(); - + /** * the inner loop of this program */ void executePixel(float output[4], int x, int y, void *data); - + /** * Initialize the execution */ void initExecution(); - + void *initializeTileData(rcti *rect); - + /** * Deinitialize the execution */ diff --git a/source/blender/compositor/operations/COM_BilateralBlurOperation.cpp b/source/blender/compositor/operations/COM_BilateralBlurOperation.cpp index 4a6da3092a2..506c2181ee9 100644 --- a/source/blender/compositor/operations/COM_BilateralBlurOperation.cpp +++ b/source/blender/compositor/operations/COM_BilateralBlurOperation.cpp @@ -84,7 +84,7 @@ void BilateralBlurOperation::executePixel(float output[4], int x, int y, void *d } } } - + if (blurDivider > 0.0f) { mul_v4_v4fl(output, blurColor, 1.0f / blurDivider); } diff --git a/source/blender/compositor/operations/COM_BilateralBlurOperation.h b/source/blender/compositor/operations/COM_BilateralBlurOperation.h index b013e357b9c..70f291d5e1c 100644 --- a/source/blender/compositor/operations/COM_BilateralBlurOperation.h +++ b/source/blender/compositor/operations/COM_BilateralBlurOperation.h @@ -39,19 +39,19 @@ public: * the inner loop of this program */ void executePixel(float output[4], int x, int y, void *data); - + /** * Initialize the execution */ void initExecution(); - + /** * Deinitialize the execution */ void deinitExecution(); - + bool determineDependingAreaOfInterest(rcti *input, ReadBufferOperation *readOperation, rcti *output); - + void setData(NodeBilateralBlurData *data) { this->m_data = data; } }; #endif diff --git a/source/blender/compositor/operations/COM_BlurBaseOperation.h b/source/blender/compositor/operations/COM_BlurBaseOperation.h index 9fd7c017715..1a57b170c9a 100644 --- a/source/blender/compositor/operations/COM_BlurBaseOperation.h +++ b/source/blender/compositor/operations/COM_BlurBaseOperation.h @@ -62,12 +62,12 @@ public: * Initialize the execution */ void initExecution(); - + /** * Deinitialize the execution */ void deinitExecution(); - + void setData(const NodeBlurData *data); void setSize(float size) { this->m_size = size; this->m_sizeavailable = true; } diff --git a/source/blender/compositor/operations/COM_BokehBlurOperation.cpp b/source/blender/compositor/operations/COM_BokehBlurOperation.cpp index c413f45cbaa..2476ab3b591 100644 --- a/source/blender/compositor/operations/COM_BokehBlurOperation.cpp +++ b/source/blender/compositor/operations/COM_BokehBlurOperation.cpp @@ -194,8 +194,8 @@ bool BokehBlurOperation::determineDependingAreaOfInterest(rcti *input, ReadBuffe } void BokehBlurOperation::executeOpenCL(OpenCLDevice *device, - MemoryBuffer *outputMemoryBuffer, cl_mem clOutputBuffer, - MemoryBuffer **inputMemoryBuffers, list *clMemToCleanUp, + MemoryBuffer *outputMemoryBuffer, cl_mem clOutputBuffer, + MemoryBuffer **inputMemoryBuffers, list *clMemToCleanUp, list * /*clKernelsToCleanUp*/) { cl_kernel kernel = device->COM_clCreateKernel("bokehBlurKernel", NULL); @@ -205,7 +205,7 @@ void BokehBlurOperation::executeOpenCL(OpenCLDevice *device, const float max_dim = max(this->getWidth(), this->getHeight()); cl_int radius = this->m_size * max_dim / 100.0f; cl_int step = this->getStep(); - + device->COM_clAttachMemoryBufferToKernelParameter(kernel, 0, -1, clMemToCleanUp, inputMemoryBuffers, this->m_inputBoundingBoxReader); device->COM_clAttachMemoryBufferToKernelParameter(kernel, 1, 4, clMemToCleanUp, inputMemoryBuffers, this->m_inputProgram); device->COM_clAttachMemoryBufferToKernelParameter(kernel, 2, -1, clMemToCleanUp, inputMemoryBuffers, this->m_inputBokehProgram); @@ -214,7 +214,7 @@ void BokehBlurOperation::executeOpenCL(OpenCLDevice *device, clSetKernelArg(kernel, 6, sizeof(cl_int), &radius); clSetKernelArg(kernel, 7, sizeof(cl_int), &step); device->COM_clAttachSizeToKernelParameter(kernel, 8, this); - + device->COM_clEnqueueRange(kernel, outputMemoryBuffer, 9, this); } diff --git a/source/blender/compositor/operations/COM_BokehBlurOperation.h b/source/blender/compositor/operations/COM_BokehBlurOperation.h index 3bfaae6617e..f1540835eaf 100644 --- a/source/blender/compositor/operations/COM_BokehBlurOperation.h +++ b/source/blender/compositor/operations/COM_BokehBlurOperation.h @@ -46,21 +46,21 @@ public: * the inner loop of this program */ void executePixel(float output[4], int x, int y, void *data); - + /** * Initialize the execution */ void initExecution(); - + /** * Deinitialize the execution */ void deinitExecution(); - + bool determineDependingAreaOfInterest(rcti *input, ReadBufferOperation *readOperation, rcti *output); void setSize(float size) { this->m_size = size; this->m_sizeavailable = true; } - + void executeOpenCL(OpenCLDevice *device, MemoryBuffer *outputMemoryBuffer, cl_mem clOutputBuffer, MemoryBuffer **inputMemoryBuffers, list *clMemToCleanUp, diff --git a/source/blender/compositor/operations/COM_BokehImageOperation.h b/source/blender/compositor/operations/COM_BokehImageOperation.h index a2dd3b6ddb7..6f2001566ea 100644 --- a/source/blender/compositor/operations/COM_BokehImageOperation.h +++ b/source/blender/compositor/operations/COM_BokehImageOperation.h @@ -61,27 +61,27 @@ private: * @brief precalced center of the image */ float m_center[2]; - + /** * @brief 1.0-rounding */ float m_inverseRounding; - + /** * @brief distance of a full circle lens */ float m_circularDistance; - + /** * @brief radius when the first flap starts */ float m_flapRad; - + /** * @brief radians of a single flap */ float m_flapRadAdd; - + /** * @brief should the m_data field by deleted when this operation is finished */ @@ -95,7 +95,7 @@ private: * @param distance the lens distance is used to simulate lens shifts */ void detemineStartPointOfFlap(float r[2], int flapNumber, float distance); - + /** * @brief Determine if a coordinate is inside the bokeh image * @@ -112,17 +112,17 @@ public: * @brief the inner loop of this program */ void executePixelSampled(float output[4], float x, float y, PixelSampler sampler); - + /** * @brief Initialize the execution */ void initExecution(); - + /** * @brief Deinitialize the execution */ void deinitExecution(); - + /** * @brief determine the resolution of this operation. currently fixed at [COM_BLUR_BOKEH_PIXELS, COM_BLUR_BOKEH_PIXELS] * @param resolution @@ -135,7 +135,7 @@ public: * @param data */ void setData(NodeBokehImage *data) { this->m_data = data; } - + /** * @brief deleteDataOnFinish * diff --git a/source/blender/compositor/operations/COM_BoxMaskOperation.cpp b/source/blender/compositor/operations/COM_BoxMaskOperation.cpp index e19e5bf031c..d4fe976cf26 100644 --- a/source/blender/compositor/operations/COM_BoxMaskOperation.cpp +++ b/source/blender/compositor/operations/COM_BoxMaskOperation.cpp @@ -48,25 +48,25 @@ void BoxMaskOperation::executePixelSampled(float output[4], float x, float y, Pi { float inputMask[4]; float inputValue[4]; - + float rx = x / this->getWidth(); float ry = y / this->getHeight(); - + const float dy = (ry - this->m_data->y) / this->m_aspectRatio; const float dx = rx - this->m_data->x; rx = this->m_data->x + (this->m_cosine * dx + this->m_sine * dy); ry = this->m_data->y + (-this->m_sine * dx + this->m_cosine * dy); - + this->m_inputMask->readSampled(inputMask, x, y, sampler); this->m_inputValue->readSampled(inputValue, x, y, sampler); - + float halfHeight = this->m_data->height / 2.0f; float halfWidth = this->m_data->width / 2.0f; bool inside = (rx > this->m_data->x - halfWidth && rx < this->m_data->x + halfWidth && ry > this->m_data->y - halfHeight && ry < this->m_data->y + halfHeight); - + switch (this->m_maskType) { case CMP_NODE_MASKTYPE_ADD: if (inside) { diff --git a/source/blender/compositor/operations/COM_BoxMaskOperation.h b/source/blender/compositor/operations/COM_BoxMaskOperation.h index c8b2ba14467..292e3a9391f 100644 --- a/source/blender/compositor/operations/COM_BoxMaskOperation.h +++ b/source/blender/compositor/operations/COM_BoxMaskOperation.h @@ -32,31 +32,31 @@ private: */ SocketReader *m_inputMask; SocketReader *m_inputValue; - + float m_sine; float m_cosine; float m_aspectRatio; int m_maskType; - + NodeBoxMask *m_data; public: BoxMaskOperation(); - + /** * the inner loop of this program */ void executePixelSampled(float output[4], float x, float y, PixelSampler sampler); - + /** * Initialize the execution */ void initExecution(); - + /** * Deinitialize the execution */ void deinitExecution(); - + void setData(NodeBoxMask *data) { this->m_data = data; } void setMaskType(int maskType) { this->m_maskType = maskType; } diff --git a/source/blender/compositor/operations/COM_BrightnessOperation.h b/source/blender/compositor/operations/COM_BrightnessOperation.h index 0b7656c5364..8bda13ea418 100644 --- a/source/blender/compositor/operations/COM_BrightnessOperation.h +++ b/source/blender/compositor/operations/COM_BrightnessOperation.h @@ -38,17 +38,17 @@ private: public: BrightnessOperation(); - + /** * the inner loop of this program */ void executePixelSampled(float output[4], float x, float y, PixelSampler sampler); - + /** * Initialize the execution */ void initExecution(); - + /** * Deinitialize the execution */ diff --git a/source/blender/compositor/operations/COM_CalculateMeanOperation.cpp b/source/blender/compositor/operations/COM_CalculateMeanOperation.cpp index 0fa8b5fa5d2..be6d2b40d7e 100644 --- a/source/blender/compositor/operations/COM_CalculateMeanOperation.cpp +++ b/source/blender/compositor/operations/COM_CalculateMeanOperation.cpp @@ -96,7 +96,7 @@ void CalculateMeanOperation::calculateMean(MemoryBuffer *tile) for (int i = 0, offset = 0; i < size; i++, offset += 4) { if (buffer[offset + 3] > 0) { pixels++; - + switch (this->m_setting) { case 1: { diff --git a/source/blender/compositor/operations/COM_CalculateMeanOperation.h b/source/blender/compositor/operations/COM_CalculateMeanOperation.h index 4fa89290c82..d7d927791b2 100644 --- a/source/blender/compositor/operations/COM_CalculateMeanOperation.h +++ b/source/blender/compositor/operations/COM_CalculateMeanOperation.h @@ -35,34 +35,34 @@ protected: * @brief Cached reference to the reader */ SocketReader *m_imageReader; - + bool m_iscalculated; float m_result; int m_setting; public: CalculateMeanOperation(); - + /** * the inner loop of this program */ void executePixel(float output[4], int x, int y, void *data); - + /** * Initialize the execution */ void initExecution(); - + void *initializeTileData(rcti *rect); - + /** * Deinitialize the execution */ void deinitExecution(); - + bool determineDependingAreaOfInterest(rcti *input, ReadBufferOperation *readOperation, rcti *output); void setSetting(int setting) { this->m_setting = setting; } - + protected: void calculateMean(MemoryBuffer *tile); }; diff --git a/source/blender/compositor/operations/COM_CalculateStandardDeviationOperation.cpp b/source/blender/compositor/operations/COM_CalculateStandardDeviationOperation.cpp index ff4857b7b0f..28012cdfabf 100644 --- a/source/blender/compositor/operations/COM_CalculateStandardDeviationOperation.cpp +++ b/source/blender/compositor/operations/COM_CalculateStandardDeviationOperation.cpp @@ -55,7 +55,7 @@ void *CalculateStandardDeviationOperation::initializeTileData(rcti *rect) for (int i = 0, offset = 0; i < size; i++, offset += 4) { if (buffer[offset + 3] > 0) { pixels++; - + switch (this->m_setting) { case 1: /* rgb combined */ { diff --git a/source/blender/compositor/operations/COM_ChangeHSVOperation.cpp b/source/blender/compositor/operations/COM_ChangeHSVOperation.cpp index a02c1b03006..f90e9b70053 100644 --- a/source/blender/compositor/operations/COM_ChangeHSVOperation.cpp +++ b/source/blender/compositor/operations/COM_ChangeHSVOperation.cpp @@ -52,12 +52,12 @@ void ChangeHSVOperation::executePixelSampled(float output[4], float x, float y, { float inputColor1[4]; float hue[4], saturation[4], value[4]; - + this->m_inputOperation->readSampled(inputColor1, x, y, sampler); this->m_hueOperation->readSampled(hue, x, y, sampler); this->m_saturationOperation->readSampled(saturation, x, y, sampler); this->m_valueOperation->readSampled(value, x, y, sampler); - + output[0] = inputColor1[0] + (hue[0] - 0.5f); if (output[0] > 1.0f) output[0] -= 1.0f; else if (output[0] < 0.0f) output[0] += 1.0f; diff --git a/source/blender/compositor/operations/COM_ChangeHSVOperation.h b/source/blender/compositor/operations/COM_ChangeHSVOperation.h index e6f45c5ad36..9685a298607 100644 --- a/source/blender/compositor/operations/COM_ChangeHSVOperation.h +++ b/source/blender/compositor/operations/COM_ChangeHSVOperation.h @@ -41,10 +41,10 @@ public: * Default constructor */ ChangeHSVOperation(); - + void initExecution(); void deinitExecution(); - + /** * the inner loop of this program */ diff --git a/source/blender/compositor/operations/COM_ChannelMatteOperation.cpp b/source/blender/compositor/operations/COM_ChannelMatteOperation.cpp index 3faffc1e3ff..688cbe91cf7 100644 --- a/source/blender/compositor/operations/COM_ChannelMatteOperation.cpp +++ b/source/blender/compositor/operations/COM_ChannelMatteOperation.cpp @@ -101,10 +101,10 @@ void ChannelMatteOperation::executePixelSampled(float output[4], float x, float /* matte operation */ alpha = inColor[this->m_ids[0]] - max(inColor[this->m_ids[1]], inColor[this->m_ids[2]]); - + /* flip because 0.0 is transparent, not 1.0 */ alpha = 1.0f - alpha; - + /* test range */ if (alpha > limit_max) { alpha = inColor[3]; /*whatever it was prior */ @@ -119,7 +119,7 @@ void ChannelMatteOperation::executePixelSampled(float output[4], float x, float /* store matte(alpha) value in [0] to go with * COM_SetAlphaOperation and the Value output */ - + /* don't make something that was more transparent less transparent */ output[0] = min(alpha, inColor[3]); } diff --git a/source/blender/compositor/operations/COM_ColorBalanceASCCDLOperation.cpp b/source/blender/compositor/operations/COM_ColorBalanceASCCDLOperation.cpp index 23390bd337d..806772417a4 100644 --- a/source/blender/compositor/operations/COM_ColorBalanceASCCDLOperation.cpp +++ b/source/blender/compositor/operations/COM_ColorBalanceASCCDLOperation.cpp @@ -53,14 +53,14 @@ void ColorBalanceASCCDLOperation::executePixelSampled(float output[4], float x, { float inputColor[4]; float value[4]; - + this->m_inputValueOperation->readSampled(value, x, y, sampler); this->m_inputColorOperation->readSampled(inputColor, x, y, sampler); - + float fac = value[0]; fac = min(1.0f, fac); const float mfac = 1.0f - fac; - + output[0] = mfac * inputColor[0] + fac * colorbalance_cdl(inputColor[0], this->m_offset[0], this->m_power[0], this->m_slope[0]); output[1] = mfac * inputColor[1] + fac * colorbalance_cdl(inputColor[1], this->m_offset[1], this->m_power[1], this->m_slope[1]); output[2] = mfac * inputColor[2] + fac * colorbalance_cdl(inputColor[2], this->m_offset[2], this->m_power[2], this->m_slope[2]); diff --git a/source/blender/compositor/operations/COM_ColorBalanceASCCDLOperation.h b/source/blender/compositor/operations/COM_ColorBalanceASCCDLOperation.h index cc6bd894748..44981a2c957 100644 --- a/source/blender/compositor/operations/COM_ColorBalanceASCCDLOperation.h +++ b/source/blender/compositor/operations/COM_ColorBalanceASCCDLOperation.h @@ -35,7 +35,7 @@ protected: */ SocketReader *m_inputValueOperation; SocketReader *m_inputColorOperation; - + float m_offset[3]; float m_power[3]; float m_slope[3]; @@ -45,22 +45,22 @@ public: * Default constructor */ ColorBalanceASCCDLOperation(); - + /** * the inner loop of this program */ void executePixelSampled(float output[4], float x, float y, PixelSampler sampler); - + /** * Initialize the execution */ void initExecution(); - + /** * Deinitialize the execution */ void deinitExecution(); - + void setOffset(float offset[3]) { copy_v3_v3(this->m_offset, offset); } void setPower(float power[3]) { copy_v3_v3(this->m_power, power); } void setSlope(float slope[3]) { copy_v3_v3(this->m_slope, slope); } diff --git a/source/blender/compositor/operations/COM_ColorBalanceLGGOperation.cpp b/source/blender/compositor/operations/COM_ColorBalanceLGGOperation.cpp index e13fd26aed2..e264c065f47 100644 --- a/source/blender/compositor/operations/COM_ColorBalanceLGGOperation.cpp +++ b/source/blender/compositor/operations/COM_ColorBalanceLGGOperation.cpp @@ -58,14 +58,14 @@ void ColorBalanceLGGOperation::executePixelSampled(float output[4], float x, flo { float inputColor[4]; float value[4]; - + this->m_inputValueOperation->readSampled(value, x, y, sampler); this->m_inputColorOperation->readSampled(inputColor, x, y, sampler); - + float fac = value[0]; fac = min(1.0f, fac); const float mfac = 1.0f - fac; - + output[0] = mfac * inputColor[0] + fac * colorbalance_lgg(inputColor[0], this->m_lift[0], this->m_gamma_inv[0], this->m_gain[0]); output[1] = mfac * inputColor[1] + fac * colorbalance_lgg(inputColor[1], this->m_lift[1], this->m_gamma_inv[1], this->m_gain[1]); output[2] = mfac * inputColor[2] + fac * colorbalance_lgg(inputColor[2], this->m_lift[2], this->m_gamma_inv[2], this->m_gain[2]); diff --git a/source/blender/compositor/operations/COM_ColorBalanceLGGOperation.h b/source/blender/compositor/operations/COM_ColorBalanceLGGOperation.h index 86d7abc92bc..97fc8b6f870 100644 --- a/source/blender/compositor/operations/COM_ColorBalanceLGGOperation.h +++ b/source/blender/compositor/operations/COM_ColorBalanceLGGOperation.h @@ -36,7 +36,7 @@ protected: */ SocketReader *m_inputValueOperation; SocketReader *m_inputColorOperation; - + float m_gain[3]; float m_lift[3]; float m_gamma_inv[3]; @@ -46,22 +46,22 @@ public: * Default constructor */ ColorBalanceLGGOperation(); - + /** * the inner loop of this program */ void executePixelSampled(float output[4], float x, float y, PixelSampler sampler); - + /** * Initialize the execution */ void initExecution(); - + /** * Deinitialize the execution */ void deinitExecution(); - + void setGain(const float gain[3]) { copy_v3_v3(this->m_gain, gain); } void setLift(const float lift[3]) { copy_v3_v3(this->m_lift, lift); } void setGammaInv(const float gamma_inv[3]) { copy_v3_v3(this->m_gamma_inv, gamma_inv); } diff --git a/source/blender/compositor/operations/COM_ColorCorrectionOperation.cpp b/source/blender/compositor/operations/COM_ColorCorrectionOperation.cpp index 05edaf51a25..5e08dadd635 100644 --- a/source/blender/compositor/operations/COM_ColorCorrectionOperation.cpp +++ b/source/blender/compositor/operations/COM_ColorCorrectionOperation.cpp @@ -50,7 +50,7 @@ void ColorCorrectionOperation::executePixelSampled(float output[4], float x, flo float inputMask[4]; this->m_inputImage->readSampled(inputImageColor, x, y, sampler); this->m_inputMask->readSampled(inputMask, x, y, sampler); - + float level = (inputImageColor[0] + inputImageColor[1] + inputImageColor[2]) / 3.0f; float contrast = this->m_data->master.contrast; float saturation = this->m_data->master.saturation; @@ -58,11 +58,11 @@ void ColorCorrectionOperation::executePixelSampled(float output[4], float x, flo float gain = this->m_data->master.gain; float lift = this->m_data->master.lift; float r, g, b; - + float value = inputMask[0]; value = min(1.0f, value); const float mvalue = 1.0f - value; - + float levelShadows = 0.0; float levelMidtones = 0.0; float levelHighlights = 0.0; @@ -92,7 +92,7 @@ void ColorCorrectionOperation::executePixelSampled(float output[4], float x, flo gamma *= (levelShadows * this->m_data->shadows.gamma) + (levelMidtones * this->m_data->midtones.gamma) + (levelHighlights * this->m_data->highlights.gamma); gain *= (levelShadows * this->m_data->shadows.gain) + (levelMidtones * this->m_data->midtones.gain) + (levelHighlights * this->m_data->highlights.gain); lift += (levelShadows * this->m_data->shadows.lift) + (levelMidtones * this->m_data->midtones.lift) + (levelHighlights * this->m_data->highlights.lift); - + float invgamma = 1.0f / gamma; float luma = IMB_colormanagement_get_luminance(inputImageColor); @@ -103,21 +103,21 @@ void ColorCorrectionOperation::executePixelSampled(float output[4], float x, flo r = (luma + saturation * (r - luma)); g = (luma + saturation * (g - luma)); b = (luma + saturation * (b - luma)); - + r = 0.5f + ((r - 0.5f) * contrast); g = 0.5f + ((g - 0.5f) * contrast); b = 0.5f + ((b - 0.5f) * contrast); - + r = powf(r * gain + lift, invgamma); g = powf(g * gain + lift, invgamma); b = powf(b * gain + lift, invgamma); - - + + // mix with mask r = mvalue * inputImageColor[0] + value * r; g = mvalue * inputImageColor[1] + value * g; b = mvalue * inputImageColor[2] + value * b; - + if (this->m_redChannelEnabled) { output[0] = r; } diff --git a/source/blender/compositor/operations/COM_ColorCorrectionOperation.h b/source/blender/compositor/operations/COM_ColorCorrectionOperation.h index c386a2f3e6e..7c7ccf2db9b 100644 --- a/source/blender/compositor/operations/COM_ColorCorrectionOperation.h +++ b/source/blender/compositor/operations/COM_ColorCorrectionOperation.h @@ -33,29 +33,29 @@ private: SocketReader *m_inputImage; SocketReader *m_inputMask; NodeColorCorrection *m_data; - + bool m_redChannelEnabled; bool m_greenChannelEnabled; bool m_blueChannelEnabled; public: ColorCorrectionOperation(); - + /** * the inner loop of this program */ void executePixelSampled(float output[4], float x, float y, PixelSampler sampler); - + /** * Initialize the execution */ void initExecution(); - + /** * Deinitialize the execution */ void deinitExecution(); - + void setData(NodeColorCorrection *data) { this->m_data = data; } void setRedChannelEnabled(bool enabled) { this->m_redChannelEnabled = enabled; } void setGreenChannelEnabled(bool enabled) { this->m_greenChannelEnabled = enabled; } diff --git a/source/blender/compositor/operations/COM_ColorCurveOperation.cpp b/source/blender/compositor/operations/COM_ColorCurveOperation.cpp index 5967147b3d1..4cecc53ad01 100644 --- a/source/blender/compositor/operations/COM_ColorCurveOperation.cpp +++ b/source/blender/compositor/operations/COM_ColorCurveOperation.cpp @@ -61,7 +61,7 @@ void ColorCurveOperation::initExecution() void ColorCurveOperation::executePixelSampled(float output[4], float x, float y, PixelSampler sampler) { CurveMapping *cumap = this->m_curveMapping; - + float fac[4]; float image[4]; diff --git a/source/blender/compositor/operations/COM_ColorCurveOperation.h b/source/blender/compositor/operations/COM_ColorCurveOperation.h index 3b10786fb2c..17c94feed5f 100644 --- a/source/blender/compositor/operations/COM_ColorCurveOperation.h +++ b/source/blender/compositor/operations/COM_ColorCurveOperation.h @@ -37,17 +37,17 @@ private: SocketReader *m_inputWhiteProgram; public: ColorCurveOperation(); - + /** * the inner loop of this program */ void executePixelSampled(float output[4], float x, float y, PixelSampler sampler); - + /** * Initialize the execution */ void initExecution(); - + /** * Deinitialize the execution */ @@ -63,25 +63,25 @@ private: SocketReader *m_inputImageProgram; float m_black[3]; float m_white[3]; - + public: ConstantLevelColorCurveOperation(); - + /** * the inner loop of this program */ void executePixelSampled(float output[4], float x, float y, PixelSampler sampler); - + /** * Initialize the execution */ void initExecution(); - + /** * Deinitialize the execution */ void deinitExecution(); - + void setBlackLevel(float black[3]) { copy_v3_v3(this->m_black, black); } void setWhiteLevel(float white[3]) { copy_v3_v3(this->m_white, white); } }; diff --git a/source/blender/compositor/operations/COM_ColorRampOperation.h b/source/blender/compositor/operations/COM_ColorRampOperation.h index 55f711165d6..2d1919bb4b5 100644 --- a/source/blender/compositor/operations/COM_ColorRampOperation.h +++ b/source/blender/compositor/operations/COM_ColorRampOperation.h @@ -34,22 +34,22 @@ private: ColorBand *m_colorBand; public: ColorRampOperation(); - + /** * the inner loop of this program */ void executePixelSampled(float output[4], float x, float y, PixelSampler sampler); - + /** * Initialize the execution */ void initExecution(); - + /** * Deinitialize the execution */ void deinitExecution(); - + void setColorBand(ColorBand *colorBand) { this->m_colorBand = colorBand; } diff --git a/source/blender/compositor/operations/COM_ColorSpillOperation.cpp b/source/blender/compositor/operations/COM_ColorSpillOperation.cpp index 0769e5d0b01..2f30ed83043 100644 --- a/source/blender/compositor/operations/COM_ColorSpillOperation.cpp +++ b/source/blender/compositor/operations/COM_ColorSpillOperation.cpp @@ -68,7 +68,7 @@ void ColorSpillOperation::initExecution() this->m_rmut = 1.0f; this->m_gmut = 1.0f; this->m_bmut = -1.0f; - + this->m_channel2 = 0; this->m_channel3 = 1; if (this->m_settings->unspill == 0) { diff --git a/source/blender/compositor/operations/COM_ColorSpillOperation.h b/source/blender/compositor/operations/COM_ColorSpillOperation.h index 3b94c293ec9..5971db9fa76 100644 --- a/source/blender/compositor/operations/COM_ColorSpillOperation.h +++ b/source/blender/compositor/operations/COM_ColorSpillOperation.h @@ -55,7 +55,7 @@ public: void setSettings(NodeColorspill *nodeColorSpill) { this->m_settings = nodeColorSpill; } void setSpillChannel(int channel) { this->m_spillChannel = channel; } void setSpillMethod(int method) { this->m_spillMethod = method; } - + float calculateMapValue(float fac, float *input); }; diff --git a/source/blender/compositor/operations/COM_ConvertColorProfileOperation.h b/source/blender/compositor/operations/COM_ConvertColorProfileOperation.h index ceba2a85da0..47f9f20f393 100644 --- a/source/blender/compositor/operations/COM_ConvertColorProfileOperation.h +++ b/source/blender/compositor/operations/COM_ConvertColorProfileOperation.h @@ -35,17 +35,17 @@ private: * Cached reference to the inputProgram */ SocketReader *m_inputOperation; - + /** * @brief color profile where to convert from */ int m_fromProfile; - + /** * @brief color profile where to convert to */ int m_toProfile; - + /** * @brief is color predivided */ @@ -55,22 +55,22 @@ public: * Default constructor */ ConvertColorProfileOperation(); - + /** * the inner loop of this program */ void executePixelSampled(float output[4], float x, float y, PixelSampler sampler); - + /** * Initialize the execution */ void initExecution(); - + /** * Deinitialize the execution */ void deinitExecution(); - + void setFromColorProfile(int colorProfile) { this->m_fromProfile = colorProfile; } void setToColorProfile(int colorProfile) { this->m_toProfile = colorProfile; } void setPredivided(bool predivided) { this->m_predivided = predivided; } diff --git a/source/blender/compositor/operations/COM_ConvertDepthToRadiusOperation.cpp b/source/blender/compositor/operations/COM_ConvertDepthToRadiusOperation.cpp index 9057c3c92ec..111bfeadf35 100644 --- a/source/blender/compositor/operations/COM_ConvertDepthToRadiusOperation.cpp +++ b/source/blender/compositor/operations/COM_ConvertDepthToRadiusOperation.cpp @@ -81,7 +81,7 @@ void ConvertDepthToRadiusOperation::executePixelSampled(float output[4], float x z = inputValue[0]; if (z != 0.0f) { float iZ = (1.0f / z); - + // bug #6656 part 2b, do not rescale #if 0 bcrad = 0.5f * fabs(aperture * (dof_sp * (cam_invfdist - iZ) - 1.0f)); diff --git a/source/blender/compositor/operations/COM_ConvertDepthToRadiusOperation.h b/source/blender/compositor/operations/COM_ConvertDepthToRadiusOperation.h index 697ac455702..65db1cf45d9 100644 --- a/source/blender/compositor/operations/COM_ConvertDepthToRadiusOperation.h +++ b/source/blender/compositor/operations/COM_ConvertDepthToRadiusOperation.h @@ -43,34 +43,34 @@ private: float m_cam_lens; float m_dof_sp; Object *m_cameraObject; - + FastGaussianBlurValueOperation *m_blurPostOperation; public: /** * Default constructor */ ConvertDepthToRadiusOperation(); - + /** * the inner loop of this program */ void executePixelSampled(float output[4], float x, float y, PixelSampler sampler); - + /** * Initialize the execution */ void initExecution(); - + /** * Deinitialize the execution */ void deinitExecution(); - + void setfStop(float fStop) { this->m_fStop = fStop; } void setMaxRadius(float maxRadius) { this->m_maxRadius = maxRadius; } void setCameraObject(Object *camera) { this->m_cameraObject = camera; } float determineFocalDistance(); void setPostBlur(FastGaussianBlurValueOperation *operation) {this->m_blurPostOperation = operation;} - + }; #endif diff --git a/source/blender/compositor/operations/COM_ConvertOperation.h b/source/blender/compositor/operations/COM_ConvertOperation.h index 5dee63ea739..9c23cc9bda7 100644 --- a/source/blender/compositor/operations/COM_ConvertOperation.h +++ b/source/blender/compositor/operations/COM_ConvertOperation.h @@ -29,10 +29,10 @@ class ConvertBaseOperation : public NodeOperation { protected: SocketReader *m_inputOperation; - + public: ConvertBaseOperation(); - + void initExecution(); void deinitExecution(); }; @@ -41,7 +41,7 @@ public: class ConvertValueToColorOperation : public ConvertBaseOperation { public: ConvertValueToColorOperation(); - + void executePixelSampled(float output[4], float x, float y, PixelSampler sampler); }; @@ -49,7 +49,7 @@ public: class ConvertColorToValueOperation : public ConvertBaseOperation { public: ConvertColorToValueOperation(); - + void executePixelSampled(float output[4], float x, float y, PixelSampler sampler); }; @@ -57,7 +57,7 @@ public: class ConvertColorToBWOperation : public ConvertBaseOperation { public: ConvertColorToBWOperation(); - + void executePixelSampled(float output[4], float x, float y, PixelSampler sampler); }; @@ -65,7 +65,7 @@ public: class ConvertColorToVectorOperation : public ConvertBaseOperation { public: ConvertColorToVectorOperation(); - + void executePixelSampled(float output[4], float x, float y, PixelSampler sampler); }; @@ -73,7 +73,7 @@ public: class ConvertValueToVectorOperation : public ConvertBaseOperation { public: ConvertValueToVectorOperation(); - + void executePixelSampled(float output[4], float x, float y, PixelSampler sampler); }; @@ -81,7 +81,7 @@ public: class ConvertVectorToColorOperation : public ConvertBaseOperation { public: ConvertVectorToColorOperation(); - + void executePixelSampled(float output[4], float x, float y, PixelSampler sampler); }; @@ -89,7 +89,7 @@ public: class ConvertVectorToValueOperation : public ConvertBaseOperation { public: ConvertVectorToValueOperation(); - + void executePixelSampled(float output[4], float x, float y, PixelSampler sampler); }; @@ -114,9 +114,9 @@ private: int m_mode; public: ConvertYCCToRGBOperation(); - + void executePixelSampled(float output[4], float x, float y, PixelSampler sampler); - + /** Set the YCC mode */ void setMode(int mode); }; @@ -125,7 +125,7 @@ public: class ConvertRGBToYUVOperation : public ConvertBaseOperation { public: ConvertRGBToYUVOperation(); - + void executePixelSampled(float output[4], float x, float y, PixelSampler sampler); }; @@ -133,7 +133,7 @@ public: class ConvertYUVToRGBOperation : public ConvertBaseOperation { public: ConvertYUVToRGBOperation(); - + void executePixelSampled(float output[4], float x, float y, PixelSampler sampler); }; @@ -141,7 +141,7 @@ public: class ConvertRGBToHSVOperation : public ConvertBaseOperation { public: ConvertRGBToHSVOperation(); - + void executePixelSampled(float output[4], float x, float y, PixelSampler sampler); }; @@ -149,7 +149,7 @@ public: class ConvertHSVToRGBOperation : public ConvertBaseOperation { public: ConvertHSVToRGBOperation(); - + void executePixelSampled(float output[4], float x, float y, PixelSampler sampler); }; @@ -177,10 +177,10 @@ private: public: SeparateChannelOperation(); void executePixelSampled(float output[4], float x, float y, PixelSampler sampler); - + void initExecution(); void deinitExecution(); - + void setChannel(int channel) { this->m_channel = channel; } }; @@ -194,7 +194,7 @@ private: public: CombineChannelsOperation(); void executePixelSampled(float output[4], float x, float y, PixelSampler sampler); - + void initExecution(); void deinitExecution(); }; diff --git a/source/blender/compositor/operations/COM_ConvolutionEdgeFilterOperation.cpp b/source/blender/compositor/operations/COM_ConvolutionEdgeFilterOperation.cpp index 56815459ee7..9eb2d1bfcc5 100644 --- a/source/blender/compositor/operations/COM_ConvolutionEdgeFilterOperation.cpp +++ b/source/blender/compositor/operations/COM_ConvolutionEdgeFilterOperation.cpp @@ -44,7 +44,7 @@ void ConvolutionEdgeFilterOperation::executePixel(float output[4], int x, int y, CLAMP(y1, 0, getHeight() - 1); CLAMP(y2, 0, getHeight() - 1); CLAMP(y3, 0, getHeight() - 1); - + float value[4]; this->m_inputValueOperation->read(value, x2, y2, NULL); float mval = 1.0f - value[0]; @@ -52,47 +52,47 @@ void ConvolutionEdgeFilterOperation::executePixel(float output[4], int x, int y, this->m_inputOperation->read(in1, x1, y1, NULL); madd_v3_v3fl(res1, in1, this->m_filter[0]); madd_v3_v3fl(res2, in1, this->m_filter[0]); - + this->m_inputOperation->read(in1, x2, y1, NULL); madd_v3_v3fl(res1, in1, this->m_filter[1]); madd_v3_v3fl(res2, in1, this->m_filter[3]); - + this->m_inputOperation->read(in1, x3, y1, NULL); madd_v3_v3fl(res1, in1, this->m_filter[2]); madd_v3_v3fl(res2, in1, this->m_filter[6]); - + this->m_inputOperation->read(in1, x1, y2, NULL); madd_v3_v3fl(res1, in1, this->m_filter[3]); madd_v3_v3fl(res2, in1, this->m_filter[1]); - + this->m_inputOperation->read(in2, x2, y2, NULL); madd_v3_v3fl(res1, in2, this->m_filter[4]); madd_v3_v3fl(res2, in2, this->m_filter[4]); - + this->m_inputOperation->read(in1, x3, y2, NULL); madd_v3_v3fl(res1, in1, this->m_filter[5]); madd_v3_v3fl(res2, in1, this->m_filter[7]); - + this->m_inputOperation->read(in1, x1, y3, NULL); madd_v3_v3fl(res1, in1, this->m_filter[6]); madd_v3_v3fl(res2, in1, this->m_filter[2]); - + this->m_inputOperation->read(in1, x2, y3, NULL); madd_v3_v3fl(res1, in1, this->m_filter[7]); madd_v3_v3fl(res2, in1, this->m_filter[5]); - + this->m_inputOperation->read(in1, x3, y3, NULL); madd_v3_v3fl(res1, in1, this->m_filter[8]); madd_v3_v3fl(res2, in1, this->m_filter[8]); - + output[0] = sqrt(res1[0] * res1[0] + res2[0] * res2[0]); output[1] = sqrt(res1[1] * res1[1] + res2[1] * res2[1]); output[2] = sqrt(res1[2] * res1[2] + res2[2] * res2[2]); - + output[0] = output[0] * value[0] + in2[0] * mval; output[1] = output[1] * value[0] + in2[1] * mval; output[2] = output[2] * value[0] + in2[2] * mval; - + output[3] = in2[3]; /* Make sure we don't return negative color. */ diff --git a/source/blender/compositor/operations/COM_ConvolutionFilterOperation.cpp b/source/blender/compositor/operations/COM_ConvolutionFilterOperation.cpp index 41cc504af05..b14fdc811d4 100644 --- a/source/blender/compositor/operations/COM_ConvolutionFilterOperation.cpp +++ b/source/blender/compositor/operations/COM_ConvolutionFilterOperation.cpp @@ -102,7 +102,7 @@ void ConvolutionFilterOperation::executePixel(float output[4], int x, int y, voi madd_v4_v4fl(output, in1, this->m_filter[7]); this->m_inputOperation->read(in1, x3, y3, NULL); madd_v4_v4fl(output, in1, this->m_filter[8]); - + output[0] = output[0] * value[0] + in2[0] * mval; output[1] = output[1] * value[0] + in2[1] * mval; output[2] = output[2] * value[0] + in2[2] * mval; @@ -124,6 +124,6 @@ bool ConvolutionFilterOperation::determineDependingAreaOfInterest(rcti *input, R newInput.xmin = input->xmin - addx; newInput.ymax = input->ymax + addy; newInput.ymin = input->ymin - addy; - + return NodeOperation::determineDependingAreaOfInterest(&newInput, readOperation, output); } diff --git a/source/blender/compositor/operations/COM_ConvolutionFilterOperation.h b/source/blender/compositor/operations/COM_ConvolutionFilterOperation.h index 75fba0ee1e4..99e6fc52ddc 100644 --- a/source/blender/compositor/operations/COM_ConvolutionFilterOperation.h +++ b/source/blender/compositor/operations/COM_ConvolutionFilterOperation.h @@ -40,7 +40,7 @@ public: void set3x3Filter(float f1, float f2, float f3, float f4, float f5, float f6, float f7, float f8, float f9); bool determineDependingAreaOfInterest(rcti *input, ReadBufferOperation *readOperation, rcti *output); void executePixel(float output[4], int x, int y, void *data); - + void initExecution(); void deinitExecution(); }; diff --git a/source/blender/compositor/operations/COM_CropOperation.cpp b/source/blender/compositor/operations/COM_CropOperation.cpp index 162811ac31d..af68fa09f1a 100644 --- a/source/blender/compositor/operations/COM_CropOperation.cpp +++ b/source/blender/compositor/operations/COM_CropOperation.cpp @@ -37,7 +37,7 @@ void CropBaseOperation::updateArea() float width = inputReference->getWidth(); float height = inputReference->getHeight(); NodeTwoXYs local_settings = *this->m_settings; - + if (width > 0.0f && height > 0.0f) { if (this->m_relative) { local_settings.x1 = width * local_settings.fac_x1; @@ -53,7 +53,7 @@ void CropBaseOperation::updateArea() local_settings.x2 = width - 1; if (height <= local_settings.y2 + 1) local_settings.y2 = height - 1; - + this->m_xmax = max(local_settings.x1, local_settings.x2) + 1; this->m_xmin = min(local_settings.x1, local_settings.x2); this->m_ymax = max(local_settings.y1, local_settings.y2) + 1; @@ -101,12 +101,12 @@ CropImageOperation::CropImageOperation() : CropBaseOperation() bool CropImageOperation::determineDependingAreaOfInterest(rcti *input, ReadBufferOperation *readOperation, rcti *output) { rcti newInput; - + newInput.xmax = input->xmax + this->m_xmin; newInput.xmin = input->xmin + this->m_xmin; newInput.ymax = input->ymax + this->m_ymin; newInput.ymin = input->ymin + this->m_ymin; - + return NodeOperation::determineDependingAreaOfInterest(&newInput, readOperation, output); } diff --git a/source/blender/compositor/operations/COM_CropOperation.h b/source/blender/compositor/operations/COM_CropOperation.h index 7c5b995fb17..f73b4c602f6 100644 --- a/source/blender/compositor/operations/COM_CropOperation.h +++ b/source/blender/compositor/operations/COM_CropOperation.h @@ -34,7 +34,7 @@ protected: int m_xmin; int m_ymax; int m_ymin; - + void updateArea(); public: CropBaseOperation(); diff --git a/source/blender/compositor/operations/COM_CurveBaseOperation.h b/source/blender/compositor/operations/COM_CurveBaseOperation.h index 169022de5f5..191cf7f5307 100644 --- a/source/blender/compositor/operations/COM_CurveBaseOperation.h +++ b/source/blender/compositor/operations/COM_CurveBaseOperation.h @@ -34,13 +34,13 @@ protected: public: CurveBaseOperation(); ~CurveBaseOperation(); - + /** * Initialize the execution */ void initExecution(); void deinitExecution(); - + void setCurveMapping(CurveMapping *mapping); }; #endif diff --git a/source/blender/compositor/operations/COM_DifferenceMatteOperation.h b/source/blender/compositor/operations/COM_DifferenceMatteOperation.h index ddf6bf6f893..3766f85444d 100644 --- a/source/blender/compositor/operations/COM_DifferenceMatteOperation.h +++ b/source/blender/compositor/operations/COM_DifferenceMatteOperation.h @@ -39,15 +39,15 @@ public: * Default constructor */ DifferenceMatteOperation(); - + /** * the inner loop of this program */ void executePixelSampled(float output[4], float x, float y, PixelSampler sampler); - + void initExecution(); void deinitExecution(); - + void setSettings(NodeChroma *nodeChroma) { this->m_settings = nodeChroma; } }; #endif diff --git a/source/blender/compositor/operations/COM_DilateErodeOperation.cpp b/source/blender/compositor/operations/COM_DilateErodeOperation.cpp index 2ea438d070d..17f3dfeac62 100644 --- a/source/blender/compositor/operations/COM_DilateErodeOperation.cpp +++ b/source/blender/compositor/operations/COM_DilateErodeOperation.cpp @@ -200,7 +200,7 @@ void DilateDistanceOperation::executePixel(float output[4], int x, int y, void * const int maxy = min(y + this->m_scope, rect->ymax); const int bufferWidth = BLI_rcti_size_x(rect); int offset; - + float value = 0.0f; for (int yi = miny; yi < maxy; yi++) { @@ -244,7 +244,7 @@ void DilateDistanceOperation::executeOpenCL(OpenCLDevice *device, cl_int distanceSquared = this->m_distance * this->m_distance; cl_int scope = this->m_scope; - + device->COM_clAttachMemoryBufferToKernelParameter(dilateKernel, 0, 2, clMemToCleanUp, inputMemoryBuffers, this->m_inputProgram); device->COM_clAttachOutputMemoryBufferToKernelParameter(dilateKernel, 1, clOutputBuffer); device->COM_clAttachMemoryBufferOffsetToKernelParameter(dilateKernel, 3, outputMemoryBuffer); @@ -255,7 +255,7 @@ void DilateDistanceOperation::executeOpenCL(OpenCLDevice *device, } // Erode Distance -ErodeDistanceOperation::ErodeDistanceOperation() : DilateDistanceOperation() +ErodeDistanceOperation::ErodeDistanceOperation() : DilateDistanceOperation() { /* pass */ } @@ -274,7 +274,7 @@ void ErodeDistanceOperation::executePixel(float output[4], int x, int y, void *d const int maxy = min(y + this->m_scope, rect->ymax); const int bufferWidth = BLI_rcti_size_x(rect); int offset; - + float value = 1.0f; for (int yi = miny; yi < maxy; yi++) { @@ -301,7 +301,7 @@ void ErodeDistanceOperation::executeOpenCL(OpenCLDevice *device, cl_int distanceSquared = this->m_distance * this->m_distance; cl_int scope = this->m_scope; - + device->COM_clAttachMemoryBufferToKernelParameter(erodeKernel, 0, 2, clMemToCleanUp, inputMemoryBuffers, this->m_inputProgram); device->COM_clAttachOutputMemoryBufferToKernelParameter(erodeKernel, 1, clOutputBuffer); device->COM_clAttachMemoryBufferOffsetToKernelParameter(erodeKernel, 3, outputMemoryBuffer); diff --git a/source/blender/compositor/operations/COM_DilateErodeOperation.h b/source/blender/compositor/operations/COM_DilateErodeOperation.h index c929fcf7fec..92c453d9d85 100644 --- a/source/blender/compositor/operations/COM_DilateErodeOperation.h +++ b/source/blender/compositor/operations/COM_DilateErodeOperation.h @@ -31,11 +31,11 @@ private: * Cached reference to the inputProgram */ SocketReader *m_inputProgram; - + float m_distance; float m__switch; float m_inset; - + /** * determines the area of interest to track pixels * keep this one as small as possible for speed gain. @@ -43,27 +43,27 @@ private: int m_scope; public: DilateErodeThresholdOperation(); - + /** * the inner loop of this program */ void executePixel(float output[4], int x, int y, void *data); - + /** * Initialize the execution */ void initExecution(); - + void *initializeTileData(rcti *rect); /** * Deinitialize the execution */ void deinitExecution(); - + void setDistance(float distance) { this->m_distance = distance; } void setSwitch(float sw) { this->m__switch = sw; } void setInset(float inset) { this->m_inset = inset; } - + bool determineDependingAreaOfInterest(rcti *input, ReadBufferOperation *readOperation, rcti *output); }; @@ -79,43 +79,43 @@ protected: int m_scope; public: DilateDistanceOperation(); - + /** * the inner loop of this program */ void executePixel(float output[4], int x, int y, void *data); - + /** * Initialize the execution */ void initExecution(); - + void *initializeTileData(rcti *rect); /** * Deinitialize the execution */ void deinitExecution(); - + void setDistance(float distance) { this->m_distance = distance; } bool determineDependingAreaOfInterest(rcti *input, ReadBufferOperation *readOperation, rcti *output); - + void executeOpenCL(OpenCLDevice *device, - MemoryBuffer *outputMemoryBuffer, cl_mem clOutputBuffer, + MemoryBuffer *outputMemoryBuffer, cl_mem clOutputBuffer, MemoryBuffer **inputMemoryBuffers, list *clMemToCleanUp, list *clKernelsToCleanUp); }; class ErodeDistanceOperation : public DilateDistanceOperation { public: ErodeDistanceOperation(); - + /** * the inner loop of this program */ void executePixel(float output[4], int x, int y, void *data); void executeOpenCL(OpenCLDevice *device, - MemoryBuffer *outputMemoryBuffer, cl_mem clOutputBuffer, - MemoryBuffer **inputMemoryBuffers, list *clMemToCleanUp, + MemoryBuffer *outputMemoryBuffer, cl_mem clOutputBuffer, + MemoryBuffer **inputMemoryBuffers, list *clMemToCleanUp, list *clKernelsToCleanUp); }; @@ -125,38 +125,38 @@ protected: * Cached reference to the inputProgram */ SocketReader *m_inputProgram; - + int m_iterations; - + public: DilateStepOperation(); - + /** * the inner loop of this program */ void executePixel(float output[4], int x, int y, void *data); - + /** * Initialize the execution */ void initExecution(); - + void *initializeTileData(rcti *rect); /** * Deinitialize the execution */ void deinitExecution(); void deinitializeTileData(rcti *rect, void *data); - + void setIterations(int iterations) { this->m_iterations = iterations; } - + bool determineDependingAreaOfInterest(rcti *input, ReadBufferOperation *readOperation, rcti *output); }; class ErodeStepOperation : public DilateStepOperation { public: ErodeStepOperation(); - + void *initializeTileData(rcti *rect); }; diff --git a/source/blender/compositor/operations/COM_DirectionalBlurOperation.cpp b/source/blender/compositor/operations/COM_DirectionalBlurOperation.cpp index 2e0be8d8410..e3dec838589 100644 --- a/source/blender/compositor/operations/COM_DirectionalBlurOperation.cpp +++ b/source/blender/compositor/operations/COM_DirectionalBlurOperation.cpp @@ -102,8 +102,8 @@ void DirectionalBlurOperation::executePixel(float output[4], int x, int y, void } void DirectionalBlurOperation::executeOpenCL(OpenCLDevice *device, - MemoryBuffer *outputMemoryBuffer, cl_mem clOutputBuffer, - MemoryBuffer **inputMemoryBuffers, list *clMemToCleanUp, + MemoryBuffer *outputMemoryBuffer, cl_mem clOutputBuffer, + MemoryBuffer **inputMemoryBuffers, list *clMemToCleanUp, list * /*clKernelsToCleanUp*/) { cl_kernel directionalBlurKernel = device->COM_clCreateKernel("directionalBlurKernel", NULL); @@ -113,7 +113,7 @@ void DirectionalBlurOperation::executeOpenCL(OpenCLDevice *device, cl_float2 centerpix = {{this->m_center_x_pix, this->m_center_y_pix}}; cl_float lsc = this->m_sc; cl_float lrot = this->m_rot; - + device->COM_clAttachMemoryBufferToKernelParameter(directionalBlurKernel, 0, -1, clMemToCleanUp, inputMemoryBuffers, this->m_inputProgram); device->COM_clAttachOutputMemoryBufferToKernelParameter(directionalBlurKernel, 1, clOutputBuffer); device->COM_clAttachMemoryBufferOffsetToKernelParameter(directionalBlurKernel, 2, outputMemoryBuffer); @@ -122,7 +122,7 @@ void DirectionalBlurOperation::executeOpenCL(OpenCLDevice *device, clSetKernelArg(directionalBlurKernel, 5, sizeof(cl_float), &lrot); clSetKernelArg(directionalBlurKernel, 6, sizeof(cl_float2), <xy); clSetKernelArg(directionalBlurKernel, 7, sizeof(cl_float2), ¢erpix); - + device->COM_clEnqueueRange(directionalBlurKernel, outputMemoryBuffer, 8, this); } diff --git a/source/blender/compositor/operations/COM_DirectionalBlurOperation.h b/source/blender/compositor/operations/COM_DirectionalBlurOperation.h index a6194a0ca73..eaabf49bf74 100644 --- a/source/blender/compositor/operations/COM_DirectionalBlurOperation.h +++ b/source/blender/compositor/operations/COM_DirectionalBlurOperation.h @@ -41,25 +41,25 @@ public: * the inner loop of this program */ void executePixel(float output[4], int x, int y, void *data); - + /** * Initialize the execution */ void initExecution(); - + /** * Deinitialize the execution */ void deinitExecution(); - + bool determineDependingAreaOfInterest(rcti *input, ReadBufferOperation *readOperation, rcti *output); - + void setData(NodeDBlurData *data) { this->m_data = data; } void executeOpenCL(OpenCLDevice *device, MemoryBuffer *outputMemoryBuffer, cl_mem clOutputBuffer, MemoryBuffer **inputMemoryBuffers, list *clMemToCleanUp, list *clKernelsToCleanUp); - + }; #endif diff --git a/source/blender/compositor/operations/COM_DisplaceOperation.cpp b/source/blender/compositor/operations/COM_DisplaceOperation.cpp index 9b3377e887a..0d959996be1 100644 --- a/source/blender/compositor/operations/COM_DisplaceOperation.cpp +++ b/source/blender/compositor/operations/COM_DisplaceOperation.cpp @@ -92,7 +92,7 @@ void DisplaceOperation::pixelTransform(const float xy[2], float r_uv[2], float r float xs = col[0]; m_inputScaleYProgram->readSampled(col, xy[0], xy[1], COM_PS_NEAREST); float ys = col[0]; - /* clamp x and y displacement to triple image resolution - + /* clamp x and y displacement to triple image resolution - * to prevent hangs from huge values mistakenly plugged in eg. z buffers */ CLAMP(xs, -m_width_x4, m_width_x4); CLAMP(ys, -m_height_x4, m_height_x4); @@ -102,7 +102,7 @@ void DisplaceOperation::pixelTransform(const float xy[2], float r_uv[2], float r /* Estimate partial derivatives using 1-pixel offsets */ const float epsilon[2] = { 1.0f, 1.0f }; - + zero_v2(r_deriv[0]); zero_v2(r_deriv[1]); diff --git a/source/blender/compositor/operations/COM_DisplaceOperation.h b/source/blender/compositor/operations/COM_DisplaceOperation.h index cec7937d9d6..680f2606692 100644 --- a/source/blender/compositor/operations/COM_DisplaceOperation.h +++ b/source/blender/compositor/operations/COM_DisplaceOperation.h @@ -49,14 +49,14 @@ public: * the inner loop of this program */ void executePixelSampled(float output[4], float x, float y, PixelSampler sampler); - + void pixelTransform(const float xy[2], float r_uv[2], float r_deriv[2][2]); - + /** * Initialize the execution */ void initExecution(); - + /** * Deinitialize the execution */ diff --git a/source/blender/compositor/operations/COM_DisplaceSimpleOperation.cpp b/source/blender/compositor/operations/COM_DisplaceSimpleOperation.cpp index 40b4fdec28e..0d7cd129a2f 100644 --- a/source/blender/compositor/operations/COM_DisplaceSimpleOperation.cpp +++ b/source/blender/compositor/operations/COM_DisplaceSimpleOperation.cpp @@ -66,7 +66,7 @@ void DisplaceSimpleOperation::executePixelSampled(float output[4], float x, floa this->m_inputScaleYProgram->readSampled(inScale, x, y, sampler); float ys = inScale[0]; - /* clamp x and y displacement to triple image resolution - + /* clamp x and y displacement to triple image resolution - * to prevent hangs from huge values mistakenly plugged in eg. z buffers */ CLAMP(xs, -this->m_width_x4, this->m_width_x4); CLAMP(ys, -this->m_height_x4, this->m_height_x4); diff --git a/source/blender/compositor/operations/COM_DisplaceSimpleOperation.h b/source/blender/compositor/operations/COM_DisplaceSimpleOperation.h index 6e52dfe86e9..b3da61722ec 100644 --- a/source/blender/compositor/operations/COM_DisplaceSimpleOperation.h +++ b/source/blender/compositor/operations/COM_DisplaceSimpleOperation.h @@ -49,12 +49,12 @@ public: * the inner loop of this program */ void executePixelSampled(float output[4], float x, float y, PixelSampler sampler); - + /** * Initialize the execution */ void initExecution(); - + /** * Deinitialize the execution */ diff --git a/source/blender/compositor/operations/COM_DistanceRGBMatteOperation.cpp b/source/blender/compositor/operations/COM_DistanceRGBMatteOperation.cpp index b9e6864b340..adc977d014d 100644 --- a/source/blender/compositor/operations/COM_DistanceRGBMatteOperation.cpp +++ b/source/blender/compositor/operations/COM_DistanceRGBMatteOperation.cpp @@ -62,13 +62,13 @@ void DistanceRGBMatteOperation::executePixelSampled(float output[4], float x, fl this->m_inputKeyProgram->readSampled(inKey, x, y, sampler); this->m_inputImageProgram->readSampled(inImage, x, y, sampler); - + distance = this->calculateDistance(inKey, inImage); /* store matte(alpha) value in [0] to go with * COM_SetAlphaOperation and the Value output */ - + /*make 100% transparent */ if (distance < tolerance) { output[0] = 0.0f; diff --git a/source/blender/compositor/operations/COM_DistanceRGBMatteOperation.h b/source/blender/compositor/operations/COM_DistanceRGBMatteOperation.h index a815caa5ef5..22bc10b7bc3 100644 --- a/source/blender/compositor/operations/COM_DistanceRGBMatteOperation.h +++ b/source/blender/compositor/operations/COM_DistanceRGBMatteOperation.h @@ -41,15 +41,15 @@ public: * Default constructor */ DistanceRGBMatteOperation(); - + /** * the inner loop of this program */ void executePixelSampled(float output[4], float x, float y, PixelSampler sampler); - + void initExecution(); void deinitExecution(); - + void setSettings(NodeChroma *nodeChroma) { this->m_settings = nodeChroma; } }; #endif diff --git a/source/blender/compositor/operations/COM_DotproductOperation.h b/source/blender/compositor/operations/COM_DotproductOperation.h index 218409cbf5b..0fbefd716eb 100644 --- a/source/blender/compositor/operations/COM_DotproductOperation.h +++ b/source/blender/compositor/operations/COM_DotproductOperation.h @@ -32,7 +32,7 @@ private: public: DotproductOperation(); void executePixelSampled(float output[4], float x, float y, PixelSampler sampler); - + void initExecution(); void deinitExecution(); diff --git a/source/blender/compositor/operations/COM_DoubleEdgeMaskOperation.cpp b/source/blender/compositor/operations/COM_DoubleEdgeMaskOperation.cpp index 8d2a0f3b427..ffa2f812ed7 100644 --- a/source/blender/compositor/operations/COM_DoubleEdgeMaskOperation.cpp +++ b/source/blender/compositor/operations/COM_DoubleEdgeMaskOperation.cpp @@ -108,7 +108,7 @@ static void do_adjacentKeepBorders(unsigned int t, unsigned int rw, unsigned int 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--) { // test if inner mask is filled @@ -128,7 +128,7 @@ static void do_adjacentKeepBorders(unsigned int t, unsigned int rw, unsigned int lres[x] = 3; // flag pixel as outer edge } } - + /* Test the BOTTOM row of pixels in buffer, except corners */ for (x = rw - 2; x; x--) { // test if inner mask is filled @@ -167,7 +167,7 @@ static void do_adjacentKeepBorders(unsigned int t, unsigned int rw, unsigned int 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) { // test if inner mask is filled @@ -187,7 +187,7 @@ static void do_adjacentKeepBorders(unsigned int t, unsigned int rw, unsigned int lres[x] = 3; // flag pixel as outer edge } } - + rsize[0] = isz; // fill in our return sizes for edges + fill rsize[1] = osz; rsize[2] = gsz; @@ -321,7 +321,7 @@ 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--) { // test if inner mask is filled @@ -372,7 +372,7 @@ 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) { // test if inner mask is filled @@ -398,7 +398,7 @@ static void do_adjacentBleedBorders(unsigned int t, unsigned int rw, unsigned in } } } - + rsize[0] = isz; // fill in our return sizes for edges + fill rsize[1] = osz; rsize[2] = gsz; @@ -479,7 +479,7 @@ static void do_allKeepBorders(unsigned int t, unsigned int rw, unsigned int *lim 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--) { // test if inner mask is filled @@ -498,7 +498,7 @@ static void do_allKeepBorders(unsigned int t, unsigned int rw, unsigned int *lim lres[x] = 3; // flag pixel as outer edge } } - + /* Test the BOTTOM row of pixels in buffer, except corners */ for (x = rw - 2; x; x--) { // test if inner mask is filled @@ -535,7 +535,7 @@ static void do_allKeepBorders(unsigned int t, unsigned int rw, unsigned int *lim 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) { // test if inner mask is filled @@ -554,7 +554,7 @@ static void do_allKeepBorders(unsigned int t, unsigned int rw, unsigned int *lim lres[x] = 3; // flag pixel as outer edge } } - + rsize[0] = isz; // fill in our return sizes for edges + fill rsize[1] = osz; rsize[2] = gsz; @@ -683,7 +683,7 @@ 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--) { // test if inner mask is filled @@ -732,7 +732,7 @@ 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) { // test if inner mask is filled @@ -757,7 +757,7 @@ static void do_allBleedBorders(unsigned int t, unsigned int rw, unsigned int *li } } } - + rsize[0] = isz; // fill in our return sizes for edges + fill rsize[1] = osz; rsize[2] = gsz; @@ -801,7 +801,7 @@ static void do_allEdgeDetection(unsigned int t, unsigned int rw, unsigned int *l lres[a] = 2; // flag pixel as gradient } } - + } else { if (!limask[pix_nextCol] || !limask[pix_prevCol] || !limask[pix_nextRow] || !limask[pix_prevRow]) { @@ -819,7 +819,7 @@ static void do_allEdgeDetection(unsigned int t, unsigned int rw, unsigned int *l pix_nextCol--; } } - + rsize[0] = in_isz; // fill in our return sizes for edges + fill rsize[1] = in_osz; rsize[2] = in_gsz; @@ -863,7 +863,7 @@ static void do_adjacentEdgeDetection(unsigned int t, unsigned int rw, unsigned i lres[a] = 2; // flag pixel as gradient } } - + } else { if ((!limask[pix_nextCol] && lomask[pix_nextCol]) || @@ -885,7 +885,7 @@ static void do_adjacentEdgeDetection(unsigned int t, unsigned int rw, unsigned i pix_nextCol--; } } - + rsize[0] = in_isz; // fill in our return sizes for edges + fill rsize[1] = in_osz; rsize[2] = in_gsz; @@ -897,7 +897,7 @@ static void do_createEdgeLocationBuffer(unsigned int t, unsigned int rw, unsigne int a; // a = temporary pixel index buffer loop counter unsigned int ud; // ud = unscaled edge distance unsigned int dmin; // dmin = minimum edge distance - + unsigned int rsl; // long used for finding fast 1.0/sqrt unsigned int gradientFillOffset; unsigned int innerAccum = 0; // for looping inner edge pixel indexes, represents current position from offset @@ -999,7 +999,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) @@ -1010,7 +1010,7 @@ static void do_fillGradientBuffer(unsigned int rw, float *res, unsigned short *g unsigned int rsl; // long used for finding fast 1.0/sqrt float rsf; // float used for finding fast 1.0/sqrt const float rsopf = 1.5f; // constant float used for finding fast 1.0/sqrt - + unsigned int gradientFillOffset; unsigned int t; unsigned int ud; // ud = unscaled edge distance @@ -1019,7 +1019,7 @@ static void do_fillGradientBuffer(unsigned int rw, float *res, unsigned short *g float idist; // idist = current inner edge distance int dx; // dx = X-delta (used for distance proportion calculation) int dy; // dy = Y-delta (used for distance proportion calculation) - + /* * The general algorithm used to color each gradient pixel is: * @@ -1057,7 +1057,7 @@ static void do_fillGradientBuffer(unsigned int rw, float *res, unsigned short *g * G = gradient pixel * | * I = inside edge pixel - * + * * __ * *note that IO does not need to be a straight line, in fact * many cases can arise where straight lines do not work @@ -1120,14 +1120,14 @@ static void do_fillGradientBuffer(unsigned int rw, float *res, unsigned short *g * proportion is already the correct intensity, and does not need to be * subtracted from 1.0 like it would have if we used real distances. */ - + /* * Here we reconstruct the pixel's memory location in the CompBuf by * Pixel Index = Pixel Column + ( Pixel Row * Row Width ) */ res[gbuf[gradientFillOffset + 1] + (gbuf[gradientFillOffset] * rw)] = (idist / (idist + odist)); //set intensity } - + } // end of copy @@ -1137,31 +1137,31 @@ void DoubleEdgeMaskOperation::doDoubleEdgeMask(float *imask, float *omask, float unsigned int *lres; // lres = unsigned int pointer to output pixel buffer (for bit operations) unsigned int *limask; // limask = unsigned int pointer to inner mask (for bit operations) unsigned int *lomask; // lomask = unsigned int pointer to outer mask (for bit operations) - + int rw; // rw = pixel row width int t; // t = total number of pixels in buffer - 1 (used for loop starts) int fsz; // size of the frame - + unsigned int isz = 0; // size (in pixels) of inside edge pixel index buffer unsigned int osz = 0; // size (in pixels) of outside edge pixel index buffer unsigned int gsz = 0; // size (in pixels) of gradient pixel index buffer unsigned int rsize[3]; // size storage to pass to helper functions unsigned int innerEdgeOffset = 0; // offset into final buffer where inner edge pixel indexes start unsigned int outerEdgeOffset = 0; // offset into final buffer where outer edge pixel indexes start - + unsigned short *gbuf; // gradient/inner/outer pixel location index buffer - + if (true) { // if both input sockets have some data coming in... - + rw = this->getWidth(); // width of a row of pixels t = (rw * this->getHeight()) - 1; // determine size of the frame memset(res, 0, sizeof(float) * (t + 1)); // clear output buffer (not all pixels will be written later) - + lres = (unsigned int *)res; // unsigned int pointer to output buffer (for bit level ops) limask = (unsigned int *)imask; // unsigned int pointer to input mask (for bit level ops) lomask = (unsigned int *)omask; // unsigned int pointer to output mask (for bit level ops) - - + + /* * The whole buffer is broken up into 4 parts. The four CORNERS, the FIRST and LAST rows, the * LEFT and RIGHT edges (excluding the corner pixels), and all OTHER rows. @@ -1213,17 +1213,17 @@ void DoubleEdgeMaskOperation::doDoubleEdgeMask(float *imask, float *omask, float // detect edges in all non-border pixels in the buffer do_allEdgeDetection(t, rw, limask, lomask, lres, res, rsize, isz, osz, gsz); } - + isz = rsize[0]; // set edge and gradient buffer sizes once again... osz = rsize[1]; // the sizes in rsize[] may have been modified gsz = rsize[2]; // by the do_*EdgeDetection() function. - + fsz = gsz + isz + osz; // calculate size of pixel index buffer needed gbuf = (unsigned short *)MEM_callocN(sizeof(unsigned short) * fsz * 2, "DEM"); // allocate edge/gradient pixel index buffer - + do_createEdgeLocationBuffer(t, rw, lres, res, gbuf, &innerEdgeOffset, &outerEdgeOffset, isz, gsz); do_fillGradientBuffer(rw, res, gbuf, isz, osz, gsz, innerEdgeOffset, outerEdgeOffset); - + MEM_freeN(gbuf); // free the gradient index buffer } } @@ -1267,7 +1267,7 @@ void *DoubleEdgeMaskOperation::initializeTileData(rcti *rect) { if (this->m_cachedInstance) return this->m_cachedInstance; - + lockMutex(); if (this->m_cachedInstance == NULL) { MemoryBuffer *innerMask = (MemoryBuffer *)this->m_inputInnerMask->initializeTileData(rect); diff --git a/source/blender/compositor/operations/COM_DoubleEdgeMaskOperation.h b/source/blender/compositor/operations/COM_DoubleEdgeMaskOperation.h index a12c44b02a1..4574454dd02 100644 --- a/source/blender/compositor/operations/COM_DoubleEdgeMaskOperation.h +++ b/source/blender/compositor/operations/COM_DoubleEdgeMaskOperation.h @@ -43,12 +43,12 @@ public: * the inner loop of this program */ void executePixel(float output[4], int x, int y, void *data); - + /** * Initialize the execution */ void initExecution(); - + /** * Deinitialize the execution */ @@ -57,7 +57,7 @@ public: void *initializeTileData(rcti *rect); bool determineDependingAreaOfInterest(rcti *input, ReadBufferOperation *readOperation, rcti *output); - + void setAdjecentOnly(bool adjecentOnly) { this->m_adjecentOnly = adjecentOnly; } void setKeepInside(bool keepInside) { this->m_keepInside = keepInside; } }; diff --git a/source/blender/compositor/operations/COM_EllipseMaskOperation.cpp b/source/blender/compositor/operations/COM_EllipseMaskOperation.cpp index 482473cbe1f..fac0e028c6d 100644 --- a/source/blender/compositor/operations/COM_EllipseMaskOperation.cpp +++ b/source/blender/compositor/operations/COM_EllipseMaskOperation.cpp @@ -48,18 +48,18 @@ void EllipseMaskOperation::executePixelSampled(float output[4], float x, float y { float inputMask[4]; float inputValue[4]; - + float rx = x / this->getWidth(); float ry = y / this->getHeight(); - + const float dy = (ry - this->m_data->y) / this->m_aspectRatio; const float dx = rx - this->m_data->x; rx = this->m_data->x + (this->m_cosine * dx + this->m_sine * dy); ry = this->m_data->y + (-this->m_sine * dx + this->m_cosine * dy); - + this->m_inputMask->readSampled(inputMask, x, y, sampler); this->m_inputValue->readSampled(inputValue, x, y, sampler); - + const float halfHeight = (this->m_data->height) / 2.0f; const float halfWidth = this->m_data->width / 2.0f; float sx = rx - this->m_data->x; @@ -68,9 +68,9 @@ void EllipseMaskOperation::executePixelSampled(float output[4], float x, float y float sy = ry - this->m_data->y; sy *= sy; const float ty = halfHeight * halfHeight; - + bool inside = ((sx / tx) + (sy / ty)) < 1.0f; - + switch (this->m_maskType) { case CMP_NODE_MASKTYPE_ADD: if (inside) { diff --git a/source/blender/compositor/operations/COM_EllipseMaskOperation.h b/source/blender/compositor/operations/COM_EllipseMaskOperation.h index 419b2c2d63b..9de9fb3e11c 100644 --- a/source/blender/compositor/operations/COM_EllipseMaskOperation.h +++ b/source/blender/compositor/operations/COM_EllipseMaskOperation.h @@ -32,34 +32,34 @@ private: */ SocketReader *m_inputMask; SocketReader *m_inputValue; - + float m_sine; float m_cosine; float m_aspectRatio; int m_maskType; - + NodeEllipseMask *m_data; public: EllipseMaskOperation(); - + /** * the inner loop of this program */ void executePixelSampled(float output[4], float x, float y, PixelSampler sampler); - + /** * Initialize the execution */ void initExecution(); - + /** * Deinitialize the execution */ void deinitExecution(); - + void setData(NodeEllipseMask *data) { this->m_data = data; } void setMaskType(int maskType) { this->m_maskType = maskType; } - + }; #endif diff --git a/source/blender/compositor/operations/COM_FastGaussianBlurOperation.cpp b/source/blender/compositor/operations/COM_FastGaussianBlurOperation.cpp index a223ac31e3d..11843da3634 100644 --- a/source/blender/compositor/operations/COM_FastGaussianBlurOperation.cpp +++ b/source/blender/compositor/operations/COM_FastGaussianBlurOperation.cpp @@ -70,7 +70,7 @@ void FastGaussianBlurOperation::initExecution() BlurBaseOperation::initMutex(); } -void FastGaussianBlurOperation::deinitExecution() +void FastGaussianBlurOperation::deinitExecution() { if (this->m_iirgaus) { delete this->m_iirgaus; @@ -90,7 +90,7 @@ void *FastGaussianBlurOperation::initializeTileData(rcti *rect) int c; this->m_sx = this->m_data.sizex * this->m_size / 2.0f; this->m_sy = this->m_data.sizey * this->m_size / 2.0f; - + if ((this->m_sx == this->m_sy) && (this->m_sx > 0.0f)) { for (c = 0; c < COM_NUM_CHANNELS_COLOR; ++c) IIR_gauss(copy, this->m_sx, c, 3); @@ -121,18 +121,18 @@ void FastGaussianBlurOperation::IIR_gauss(MemoryBuffer *src, float sigma, unsign unsigned int i; float *buffer = src->getBuffer(); const unsigned int num_channels = src->get_num_channels(); - + // <0.5 not valid, though can have a possibly useful sort of sharpening effect if (sigma < 0.5f) return; - + if ((xy < 1) || (xy > 3)) xy = 3; - + // XXX The YVV macro defined below explicitly expects sources of at least 3x3 pixels, // so just skiping blur along faulty direction if src's def is below that limit! if (src_width < 3) xy &= ~1; if (src_height < 3) xy &= ~2; if (xy < 1) return; - + // see "Recursive Gabor Filtering" by Young/VanVliet // all factors here in double.prec. Required, because for single.prec it seems to blow up if sigma > ~200 if (sigma >= 3.556f) @@ -148,7 +148,7 @@ void FastGaussianBlurOperation::IIR_gauss(MemoryBuffer *src, float sigma, unsign // 0 & 3 unchanged cf[3] = q2 * q / sc; cf[0] = 1.0 - cf[1] - cf[2] - cf[3]; - + // Triggs/Sdika border corrections, // it seems to work, not entirely sure if it is actually totally correct, // Besides J.M.Geusebroek's anigauss.c (see http://www.science.uva.nl/~mark), @@ -166,7 +166,7 @@ void FastGaussianBlurOperation::IIR_gauss(MemoryBuffer *src, float sigma, unsign tsM[6] = sc * (cf[3] * cf[1] + cf[2] + cf[1] * cf[1] - cf[2] * cf[2]); tsM[7] = sc * (cf[1] * cf[2] + cf[3] * cf[2] * cf[2] - cf[1] * cf[3] * cf[3] - cf[3] * cf[3] * cf[3] - cf[3] * cf[2] + cf[3]); tsM[8] = sc * (cf[3] * (cf[1] + cf[3] * cf[2])); - + #define YVV(L) \ { \ W[0] = cf[0] * X[0] + cf[1] * X[0] + cf[2] * X[0] + cf[3] * X[0]; \ @@ -189,7 +189,7 @@ void FastGaussianBlurOperation::IIR_gauss(MemoryBuffer *src, float sigma, unsign Y[i] = cf[0] * W[i] + cf[1] * Y[i + 1] + cf[2] * Y[i + 2] + cf[3] * Y[i + 3]; \ } \ } (void)0 - + // intermediate buffers sz = max(src_width, src_height); X = (double *)MEM_callocN(sz * sizeof(double), "IIR_gauss X buf"); @@ -230,12 +230,12 @@ void FastGaussianBlurOperation::IIR_gauss(MemoryBuffer *src, float sigma, unsign } } } - + MEM_freeN(X); MEM_freeN(W); MEM_freeN(Y); #undef YVV - + } @@ -260,7 +260,7 @@ void FastGaussianBlurValueOperation::executePixel(float output[4], int x, int y, bool FastGaussianBlurValueOperation::determineDependingAreaOfInterest(rcti * /*input*/, ReadBufferOperation *readOperation, rcti *output) { rcti newInput; - + if (this->m_iirgaus) { return false; } @@ -279,7 +279,7 @@ void FastGaussianBlurValueOperation::initExecution() initMutex(); } -void FastGaussianBlurValueOperation::deinitExecution() +void FastGaussianBlurValueOperation::deinitExecution() { if (this->m_iirgaus) { delete this->m_iirgaus; diff --git a/source/blender/compositor/operations/COM_FastGaussianBlurOperation.h b/source/blender/compositor/operations/COM_FastGaussianBlurOperation.h index 1cfaee3f537..2b02cf322ef 100644 --- a/source/blender/compositor/operations/COM_FastGaussianBlurOperation.h +++ b/source/blender/compositor/operations/COM_FastGaussianBlurOperation.h @@ -35,7 +35,7 @@ public: FastGaussianBlurOperation(); bool determineDependingAreaOfInterest(rcti *input, ReadBufferOperation *readOperation, rcti *output); void executePixel(float output[4], int x, int y, void *data); - + static void IIR_gauss(MemoryBuffer *src, float sigma, unsigned int channel, unsigned int xy); void *initializeTileData(rcti *rect); void deinitExecution(); @@ -63,7 +63,7 @@ public: FastGaussianBlurValueOperation(); bool determineDependingAreaOfInterest(rcti *input, ReadBufferOperation *readOperation, rcti *output); void executePixel(float output[4], int x, int y, void *data); - + void *initializeTileData(rcti *rect); void deinitExecution(); void initExecution(); diff --git a/source/blender/compositor/operations/COM_FlipOperation.cpp b/source/blender/compositor/operations/COM_FlipOperation.cpp index 80e67a7297b..c75201903eb 100644 --- a/source/blender/compositor/operations/COM_FlipOperation.cpp +++ b/source/blender/compositor/operations/COM_FlipOperation.cpp @@ -46,14 +46,14 @@ void FlipOperation::executePixelSampled(float output[4], float x, float y, Pixel { float nx = this->m_flipX ? ((int)this->getWidth() - 1) - x : x; float ny = this->m_flipY ? ((int)this->getHeight() - 1) - y : y; - + this->m_inputOperation->readSampled(output, nx, ny, sampler); } bool FlipOperation::determineDependingAreaOfInterest(rcti *input, ReadBufferOperation *readOperation, rcti *output) { rcti newInput; - + if (this->m_flipX) { const int w = (int)this->getWidth() - 1; newInput.xmax = (w - input->xmin) + 1; @@ -72,6 +72,6 @@ bool FlipOperation::determineDependingAreaOfInterest(rcti *input, ReadBufferOper newInput.ymin = input->ymin; newInput.ymax = input->ymax; } - + return NodeOperation::determineDependingAreaOfInterest(&newInput, readOperation, output); } diff --git a/source/blender/compositor/operations/COM_FlipOperation.h b/source/blender/compositor/operations/COM_FlipOperation.h index 3a7bf77f29b..e577259fea4 100644 --- a/source/blender/compositor/operations/COM_FlipOperation.h +++ b/source/blender/compositor/operations/COM_FlipOperation.h @@ -34,7 +34,7 @@ public: FlipOperation(); bool determineDependingAreaOfInterest(rcti *input, ReadBufferOperation *readOperation, rcti *output); void executePixelSampled(float output[4], float x, float y, PixelSampler sampler); - + void initExecution(); void deinitExecution(); void setFlipX(bool flipX) { this->m_flipX = flipX; } diff --git a/source/blender/compositor/operations/COM_GammaCorrectOperation.h b/source/blender/compositor/operations/COM_GammaCorrectOperation.h index b3f0cedce22..aabfe09fbf2 100644 --- a/source/blender/compositor/operations/COM_GammaCorrectOperation.h +++ b/source/blender/compositor/operations/COM_GammaCorrectOperation.h @@ -34,17 +34,17 @@ private: public: GammaCorrectOperation(); - + /** * the inner loop of this program */ void executePixelSampled(float output[4], float x, float y, PixelSampler sampler); - + /** * Initialize the execution */ void initExecution(); - + /** * Deinitialize the execution */ @@ -60,17 +60,17 @@ private: public: GammaUncorrectOperation(); - + /** * the inner loop of this program */ void executePixelSampled(float output[4], float x, float y, PixelSampler sampler); - + /** * Initialize the execution */ void initExecution(); - + /** * Deinitialize the execution */ diff --git a/source/blender/compositor/operations/COM_GammaOperation.cpp b/source/blender/compositor/operations/COM_GammaOperation.cpp index 79b70b5170e..0cc0cbefd46 100644 --- a/source/blender/compositor/operations/COM_GammaOperation.cpp +++ b/source/blender/compositor/operations/COM_GammaOperation.cpp @@ -41,7 +41,7 @@ void GammaOperation::executePixelSampled(float output[4], float x, float y, Pixe { float inputValue[4]; float inputGamma[4]; - + this->m_inputProgram->readSampled(inputValue, x, y, sampler); this->m_inputGammaProgram->readSampled(inputGamma, x, y, sampler); const float gamma = inputGamma[0]; @@ -49,7 +49,7 @@ void GammaOperation::executePixelSampled(float output[4], float x, float y, Pixe output[0] = inputValue[0] > 0.0f ? powf(inputValue[0], gamma) : inputValue[0]; output[1] = inputValue[1] > 0.0f ? powf(inputValue[1], gamma) : inputValue[1]; output[2] = inputValue[2] > 0.0f ? powf(inputValue[2], gamma) : inputValue[2]; - + output[3] = inputValue[3]; } diff --git a/source/blender/compositor/operations/COM_GammaOperation.h b/source/blender/compositor/operations/COM_GammaOperation.h index 9243ece6b30..ce221965eb5 100644 --- a/source/blender/compositor/operations/COM_GammaOperation.h +++ b/source/blender/compositor/operations/COM_GammaOperation.h @@ -35,17 +35,17 @@ private: public: GammaOperation(); - + /** * the inner loop of this program */ void executePixelSampled(float output[4], float x, float y, PixelSampler sampler); - + /** * Initialize the execution */ void initExecution(); - + /** * Deinitialize the execution */ diff --git a/source/blender/compositor/operations/COM_GaussianAlphaXBlurOperation.cpp b/source/blender/compositor/operations/COM_GaussianAlphaXBlurOperation.cpp index 0fab888b9d9..c560257b859 100644 --- a/source/blender/compositor/operations/COM_GaussianAlphaXBlurOperation.cpp +++ b/source/blender/compositor/operations/COM_GaussianAlphaXBlurOperation.cpp @@ -56,7 +56,7 @@ void GaussianAlphaXBlurOperation::initExecution() if (this->m_sizeavailable) { float rad = max_ff(m_size * m_data.sizex, 0.0f); m_filtersize = min_ii(ceil(rad), MAX_GAUSSTAB_RADIUS); - + m_gausstab = BlurBaseOperation::make_gausstab(rad, m_filtersize); m_distbuf_inv = BlurBaseOperation::make_dist_fac_inverse(rad, m_filtersize, m_falloff); } @@ -68,7 +68,7 @@ void GaussianAlphaXBlurOperation::updateGauss() updateSize(); float rad = max_ff(m_size * m_data.sizex, 0.0f); m_filtersize = min_ii(ceil(rad), MAX_GAUSSTAB_RADIUS); - + m_gausstab = BlurBaseOperation::make_gausstab(rad, m_filtersize); } @@ -76,7 +76,7 @@ void GaussianAlphaXBlurOperation::updateGauss() updateSize(); float rad = max_ff(m_size * m_data.sizex, 0.0f); m_filtersize = min_ii(ceil(rad), MAX_GAUSSTAB_RADIUS); - + m_distbuf_inv = BlurBaseOperation::make_dist_fac_inverse(rad, m_filtersize, m_falloff); } } diff --git a/source/blender/compositor/operations/COM_GaussianAlphaXBlurOperation.h b/source/blender/compositor/operations/COM_GaussianAlphaXBlurOperation.h index fc5b3384749..651e8d9e658 100644 --- a/source/blender/compositor/operations/COM_GaussianAlphaXBlurOperation.h +++ b/source/blender/compositor/operations/COM_GaussianAlphaXBlurOperation.h @@ -41,7 +41,7 @@ public: * @brief the inner loop of this program */ void executePixel(float output[4], int x, int y, void *data); - + /** * @brief initialize the execution */ @@ -51,7 +51,7 @@ public: * @brief Deinitialize the execution */ void deinitExecution(); - + void *initializeTileData(rcti *rect); bool determineDependingAreaOfInterest(rcti *input, ReadBufferOperation *readOperation, rcti *output); diff --git a/source/blender/compositor/operations/COM_GaussianAlphaYBlurOperation.cpp b/source/blender/compositor/operations/COM_GaussianAlphaYBlurOperation.cpp index b4e535cbf20..b90320afdeb 100644 --- a/source/blender/compositor/operations/COM_GaussianAlphaYBlurOperation.cpp +++ b/source/blender/compositor/operations/COM_GaussianAlphaYBlurOperation.cpp @@ -56,7 +56,7 @@ void GaussianAlphaYBlurOperation::initExecution() if (this->m_sizeavailable) { float rad = max_ff(m_size * m_data.sizey, 0.0f); m_filtersize = min_ii(ceil(rad), MAX_GAUSSTAB_RADIUS); - + m_gausstab = BlurBaseOperation::make_gausstab(rad, m_filtersize); m_distbuf_inv = BlurBaseOperation::make_dist_fac_inverse(rad, m_filtersize, m_falloff); } @@ -68,7 +68,7 @@ void GaussianAlphaYBlurOperation::updateGauss() updateSize(); float rad = max_ff(m_size * m_data.sizey, 0.0f); m_filtersize = min_ii(ceil(rad), MAX_GAUSSTAB_RADIUS); - + m_gausstab = BlurBaseOperation::make_gausstab(rad, m_filtersize); } @@ -76,7 +76,7 @@ void GaussianAlphaYBlurOperation::updateGauss() updateSize(); float rad = max_ff(m_size * m_data.sizey, 0.0f); m_filtersize = min_ii(ceil(rad), MAX_GAUSSTAB_RADIUS); - + m_distbuf_inv = BlurBaseOperation::make_dist_fac_inverse(rad, m_filtersize, m_falloff); } } diff --git a/source/blender/compositor/operations/COM_GaussianAlphaYBlurOperation.h b/source/blender/compositor/operations/COM_GaussianAlphaYBlurOperation.h index 4f2f2ec3fe4..dc9e5607ae6 100644 --- a/source/blender/compositor/operations/COM_GaussianAlphaYBlurOperation.h +++ b/source/blender/compositor/operations/COM_GaussianAlphaYBlurOperation.h @@ -36,12 +36,12 @@ private: void updateGauss(); public: GaussianAlphaYBlurOperation(); - + /** * the inner loop of this program */ void executePixel(float output[4], int x, int y, void *data); - + /** * @brief initialize the execution */ @@ -51,7 +51,7 @@ public: * Deinitialize the execution */ void deinitExecution(); - + void *initializeTileData(rcti *rect); bool determineDependingAreaOfInterest(rcti *input, ReadBufferOperation *readOperation, rcti *output); diff --git a/source/blender/compositor/operations/COM_GaussianBokehBlurOperation.cpp b/source/blender/compositor/operations/COM_GaussianBokehBlurOperation.cpp index c268cff557a..483ddb53344 100644 --- a/source/blender/compositor/operations/COM_GaussianBokehBlurOperation.cpp +++ b/source/blender/compositor/operations/COM_GaussianBokehBlurOperation.cpp @@ -70,18 +70,18 @@ void GaussianBokehBlurOperation::updateGauss() } radxf = this->m_size * (float)this->m_data.sizex; CLAMP(radxf, 0.0f, width / 2.0f); - + /* vertical */ radyf = this->m_size * (float)this->m_data.sizey; CLAMP(radyf, 0.0f, height / 2.0f); - + this->m_radx = ceil(radxf); this->m_rady = ceil(radyf); - + int ddwidth = 2 * this->m_radx + 1; int ddheight = 2 * this->m_rady + 1; n = ddwidth * ddheight; - + /* create a full filter image */ ddgauss = (float *)MEM_mallocN(sizeof(float) * n, __func__); dgauss = ddgauss; @@ -94,7 +94,7 @@ void GaussianBokehBlurOperation::updateGauss() float fi = (float)i * facx; float dist = sqrt(fj * fj + fi * fi); *dgauss = RE_filter_value(this->m_data.filtertype, dist); - + sum += *dgauss; } } @@ -109,7 +109,7 @@ void GaussianBokehBlurOperation::updateGauss() int center = m_rady * ddwidth + m_radx; ddgauss[center] = 1.0f; } - + this->m_gausstab = ddgauss; } } @@ -175,7 +175,7 @@ bool GaussianBokehBlurOperation::determineDependingAreaOfInterest(rcti *input, R sizeInput.xmax = 5; sizeInput.ymax = 5; NodeOperation *operation = this->getInputOperation(1); - + if (operation->determineDependingAreaOfInterest(&sizeInput, readOperation, output)) { return true; } @@ -233,8 +233,8 @@ void GaussianBlurReferenceOperation::initExecution() break; } } - - + + /* horizontal */ m_filtersizex = (float)this->m_data.sizex; int imgx = getWidth() / 2; @@ -307,7 +307,7 @@ void GaussianBlurReferenceOperation::executePixel(float output[4], int x, int y, for (i = minyr; i < maxyr; i++, srcd += COM_NUM_CHANNELS_COLOR * imgx) { src = srcd; for (j = minxr; j < maxxr; j++, src += COM_NUM_CHANNELS_COLOR) { - + val = gausstabcenty[i] * gausstabcentx[j]; sum += val; rval += val * src[0]; @@ -340,7 +340,7 @@ bool GaussianBlurReferenceOperation::determineDependingAreaOfInterest(rcti *inpu { rcti newInput; NodeOperation *operation = this->getInputOperation(1); - + if (operation->determineDependingAreaOfInterest(input, readOperation, output)) { return true; } diff --git a/source/blender/compositor/operations/COM_GaussianBokehBlurOperation.h b/source/blender/compositor/operations/COM_GaussianBokehBlurOperation.h index e483ffd4f2d..9089838add5 100644 --- a/source/blender/compositor/operations/COM_GaussianBokehBlurOperation.h +++ b/source/blender/compositor/operations/COM_GaussianBokehBlurOperation.h @@ -40,19 +40,19 @@ public: * the inner loop of this program */ void executePixel(float output[4], int x, int y, void *data); - + /** * Deinitialize the execution */ void deinitExecution(); - + bool determineDependingAreaOfInterest(rcti *input, ReadBufferOperation *readOperation, rcti *output); }; class GaussianBlurReferenceOperation : public BlurBaseOperation { private: float **m_maintabs; - + void updateGauss(); int m_filtersizex; int m_filtersizey; @@ -67,12 +67,12 @@ public: * the inner loop of this program */ void executePixel(float output[4], int x, int y, void *data); - + /** * Deinitialize the execution */ void deinitExecution(); - + bool determineDependingAreaOfInterest(rcti *input, ReadBufferOperation *readOperation, rcti *output); }; diff --git a/source/blender/compositor/operations/COM_GaussianXBlurOperation.cpp b/source/blender/compositor/operations/COM_GaussianXBlurOperation.cpp index ef438e1d364..3eafc7a1bfe 100644 --- a/source/blender/compositor/operations/COM_GaussianXBlurOperation.cpp +++ b/source/blender/compositor/operations/COM_GaussianXBlurOperation.cpp @@ -170,7 +170,7 @@ void GaussianXBlurOperation::deinitExecution() bool GaussianXBlurOperation::determineDependingAreaOfInterest(rcti *input, ReadBufferOperation *readOperation, rcti *output) { rcti newInput; - + if (!this->m_sizeavailable) { rcti sizeInput; sizeInput.xmin = 0; diff --git a/source/blender/compositor/operations/COM_GaussianXBlurOperation.h b/source/blender/compositor/operations/COM_GaussianXBlurOperation.h index 46a5c4e3c03..4ad57bda742 100644 --- a/source/blender/compositor/operations/COM_GaussianXBlurOperation.h +++ b/source/blender/compositor/operations/COM_GaussianXBlurOperation.h @@ -55,7 +55,7 @@ public: * @brief Deinitialize the execution */ void deinitExecution(); - + void *initializeTileData(rcti *rect); bool determineDependingAreaOfInterest(rcti *input, ReadBufferOperation *readOperation, rcti *output); diff --git a/source/blender/compositor/operations/COM_GaussianYBlurOperation.cpp b/source/blender/compositor/operations/COM_GaussianYBlurOperation.cpp index 6f8f96a6344..45089598af5 100644 --- a/source/blender/compositor/operations/COM_GaussianYBlurOperation.cpp +++ b/source/blender/compositor/operations/COM_GaussianYBlurOperation.cpp @@ -172,7 +172,7 @@ void GaussianYBlurOperation::deinitExecution() bool GaussianYBlurOperation::determineDependingAreaOfInterest(rcti *input, ReadBufferOperation *readOperation, rcti *output) { rcti newInput; - + if (!m_sizeavailable) { rcti sizeInput; sizeInput.xmin = 0; diff --git a/source/blender/compositor/operations/COM_GaussianYBlurOperation.h b/source/blender/compositor/operations/COM_GaussianYBlurOperation.h index ca3172bd505..da1adbd0ea7 100644 --- a/source/blender/compositor/operations/COM_GaussianYBlurOperation.h +++ b/source/blender/compositor/operations/COM_GaussianYBlurOperation.h @@ -35,7 +35,7 @@ private: void updateGauss(); public: GaussianYBlurOperation(); - + /** * the inner loop of this program */ @@ -55,7 +55,7 @@ public: * Deinitialize the execution */ void deinitExecution(); - + void *initializeTileData(rcti *rect); bool determineDependingAreaOfInterest(rcti *input, ReadBufferOperation *readOperation, rcti *output); diff --git a/source/blender/compositor/operations/COM_GlareThresholdOperation.cpp b/source/blender/compositor/operations/COM_GlareThresholdOperation.cpp index f54e75a6b35..62ebe601d8d 100644 --- a/source/blender/compositor/operations/COM_GlareThresholdOperation.cpp +++ b/source/blender/compositor/operations/COM_GlareThresholdOperation.cpp @@ -49,7 +49,7 @@ void GlareThresholdOperation::initExecution() void GlareThresholdOperation::executePixelSampled(float output[4], float x, float y, PixelSampler sampler) { const float threshold = this->m_settings->threshold; - + this->m_inputProgram->readSampled(output, x, y, sampler); if (IMB_colormanagement_get_luminance(output) >= threshold) { output[0] -= threshold; diff --git a/source/blender/compositor/operations/COM_GlareThresholdOperation.h b/source/blender/compositor/operations/COM_GlareThresholdOperation.h index 7760a19251b..647cf74cdcf 100644 --- a/source/blender/compositor/operations/COM_GlareThresholdOperation.h +++ b/source/blender/compositor/operations/COM_GlareThresholdOperation.h @@ -57,7 +57,7 @@ public: void setGlareSettings(NodeGlare *settings) { this->m_settings = settings; } - + void determineResolution(unsigned int resolution[2], unsigned int preferredResolution[2]); }; #endif diff --git a/source/blender/compositor/operations/COM_HueSaturationValueCorrectOperation.h b/source/blender/compositor/operations/COM_HueSaturationValueCorrectOperation.h index 06d785f2c51..97bfc836ae2 100644 --- a/source/blender/compositor/operations/COM_HueSaturationValueCorrectOperation.h +++ b/source/blender/compositor/operations/COM_HueSaturationValueCorrectOperation.h @@ -33,17 +33,17 @@ private: SocketReader *m_inputProgram; public: HueSaturationValueCorrectOperation(); - + /** * the inner loop of this program */ void executePixelSampled(float output[4], float x, float y, PixelSampler sampler); - + /** * Initialize the execution */ void initExecution(); - + /** * Deinitialize the execution */ diff --git a/source/blender/compositor/operations/COM_ImageOperation.h b/source/blender/compositor/operations/COM_ImageOperation.h index 1f9a9a45af1..8ab93c2ba64 100644 --- a/source/blender/compositor/operations/COM_ImageOperation.h +++ b/source/blender/compositor/operations/COM_ImageOperation.h @@ -57,11 +57,11 @@ protected: * Determine the output resolution. The resolution is retrieved from the Renderer */ void determineResolution(unsigned int resolution[2], unsigned int preferredResolution[2]); - + virtual ImBuf *getImBuf(); public: - + void initExecution(); void deinitExecution(); void setImage(Image *image) { this->m_image = image; } diff --git a/source/blender/compositor/operations/COM_InpaintOperation.cpp b/source/blender/compositor/operations/COM_InpaintOperation.cpp index 11896b1d78c..da31638ff07 100644 --- a/source/blender/compositor/operations/COM_InpaintOperation.cpp +++ b/source/blender/compositor/operations/COM_InpaintOperation.cpp @@ -87,7 +87,7 @@ float *InpaintSimpleOperation::get_pixel(int x, int y) x * COM_NUM_CHANNELS_COLOR]; } -int InpaintSimpleOperation::mdist(int x, int y) +int InpaintSimpleOperation::mdist(int x, int y) { int width = this->getWidth(); @@ -103,7 +103,7 @@ bool InpaintSimpleOperation::next_pixel(int &x, int &y, int & curr, int iters) if (curr >= this->m_area_size) { return false; } - + int r = this->m_pixelorder[curr++]; x = r % width; @@ -112,11 +112,11 @@ bool InpaintSimpleOperation::next_pixel(int &x, int &y, int & curr, int iters) if (this->mdist(x, y) > iters) { return false; } - + return true; } -void InpaintSimpleOperation::calc_manhatten_distance() +void InpaintSimpleOperation::calc_manhatten_distance() { int width = this->getWidth(); int height = this->getHeight(); @@ -131,9 +131,9 @@ void InpaintSimpleOperation::calc_manhatten_distance() /* no need to clamp here */ if (this->get_pixel(i, j)[3] < 1.0f) { r = width + height; - if (i > 0) + if (i > 0) r = min_ii(r, m[j * width + i - 1] + 1); - if (j > 0) + if (j > 0) r = min_ii(r, m[(j - 1) * width + i] + 1); } m[j * width + i] = r; @@ -143,27 +143,27 @@ void InpaintSimpleOperation::calc_manhatten_distance() for (int j = height - 1; j >= 0; j--) { for (int i = width - 1; i >= 0; i--) { int r = m[j * width + i]; - - if (i + 1 < width) + + if (i + 1 < width) r = min_ii(r, m[j * width + i + 1] + 1); - if (j + 1 < height) + if (j + 1 < height) r = min_ii(r, m[(j + 1) * width + i] + 1); - + m[j * width + i] = r; - + offsets[r]++; } } - + offsets[0] = 0; - + for (int i = 1; i < width + height + 1; i++) { offsets[i] += offsets[i - 1]; } - + this->m_area_size = offsets[width + height]; this->m_pixelorder = (int *)MEM_mallocN(sizeof(int) * this->m_area_size, __func__); - + for (int i = 0; i < width * height; i++) { if (m[i] > 0) { this->m_pixelorder[offsets[m[i] - 1]++] = i; @@ -230,7 +230,7 @@ void *InpaintSimpleOperation::initializeTileData(rcti *rect) int curr = 0; int x, y; - + while (this->next_pixel(x, y, curr, this->m_iterations)) { this->pix_step(x, y); } @@ -275,12 +275,12 @@ bool InpaintSimpleOperation::determineDependingAreaOfInterest(rcti * /*input*/, } else { rcti newInput; - + newInput.xmax = getWidth(); newInput.xmin = 0; newInput.ymax = getHeight(); newInput.ymin = 0; - + return NodeOperation::determineDependingAreaOfInterest(&newInput, readOperation, output); } } diff --git a/source/blender/compositor/operations/COM_InpaintOperation.h b/source/blender/compositor/operations/COM_InpaintOperation.h index 9ddcac93c5c..fe8e2dd2a19 100644 --- a/source/blender/compositor/operations/COM_InpaintOperation.h +++ b/source/blender/compositor/operations/COM_InpaintOperation.h @@ -30,9 +30,9 @@ protected: * Cached reference to the inputProgram */ SocketReader *m_inputImageProgram; - + int m_iterations; - + float *m_cached_buffer; bool m_cached_buffer_ready; @@ -41,25 +41,25 @@ protected: short *m_manhatten_distance; public: InpaintSimpleOperation(); - + /** * the inner loop of this program */ void executePixel(float output[4], int x, int y, void *data); - + /** * Initialize the execution */ void initExecution(); - + void *initializeTileData(rcti *rect); /** * Deinitialize the execution */ void deinitExecution(); - + void setIterations(int iterations) { this->m_iterations = iterations; } - + bool determineDependingAreaOfInterest(rcti *input, ReadBufferOperation *readOperation, rcti *output); private: diff --git a/source/blender/compositor/operations/COM_InvertOperation.cpp b/source/blender/compositor/operations/COM_InvertOperation.cpp index 833b91ac1e3..53f181cf008 100644 --- a/source/blender/compositor/operations/COM_InvertOperation.cpp +++ b/source/blender/compositor/operations/COM_InvertOperation.cpp @@ -45,10 +45,10 @@ void InvertOperation::executePixelSampled(float output[4], float x, float y, Pix float inputColor[4]; this->m_inputValueProgram->readSampled(inputValue, x, y, sampler); this->m_inputColorProgram->readSampled(inputColor, x, y, sampler); - + const float value = inputValue[0]; const float invertedValue = 1.0f - value; - + if (this->m_color) { output[0] = (1.0f - inputColor[0]) * value + inputColor[0] * invertedValue; output[1] = (1.0f - inputColor[1]) * value + inputColor[1] * invertedValue; @@ -57,7 +57,7 @@ void InvertOperation::executePixelSampled(float output[4], float x, float y, Pix else { copy_v3_v3(output, inputColor); } - + if (this->m_alpha) output[3] = (1.0f - inputColor[3]) * value + inputColor[3] * invertedValue; else diff --git a/source/blender/compositor/operations/COM_InvertOperation.h b/source/blender/compositor/operations/COM_InvertOperation.h index 977feeb87af..4528895c282 100644 --- a/source/blender/compositor/operations/COM_InvertOperation.h +++ b/source/blender/compositor/operations/COM_InvertOperation.h @@ -32,28 +32,28 @@ private: */ SocketReader *m_inputValueProgram; SocketReader *m_inputColorProgram; - + bool m_alpha; bool m_color; public: InvertOperation(); - + /** * the inner loop of this program */ void executePixelSampled(float output[4], float x, float y, PixelSampler sampler); - + /** * Initialize the execution */ void initExecution(); - + /** * Deinitialize the execution */ void deinitExecution(); - + void setColor(bool color) { this->m_color = color; } void setAlpha(bool alpha) { this->m_alpha = alpha; } }; diff --git a/source/blender/compositor/operations/COM_LuminanceMatteOperation.cpp b/source/blender/compositor/operations/COM_LuminanceMatteOperation.cpp index 1401ab56fbd..e07da3bd17f 100644 --- a/source/blender/compositor/operations/COM_LuminanceMatteOperation.cpp +++ b/source/blender/compositor/operations/COM_LuminanceMatteOperation.cpp @@ -54,11 +54,11 @@ void LuminanceMatteOperation::executePixelSampled(float output[4], float x, floa const float luminance = IMB_colormanagement_get_luminance(inColor); float alpha; - + /* one line thread-friend algorithm: * output[0] = min(inputValue[3], min(1.0f, max(0.0f, ((luminance - low) / (high - low)))); */ - + /* test range */ if (luminance > high) { alpha = 1.0f; diff --git a/source/blender/compositor/operations/COM_LuminanceMatteOperation.h b/source/blender/compositor/operations/COM_LuminanceMatteOperation.h index 93051f52228..951c054d241 100644 --- a/source/blender/compositor/operations/COM_LuminanceMatteOperation.h +++ b/source/blender/compositor/operations/COM_LuminanceMatteOperation.h @@ -37,15 +37,15 @@ public: * Default constructor */ LuminanceMatteOperation(); - + /** * the inner loop of this program */ void executePixelSampled(float output[4], float x, float y, PixelSampler sampler); - + void initExecution(); void deinitExecution(); - + void setSettings(NodeChroma *nodeChroma) { this->m_settings = nodeChroma; } }; #endif diff --git a/source/blender/compositor/operations/COM_MapRangeOperation.cpp b/source/blender/compositor/operations/COM_MapRangeOperation.cpp index 6124a53d5b9..f5d3b146196 100644 --- a/source/blender/compositor/operations/COM_MapRangeOperation.cpp +++ b/source/blender/compositor/operations/COM_MapRangeOperation.cpp @@ -58,7 +58,7 @@ void MapRangeOperation::executePixelSampled(float output[4], float x, float y, P this->m_sourceMaxOperation->readSampled(inputs + 2, x, y, sampler); this->m_destMinOperation->readSampled(inputs + 3, x, y, sampler); this->m_destMaxOperation->readSampled(inputs + 4, x, y, sampler); - + value = inputs[0]; source_min = inputs[1]; source_max = inputs[2]; diff --git a/source/blender/compositor/operations/COM_MapRangeOperation.h b/source/blender/compositor/operations/COM_MapRangeOperation.h index 48ecad9d226..405faf3fb2c 100644 --- a/source/blender/compositor/operations/COM_MapRangeOperation.h +++ b/source/blender/compositor/operations/COM_MapRangeOperation.h @@ -46,26 +46,26 @@ public: * Default constructor */ MapRangeOperation(); - + /** * the inner loop of this program */ void executePixelSampled(float output[4], float x, float y, PixelSampler sampler); - + /** * Initialize the execution */ void initExecution(); - + /** * Deinitialize the execution */ void deinitExecution(); - + /** * Clamp the output */ void setUseClamp(bool value) { this->m_useClamp = value; } - + }; #endif diff --git a/source/blender/compositor/operations/COM_MapUVOperation.cpp b/source/blender/compositor/operations/COM_MapUVOperation.cpp index 0112f4bbf21..54d63b6a12c 100644 --- a/source/blender/compositor/operations/COM_MapUVOperation.cpp +++ b/source/blender/compositor/operations/COM_MapUVOperation.cpp @@ -54,7 +54,7 @@ void MapUVOperation::executePixelSampled(float output[4], float x, float y, Pixe /* EWA filtering */ this->m_inputColorProgram->readFiltered(output, uv[0], uv[1], deriv[0], deriv[1]); - + /* UV to alpha threshold */ const float threshold = this->m_alpha * 0.05f; /* XXX alpha threshold is used to fade out pixels on boundaries with invalid derivatives. diff --git a/source/blender/compositor/operations/COM_MapUVOperation.h b/source/blender/compositor/operations/COM_MapUVOperation.h index 796ee952607..1bb26bf14f0 100644 --- a/source/blender/compositor/operations/COM_MapUVOperation.h +++ b/source/blender/compositor/operations/COM_MapUVOperation.h @@ -33,7 +33,7 @@ private: SocketReader *m_inputColorProgram; float m_alpha; - + public: MapUVOperation(); @@ -53,7 +53,7 @@ public: * Initialize the execution */ void initExecution(); - + /** * Deinitialize the execution */ diff --git a/source/blender/compositor/operations/COM_MapValueOperation.cpp b/source/blender/compositor/operations/COM_MapValueOperation.cpp index 59d4d836b1b..afe3961dbf1 100644 --- a/source/blender/compositor/operations/COM_MapValueOperation.cpp +++ b/source/blender/compositor/operations/COM_MapValueOperation.cpp @@ -46,7 +46,7 @@ void MapValueOperation::executePixelSampled(float output[4], float x, float y, P if (texmap->flag & TEXMAP_CLIP_MAX) if (value > texmap->max[0]) value = texmap->max[0]; - + output[0] = value; } diff --git a/source/blender/compositor/operations/COM_MapValueOperation.h b/source/blender/compositor/operations/COM_MapValueOperation.h index ba19e76f4db..97528efca19 100644 --- a/source/blender/compositor/operations/COM_MapValueOperation.h +++ b/source/blender/compositor/operations/COM_MapValueOperation.h @@ -41,26 +41,26 @@ public: * Default constructor */ MapValueOperation(); - + /** * the inner loop of this program */ void executePixelSampled(float output[4], float x, float y, PixelSampler sampler); - + /** * Initialize the execution */ void initExecution(); - + /** * Deinitialize the execution */ void deinitExecution(); - + /** * @brief set the TexMapping settings */ void setSettings(TexMapping *settings) { this->m_settings = settings; } - + }; #endif diff --git a/source/blender/compositor/operations/COM_MathBaseOperation.cpp b/source/blender/compositor/operations/COM_MathBaseOperation.cpp index bb6e1f9da8d..0a515da1877 100644 --- a/source/blender/compositor/operations/COM_MathBaseOperation.cpp +++ b/source/blender/compositor/operations/COM_MathBaseOperation.cpp @@ -76,10 +76,10 @@ void MathAddOperation::executePixelSampled(float output[4], float x, float y, Pi { float inputValue1[4]; float inputValue2[4]; - + this->m_inputValue1Operation->readSampled(inputValue1, x, y, sampler); this->m_inputValue2Operation->readSampled(inputValue2, x, y, sampler); - + output[0] = inputValue1[0] + inputValue2[0]; clampIfNeeded(output); @@ -89,10 +89,10 @@ void MathSubtractOperation::executePixelSampled(float output[4], float x, float { float inputValue1[4]; float inputValue2[4]; - + this->m_inputValue1Operation->readSampled(inputValue1, x, y, sampler); this->m_inputValue2Operation->readSampled(inputValue2, x, y, sampler); - + output[0] = inputValue1[0] - inputValue2[0]; clampIfNeeded(output); @@ -102,10 +102,10 @@ void MathMultiplyOperation::executePixelSampled(float output[4], float x, float { float inputValue1[4]; float inputValue2[4]; - + this->m_inputValue1Operation->readSampled(inputValue1, x, y, sampler); this->m_inputValue2Operation->readSampled(inputValue2, x, y, sampler); - + output[0] = inputValue1[0] * inputValue2[0]; clampIfNeeded(output); @@ -115,10 +115,10 @@ void MathDivideOperation::executePixelSampled(float output[4], float x, float y, { float inputValue1[4]; float inputValue2[4]; - + this->m_inputValue1Operation->readSampled(inputValue1, x, y, sampler); this->m_inputValue2Operation->readSampled(inputValue2, x, y, sampler); - + if (inputValue2[0] == 0) /* We don't want to divide by zero. */ output[0] = 0.0; else @@ -131,10 +131,10 @@ void MathSineOperation::executePixelSampled(float output[4], float x, float y, P { float inputValue1[4]; float inputValue2[4]; - + this->m_inputValue1Operation->readSampled(inputValue1, x, y, sampler); this->m_inputValue2Operation->readSampled(inputValue2, x, y, sampler); - + output[0] = sin(inputValue1[0]); clampIfNeeded(output); @@ -144,10 +144,10 @@ void MathCosineOperation::executePixelSampled(float output[4], float x, float y, { float inputValue1[4]; float inputValue2[4]; - + this->m_inputValue1Operation->readSampled(inputValue1, x, y, sampler); this->m_inputValue2Operation->readSampled(inputValue2, x, y, sampler); - + output[0] = cos(inputValue1[0]); clampIfNeeded(output); @@ -157,10 +157,10 @@ void MathTangentOperation::executePixelSampled(float output[4], float x, float y { float inputValue1[4]; float inputValue2[4]; - + this->m_inputValue1Operation->readSampled(inputValue1, x, y, sampler); this->m_inputValue2Operation->readSampled(inputValue2, x, y, sampler); - + output[0] = tan(inputValue1[0]); clampIfNeeded(output); @@ -170,10 +170,10 @@ void MathArcSineOperation::executePixelSampled(float output[4], float x, float y { float inputValue1[4]; float inputValue2[4]; - + this->m_inputValue1Operation->readSampled(inputValue1, x, y, sampler); this->m_inputValue2Operation->readSampled(inputValue2, x, y, sampler); - + if (inputValue1[0] <= 1 && inputValue1[0] >= -1) output[0] = asin(inputValue1[0]); else @@ -186,10 +186,10 @@ void MathArcCosineOperation::executePixelSampled(float output[4], float x, float { float inputValue1[4]; float inputValue2[4]; - + this->m_inputValue1Operation->readSampled(inputValue1, x, y, sampler); this->m_inputValue2Operation->readSampled(inputValue2, x, y, sampler); - + if (inputValue1[0] <= 1 && inputValue1[0] >= -1) output[0] = acos(inputValue1[0]); else @@ -202,10 +202,10 @@ void MathArcTangentOperation::executePixelSampled(float output[4], float x, floa { float inputValue1[4]; float inputValue2[4]; - + this->m_inputValue1Operation->readSampled(inputValue1, x, y, sampler); this->m_inputValue2Operation->readSampled(inputValue2, x, y, sampler); - + output[0] = atan(inputValue1[0]); clampIfNeeded(output); @@ -215,10 +215,10 @@ void MathPowerOperation::executePixelSampled(float output[4], float x, float y, { float inputValue1[4]; float inputValue2[4]; - + this->m_inputValue1Operation->readSampled(inputValue1, x, y, sampler); this->m_inputValue2Operation->readSampled(inputValue2, x, y, sampler); - + if (inputValue1[0] >= 0) { output[0] = pow(inputValue1[0], inputValue2[0]); } @@ -240,10 +240,10 @@ void MathLogarithmOperation::executePixelSampled(float output[4], float x, float { float inputValue1[4]; float inputValue2[4]; - + this->m_inputValue1Operation->readSampled(inputValue1, x, y, sampler); this->m_inputValue2Operation->readSampled(inputValue2, x, y, sampler); - + if (inputValue1[0] > 0 && inputValue2[0] > 0) output[0] = log(inputValue1[0]) / log(inputValue2[0]); else @@ -256,10 +256,10 @@ void MathMinimumOperation::executePixelSampled(float output[4], float x, float y { float inputValue1[4]; float inputValue2[4]; - + this->m_inputValue1Operation->readSampled(inputValue1, x, y, sampler); this->m_inputValue2Operation->readSampled(inputValue2, x, y, sampler); - + output[0] = min(inputValue1[0], inputValue2[0]); clampIfNeeded(output); @@ -269,10 +269,10 @@ void MathMaximumOperation::executePixelSampled(float output[4], float x, float y { float inputValue1[4]; float inputValue2[4]; - + this->m_inputValue1Operation->readSampled(inputValue1, x, y, sampler); this->m_inputValue2Operation->readSampled(inputValue2, x, y, sampler); - + output[0] = max(inputValue1[0], inputValue2[0]); clampIfNeeded(output); @@ -282,10 +282,10 @@ void MathRoundOperation::executePixelSampled(float output[4], float x, float y, { float inputValue1[4]; float inputValue2[4]; - + this->m_inputValue1Operation->readSampled(inputValue1, x, y, sampler); this->m_inputValue2Operation->readSampled(inputValue2, x, y, sampler); - + output[0] = round(inputValue1[0]); clampIfNeeded(output); @@ -295,10 +295,10 @@ void MathLessThanOperation::executePixelSampled(float output[4], float x, float { float inputValue1[4]; float inputValue2[4]; - + this->m_inputValue1Operation->readSampled(inputValue1, x, y, sampler); this->m_inputValue2Operation->readSampled(inputValue2, x, y, sampler); - + output[0] = inputValue1[0] < inputValue2[0] ? 1.0f : 0.0f; clampIfNeeded(output); @@ -308,10 +308,10 @@ void MathGreaterThanOperation::executePixelSampled(float output[4], float x, flo { float inputValue1[4]; float inputValue2[4]; - + this->m_inputValue1Operation->readSampled(inputValue1, x, y, sampler); this->m_inputValue2Operation->readSampled(inputValue2, x, y, sampler); - + output[0] = inputValue1[0] > inputValue2[0] ? 1.0f : 0.0f; clampIfNeeded(output); @@ -321,10 +321,10 @@ void MathModuloOperation::executePixelSampled(float output[4], float x, float y, { float inputValue1[4]; float inputValue2[4]; - + this->m_inputValue1Operation->readSampled(inputValue1, x, y, sampler); this->m_inputValue2Operation->readSampled(inputValue2, x, y, sampler); - + if (inputValue2[0] == 0) output[0] = 0.0; else @@ -355,4 +355,4 @@ void MathArcTan2Operation::executePixelSampled(float output[4], float x, float y output[0] = atan2(inputValue1[0], inputValue2[0]); clampIfNeeded(output); -} \ No newline at end of file +} diff --git a/source/blender/compositor/operations/COM_MathBaseOperation.h b/source/blender/compositor/operations/COM_MathBaseOperation.h index 862783fff5d..c636117451f 100644 --- a/source/blender/compositor/operations/COM_MathBaseOperation.h +++ b/source/blender/compositor/operations/COM_MathBaseOperation.h @@ -51,12 +51,12 @@ public: * the inner loop of this program */ void executePixelSampled(float output[4], float x, float y, PixelSampler sampler) = 0; - + /** * Initialize the execution */ void initExecution(); - + /** * Deinitialize the execution */ diff --git a/source/blender/compositor/operations/COM_MixOperation.cpp b/source/blender/compositor/operations/COM_MixOperation.cpp index 314e16895f3..0acbe63e20e 100644 --- a/source/blender/compositor/operations/COM_MixOperation.cpp +++ b/source/blender/compositor/operations/COM_MixOperation.cpp @@ -53,11 +53,11 @@ void MixBaseOperation::executePixelSampled(float output[4], float x, float y, Pi float inputColor1[4]; float inputColor2[4]; float inputValue[4]; - + this->m_inputValueOperation->readSampled(inputValue, x, y, sampler); this->m_inputColor1Operation->readSampled(inputColor1, x, y, sampler); this->m_inputColor2Operation->readSampled(inputColor2, x, y, sampler); - + float value = inputValue[0]; if (this->useValueAlphaMultiply()) { value *= inputColor2[3]; @@ -147,7 +147,7 @@ void MixBlendOperation::executePixelSampled(float output[4], float x, float y, P this->m_inputColor1Operation->readSampled(inputColor1, x, y, sampler); this->m_inputColor2Operation->readSampled(inputColor2, x, y, sampler); value = inputValue[0]; - + if (this->useValueAlphaMultiply()) { value *= inputColor2[3]; } diff --git a/source/blender/compositor/operations/COM_MixOperation.h b/source/blender/compositor/operations/COM_MixOperation.h index f375a47f087..fa13a486657 100644 --- a/source/blender/compositor/operations/COM_MixOperation.h +++ b/source/blender/compositor/operations/COM_MixOperation.h @@ -50,23 +50,23 @@ protected: CLAMP(color[3], 0.0f, 1.0f); } } - + public: /** * Default constructor */ MixBaseOperation(); - + /** * the inner loop of this program */ void executePixelSampled(float output[4], float x, float y, PixelSampler sampler); - + /** * Initialize the execution */ void initExecution(); - + /** * Deinitialize the execution */ @@ -74,7 +74,7 @@ public: void determineResolution(unsigned int resolution[2], unsigned int preferredResolution[2]); - + void setUseValueAlphaMultiply(const bool value) { this->m_valueAlphaMultiply = value; } inline bool useValueAlphaMultiply() { return this->m_valueAlphaMultiply; } void setUseClamp(bool value) { this->m_useClamp = value; } diff --git a/source/blender/compositor/operations/COM_MovieClipOperation.h b/source/blender/compositor/operations/COM_MovieClipOperation.h index 93452752234..28e6c0d0c3a 100644 --- a/source/blender/compositor/operations/COM_MovieClipOperation.h +++ b/source/blender/compositor/operations/COM_MovieClipOperation.h @@ -41,7 +41,7 @@ protected: int m_movieClipwidth; int m_framenumber; bool m_cacheFrame; - + /** * Determine the output resolution. The resolution is retrieved from the Renderer */ @@ -49,7 +49,7 @@ protected: public: MovieClipBaseOperation(); - + void initExecution(); void deinitExecution(); void setMovieClip(MovieClip *image) { this->m_movieClip = image; } diff --git a/source/blender/compositor/operations/COM_NormalizeOperation.cpp b/source/blender/compositor/operations/COM_NormalizeOperation.cpp index 6106a805f87..3527c874bcf 100644 --- a/source/blender/compositor/operations/COM_NormalizeOperation.cpp +++ b/source/blender/compositor/operations/COM_NormalizeOperation.cpp @@ -64,7 +64,7 @@ bool NormalizeOperation::determineDependingAreaOfInterest(rcti * /*input*/, Read { rcti imageInput; if (this->m_cachedInstance) return false; - + NodeOperation *operation = getInputOperation(0); imageInput.xmax = operation->getWidth(); imageInput.xmin = 0; diff --git a/source/blender/compositor/operations/COM_OutputFileOperation.cpp b/source/blender/compositor/operations/COM_OutputFileOperation.cpp index 39877e35605..db2598ad6dc 100644 --- a/source/blender/compositor/operations/COM_OutputFileOperation.cpp +++ b/source/blender/compositor/operations/COM_OutputFileOperation.cpp @@ -135,11 +135,11 @@ static void write_buffer_rect(rcti *rect, const bNodeTree *tree, for (y = y1; y < y2 && (!breaked); y++) { for (x = x1; x < x2 && (!breaked); x++) { reader->readSampled(color, x, y, COM_PS_NEAREST); - + for (i = 0; i < size; ++i) buffer[offset + i] = color[i]; offset += size; - + if (tree->test_break && tree->test_break(tree->tbh)) breaked = true; } @@ -154,13 +154,13 @@ OutputSingleLayerOperation::OutputSingleLayerOperation( { this->m_rd = rd; this->m_tree = tree; - + this->addInputSocket(datatype); - + this->m_outputBuffer = NULL; this->m_datatype = datatype; this->m_imageInput = NULL; - + this->m_format = format; BLI_strncpy(this->m_path, path, sizeof(this->m_path)); @@ -183,17 +183,17 @@ void OutputSingleLayerOperation::executeRegion(rcti *rect, unsigned int /*tileNu void OutputSingleLayerOperation::deinitExecution() { if (this->getWidth() * this->getHeight() != 0) { - + int size = get_datatype_size(this->m_datatype); ImBuf *ibuf = IMB_allocImBuf(this->getWidth(), this->getHeight(), this->m_format->planes, 0); char filename[FILE_MAX]; const char *suffix; - + ibuf->channels = size; ibuf->rect_float = this->m_outputBuffer; - ibuf->mall |= IB_rectfloat; + ibuf->mall |= IB_rectfloat; ibuf->dither = this->m_rd->dither_intensity; - + IMB_colormanagement_imbuf_for_write(ibuf, true, false, m_viewSettings, m_displaySettings, this->m_format); @@ -207,7 +207,7 @@ void OutputSingleLayerOperation::deinitExecution() printf("Cannot save Node File Output to %s\n", filename); else printf("Saved: %s\n", filename); - + IMB_freeImBuf(ibuf); } this->m_outputBuffer = NULL; @@ -221,7 +221,7 @@ OutputOpenExrLayer::OutputOpenExrLayer(const char *name_, DataType datatype_, bo BLI_strncpy(this->name, name_, sizeof(this->name)); this->datatype = datatype_; this->use_layer = use_layer_; - + /* these are created in initExecution */ this->outputBuffer = 0; this->imageInput = 0; @@ -233,7 +233,7 @@ OutputOpenExrMultiLayerOperation::OutputOpenExrMultiLayerOperation( { this->m_rd = rd; this->m_tree = tree; - + BLI_strncpy(this->m_path, path, sizeof(this->m_path)); this->m_exr_codec = exr_codec; this->m_exr_half_float = exr_half_float; @@ -285,11 +285,11 @@ void OutputOpenExrMultiLayerOperation::deinitExecution() OutputOpenExrLayer &layer = this->m_layers[i]; if (!layer.imageInput) continue; /* skip unconnected sockets */ - + add_exr_channels(exrhandle, this->m_layers[i].name, this->m_layers[i].datatype, "", width, this->m_exr_half_float, this->m_layers[i].outputBuffer); } - + /* when the filename has no permissions, this can fail */ if (IMB_exr_begin_write(exrhandle, filename, width, height, this->m_exr_codec, NULL)) { IMB_exr_write_channels(exrhandle); @@ -299,14 +299,14 @@ void OutputOpenExrMultiLayerOperation::deinitExecution() /* XXX nice way to do report? */ printf("Error Writing Render Result, see console\n"); } - + IMB_exr_close(exrhandle); for (unsigned int i = 0; i < this->m_layers.size(); ++i) { if (this->m_layers[i].outputBuffer) { MEM_freeN(this->m_layers[i].outputBuffer); this->m_layers[i].outputBuffer = NULL; } - + this->m_layers[i].imageInput = NULL; } } diff --git a/source/blender/compositor/operations/COM_OutputFileOperation.h b/source/blender/compositor/operations/COM_OutputFileOperation.h index 60862de48cb..32c9b5ab5b8 100644 --- a/source/blender/compositor/operations/COM_OutputFileOperation.h +++ b/source/blender/compositor/operations/COM_OutputFileOperation.h @@ -37,10 +37,10 @@ class OutputSingleLayerOperation : public NodeOperation { protected: const RenderData *m_rd; const bNodeTree *m_tree; - + ImageFormatData *m_format; char m_path[FILE_MAX]; - + float *m_outputBuffer; DataType m_datatype; SocketReader *m_imageInput; @@ -52,7 +52,7 @@ protected: public: OutputSingleLayerOperation(const RenderData *rd, const bNodeTree *tree, DataType datatype, ImageFormatData *format, const char *path, const ColorManagedViewSettings *viewSettings, const ColorManagedDisplaySettings *displaySettings, const char *viewName); - + void executeRegion(rcti *rect, unsigned int tileNumber); bool isOutputOperation(bool /*rendering*/) const { return true; } void initExecution(); @@ -65,11 +65,11 @@ public: /* extra info for OpenEXR layers */ struct OutputOpenExrLayer { OutputOpenExrLayer(const char *name, DataType datatype, bool use_layer); - + char name[EXR_TOT_MAXNAME - 2]; DataType datatype; bool use_layer; - + /* internals */ float *outputBuffer; SocketReader *imageInput; @@ -79,22 +79,22 @@ struct OutputOpenExrLayer { class OutputOpenExrMultiLayerOperation : public NodeOperation { protected: typedef std::vector LayerList; - + const RenderData *m_rd; const bNodeTree *m_tree; - + char m_path[FILE_MAX]; char m_exr_codec; bool m_exr_half_float; LayerList m_layers; const char *m_viewName; - + public: OutputOpenExrMultiLayerOperation(const RenderData *rd, const bNodeTree *tree, const char *path, char exr_codec, bool exr_half_float, const char *viewName); - + void add_layer(const char *name, DataType datatype, bool use_layer); - + void executeRegion(rcti *rect, unsigned int tileNumber); bool isOutputOperation(bool /*rendering*/) const { return true; } void initExecution(); diff --git a/source/blender/compositor/operations/COM_PlaneCornerPinOperation.cpp b/source/blender/compositor/operations/COM_PlaneCornerPinOperation.cpp index d6affa6eee9..4e4e803c757 100644 --- a/source/blender/compositor/operations/COM_PlaneCornerPinOperation.cpp +++ b/source/blender/compositor/operations/COM_PlaneCornerPinOperation.cpp @@ -49,7 +49,7 @@ static bool check_corners(float corners[4][2]) cur_cross = cross_v2v2(v1, v2); if (fabsf(cur_cross) <= FLT_EPSILON) return false; - + if (cross == 0.0f) cross = cur_cross; else if (cross * cur_cross < 0.0f) @@ -67,7 +67,7 @@ static void readCornersFromSockets(rcti *rect, SocketReader *readers[4], float c corners[i][0] = result[0]; corners[i][1] = result[1]; } - + /* convexity check: * concave corners need to be prevented, otherwise * BKE_tracking_homography_between_two_quads will freeze @@ -95,7 +95,7 @@ PlaneCornerPinMaskOperation::PlaneCornerPinMaskOperation() : addInputSocket(COM_DT_VECTOR); addInputSocket(COM_DT_VECTOR); addInputSocket(COM_DT_VECTOR); - + /* XXX this is stupid: we need to make this "complex", * so we can use the initializeTileData function * to read corners from input sockets ... @@ -106,21 +106,21 @@ PlaneCornerPinMaskOperation::PlaneCornerPinMaskOperation() : void PlaneCornerPinMaskOperation::initExecution() { PlaneDistortMaskOperation::initExecution(); - + initMutex(); } void PlaneCornerPinMaskOperation::deinitExecution() { PlaneDistortMaskOperation::deinitExecution(); - + deinitMutex(); } void *PlaneCornerPinMaskOperation::initializeTileData(rcti *rect) { void *data = PlaneDistortMaskOperation::initializeTileData(rect); - + /* get corner values once, by reading inputs at (0,0) * XXX this assumes invariable values (no image inputs), * we don't have a nice generic system for that yet @@ -134,11 +134,11 @@ void *PlaneCornerPinMaskOperation::initializeTileData(rcti *rect) float corners[4][2]; readCornersFromSockets(rect, readers, corners); calculateCorners(corners, true, 0); - + m_corners_ready = true; } unlockMutex(); - + return data; } @@ -164,21 +164,21 @@ PlaneCornerPinWarpImageOperation::PlaneCornerPinWarpImageOperation() : void PlaneCornerPinWarpImageOperation::initExecution() { PlaneDistortWarpImageOperation::initExecution(); - + initMutex(); } void PlaneCornerPinWarpImageOperation::deinitExecution() { PlaneDistortWarpImageOperation::deinitExecution(); - + deinitMutex(); } void *PlaneCornerPinWarpImageOperation::initializeTileData(rcti *rect) { void *data = PlaneDistortWarpImageOperation::initializeTileData(rect); - + /* get corner values once, by reading inputs at (0,0) * XXX this assumes invariable values (no image inputs), * we don't have a nice generic system for that yet @@ -193,11 +193,11 @@ void *PlaneCornerPinWarpImageOperation::initializeTileData(rcti *rect) float corners[4][2]; readCornersFromSockets(rect, readers, corners); calculateCorners(corners, true, 0); - + m_corners_ready = true; } unlockMutex(); - + return data; } @@ -206,7 +206,7 @@ bool PlaneCornerPinWarpImageOperation::determineDependingAreaOfInterest(rcti *in for (int i = 0; i < 4; ++i) if (getInputOperation(i + 1)->determineDependingAreaOfInterest(input, readOperation, output)) return true; - + /* XXX this is bad, but unavoidable with the current design: * we don't know the actual corners and matrix at this point, * so all we can do is get the full input image diff --git a/source/blender/compositor/operations/COM_PlaneCornerPinOperation.h b/source/blender/compositor/operations/COM_PlaneCornerPinOperation.h index ed70d9c80a3..a9bd18299eb 100644 --- a/source/blender/compositor/operations/COM_PlaneCornerPinOperation.h +++ b/source/blender/compositor/operations/COM_PlaneCornerPinOperation.h @@ -37,15 +37,15 @@ class PlaneCornerPinMaskOperation : public PlaneDistortMaskOperation { private: bool m_corners_ready; - + public: PlaneCornerPinMaskOperation(); - + void initExecution(); void deinitExecution(); - + void *initializeTileData(rcti *rect); - + void determineResolution(unsigned int resolution[2], unsigned int preferredResolution[2]); }; @@ -53,15 +53,15 @@ public: class PlaneCornerPinWarpImageOperation : public PlaneDistortWarpImageOperation { private: bool m_corners_ready; - + public: PlaneCornerPinWarpImageOperation(); - + void initExecution(); void deinitExecution(); - + void *initializeTileData(rcti *rect); - + bool determineDependingAreaOfInterest(rcti *input, ReadBufferOperation *readOperation, rcti *output); }; diff --git a/source/blender/compositor/operations/COM_PreviewOperation.cpp b/source/blender/compositor/operations/COM_PreviewOperation.cpp index d4075844f0e..90e1bba3cd9 100644 --- a/source/blender/compositor/operations/COM_PreviewOperation.cpp +++ b/source/blender/compositor/operations/COM_PreviewOperation.cpp @@ -61,7 +61,7 @@ void PreviewOperation::verifyPreview(bNodeInstanceHash *previews, bNodeInstanceK void PreviewOperation::initExecution() { this->m_input = getInputSocketReader(0); - + if (this->getWidth() == (unsigned int)this->m_preview->xsize && this->getHeight() == (unsigned int)this->m_preview->ysize) { @@ -98,7 +98,7 @@ void PreviewOperation::executeRegion(rcti *rect, unsigned int /*tileNumber*/) for (int x = rect->xmin; x < rect->xmax; x++) { float rx = floor(x / this->m_divider); float ry = floor(y / this->m_divider); - + color[0] = 0.0f; color[1] = 0.0f; color[2] = 0.0f; @@ -137,7 +137,7 @@ void PreviewOperation::determineResolution(unsigned int resolution[2], unsigned } width = width * this->m_divider; height = height * this->m_divider; - + resolution[0] = width; resolution[1] = height; } diff --git a/source/blender/compositor/operations/COM_PreviewOperation.h b/source/blender/compositor/operations/COM_PreviewOperation.h index ca1d6f54cdc..907a6c8997f 100644 --- a/source/blender/compositor/operations/COM_PreviewOperation.h +++ b/source/blender/compositor/operations/COM_PreviewOperation.h @@ -44,16 +44,16 @@ protected: public: PreviewOperation(const ColorManagedViewSettings *viewSettings, const ColorManagedDisplaySettings *displaySettings); void verifyPreview(bNodeInstanceHash *previews, bNodeInstanceKey key); - + bool isOutputOperation(bool /*rendering*/) const { return !G.background; } void initExecution(); void deinitExecution(); const CompositorPriority getRenderPriority() const; - + void executeRegion(rcti *rect, unsigned int tileNumber); void determineResolution(unsigned int resolution[2], unsigned int preferredResolution[2]); bool determineDependingAreaOfInterest(rcti *input, ReadBufferOperation *readOperation, rcti *output); bool isPreviewOperation() const { return true; } - + }; #endif diff --git a/source/blender/compositor/operations/COM_ProjectorLensDistortionOperation.cpp b/source/blender/compositor/operations/COM_ProjectorLensDistortionOperation.cpp index 020bdde8c93..e135abe5f20 100644 --- a/source/blender/compositor/operations/COM_ProjectorLensDistortionOperation.cpp +++ b/source/blender/compositor/operations/COM_ProjectorLensDistortionOperation.cpp @@ -96,7 +96,7 @@ bool ProjectorLensDistortionOperation::determineDependingAreaOfInterest(rcti *in return false; } -void ProjectorLensDistortionOperation::updateDispersion() +void ProjectorLensDistortionOperation::updateDispersion() { if (this->m_dispersionAvailable) return; this->lockMutex(); diff --git a/source/blender/compositor/operations/COM_ProjectorLensDistortionOperation.h b/source/blender/compositor/operations/COM_ProjectorLensDistortionOperation.h index 9eb90b6006b..12efff14839 100644 --- a/source/blender/compositor/operations/COM_ProjectorLensDistortionOperation.h +++ b/source/blender/compositor/operations/COM_ProjectorLensDistortionOperation.h @@ -31,30 +31,30 @@ private: * Cached reference to the inputProgram */ SocketReader *m_inputProgram; - + float m_dispersion; bool m_dispersionAvailable; - + float m_kr, m_kr2; public: ProjectorLensDistortionOperation(); - + /** * the inner loop of this program */ void executePixel(float output[4], int x, int y, void *data); - + /** * Initialize the execution */ void initExecution(); - + void *initializeTileData(rcti *rect); /** * Deinitialize the execution */ void deinitExecution(); - + bool determineDependingAreaOfInterest(rcti *input, ReadBufferOperation *readOperation, rcti *output); void updateDispersion(); diff --git a/source/blender/compositor/operations/COM_ReadBufferOperation.cpp b/source/blender/compositor/operations/COM_ReadBufferOperation.cpp index f256d3a6aa1..6e7a32ba5a9 100644 --- a/source/blender/compositor/operations/COM_ReadBufferOperation.cpp +++ b/source/blender/compositor/operations/COM_ReadBufferOperation.cpp @@ -120,8 +120,8 @@ void ReadBufferOperation::readResolutionFromWriteBuffer() } } -void ReadBufferOperation::updateMemoryBuffer() +void ReadBufferOperation::updateMemoryBuffer() { this->m_buffer = this->getMemoryProxy()->getBuffer(); - + } diff --git a/source/blender/compositor/operations/COM_ReadBufferOperation.h b/source/blender/compositor/operations/COM_ReadBufferOperation.h index 898b568bb91..c42de32b9e9 100644 --- a/source/blender/compositor/operations/COM_ReadBufferOperation.h +++ b/source/blender/compositor/operations/COM_ReadBufferOperation.h @@ -38,7 +38,7 @@ public: void setMemoryProxy(MemoryProxy *memoryProxy) { this->m_memoryProxy = memoryProxy; } MemoryProxy *getMemoryProxy() { return this->m_memoryProxy; } void determineResolution(unsigned int resolution[2], unsigned int preferredResolution[2]); - + void *initializeTileData(rcti *rect); void executePixelSampled(float output[4], float x, float y, PixelSampler sampler); void executePixelExtend(float output[4], float x, float y, PixelSampler sampler, diff --git a/source/blender/compositor/operations/COM_RenderLayersProg.cpp b/source/blender/compositor/operations/COM_RenderLayersProg.cpp index c7afa67a306..5331f198aa4 100644 --- a/source/blender/compositor/operations/COM_RenderLayersProg.cpp +++ b/source/blender/compositor/operations/COM_RenderLayersProg.cpp @@ -50,10 +50,10 @@ void RenderLayersProg::initExecution() Scene *scene = this->getScene(); Render *re = (scene) ? RE_GetSceneRender(scene) : NULL; RenderResult *rr = NULL; - + if (re) rr = RE_AcquireResultRead(re); - + if (rr) { SceneRenderLayer *srl = (SceneRenderLayer *)BLI_findlink(&scene->r.layers, getLayerId()); if (srl) { @@ -181,13 +181,13 @@ void RenderLayersProg::determineResolution(unsigned int resolution[2], unsigned Scene *sce = this->getScene(); Render *re = (sce) ? RE_GetSceneRender(sce) : NULL; RenderResult *rr = NULL; - + resolution[0] = 0; resolution[1] = 0; - + if (re) rr = RE_AcquireResultRead(re); - + if (rr) { SceneRenderLayer *srl = (SceneRenderLayer *)BLI_findlink(&sce->r.layers, getLayerId()); if (srl) { @@ -198,7 +198,7 @@ void RenderLayersProg::determineResolution(unsigned int resolution[2], unsigned } } } - + if (re) RE_ReleaseResult(re); diff --git a/source/blender/compositor/operations/COM_RotateOperation.cpp b/source/blender/compositor/operations/COM_RotateOperation.cpp index 2d0d5aaf8d3..4186a0e1fc8 100644 --- a/source/blender/compositor/operations/COM_RotateOperation.cpp +++ b/source/blender/compositor/operations/COM_RotateOperation.cpp @@ -62,7 +62,7 @@ inline void RotateOperation::ensureDegree() } this->m_cosine = cos(rad); this->m_sine = sin(rad); - + this->m_isDegreeSet = true; } } @@ -82,12 +82,12 @@ bool RotateOperation::determineDependingAreaOfInterest(rcti *input, ReadBufferOp { ensureDegree(); rcti newInput; - + const float dxmin = input->xmin - this->m_centerX; const float dymin = input->ymin - this->m_centerY; const float dxmax = input->xmax - this->m_centerX; const float dymax = input->ymax - this->m_centerY; - + const float x1 = this->m_centerX + (this->m_cosine * dxmin + this->m_sine * dymin); const float x2 = this->m_centerX + (this->m_cosine * dxmax + this->m_sine * dymin); const float x3 = this->m_centerX + (this->m_cosine * dxmin + this->m_sine * dymax); @@ -100,11 +100,11 @@ bool RotateOperation::determineDependingAreaOfInterest(rcti *input, ReadBufferOp const float maxx = max(x1, max(x2, max(x3, x4))); const float miny = min(y1, min(y2, min(y3, y4))); const float maxy = max(y1, max(y2, max(y3, y4))); - + newInput.xmax = ceil(maxx) + 1; newInput.xmin = floor(minx) - 1; newInput.ymax = ceil(maxy) + 1; newInput.ymin = floor(miny) - 1; - + return NodeOperation::determineDependingAreaOfInterest(&newInput, readOperation, output); } diff --git a/source/blender/compositor/operations/COM_RotateOperation.h b/source/blender/compositor/operations/COM_RotateOperation.h index 7b99b6faa97..d332f7208b5 100644 --- a/source/blender/compositor/operations/COM_RotateOperation.h +++ b/source/blender/compositor/operations/COM_RotateOperation.h @@ -42,7 +42,7 @@ public: void initExecution(); void deinitExecution(); void setDoDegree2RadConversion(bool abool) { this->m_doDegree2RadConversion = abool; } - + void ensureDegree(); }; diff --git a/source/blender/compositor/operations/COM_ScreenLensDistortionOperation.cpp b/source/blender/compositor/operations/COM_ScreenLensDistortionOperation.cpp index 651c336452e..5d50640d582 100644 --- a/source/blender/compositor/operations/COM_ScreenLensDistortionOperation.cpp +++ b/source/blender/compositor/operations/COM_ScreenLensDistortionOperation.cpp @@ -59,10 +59,10 @@ void ScreenLensDistortionOperation::initExecution() { this->m_inputProgram = this->getInputSocketReader(0); this->initMutex(); - + this->m_cx = 0.5f * (float)getWidth(); this->m_cy = 0.5f * (float)getHeight(); - + /* if both are constant, init variables once */ if (m_distortion_const && m_dispersion_const) { updateVariables(m_distortion, m_dispersion); @@ -80,7 +80,7 @@ void *ScreenLensDistortionOperation::initializeTileData(rcti * /*rect*/) */ if (!m_variables_ready) { this->lockMutex(); - + if (!m_distortion_const) { float result[4]; getInputSocketReader(1)->readSampled(result, 0, 0, COM_PS_NEAREST); @@ -91,13 +91,13 @@ void *ScreenLensDistortionOperation::initializeTileData(rcti * /*rect*/) getInputSocketReader(2)->readSampled(result, 0, 0, COM_PS_NEAREST); m_dispersion = result[0]; } - + updateVariables(m_distortion, m_dispersion); m_variables_ready = true; - + this->unlockMutex(); } - + return buffer; } @@ -123,7 +123,7 @@ bool ScreenLensDistortionOperation::get_delta(float r_sq, float k4, const float } else return false; - + } void ScreenLensDistortionOperation::accumulate(MemoryBuffer *buffer, @@ -133,7 +133,7 @@ void ScreenLensDistortionOperation::accumulate(MemoryBuffer *buffer, float sum[4], int count[3]) const { float color[4]; - + float dsf = len_v2v2(delta[a], delta[b]) + 1.0f; int ds = m_jitter ? (dsf < 4.0f ? 2 : (int)sqrtf(dsf)) : (int)dsf; float sd = 1.0f / (float)ds; @@ -144,11 +144,11 @@ void ScreenLensDistortionOperation::accumulate(MemoryBuffer *buffer, for (float z = 0; z < ds; ++z) { float tz = (z + (m_jitter ? BLI_frand() : 0.5f)) * sd; float t = 1.0f - (k4 + tz * dk4) * r_sq; - + float xy[2]; distort_uv(uv, t, xy); buffer->readBilinear(color, xy[0], xy[1]); - + sum[a] += (1.0f - tz) * color[a]; sum[b] += (tz ) * color[b]; count[a]++; @@ -175,11 +175,11 @@ void ScreenLensDistortionOperation::executePixel(float output[4], int x, int y, if (valid_r && valid_g && valid_b) { accumulate(buffer, 0, 1, uv_dot, uv, delta, sum, count); accumulate(buffer, 1, 2, uv_dot, uv, delta, sum, count); - + if (count[0]) output[0] = 2.0f * sum[0] / (float)count[0]; if (count[1]) output[1] = 2.0f * sum[1] / (float)count[1]; if (count[2]) output[2] = 2.0f * sum[2] / (float)count[2]; - + /* set alpha */ output[3] = 1.0f; } @@ -200,7 +200,7 @@ void ScreenLensDistortionOperation::determineUV(float result[6], float x, float float uv[2]; get_uv(xy, uv); float uv_dot = len_squared_v2(uv); - + copy_v2_v2(result + 0, xy); copy_v2_v2(result + 2, xy); copy_v2_v2(result + 4, xy); @@ -216,7 +216,7 @@ bool ScreenLensDistortionOperation::determineDependingAreaOfInterest(rcti * /*in newInputValue.ymin = 0; newInputValue.xmax = 2; newInputValue.ymax = 2; - + NodeOperation *operation = getInputOperation(1); if (operation->determineDependingAreaOfInterest(&newInputValue, readOperation, output) ) { return true; @@ -226,7 +226,7 @@ bool ScreenLensDistortionOperation::determineDependingAreaOfInterest(rcti * /*in if (operation->determineDependingAreaOfInterest(&newInputValue, readOperation, output) ) { return true; } - + /* XXX the original method of estimating the area-of-interest does not work * it assumes a linear increase/decrease of mapped coordinates, which does not * yield correct results for the area and leaves uninitialized buffer areas. @@ -234,7 +234,7 @@ bool ScreenLensDistortionOperation::determineDependingAreaOfInterest(rcti * /*in */ #if 1 rcti imageInput; - + operation = getInputOperation(0); imageInput.xmax = operation->getWidth(); imageInput.xmin = 0; @@ -248,9 +248,9 @@ bool ScreenLensDistortionOperation::determineDependingAreaOfInterest(rcti * /*in #else rcti newInput; const float margin = 2; - + BLI_rcti_init_minmax(&newInput); - + if (m_dispersion_const && m_distortion_const) { /* update from fixed distortion/dispersion */ #define UPDATE_INPUT(x, y) \ @@ -284,7 +284,7 @@ bool ScreenLensDistortionOperation::determineDependingAreaOfInterest(rcti * /*in newInput.xmax = max_ffff(newInput.xmax, coords[0], coords[2], coords[4]); \ newInput.ymax = max_ffff(newInput.ymax, coords[1], coords[3], coords[5]); \ } (void)0 - + if (m_distortion_const) { /* update from fixed distortion */ UPDATE_INPUT(input->xmin, input->xmax, m_distortion); diff --git a/source/blender/compositor/operations/COM_ScreenLensDistortionOperation.h b/source/blender/compositor/operations/COM_ScreenLensDistortionOperation.h index 648a7a6e551..963a9210b93 100644 --- a/source/blender/compositor/operations/COM_ScreenLensDistortionOperation.h +++ b/source/blender/compositor/operations/COM_ScreenLensDistortionOperation.h @@ -31,10 +31,10 @@ private: * Cached reference to the inputProgram */ SocketReader *m_inputProgram; - + bool m_fit; bool m_jitter; - + float m_dispersion; float m_distortion; bool m_dispersion_const; @@ -47,31 +47,31 @@ private: float m_sc, m_cx, m_cy; public: ScreenLensDistortionOperation(); - + /** * the inner loop of this program */ void executePixel(float output[4], int x, int y, void *data); - + /** * Initialize the execution */ void initExecution(); - + void *initializeTileData(rcti *rect); /** * Deinitialize the execution */ void deinitExecution(); - + void setFit(bool fit) { m_fit = fit; } void setJitter(bool jitter) { m_jitter = jitter; } - + /** Set constant distortion value */ void setDistortion(float distortion); /** Set constant dispersion value */ void setDispersion(float dispersion); - + bool determineDependingAreaOfInterest(rcti *input, ReadBufferOperation *readOperation, rcti *output); private: diff --git a/source/blender/compositor/operations/COM_SetAlphaOperation.cpp b/source/blender/compositor/operations/COM_SetAlphaOperation.cpp index 91933484027..e6c04a4b68c 100644 --- a/source/blender/compositor/operations/COM_SetAlphaOperation.cpp +++ b/source/blender/compositor/operations/COM_SetAlphaOperation.cpp @@ -27,7 +27,7 @@ SetAlphaOperation::SetAlphaOperation() : NodeOperation() this->addInputSocket(COM_DT_COLOR); this->addInputSocket(COM_DT_VALUE); this->addOutputSocket(COM_DT_COLOR); - + this->m_inputColor = NULL; this->m_inputAlpha = NULL; } @@ -41,10 +41,10 @@ void SetAlphaOperation::initExecution() void SetAlphaOperation::executePixelSampled(float output[4], float x, float y, PixelSampler sampler) { float alphaInput[4]; - + this->m_inputColor->readSampled(output, x, y, sampler); this->m_inputAlpha->readSampled(alphaInput, x, y, sampler); - + output[3] = alphaInput[0]; } diff --git a/source/blender/compositor/operations/COM_SetAlphaOperation.h b/source/blender/compositor/operations/COM_SetAlphaOperation.h index 12e3debf3d3..c4e12a367a5 100644 --- a/source/blender/compositor/operations/COM_SetAlphaOperation.h +++ b/source/blender/compositor/operations/COM_SetAlphaOperation.h @@ -39,12 +39,12 @@ public: * Default constructor */ SetAlphaOperation(); - + /** * the inner loop of this program */ void executePixelSampled(float output[4], float x, float y, PixelSampler sampler); - + void initExecution(); void deinitExecution(); }; diff --git a/source/blender/compositor/operations/COM_SetSamplerOperation.h b/source/blender/compositor/operations/COM_SetSamplerOperation.h index 903bcef95f0..6d97b20769d 100644 --- a/source/blender/compositor/operations/COM_SetSamplerOperation.h +++ b/source/blender/compositor/operations/COM_SetSamplerOperation.h @@ -38,9 +38,9 @@ public: * Default constructor */ SetSamplerOperation(); - + void setSampler(PixelSampler sampler) { this->m_sampler = sampler; } - + /** * the inner loop of this program */ diff --git a/source/blender/compositor/operations/COM_SetValueOperation.h b/source/blender/compositor/operations/COM_SetValueOperation.h index 10de8825d38..a0867a3bc9c 100644 --- a/source/blender/compositor/operations/COM_SetValueOperation.h +++ b/source/blender/compositor/operations/COM_SetValueOperation.h @@ -38,17 +38,17 @@ public: * Default constructor */ SetValueOperation(); - + const float getValue() { return this->m_value; } void setValue(float value) { this->m_value = value; } - - + + /** * the inner loop of this program */ void executePixelSampled(float output[4], float x, float y, PixelSampler sampler); void determineResolution(unsigned int resolution[2], unsigned int preferredResolution[2]); - + bool isSetOperation() const { return true; } }; #endif diff --git a/source/blender/compositor/operations/COM_SetVectorOperation.h b/source/blender/compositor/operations/COM_SetVectorOperation.h index b01f2f7a6b5..79b55bb7d91 100644 --- a/source/blender/compositor/operations/COM_SetVectorOperation.h +++ b/source/blender/compositor/operations/COM_SetVectorOperation.h @@ -41,7 +41,7 @@ public: * Default constructor */ SetVectorOperation(); - + const float getX() { return this->m_x; } void setX(float value) { this->m_x = value; } const float getY() { return this->m_y; } @@ -50,7 +50,7 @@ public: void setZ(float value) { this->m_z = value; } const float getW() { return this->m_w; } void setW(float value) { this->m_w = value; } - + /** * the inner loop of this program */ diff --git a/source/blender/compositor/operations/COM_SocketProxyOperation.h b/source/blender/compositor/operations/COM_SocketProxyOperation.h index 86c8b23b115..55cf6d376b7 100644 --- a/source/blender/compositor/operations/COM_SocketProxyOperation.h +++ b/source/blender/compositor/operations/COM_SocketProxyOperation.h @@ -28,13 +28,13 @@ class SocketProxyOperation : public NodeOperation { public: SocketProxyOperation(DataType type, bool use_conversion); - + bool isProxyOperation() const { return true; } bool useDatatypeConversion() const { return m_use_conversion; } - + bool getUseConversion() const { return m_use_conversion; } void setUseConversion(bool use_conversion) { m_use_conversion = use_conversion; } - + private: bool m_use_conversion; }; diff --git a/source/blender/compositor/operations/COM_SunBeamsOperation.cpp b/source/blender/compositor/operations/COM_SunBeamsOperation.cpp index 81b967bf530..964ba36d08c 100644 --- a/source/blender/compositor/operations/COM_SunBeamsOperation.cpp +++ b/source/blender/compositor/operations/COM_SunBeamsOperation.cpp @@ -61,7 +61,7 @@ template struct BufferLineAccumulator { /* utility functions implementing the matrix transform to/from sector space */ - + static inline void buffer_to_sector(const float source[2], int x, int y, int &u, int &v) { int x0 = (int)source[0]; @@ -155,9 +155,9 @@ struct BufferLineAccumulator { float v, dv; float falloff_factor; float border[4]; - + zero_v4(output); - + if ((int)(co[0] - source[0]) == 0 && (int)(co[1] - source[1]) == 0) { copy_v4_v4(output, input->getBuffer() + COM_NUM_CHANNELS_COLOR * ((int)source[0] + input->getWidth() * (int)source[1])); return; @@ -174,7 +174,7 @@ struct BufferLineAccumulator { for (int i = 0; i < num; i++) { float weight = 1.0f - (float)i * falloff_factor; weight *= weight; - + /* range check, use last valid color when running beyond the image border */ if (x >= rect.xmin && x < rect.xmax && y >= rect.ymin && y < rect.ymax) { madd_v4_v4fl(output, buffer, buffer[3] * weight); @@ -184,7 +184,7 @@ struct BufferLineAccumulator { else { madd_v4_v4fl(output, border, border[3] * weight); } - + /* TODO implement proper filtering here, see * https://en.wikipedia.org/wiki/Lanczos_resampling * https://en.wikipedia.org/wiki/Sinc_function diff --git a/source/blender/compositor/operations/COM_TextureOperation.h b/source/blender/compositor/operations/COM_TextureOperation.h index a2fb7c7501f..26d50ca1753 100644 --- a/source/blender/compositor/operations/COM_TextureOperation.h +++ b/source/blender/compositor/operations/COM_TextureOperation.h @@ -54,7 +54,7 @@ protected: * Determine the output resolution. The resolution is retrieved from the Renderer */ void determineResolution(unsigned int resolution[2], unsigned int preferredResolution[2]); - + /** * Constructor */ diff --git a/source/blender/compositor/operations/COM_TonemapOperation.h b/source/blender/compositor/operations/COM_TonemapOperation.h index 51ffaac8503..6fcf72c9d14 100644 --- a/source/blender/compositor/operations/COM_TonemapOperation.h +++ b/source/blender/compositor/operations/COM_TonemapOperation.h @@ -47,12 +47,12 @@ protected: * @brief Cached reference to the reader */ SocketReader *m_imageReader; - + /** * @brief settings of the Tonemap */ NodeTonemap *m_data; - + /** * @brief temporarily cache of the execution storage */ @@ -60,27 +60,27 @@ protected: public: TonemapOperation(); - + /** * the inner loop of this program */ void executePixel(float output[4], int x, int y, void *data); - + /** * Initialize the execution */ void initExecution(); - + void *initializeTileData(rcti *rect); void deinitializeTileData(rcti *rect, void *data); - + /** * Deinitialize the execution */ void deinitExecution(); - + void setData(NodeTonemap *data) { this->m_data = data; } - + bool determineDependingAreaOfInterest(rcti *input, ReadBufferOperation *readOperation, rcti *output); }; diff --git a/source/blender/compositor/operations/COM_TranslateOperation.h b/source/blender/compositor/operations/COM_TranslateOperation.h index e30ba7ff2d7..f3708ef3c7c 100644 --- a/source/blender/compositor/operations/COM_TranslateOperation.h +++ b/source/blender/compositor/operations/COM_TranslateOperation.h @@ -45,7 +45,7 @@ public: float getDeltaX() { return this->m_deltaX * this->m_factorX; } float getDeltaY() { return this->m_deltaY * this->m_factorY; } - + inline void ensureDelta() { if (!this->m_isDeltaSet) { float tempDelta[4]; diff --git a/source/blender/compositor/operations/COM_VariableSizeBokehBlurOperation.cpp b/source/blender/compositor/operations/COM_VariableSizeBokehBlurOperation.cpp index e8dbff9b2d7..a252af053cc 100644 --- a/source/blender/compositor/operations/COM_VariableSizeBokehBlurOperation.cpp +++ b/source/blender/compositor/operations/COM_VariableSizeBokehBlurOperation.cpp @@ -135,7 +135,7 @@ void VariableSizeBokehBlurOperation::executePixel(float output[4], int x, int y, copy_v4_v4(color_accum, readColor); copy_v4_fl(multiplier_accum, 1.0f); float size_center = tempSize[0] * scalar; - + const int addXStepValue = QualityStepHelper::getStep(); const int addYStepValue = addXStepValue; const int addXStepColor = addXStepValue * COM_NUM_CHANNELS_COLOR; @@ -184,8 +184,8 @@ void VariableSizeBokehBlurOperation::executePixel(float output[4], int x, int y, } void VariableSizeBokehBlurOperation::executeOpenCL(OpenCLDevice *device, - MemoryBuffer *outputMemoryBuffer, cl_mem clOutputBuffer, - MemoryBuffer **inputMemoryBuffers, list *clMemToCleanUp, + MemoryBuffer *outputMemoryBuffer, cl_mem clOutputBuffer, + MemoryBuffer **inputMemoryBuffers, list *clMemToCleanUp, list * /*clKernelsToCleanUp*/) { cl_kernel defocusKernel = device->COM_clCreateKernel("defocusKernel", NULL); @@ -193,7 +193,7 @@ void VariableSizeBokehBlurOperation::executeOpenCL(OpenCLDevice *device, cl_int step = this->getStep(); cl_int maxBlur; cl_float threshold = this->m_threshold; - + MemoryBuffer *sizeMemoryBuffer = this->m_inputSizeProgram->getInputMemoryBuffer(inputMemoryBuffers); const float max_dim = max(m_width, m_height); @@ -212,7 +212,7 @@ void VariableSizeBokehBlurOperation::executeOpenCL(OpenCLDevice *device, clSetKernelArg(defocusKernel, 8, sizeof(cl_float), &threshold); clSetKernelArg(defocusKernel, 9, sizeof(cl_float), &scalar); device->COM_clAttachSizeToKernelParameter(defocusKernel, 10, this); - + device->COM_clEnqueueRange(defocusKernel, outputMemoryBuffer, 11, this); } @@ -243,7 +243,7 @@ bool VariableSizeBokehBlurOperation::determineDependingAreaOfInterest(rcti *inpu bokehInput.xmin = 0; bokehInput.ymax = COM_BLUR_BOKEH_PIXELS; bokehInput.ymin = 0; - + NodeOperation *operation = getInputOperation(2); if (operation->determineDependingAreaOfInterest(&newInput, readOperation, output) ) { @@ -273,7 +273,7 @@ bool VariableSizeBokehBlurOperation::determineDependingAreaOfInterest(rcti *inpu #ifdef COM_DEFOCUS_SEARCH // InverseSearchRadiusOperation -InverseSearchRadiusOperation::InverseSearchRadiusOperation() : NodeOperation() +InverseSearchRadiusOperation::InverseSearchRadiusOperation() : NodeOperation() { this->addInputSocket(COM_DT_VALUE, COM_SC_NO_RESIZE); // radius this->addOutputSocket(COM_DT_COLOR); @@ -281,7 +281,7 @@ InverseSearchRadiusOperation::InverseSearchRadiusOperation() : NodeOperation() this->m_inputRadius = NULL; } -void InverseSearchRadiusOperation::initExecution() +void InverseSearchRadiusOperation::initExecution() { this->m_inputRadius = this->getInputSocketReader(0); } @@ -313,7 +313,7 @@ void *InverseSearchRadiusOperation::initializeTileData(rcti *rect) // float radius = 0.0f; // float maxx = x; // float maxy = y; - + // for (int x2 = 0 ; x2 < DIVIDER ; x2 ++) { // for (int y2 = 0 ; y2 < DIVIDER ; y2 ++) { // this->m_inputRadius->read(temp, rx+x2, ry+y2, COM_PS_NEAREST); @@ -346,7 +346,7 @@ void InverseSearchRadiusOperation::executePixelChunk(float output[4], int x, int buffer->readNoCheck(output, x, y); } -void InverseSearchRadiusOperation::deinitializeTileData(rcti *rect, void *data) +void InverseSearchRadiusOperation::deinitializeTileData(rcti *rect, void *data) { if (data) { MemoryBuffer *mb = (MemoryBuffer *)data; @@ -354,7 +354,7 @@ void InverseSearchRadiusOperation::deinitializeTileData(rcti *rect, void *data) } } -void InverseSearchRadiusOperation::deinitExecution() +void InverseSearchRadiusOperation::deinitExecution() { this->m_inputRadius = NULL; } diff --git a/source/blender/compositor/operations/COM_VariableSizeBokehBlurOperation.h b/source/blender/compositor/operations/COM_VariableSizeBokehBlurOperation.h index 110bb6b4952..57ffde6d398 100644 --- a/source/blender/compositor/operations/COM_VariableSizeBokehBlurOperation.h +++ b/source/blender/compositor/operations/COM_VariableSizeBokehBlurOperation.h @@ -46,23 +46,23 @@ public: * the inner loop of this program */ void executePixel(float output[4], int x, int y, void *data); - + /** * Initialize the execution */ void initExecution(); - + void *initializeTileData(rcti *rect); - + void deinitializeTileData(rcti *rect, void *data); - + /** * Deinitialize the execution */ void deinitExecution(); - + bool determineDependingAreaOfInterest(rcti *input, ReadBufferOperation *readOperation, rcti *output); - + void setMaxBlur(int maxRadius) { this->m_maxBlur = maxRadius; } void setThreshold(float threshold) { this->m_threshold = threshold; } @@ -79,29 +79,29 @@ private: SocketReader *m_inputRadius; public: static const int DIVIDER = 4; - + InverseSearchRadiusOperation(); /** * the inner loop of this program */ void executePixelChunk(float output[4], int x, int y, void *data); - + /** * Initialize the execution */ void initExecution(); void *initializeTileData(rcti *rect); void deinitializeTileData(rcti *rect, void *data); - + /** * Deinitialize the execution */ void deinitExecution(); - + bool determineDependingAreaOfInterest(rcti *input, ReadBufferOperation *readOperation, rcti *output); void determineResolution(unsigned int resolution[2], unsigned int preferredResolution[2]); - + void setMaxBlur(int maxRadius) { this->m_maxBlur = maxRadius; } }; #endif diff --git a/source/blender/compositor/operations/COM_VectorBlurOperation.h b/source/blender/compositor/operations/COM_VectorBlurOperation.h index 05c2c3183c1..30ca2f644bb 100644 --- a/source/blender/compositor/operations/COM_VectorBlurOperation.h +++ b/source/blender/compositor/operations/COM_VectorBlurOperation.h @@ -34,27 +34,27 @@ private: SocketReader *m_inputImageProgram; SocketReader *m_inputSpeedProgram; SocketReader *m_inputZProgram; - + /** * @brief settings of the glare node. */ NodeBlurData *m_settings; - + float *m_cachedInstance; public: VectorBlurOperation(); - + /** * the inner loop of this program */ void executePixel(float output[4], int x, int y, void *data); - + /** * Initialize the execution */ void initExecution(); - + /** * Deinitialize the execution */ @@ -65,9 +65,9 @@ public: void setVectorBlurSettings(NodeBlurData *settings) { this->m_settings = settings; } bool determineDependingAreaOfInterest(rcti *input, ReadBufferOperation *readOperation, rcti *output); protected: - + void generateVectorBlur(float *data, MemoryBuffer *inputImage, MemoryBuffer *inputSpeed, MemoryBuffer *inputZ); - - + + }; #endif diff --git a/source/blender/compositor/operations/COM_VectorCurveOperation.h b/source/blender/compositor/operations/COM_VectorCurveOperation.h index 444f848cb0a..518e4713c99 100644 --- a/source/blender/compositor/operations/COM_VectorCurveOperation.h +++ b/source/blender/compositor/operations/COM_VectorCurveOperation.h @@ -33,17 +33,17 @@ private: SocketReader *m_inputProgram; public: VectorCurveOperation(); - + /** * the inner loop of this program */ void executePixelSampled(float output[4], float x, float y, PixelSampler sampler); - + /** * Initialize the execution */ void initExecution(); - + /** * Deinitialize the execution */ diff --git a/source/blender/compositor/operations/COM_ViewerOperation.cpp b/source/blender/compositor/operations/COM_ViewerOperation.cpp index 0eff52f4d9a..51fd5d4dc76 100644 --- a/source/blender/compositor/operations/COM_ViewerOperation.cpp +++ b/source/blender/compositor/operations/COM_ViewerOperation.cpp @@ -50,7 +50,7 @@ ViewerOperation::ViewerOperation() : NodeOperation() this->m_viewSettings = NULL; this->m_displaySettings = NULL; this->m_useAlphaInput = false; - + this->addInputSocket(COM_DT_COLOR); this->addInputSocket(COM_DT_VALUE); this->addInputSocket(COM_DT_VALUE); @@ -69,7 +69,7 @@ void ViewerOperation::initExecution() this->m_alphaInput = getInputSocketReader(1); this->m_depthInput = getInputSocketReader(2); this->m_doDepthBuffer = (this->m_depthInput != NULL); - + if (isActiveViewerOutput()) { initImage(); } diff --git a/source/blender/compositor/operations/COM_ViewerOperation.h b/source/blender/compositor/operations/COM_ViewerOperation.h index e5eed3e8024..0e4bff2c4e8 100644 --- a/source/blender/compositor/operations/COM_ViewerOperation.h +++ b/source/blender/compositor/operations/COM_ViewerOperation.h @@ -45,7 +45,7 @@ private: const ColorManagedViewSettings *m_viewSettings; const ColorManagedDisplaySettings *m_displaySettings; - + SocketReader *m_imageInput; SocketReader *m_alphaInput; SocketReader *m_depthInput; diff --git a/source/blender/compositor/operations/COM_WriteBufferOperation.cpp b/source/blender/compositor/operations/COM_WriteBufferOperation.cpp index 85602e6741c..5a34673b2bd 100644 --- a/source/blender/compositor/operations/COM_WriteBufferOperation.cpp +++ b/source/blender/compositor/operations/COM_WriteBufferOperation.cpp @@ -131,7 +131,7 @@ void WriteBufferOperation::executeOpenCLRegion(OpenCLDevice *device, rcti * /*re cl_mem clOutputBuffer = clCreateImage2D(device->getContext(), CL_MEM_WRITE_ONLY | CL_MEM_USE_HOST_PTR, imageFormat, outputBufferWidth, outputBufferHeight, 0, outputFloatBuffer, &error); if (error != CL_SUCCESS) { printf("CLERROR[%d]: %s\n", error, clewErrorString(error)); } - + // STEP 2 list *clMemToCleanUp = new list(); clMemToCleanUp->push_back(clOutputBuffer); @@ -151,7 +151,7 @@ void WriteBufferOperation::executeOpenCLRegion(OpenCLDevice *device, rcti * /*re if (error != CL_SUCCESS) { printf("CLERROR[%d]: %s\n", error, clewErrorString(error)); } error = clEnqueueReadImage(device->getQueue(), clOutputBuffer, CL_TRUE, origin, region, 0, 0, outputFloatBuffer, 0, NULL, NULL); if (error != CL_SUCCESS) { printf("CLERROR[%d]: %s\n", error, clewErrorString(error)); } - + this->getMemoryProxy()->getBuffer()->copyContentFrom(outputBuffer); // STEP 4 diff --git a/source/blender/compositor/operations/COM_WriteBufferOperation.h b/source/blender/compositor/operations/COM_WriteBufferOperation.h index afcdc70889b..73314c947f5 100644 --- a/source/blender/compositor/operations/COM_WriteBufferOperation.h +++ b/source/blender/compositor/operations/COM_WriteBufferOperation.h @@ -41,7 +41,7 @@ public: void executePixelSampled(float output[4], float x, float y, PixelSampler sampler); const bool isWriteBufferOperation() const { return true; } bool isSingleValue() const { return m_single_value; } - + void executeRegion(rcti *rect, unsigned int tileNumber); void initExecution(); void deinitExecution(); diff --git a/source/blender/compositor/operations/COM_ZCombineOperation.h b/source/blender/compositor/operations/COM_ZCombineOperation.h index a89a2c7bd62..c9d26adfc46 100644 --- a/source/blender/compositor/operations/COM_ZCombineOperation.h +++ b/source/blender/compositor/operations/COM_ZCombineOperation.h @@ -40,10 +40,10 @@ public: * Default constructor */ ZCombineOperation(); - + void initExecution(); void deinitExecution(); - + /** * the inner loop of this program */