From 8e7d7d5ea56c75739164b98f5fb2f97ff51d697b Mon Sep 17 00:00:00 2001 From: Campbell Barton Date: Sat, 9 Jun 2012 19:57:14 +0000 Subject: code cleanup: reduce float/double promotion --- source/blender/compositor/CMakeLists.txt | 419 ++++++++++----------- .../compositor/intern/COM_ChunkOrderHotspot.cpp | 2 +- .../blender/compositor/intern/COM_MemoryBuffer.cpp | 4 +- .../operations/COM_BokehBlurOperation.cpp | 6 +- .../operations/COM_BokehImageOperation.cpp | 40 +- .../compositor/operations/COM_BoxMaskOperation.cpp | 14 +- .../operations/COM_ChangeHSVOperation.cpp | 3 +- .../operations/COM_ColorBalanceASCCDLOperation.cpp | 2 +- .../operations/COM_ColorCorrectionOperation.cpp | 30 +- .../operations/COM_ColorCurveOperation.cpp | 24 +- .../operations/COM_DifferenceMatteOperation.cpp | 12 +- .../operations/COM_DirectionalBlurOperation.cpp | 10 +- .../operations/COM_EllipseMaskOperation.cpp | 2 +- .../operations/COM_FogGlowImageOperation.cpp | 2 +- .../compositor/operations/COM_GammaOperation.cpp | 6 +- .../operations/COM_GaussianBokehBlurOperation.cpp | 10 +- .../operations/COM_GaussianXBlurOperation.cpp | 12 +- .../operations/COM_GaussianYBlurOperation.cpp | 10 +- .../COM_HueSaturationValueCorrectOperation.cpp | 4 +- .../compositor/operations/COM_MapUVOperation.cpp | 8 +- .../operations/COM_MathBaseOperation.cpp | 4 +- .../compositor/operations/COM_RotateOperation.cpp | 2 +- .../compositor/operations/COM_TonemapOperation.cpp | 60 +-- .../COM_VariableSizeBokehBlurOperation.cpp | 8 +- 24 files changed, 347 insertions(+), 347 deletions(-) (limited to 'source') diff --git a/source/blender/compositor/CMakeLists.txt b/source/blender/compositor/CMakeLists.txt index 27bf7df8142..22f72270734 100644 --- a/source/blender/compositor/CMakeLists.txt +++ b/source/blender/compositor/CMakeLists.txt @@ -26,24 +26,24 @@ set(INC . + intern + nodes + operations ../blenkernel ../blenlib + ../blenlib + ../blenloader + ../imbuf ../makesdna - ../render/extern/include - ../render/intern/include ../makesrna - ../blenloader - ../blenlib + ../opencl ../windowmanager - ../imbuf - ../../../intern/guardedalloc - nodes - ../nodes/ + ../nodes ../nodes/composite ../nodes/intern - intern - operations - ../opencl + ../render/extern/include + ../render/intern/include + ../../../intern/guardedalloc ) set(SRC @@ -100,7 +100,7 @@ set(SRC operations/COM_QualityStepHelper.h operations/COM_QualityStepHelper.cpp -# Internal nodes + # Internal nodes nodes/COM_MuteNode.cpp nodes/COM_MuteNode.h nodes/COM_GroupNode.cpp @@ -108,7 +108,7 @@ set(SRC nodes/COM_SocketProxyNode.cpp nodes/COM_SocketProxyNode.h -# input nodes + # input nodes nodes/COM_RenderLayersNode.cpp nodes/COM_RenderLayersNode.h nodes/COM_ImageNode.cpp @@ -132,7 +132,7 @@ set(SRC nodes/COM_MaskNode.cpp nodes/COM_MaskNode.h -# output nodes + # output nodes nodes/COM_CompositorNode.cpp nodes/COM_CompositorNode.h nodes/COM_ViewerNode.cpp @@ -146,7 +146,7 @@ set(SRC operations/COM_CalculateMeanOperation.cpp operations/COM_CalculateMeanOperation.h -# distort nodes + # distort nodes nodes/COM_TranslateNode.cpp nodes/COM_TranslateNode.h nodes/COM_ScaleNode.cpp @@ -193,27 +193,27 @@ set(SRC nodes/COM_DefocusNode.cpp nodes/COM_DefocusNode.h -# color nodes - nodes/COM_VectorCurveNode.cpp - nodes/COM_VectorCurveNode.h - nodes/COM_ColorCurveNode.cpp - nodes/COM_ColorCurveNode.h - nodes/COM_ColorToBWNode.cpp - nodes/COM_ColorToBWNode.h - nodes/COM_ColorRampNode.cpp - nodes/COM_ColorRampNode.h - nodes/COM_MixNode.cpp - nodes/COM_MixNode.h - nodes/COM_AlphaOverNode.cpp - nodes/COM_AlphaOverNode.h - nodes/COM_ZCombineNode.cpp - nodes/COM_ZCombineNode.h - nodes/COM_BrightnessNode.cpp - nodes/COM_BrightnessNode.h - nodes/COM_ColorBalanceNode.cpp - nodes/COM_ColorBalanceNode.h - nodes/COM_InvertNode.cpp - nodes/COM_InvertNode.h + # color nodes + nodes/COM_VectorCurveNode.cpp + nodes/COM_VectorCurveNode.h + nodes/COM_ColorCurveNode.cpp + nodes/COM_ColorCurveNode.h + nodes/COM_ColorToBWNode.cpp + nodes/COM_ColorToBWNode.h + nodes/COM_ColorRampNode.cpp + nodes/COM_ColorRampNode.h + nodes/COM_MixNode.cpp + nodes/COM_MixNode.h + nodes/COM_AlphaOverNode.cpp + nodes/COM_AlphaOverNode.h + nodes/COM_ZCombineNode.cpp + nodes/COM_ZCombineNode.h + nodes/COM_BrightnessNode.cpp + nodes/COM_BrightnessNode.h + nodes/COM_ColorBalanceNode.cpp + nodes/COM_ColorBalanceNode.h + nodes/COM_InvertNode.cpp + nodes/COM_InvertNode.h nodes/COM_GammaNode.cpp nodes/COM_GammaNode.h nodes/COM_SetAlphaNode.cpp @@ -233,25 +233,25 @@ set(SRC operations/COM_TonemapOperation.cpp operations/COM_TonemapOperation.h -# converter nodes - nodes/COM_IDMaskNode.cpp - nodes/COM_IDMaskNode.h - nodes/COM_SeparateRGBANode.cpp - nodes/COM_SeparateRGBANode.h - nodes/COM_CombineRGBANode.cpp - nodes/COM_CombineRGBANode.h - nodes/COM_SeparateHSVANode.cpp - nodes/COM_SeparateHSVANode.h - nodes/COM_CombineHSVANode.cpp - nodes/COM_CombineHSVANode.h - nodes/COM_SeparateYUVANode.cpp - nodes/COM_SeparateYUVANode.h - nodes/COM_CombineYUVANode.cpp - nodes/COM_CombineYUVANode.h - nodes/COM_SeparateYCCANode.cpp - nodes/COM_SeparateYCCANode.h - nodes/COM_CombineYCCANode.cpp - nodes/COM_CombineYCCANode.h + # converter nodes + nodes/COM_IDMaskNode.cpp + nodes/COM_IDMaskNode.h + nodes/COM_SeparateRGBANode.cpp + nodes/COM_SeparateRGBANode.h + nodes/COM_CombineRGBANode.cpp + nodes/COM_CombineRGBANode.h + nodes/COM_SeparateHSVANode.cpp + nodes/COM_SeparateHSVANode.h + nodes/COM_CombineHSVANode.cpp + nodes/COM_CombineHSVANode.h + nodes/COM_SeparateYUVANode.cpp + nodes/COM_SeparateYUVANode.h + nodes/COM_CombineYUVANode.cpp + nodes/COM_CombineYUVANode.h + nodes/COM_SeparateYCCANode.cpp + nodes/COM_SeparateYCCANode.h + nodes/COM_CombineYCCANode.cpp + nodes/COM_CombineYCCANode.h nodes/COM_NormalNode.cpp nodes/COM_NormalNode.h @@ -265,7 +265,7 @@ set(SRC operations/COM_NormalizeOperation.cpp operations/COM_NormalizeOperation.h -# Filter nodes + # Filter nodes nodes/COM_BilateralBlurNode.cpp nodes/COM_BilateralBlurNode.h operations/COM_BilateralBlurOperation.cpp @@ -275,12 +275,10 @@ set(SRC operations/COM_VectorBlurOperation.cpp operations/COM_VectorBlurOperation.h - - - nodes/COM_FilterNode.cpp - nodes/COM_FilterNode.h - nodes/COM_DilateErodeNode.cpp - nodes/COM_DilateErodeNode.h + nodes/COM_FilterNode.cpp + nodes/COM_FilterNode.h + nodes/COM_DilateErodeNode.cpp + nodes/COM_DilateErodeNode.h nodes/COM_BlurNode.cpp nodes/COM_BlurNode.h nodes/COM_BokehBlurNode.cpp @@ -310,7 +308,7 @@ set(SRC operations/COM_GammaCorrectOperation.h operations/COM_GammaCorrectOperation.cpp -# Matte nodes + # Matte nodes nodes/COM_BoxMaskNode.cpp nodes/COM_BoxMaskNode.h nodes/COM_EllipseMaskNode.cpp @@ -322,50 +320,50 @@ set(SRC operations/COM_DoubleEdgeMaskOperation.cpp operations/COM_DoubleEdgeMaskOperation.h -operations/COM_ColorSpillOperation.cpp -operations/COM_ColorSpillOperation.h - operations/COM_RenderLayersBaseProg.cpp - operations/COM_RenderLayersBaseProg.h - operations/COM_RenderLayersImageProg.cpp - operations/COM_RenderLayersImageProg.h - operations/COM_RenderLayersAlphaProg.cpp - operations/COM_RenderLayersAlphaProg.h - operations/COM_RenderLayersDepthProg.cpp - operations/COM_RenderLayersDepthProg.h - operations/COM_RenderLayersNormalOperation.cpp - operations/COM_RenderLayersNormalOperation.h - operations/COM_RenderLayersSpeedOperation.cpp - operations/COM_RenderLayersSpeedOperation.h - operations/COM_RenderLayersColorOperation.cpp - operations/COM_RenderLayersColorOperation.h - operations/COM_RenderLayersUVOperation.cpp - operations/COM_RenderLayersUVOperation.h - operations/COM_RenderLayersMistOperation.cpp - operations/COM_RenderLayersMistOperation.h - operations/COM_RenderLayersObjectIndexOperation.cpp - operations/COM_RenderLayersObjectIndexOperation.h - operations/COM_RenderLayersMaterialIndexOperation.cpp - operations/COM_RenderLayersMaterialIndexOperation.h - operations/COM_RenderLayersDiffuseOperation.cpp - operations/COM_RenderLayersDiffuseOperation.h - operations/COM_RenderLayersSpecularOperation.cpp - operations/COM_RenderLayersSpecularOperation.h - operations/COM_RenderLayersShadowOperation.cpp - operations/COM_RenderLayersShadowOperation.h - operations/COM_RenderLayersAOOperation.cpp - operations/COM_RenderLayersAOOperation.h - operations/COM_RenderLayersEmitOperation.cpp - operations/COM_RenderLayersEmitOperation.h - operations/COM_RenderLayersReflectionOperation.cpp - operations/COM_RenderLayersReflectionOperation.h - operations/COM_RenderLayersRefractionOperation.cpp - operations/COM_RenderLayersRefractionOperation.h - operations/COM_RenderLayersEnvironmentOperation.cpp - operations/COM_RenderLayersEnvironmentOperation.h - operations/COM_RenderLayersIndirectOperation.cpp - operations/COM_RenderLayersIndirectOperation.h - operations/COM_RenderLayersCyclesOperation.cpp - operations/COM_RenderLayersCyclesOperation.h + operations/COM_ColorSpillOperation.cpp + operations/COM_ColorSpillOperation.h + operations/COM_RenderLayersBaseProg.cpp + operations/COM_RenderLayersBaseProg.h + operations/COM_RenderLayersImageProg.cpp + operations/COM_RenderLayersImageProg.h + operations/COM_RenderLayersAlphaProg.cpp + operations/COM_RenderLayersAlphaProg.h + operations/COM_RenderLayersDepthProg.cpp + operations/COM_RenderLayersDepthProg.h + operations/COM_RenderLayersNormalOperation.cpp + operations/COM_RenderLayersNormalOperation.h + operations/COM_RenderLayersSpeedOperation.cpp + operations/COM_RenderLayersSpeedOperation.h + operations/COM_RenderLayersColorOperation.cpp + operations/COM_RenderLayersColorOperation.h + operations/COM_RenderLayersUVOperation.cpp + operations/COM_RenderLayersUVOperation.h + operations/COM_RenderLayersMistOperation.cpp + operations/COM_RenderLayersMistOperation.h + operations/COM_RenderLayersObjectIndexOperation.cpp + operations/COM_RenderLayersObjectIndexOperation.h + operations/COM_RenderLayersMaterialIndexOperation.cpp + operations/COM_RenderLayersMaterialIndexOperation.h + operations/COM_RenderLayersDiffuseOperation.cpp + operations/COM_RenderLayersDiffuseOperation.h + operations/COM_RenderLayersSpecularOperation.cpp + operations/COM_RenderLayersSpecularOperation.h + operations/COM_RenderLayersShadowOperation.cpp + operations/COM_RenderLayersShadowOperation.h + operations/COM_RenderLayersAOOperation.cpp + operations/COM_RenderLayersAOOperation.h + operations/COM_RenderLayersEmitOperation.cpp + operations/COM_RenderLayersEmitOperation.h + operations/COM_RenderLayersReflectionOperation.cpp + operations/COM_RenderLayersReflectionOperation.h + operations/COM_RenderLayersRefractionOperation.cpp + operations/COM_RenderLayersRefractionOperation.h + operations/COM_RenderLayersEnvironmentOperation.cpp + operations/COM_RenderLayersEnvironmentOperation.h + operations/COM_RenderLayersIndirectOperation.cpp + operations/COM_RenderLayersIndirectOperation.h + operations/COM_RenderLayersCyclesOperation.cpp + operations/COM_RenderLayersCyclesOperation.h operations/COM_ImageOperation.cpp operations/COM_ImageOperation.h @@ -377,39 +375,39 @@ operations/COM_ColorSpillOperation.h operations/COM_BokehImageOperation.h - operations/COM_SocketProxyOperation.h - operations/COM_SocketProxyOperation.cpp + operations/COM_SocketProxyOperation.h + operations/COM_SocketProxyOperation.cpp - operations/COM_CompositorOperation.h - operations/COM_CompositorOperation.cpp + operations/COM_CompositorOperation.h + operations/COM_CompositorOperation.cpp operations/COM_OutputFileOperation.h operations/COM_OutputFileOperation.cpp - operations/COM_ViewerBaseOperation.h - operations/COM_ViewerBaseOperation.cpp - operations/COM_ViewerOperation.h - operations/COM_ViewerOperation.cpp - operations/COM_PreviewOperation.h - operations/COM_PreviewOperation.cpp - operations/COM_SplitViewerOperation.h - operations/COM_SplitViewerOperation.cpp - operations/COM_ConvertValueToColourProg.h - operations/COM_ConvertValueToColourProg.cpp - operations/COM_ConvertColourToValueProg.h - operations/COM_ConvertColourToValueProg.cpp - operations/COM_ConvertColorToBWOperation.h - operations/COM_ConvertColorToBWOperation.cpp - operations/COM_ConvertColorToVectorOperation.h - operations/COM_ConvertColorToVectorOperation.cpp - operations/COM_ConvertValueToVectorOperation.h - operations/COM_ConvertValueToVectorOperation.cpp - operations/COM_ConvertVectorToColorOperation.h - operations/COM_ConvertVectorToColorOperation.cpp - operations/COM_ConvertVectorToValueOperation.h - operations/COM_ConvertVectorToValueOperation.cpp -operations/COM_ConvertDepthToRadiusOperation.h -operations/COM_ConvertDepthToRadiusOperation.cpp - operations/COM_ZCombineOperation.cpp - operations/COM_ZCombineOperation.h + operations/COM_ViewerBaseOperation.h + operations/COM_ViewerBaseOperation.cpp + operations/COM_ViewerOperation.h + operations/COM_ViewerOperation.cpp + operations/COM_PreviewOperation.h + operations/COM_PreviewOperation.cpp + operations/COM_SplitViewerOperation.h + operations/COM_SplitViewerOperation.cpp + operations/COM_ConvertValueToColourProg.h + operations/COM_ConvertValueToColourProg.cpp + operations/COM_ConvertColourToValueProg.h + operations/COM_ConvertColourToValueProg.cpp + operations/COM_ConvertColorToBWOperation.h + operations/COM_ConvertColorToBWOperation.cpp + operations/COM_ConvertColorToVectorOperation.h + operations/COM_ConvertColorToVectorOperation.cpp + operations/COM_ConvertValueToVectorOperation.h + operations/COM_ConvertValueToVectorOperation.cpp + operations/COM_ConvertVectorToColorOperation.h + operations/COM_ConvertVectorToColorOperation.cpp + operations/COM_ConvertVectorToValueOperation.h + operations/COM_ConvertVectorToValueOperation.cpp + operations/COM_ConvertDepthToRadiusOperation.h + operations/COM_ConvertDepthToRadiusOperation.cpp + operations/COM_ZCombineOperation.cpp + operations/COM_ZCombineOperation.h operations/COM_ConvertRGBToYCCOperation.h operations/COM_ConvertRGBToYCCOperation.cpp @@ -470,86 +468,86 @@ operations/COM_ConvertDepthToRadiusOperation.cpp operations/COM_GammaOperation.h operations/COM_ColorCorrectionOperation.cpp operations/COM_ColorCorrectionOperation.h - operations/COM_SetValueOperation.h - operations/COM_SetValueOperation.cpp - operations/COM_SetColorOperation.h - operations/COM_SetColorOperation.cpp - operations/COM_SetVectorOperation.h - operations/COM_SetVectorOperation.cpp - - operations/COM_MixBurnOperation.h - operations/COM_MixBurnOperation.cpp - operations/COM_MixColorOperation.h - operations/COM_MixColorOperation.cpp - operations/COM_MixDarkenOperation.h - operations/COM_MixDarkenOperation.cpp - operations/COM_MixDodgeOperation.h - operations/COM_MixDodgeOperation.cpp - operations/COM_MixDifferenceOperation.h - operations/COM_MixDifferenceOperation.cpp - operations/COM_MixDivideOperation.h - operations/COM_MixDivideOperation.cpp - operations/COM_MixHueOperation.h - operations/COM_MixHueOperation.cpp - operations/COM_MixLightenOperation.h - operations/COM_MixLightenOperation.cpp - operations/COM_MixLinearLightOperation.h - operations/COM_MixLinearLightOperation.cpp - operations/COM_MixOverlayOperation.h - operations/COM_MixOverlayOperation.cpp - operations/COM_MixSaturationOperation.h - operations/COM_MixSaturationOperation.cpp - operations/COM_MixScreenOperation.h - operations/COM_MixScreenOperation.cpp - operations/COM_MixSoftLightOperation.h - operations/COM_MixSoftLightOperation.cpp - operations/COM_MixValueOperation.h - operations/COM_MixValueOperation.cpp - operations/COM_MixSubtractOperation.h - operations/COM_MixSubtractOperation.cpp + operations/COM_SetValueOperation.h + operations/COM_SetValueOperation.cpp + operations/COM_SetColorOperation.h + operations/COM_SetColorOperation.cpp + operations/COM_SetVectorOperation.h + operations/COM_SetVectorOperation.cpp + + operations/COM_MixBurnOperation.h + operations/COM_MixBurnOperation.cpp + operations/COM_MixColorOperation.h + operations/COM_MixColorOperation.cpp + operations/COM_MixDarkenOperation.h + operations/COM_MixDarkenOperation.cpp + operations/COM_MixDodgeOperation.h + operations/COM_MixDodgeOperation.cpp + operations/COM_MixDifferenceOperation.h + operations/COM_MixDifferenceOperation.cpp + operations/COM_MixDivideOperation.h + operations/COM_MixDivideOperation.cpp + operations/COM_MixHueOperation.h + operations/COM_MixHueOperation.cpp + operations/COM_MixLightenOperation.h + operations/COM_MixLightenOperation.cpp + operations/COM_MixLinearLightOperation.h + operations/COM_MixLinearLightOperation.cpp + operations/COM_MixOverlayOperation.h + operations/COM_MixOverlayOperation.cpp + operations/COM_MixSaturationOperation.h + operations/COM_MixSaturationOperation.cpp + operations/COM_MixScreenOperation.h + operations/COM_MixScreenOperation.cpp + operations/COM_MixSoftLightOperation.h + operations/COM_MixSoftLightOperation.cpp + operations/COM_MixValueOperation.h + operations/COM_MixValueOperation.cpp + operations/COM_MixSubtractOperation.h + operations/COM_MixSubtractOperation.cpp operations/COM_MathBaseOperation.h operations/COM_MathBaseOperation.cpp - operations/COM_AlphaOverMixedOperation.h - operations/COM_AlphaOverMixedOperation.cpp - operations/COM_AlphaOverPremultiplyOperation.h - operations/COM_AlphaOverPremultiplyOperation.cpp - operations/COM_AlphaOverKeyOperation.h - operations/COM_AlphaOverKeyOperation.cpp - - operations/COM_ColorBalanceLGGOperation.h - operations/COM_ColorBalanceLGGOperation.cpp - operations/COM_ColorBalanceASCCDLOperation.h - operations/COM_ColorBalanceASCCDLOperation.cpp - operations/COM_InvertOperation.cpp - operations/COM_InvertOperation.h + operations/COM_AlphaOverMixedOperation.h + operations/COM_AlphaOverMixedOperation.cpp + operations/COM_AlphaOverPremultiplyOperation.h + operations/COM_AlphaOverPremultiplyOperation.cpp + operations/COM_AlphaOverKeyOperation.h + operations/COM_AlphaOverKeyOperation.cpp + + operations/COM_ColorBalanceLGGOperation.h + operations/COM_ColorBalanceLGGOperation.cpp + operations/COM_ColorBalanceASCCDLOperation.h + operations/COM_ColorBalanceASCCDLOperation.cpp + operations/COM_InvertOperation.cpp + operations/COM_InvertOperation.h operations/COM_SetAlphaOperation.cpp operations/COM_SetAlphaOperation.h operations/COM_MapValueOperation.cpp operations/COM_MapValueOperation.h -# Distort operation - operations/COM_TranslateOperation.h - operations/COM_TranslateOperation.cpp - operations/COM_RotateOperation.h - operations/COM_RotateOperation.cpp - operations/COM_ScaleOperation.h - operations/COM_ScaleOperation.cpp - operations/COM_MapUVOperation.h - operations/COM_MapUVOperation.cpp - operations/COM_DisplaceOperation.h - operations/COM_DisplaceOperation.cpp - operations/COM_DisplaceSimpleOperation.h - operations/COM_DisplaceSimpleOperation.cpp - operations/COM_FlipOperation.h - operations/COM_FlipOperation.cpp - operations/COM_ProjectorLensDistortionOperation.cpp - operations/COM_ProjectorLensDistortionOperation.h - operations/COM_ScreenLensDistortionOperation.cpp - operations/COM_ScreenLensDistortionOperation.h - -#Filter operations + # Distort operation + operations/COM_TranslateOperation.h + operations/COM_TranslateOperation.cpp + operations/COM_RotateOperation.h + operations/COM_RotateOperation.cpp + operations/COM_ScaleOperation.h + operations/COM_ScaleOperation.cpp + operations/COM_MapUVOperation.h + operations/COM_MapUVOperation.cpp + operations/COM_DisplaceOperation.h + operations/COM_DisplaceOperation.cpp + operations/COM_DisplaceSimpleOperation.h + operations/COM_DisplaceSimpleOperation.cpp + operations/COM_FlipOperation.h + operations/COM_FlipOperation.cpp + operations/COM_ProjectorLensDistortionOperation.cpp + operations/COM_ProjectorLensDistortionOperation.h + operations/COM_ScreenLensDistortionOperation.cpp + operations/COM_ScreenLensDistortionOperation.h + + #Filter operations operations/COM_ConvolutionFilterOperation.h operations/COM_ConvolutionFilterOperation.cpp operations/COM_ConvolutionEdgeFilterOperation.h @@ -572,7 +570,7 @@ operations/COM_ConvertDepthToRadiusOperation.cpp operations/COM_SetSamplerOperation.h -#Convert operations + #Convert operations operations/COM_IDMaskOperation.cpp operations/COM_IDMaskOperation.h @@ -583,7 +581,8 @@ operations/COM_ConvertDepthToRadiusOperation.cpp operations/COM_DotproductOperation.cpp operations/COM_DotproductOperation.h -# Matte operation + + # Matte operation operations/COM_BoxMaskOperation.h operations/COM_BoxMaskOperation.cpp operations/COM_EllipseMaskOperation.h diff --git a/source/blender/compositor/intern/COM_ChunkOrderHotspot.cpp b/source/blender/compositor/intern/COM_ChunkOrderHotspot.cpp index 94110f0bcfe..0ab08ec5810 100644 --- a/source/blender/compositor/intern/COM_ChunkOrderHotspot.cpp +++ b/source/blender/compositor/intern/COM_ChunkOrderHotspot.cpp @@ -35,6 +35,6 @@ double ChunkOrderHotspot::determineDistance(int x, int y) int dx = x-this->x; int dy = y-this->y; double result = sqrt((double)(dx*dx+dy*dy)); - result += this->addition; + result += (double)this->addition; return result; } diff --git a/source/blender/compositor/intern/COM_MemoryBuffer.cpp b/source/blender/compositor/intern/COM_MemoryBuffer.cpp index 37d79607d12..3ebf8398c02 100644 --- a/source/blender/compositor/intern/COM_MemoryBuffer.cpp +++ b/source/blender/compositor/intern/COM_MemoryBuffer.cpp @@ -150,8 +150,8 @@ void MemoryBuffer::readCubic(float result[4], float x, float y) float valuex = x - x1; float valuey = y - y1; - float mvaluex = 1.0 - valuex; - float mvaluey = 1.0 - valuey; + float mvaluex = 1.0f - valuex; + float mvaluey = 1.0f - valuey; float color1[4]; float color2[4]; diff --git a/source/blender/compositor/operations/COM_BokehBlurOperation.cpp b/source/blender/compositor/operations/COM_BokehBlurOperation.cpp index c48f3b0a291..71a87dce2a7 100644 --- a/source/blender/compositor/operations/COM_BokehBlurOperation.cpp +++ b/source/blender/compositor/operations/COM_BokehBlurOperation.cpp @@ -121,9 +121,9 @@ void BokehBlurOperation::executePixel(float *color, int x, int y, MemoryBuffer * bufferindex +=offsetadd; } } - color[0] = tempColor[0]*(1.0/overallmultiplyerr); - color[1] = tempColor[1]*(1.0/overallmultiplyerg); - color[2] = tempColor[2]*(1.0/overallmultiplyerb); + color[0] = tempColor[0] * (1.0f / overallmultiplyerr); + color[1] = tempColor[1] * (1.0f / overallmultiplyerg); + color[2] = tempColor[2] * (1.0f / overallmultiplyerb); color[3] = 1.0f; } else { diff --git a/source/blender/compositor/operations/COM_BokehImageOperation.cpp b/source/blender/compositor/operations/COM_BokehImageOperation.cpp index 0279b9a5bdf..a0297b12961 100644 --- a/source/blender/compositor/operations/COM_BokehImageOperation.cpp +++ b/source/blender/compositor/operations/COM_BokehImageOperation.cpp @@ -34,25 +34,25 @@ void BokehImageOperation::initExecution() this->centerY = getHeight() / 2; this->center[0] = this->centerX; this->center[1] = this->centerY; - this->inverseRounding = 1.0-this->data->rounding; + this->inverseRounding = 1.0f - this->data->rounding; this->circularDistance = getWidth()/2; - this->flapRad = (M_PI*2)/this->data->flaps; - this->flapRadAdd = (this->data->angle/360.0)*M_PI*2; - while (this->flapRadAdd<0.0f) { - this->flapRadAdd+=M_PI*2; + this->flapRad = (float)(M_PI * 2) / this->data->flaps; + this->flapRadAdd = (this->data->angle / 360.0f) * (float)(M_PI * 2.0); + while (this->flapRadAdd < 0.0f) { + this->flapRadAdd += (float)(M_PI * 2.0); } - while (this->flapRadAdd>M_PI) { - this->flapRadAdd-=M_PI*2; + while (this->flapRadAdd > (float)M_PI) { + this->flapRadAdd -= (float)(M_PI * 2.0); } } void BokehImageOperation::detemineStartPointOfFlap(float r[2], int flapNumber, float distance) { - r[0] = sin(flapRad*flapNumber + flapRadAdd)*distance+centerX; - r[1] = cos(flapRad*flapNumber + flapRadAdd)*distance+centerY; + r[0] = sinf(flapRad * flapNumber + flapRadAdd) * distance + centerX; + r[1] = cosf(flapRad * flapNumber + flapRadAdd) * distance + centerY; } float BokehImageOperation::isInsideBokeh(float distance, float x, float y) { - float insideBokeh = 0.0; + float insideBokeh = 0.0f; const float deltaX = x - centerX; const float deltaY = y - centerY; float closestPoint[2]; @@ -63,7 +63,7 @@ float BokehImageOperation::isInsideBokeh(float distance, float x, float y) point[1] = y; const float distanceToCenter = len_v2v2(point, center); - const float bearing = (atan2f(deltaX, deltaY) + (M_PI*2)); + const float bearing = (atan2f(deltaX, deltaY) + (float)(M_PI * 2.0)); int flapNumber = (int)((bearing-flapRadAdd)/flapRad); detemineStartPointOfFlap(lineP1, flapNumber, distance); @@ -73,16 +73,16 @@ float BokehImageOperation::isInsideBokeh(float distance, float x, float y) const float distanceLineToCenter = len_v2v2(center, closestPoint); const float distanceRoundingToCenter = inverseRounding*distanceLineToCenter+this->data->rounding*distance; - const float catadioptricDistanceToCenter = distanceRoundingToCenter*this->data->catadioptric; - if (distanceRoundingToCenter>=distanceToCenter && catadioptricDistanceToCenter<=distanceToCenter) { - if (distanceRoundingToCenter-distanceToCenter<1.0) { + const float catadioptricDistanceToCenter = distanceRoundingToCenter * this->data->catadioptric; + if (distanceRoundingToCenter>=distanceToCenter && catadioptricDistanceToCenter <= distanceToCenter) { + if (distanceRoundingToCenter - distanceToCenter < 1.0f) { insideBokeh = (distanceRoundingToCenter-distanceToCenter); } - else if (this->data->catadioptric != 0.0 && distanceToCenter-catadioptricDistanceToCenter<1.0) { - insideBokeh = (distanceToCenter-catadioptricDistanceToCenter); + else if (this->data->catadioptric != 0.0f && distanceToCenter - catadioptricDistanceToCenter < 1.0f) { + insideBokeh = (distanceToCenter - catadioptricDistanceToCenter); } else { - insideBokeh = 1.0; + insideBokeh = 1.0f; } } return insideBokeh; @@ -90,11 +90,11 @@ float BokehImageOperation::isInsideBokeh(float distance, float x, float y) void BokehImageOperation::executePixel(float *color, float x, float y, PixelSampler sampler, MemoryBuffer *inputBuffers[]) { float shift = this->data->lensshift; - float shift2 = shift/2.0f; + float shift2 = shift / 2.0f; float distance = this->circularDistance; float insideBokehMax = isInsideBokeh(distance, x, y); - float insideBokehMed = isInsideBokeh(distance-fabs(shift2*distance), x, y); - float insideBokehMin = isInsideBokeh(distance-fabs(shift*distance), x, y); + float insideBokehMed = isInsideBokeh(distance - fabsf(shift2 * distance), x, y); + float insideBokehMin = isInsideBokeh(distance - fabsf(shift * distance), x, y); if (shift<0) { color[0] = insideBokehMax; color[1] = insideBokehMed; diff --git a/source/blender/compositor/operations/COM_BoxMaskOperation.cpp b/source/blender/compositor/operations/COM_BoxMaskOperation.cpp index 0244be4cad3..ae83115ff69 100644 --- a/source/blender/compositor/operations/COM_BoxMaskOperation.cpp +++ b/source/blender/compositor/operations/COM_BoxMaskOperation.cpp @@ -38,7 +38,7 @@ void BoxMaskOperation::initExecution() { this->inputMask = this->getInputSocketReader(0); this->inputValue = this->getInputSocketReader(1); - const double rad = DEG2RAD(this->data->rotation); + const double rad = DEG2RAD((double)this->data->rotation); this->cosine = cos(rad); this->sine = sin(rad); this->aspectRatio = ((float)this->getWidth())/this->getHeight(); @@ -60,12 +60,12 @@ void BoxMaskOperation::executePixel(float *color, float x, float y, PixelSampler this->inputMask->read(inputMask, x, y, sampler, inputBuffers); this->inputValue->read(inputValue, x, y, sampler, inputBuffers); - float halfHeight = (this->data->height)/2.0f; - float halfWidth = this->data->width/2.0f; - bool inside = rx > this->data->x-halfWidth - && rx < this->data->x+halfWidth - && ry > this->data->y-halfHeight - && ry < this->data->y+halfHeight; + float halfHeight = this->data->height / 2.0f; + float halfWidth = this->data->width / 2.0f; + bool inside = (rx > this->data->x - halfWidth && + rx < this->data->x + halfWidth && + ry > this->data->y - halfHeight && + ry < this->data->y + halfHeight); switch (this->maskType) { case CMP_NODE_MASKTYPE_ADD: diff --git a/source/blender/compositor/operations/COM_ChangeHSVOperation.cpp b/source/blender/compositor/operations/COM_ChangeHSVOperation.cpp index 9b7f87e38bc..f949b0a55fa 100644 --- a/source/blender/compositor/operations/COM_ChangeHSVOperation.cpp +++ b/source/blender/compositor/operations/COM_ChangeHSVOperation.cpp @@ -46,7 +46,8 @@ void ChangeHSVOperation::executePixel(float *outputValue, float x, float y, Pixe inputOperation->read(inputColor1, x, y, sampler, inputBuffers); outputValue[0] = inputColor1[0] + (this->hue - 0.5f); - if (outputValue[0]>1.0f) outputValue[0]-=1.0; else if (outputValue[0]<0.0) outputValue[0]+= 1.0; + if (outputValue[0] > 1.0f) outputValue[0] -= 1.0f; + else if (outputValue[0] < 0.0f) outputValue[0] += 1.0f; outputValue[1] = inputColor1[1] * this->saturation; outputValue[2] = inputColor1[2] * this->value; outputValue[3] = inputColor1[3]; diff --git a/source/blender/compositor/operations/COM_ColorBalanceASCCDLOperation.cpp b/source/blender/compositor/operations/COM_ColorBalanceASCCDLOperation.cpp index cc535cd95df..6fe6bde7c09 100644 --- a/source/blender/compositor/operations/COM_ColorBalanceASCCDLOperation.cpp +++ b/source/blender/compositor/operations/COM_ColorBalanceASCCDLOperation.cpp @@ -28,7 +28,7 @@ inline float colorbalance_cdl(float in, float offset, float power, float slope) float x = in * slope + offset; /* prevent NaN */ - CLAMP(x, 0.0, 1.0); + CLAMP(x, 0.0f, 1.0f); return powf(x, power); } diff --git a/source/blender/compositor/operations/COM_ColorCorrectionOperation.cpp b/source/blender/compositor/operations/COM_ColorCorrectionOperation.cpp index af28b776892..82a71f6a7a8 100644 --- a/source/blender/compositor/operations/COM_ColorCorrectionOperation.cpp +++ b/source/blender/compositor/operations/COM_ColorCorrectionOperation.cpp @@ -62,21 +62,21 @@ void ColorCorrectionOperation::executePixel(float *output, float x, float y, Pix float levelShadows = 0.0; float levelMidtones = 0.0; float levelHighlights = 0.0; -#define MARGIN 0.10 -#define MARGIN_DIV (0.5/MARGIN) - if (level < this->data->startmidtones-MARGIN) { +#define MARGIN 0.10f +#define MARGIN_DIV (0.5f / MARGIN) + if (level < this->data->startmidtones - MARGIN) { levelShadows = 1.0f; } - else if (level < this->data->startmidtones+MARGIN) { - levelMidtones = ((level-this->data->startmidtones)*MARGIN_DIV)+0.5; - levelShadows = 1.0 - levelMidtones; + else if (level < this->data->startmidtones + MARGIN) { + levelMidtones = ((level - this->data->startmidtones) * MARGIN_DIV) + 0.5f; + levelShadows = 1.0f - levelMidtones; } - else if (level < this->data->endmidtones-MARGIN) { + else if (level < this->data->endmidtones - MARGIN) { levelMidtones = 1.0f; } - else if (level < this->data->endmidtones+MARGIN) { - levelHighlights = ((level-this->data->endmidtones)*MARGIN_DIV)+0.5; - levelMidtones = 1.0 - levelHighlights; + else if (level < this->data->endmidtones + MARGIN) { + levelHighlights = ((level - this->data->endmidtones) * MARGIN_DIV) + 0.5f; + levelMidtones = 1.0f - levelHighlights; } else { levelHighlights = 1.0f; @@ -93,15 +93,15 @@ void ColorCorrectionOperation::executePixel(float *output, float x, float y, Pix g = inputImageColor[1]; b = inputImageColor[2]; - float invgamma = 1.0f/gamma; - float luma = 0.2126 * r + 0.7152 * g + 0.0722 * b; + float invgamma = 1.0f / gamma; + float luma = 0.2126f * r + 0.7152f * g + 0.0722f * b; r = (luma + saturation * (r - luma)); g = (luma + saturation * (g - luma)); b = (luma + saturation * (b - luma)); - r = 0.5+((r-0.5)*contrast); - g = 0.5+((g-0.5)*contrast); - b = 0.5+((b-0.5)*contrast); + 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); diff --git a/source/blender/compositor/operations/COM_ColorCurveOperation.cpp b/source/blender/compositor/operations/COM_ColorCurveOperation.cpp index 069bbde5e73..a38012271f1 100644 --- a/source/blender/compositor/operations/COM_ColorCurveOperation.cpp +++ b/source/blender/compositor/operations/COM_ColorCurveOperation.cpp @@ -76,19 +76,19 @@ void ColorCurveOperation::executePixel(float *color, float x, float y, PixelSamp this->inputFacProgram->read(fac, x, y, sampler, inputBuffers); this->inputImageProgram->read(image, x, y, sampler, inputBuffers); - if (fac[0] >= 1.0) + if (*fac >= 1.0f) curvemapping_evaluate_premulRGBF(workingCopy, color, image); - else if (*fac<=0.0) { + else if (*fac <= 0.0f) { color[0] = image[0]; color[1] = image[1]; color[2] = image[2]; } else { - float col[4], mfac = 1.0f-*fac; + float col[4], mfac = 1.0f - *fac; curvemapping_evaluate_premulRGBF(workingCopy, col, image); - color[0] = mfac*image[0] + *fac*col[0]; - color[1] = mfac*image[1] + *fac*col[1]; - color[2] = mfac*image[2] + *fac*col[2]; + color[0] = mfac * image[0] + *fac * col[0]; + color[1] = mfac * image[1] + *fac * col[1]; + color[2] = mfac * image[2] + *fac * col[2]; } color[3] = image[3]; MEM_freeN(workingCopy); @@ -137,19 +137,19 @@ void ConstantLevelColorCurveOperation::executePixel(float *color, float x, float this->inputFacProgram->read(fac, x, y, sampler, inputBuffers); this->inputImageProgram->read(image, x, y, sampler, inputBuffers); - if (fac[0] >= 1.0) + if (*fac >= 1.0f) curvemapping_evaluate_premulRGBF(this->curveMapping, color, image); - else if (*fac<=0.0) { + else if (*fac <= 0.0f) { color[0] = image[0]; color[1] = image[1]; color[2] = image[2]; } else { - float col[4], mfac = 1.0f-*fac; + float col[4], mfac = 1.0f - *fac; curvemapping_evaluate_premulRGBF(this->curveMapping, col, image); - color[0] = mfac*image[0] + *fac*col[0]; - color[1] = mfac*image[1] + *fac*col[1]; - color[2] = mfac*image[2] + *fac*col[2]; + color[0] = mfac * image[0] + *fac * col[0]; + color[1] = mfac * image[1] + *fac * col[1]; + color[2] = mfac * image[2] + *fac * col[2]; } color[3] = image[3]; } diff --git a/source/blender/compositor/operations/COM_DifferenceMatteOperation.cpp b/source/blender/compositor/operations/COM_DifferenceMatteOperation.cpp index 628daa7c775..0b1ac1b2127 100644 --- a/source/blender/compositor/operations/COM_DifferenceMatteOperation.cpp +++ b/source/blender/compositor/operations/COM_DifferenceMatteOperation.cpp @@ -57,16 +57,16 @@ void DifferenceMatteOperation::executePixel(float *outputValue, float x, float y this->inputImage1Program->read(inColor1, x, y, sampler, inputBuffers); this->inputImage2Program->read(inColor2, x, y, sampler, inputBuffers); - difference = (fabs(inColor2[0] - inColor1[0]) + - fabs(inColor2[1] - inColor1[1]) + - fabs(inColor2[2] - inColor1[2])); + difference = (fabsf(inColor2[0] - inColor1[0]) + + fabsf(inColor2[1] - inColor1[1]) + + fabsf(inColor2[2] - inColor1[2])); - /*average together the distances*/ - difference=difference/3.0; + /* average together the distances */ + difference = difference / 3.0f; /*make 100% transparent*/ if (difference < tolerence) { - outputValue[0]=0.0; + outputValue[0] = 0.0f; } /*in the falloff region, make partially transparent */ else if (difference < falloff+tolerence) { diff --git a/source/blender/compositor/operations/COM_DirectionalBlurOperation.cpp b/source/blender/compositor/operations/COM_DirectionalBlurOperation.cpp index 30a09a45ade..43cba09d16f 100644 --- a/source/blender/compositor/operations/COM_DirectionalBlurOperation.cpp +++ b/source/blender/compositor/operations/COM_DirectionalBlurOperation.cpp @@ -51,17 +51,17 @@ void DirectionalBlurOperation::initExecution() const float height = getHeight(); const float a = angle; - const float itsc = 1.f / pow(2.f, (float)iterations); + const float itsc = 1.0f / powf(2.0f, (float)iterations); float D; D = distance * sqrtf(width*width + height*height); center_x_pix = center_x * width; center_y_pix = center_y * height; - tx= itsc * D * cos(a); - ty= -itsc * D * sin(a); - sc= itsc * zoom; - rot = itsc * spin; + tx = itsc * D * cosf(a); + ty = -itsc * D * sinf(a); + sc = itsc * zoom; + rot = itsc * spin; } diff --git a/source/blender/compositor/operations/COM_EllipseMaskOperation.cpp b/source/blender/compositor/operations/COM_EllipseMaskOperation.cpp index 85a629f7365..650c57dd8dc 100644 --- a/source/blender/compositor/operations/COM_EllipseMaskOperation.cpp +++ b/source/blender/compositor/operations/COM_EllipseMaskOperation.cpp @@ -38,7 +38,7 @@ void EllipseMaskOperation::initExecution() { this->inputMask = this->getInputSocketReader(0); this->inputValue = this->getInputSocketReader(1); - const double rad = DEG2RAD(this->data->rotation); + const double rad = DEG2RAD((double)this->data->rotation); this->cosine = cos(rad); this->sine = sin(rad); this->aspectRatio = ((float)this->getWidth())/this->getHeight(); diff --git a/source/blender/compositor/operations/COM_FogGlowImageOperation.cpp b/source/blender/compositor/operations/COM_FogGlowImageOperation.cpp index 600bfde64d9..05a758aca7f 100644 --- a/source/blender/compositor/operations/COM_FogGlowImageOperation.cpp +++ b/source/blender/compositor/operations/COM_FogGlowImageOperation.cpp @@ -37,7 +37,7 @@ void FogGlowImageOperation::executePixel(float *color, float x, float y, PixelSa u = 2.f*(x / (float)512) - 1.f; r = (u*u + v*v)*256; d = -sqrtf(sqrtf(sqrtf(r))); - w = (0.5f + 0.5f*cos((double)u*M_PI))*(0.5f + 0.5f*cos((double)v*M_PI)); + w = (0.5f + 0.5f * cosf(u * (float)M_PI)) * (0.5f + 0.5f * cosf(v * (float)M_PI)); color[0] = expf(d*cs_r) * w; color[1] = expf(d*cs_g) * w; color[2] = expf(d*cs_b) * w; diff --git a/source/blender/compositor/operations/COM_GammaOperation.cpp b/source/blender/compositor/operations/COM_GammaOperation.cpp index f0887d4adee..989ffd5dfba 100644 --- a/source/blender/compositor/operations/COM_GammaOperation.cpp +++ b/source/blender/compositor/operations/COM_GammaOperation.cpp @@ -46,9 +46,9 @@ void GammaOperation::executePixel(float *color, float x, float y, PixelSampler s this->inputGammaProgram->read(inputGamma, x, y, sampler, inputBuffers); const float gamma = inputGamma[0]; /* check for negative to avoid nan's */ - color[0] = inputValue[0]>0.0f?pow(inputValue[0], gamma):inputValue[0]; - color[1] = inputValue[1]>0.0f?pow(inputValue[1], gamma):inputValue[1]; - color[2] = inputValue[2]>0.0f?pow(inputValue[2], gamma):inputValue[2]; + color[0] = inputValue[0] > 0.0f ? powf(inputValue[0], gamma) : inputValue[0]; + color[1] = inputValue[1] > 0.0f ? powf(inputValue[1], gamma) : inputValue[1]; + color[2] = inputValue[2] > 0.0f ? powf(inputValue[2], gamma) : inputValue[2]; color[3] = inputValue[3]; } diff --git a/source/blender/compositor/operations/COM_GaussianBokehBlurOperation.cpp b/source/blender/compositor/operations/COM_GaussianBokehBlurOperation.cpp index 642a28627bd..e522d334d8b 100644 --- a/source/blender/compositor/operations/COM_GaussianBokehBlurOperation.cpp +++ b/source/blender/compositor/operations/COM_GaussianBokehBlurOperation.cpp @@ -147,11 +147,11 @@ void GaussianBokehBlurOperation::executePixel(float *color, int x, int y, Memory bufferindex +=offsetadd; } } - float divider = 1.0/overallmultiplyer; - color[0] = tempColor[0]*divider; - color[1] = tempColor[1]*divider; - color[2] = tempColor[2]*divider; - color[3] = tempColor[3]*divider; + float divider = 1.0f / overallmultiplyer; + color[0] = tempColor[0] * divider; + color[1] = tempColor[1] * divider; + color[2] = tempColor[2] * divider; + color[3] = tempColor[3] * divider; } void GaussianBokehBlurOperation::deinitExecution() diff --git a/source/blender/compositor/operations/COM_GaussianXBlurOperation.cpp b/source/blender/compositor/operations/COM_GaussianXBlurOperation.cpp index 852754416f4..2eb51b4577f 100644 --- a/source/blender/compositor/operations/COM_GaussianXBlurOperation.cpp +++ b/source/blender/compositor/operations/COM_GaussianXBlurOperation.cpp @@ -77,7 +77,7 @@ void GaussianXBlurOperation::executePixel(float *color, int x, int y, MemoryBuff tempColor[1] = 0; tempColor[2] = 0; tempColor[3] = 0; - float overallmultiplyer = 0; + float overallmultiplyer = 0.0f; MemoryBuffer *inputBuffer = (MemoryBuffer*)data; float *buffer = inputBuffer->getBuffer(); int bufferwidth = inputBuffer->getWidth(); @@ -106,11 +106,11 @@ void GaussianXBlurOperation::executePixel(float *color, int x, int y, MemoryBuff overallmultiplyer += multiplyer; bufferindex +=offsetadd; } - float divider = 1.0/overallmultiplyer; - color[0] = tempColor[0]*divider; - color[1] = tempColor[1]*divider; - color[2] = tempColor[2]*divider; - color[3] = tempColor[3]*divider; + float divider = 1.0f / overallmultiplyer; + color[0] = tempColor[0] * divider; + color[1] = tempColor[1] * divider; + color[2] = tempColor[2] * divider; + color[3] = tempColor[3] * divider; } void GaussianXBlurOperation::deinitExecution() diff --git a/source/blender/compositor/operations/COM_GaussianYBlurOperation.cpp b/source/blender/compositor/operations/COM_GaussianYBlurOperation.cpp index cab3e3d6094..28e8e548530 100644 --- a/source/blender/compositor/operations/COM_GaussianYBlurOperation.cpp +++ b/source/blender/compositor/operations/COM_GaussianYBlurOperation.cpp @@ -101,11 +101,11 @@ void GaussianYBlurOperation::executePixel(float *color, int x, int y, MemoryBuff tempColor[3] += multiplyer * buffer[bufferindex+3]; overallmultiplyer += multiplyer; } - float divider = 1.0/overallmultiplyer; - color[0] = tempColor[0]*divider; - color[1] = tempColor[1]*divider; - color[2] = tempColor[2]*divider; - color[3] = tempColor[3]*divider; + float divider = 1.0f / overallmultiplyer; + color[0] = tempColor[0] * divider; + color[1] = tempColor[1] * divider; + color[2] = tempColor[2] * divider; + color[3] = tempColor[3] * divider; } void GaussianYBlurOperation::deinitExecution() diff --git a/source/blender/compositor/operations/COM_HueSaturationValueCorrectOperation.cpp b/source/blender/compositor/operations/COM_HueSaturationValueCorrectOperation.cpp index 2970c396493..2afcc2e5cc7 100644 --- a/source/blender/compositor/operations/COM_HueSaturationValueCorrectOperation.cpp +++ b/source/blender/compositor/operations/COM_HueSaturationValueCorrectOperation.cpp @@ -63,8 +63,8 @@ void HueSaturationValueCorrectOperation::executePixel(float *output, float x, fl f = curvemapping_evaluateF(this->curveMapping, 2, hsv[0]); hsv[2] *= (f * 2.f); - hsv[0] = hsv[0] - floor(hsv[0]); /* mod 1.0 */ - CLAMP(hsv[1], 0.f, 1.f); + hsv[0] = hsv[0] - floorf(hsv[0]); /* mod 1.0 */ + CLAMP(hsv[1], 0.0f, 1.0f); output[0] = hsv[0]; output[1] = hsv[1]; diff --git a/source/blender/compositor/operations/COM_MapUVOperation.cpp b/source/blender/compositor/operations/COM_MapUVOperation.cpp index 7b393cc04a8..035f5584065 100644 --- a/source/blender/compositor/operations/COM_MapUVOperation.cpp +++ b/source/blender/compositor/operations/COM_MapUVOperation.cpp @@ -61,16 +61,16 @@ void MapUVOperation::executePixel(float *color, float x, float y, PixelSampler s /* adaptive sampling, red (U) channel */ this->inputUVProgram->read(uv_a, x-1, y, COM_PS_NEAREST, inputBuffers); this->inputUVProgram->read(uv_b, x+1, y, COM_PS_NEAREST, inputBuffers); - uv_l = uv_a[2]!=0.f? fabs(inputUV[0] - uv_a[0]) : 0.f; - uv_r = uv_b[2]!=0.f? fabs(inputUV[0] - uv_b[0]) : 0.f; + uv_l = uv_a[2]!=0.f? fabsf(inputUV[0] - uv_a[0]) : 0.f; + uv_r = uv_b[2]!=0.f? fabsf(inputUV[0] - uv_b[0]) : 0.f; dx = 0.5f * (uv_l + uv_r); /* adaptive sampling, green (V) channel */ this->inputUVProgram->read(uv_a, x, y-1, COM_PS_NEAREST, inputBuffers); this->inputUVProgram->read(uv_b, x, y+1, COM_PS_NEAREST, inputBuffers); - uv_u = uv_a[2]!=0.f? fabs(inputUV[1] - uv_a[1]) : 0.f; - uv_d = uv_b[2]!=0.f? fabs(inputUV[1] - uv_b[1]) : 0.f; + uv_u = uv_a[2]!=0.f? fabsf(inputUV[1] - uv_a[1]) : 0.f; + uv_d = uv_b[2]!=0.f? fabsf(inputUV[1] - uv_b[1]) : 0.f; dy = 0.5f * (uv_u + uv_d); diff --git a/source/blender/compositor/operations/COM_MathBaseOperation.cpp b/source/blender/compositor/operations/COM_MathBaseOperation.cpp index 2ea5f85253b..b943ec88fde 100644 --- a/source/blender/compositor/operations/COM_MathBaseOperation.cpp +++ b/source/blender/compositor/operations/COM_MathBaseOperation.cpp @@ -196,8 +196,8 @@ void MathPowerOperation::executePixel(float *outputValue, float x, float y, Pixe else { float y_mod_1 = fmod(inputValue2[0], 1); /* if input value is not nearly an integer, fall back to zero, nicer than straight rounding */ - if (y_mod_1 > 0.999 || y_mod_1 < 0.001) { - outputValue[0] = pow(inputValue1[0], (float)floor(inputValue2[0] + 0.5)); + if (y_mod_1 > 0.999f || y_mod_1 < 0.001f) { + outputValue[0] = pow(inputValue1[0], floorf(inputValue2[0] + 0.5f)); } else { outputValue[0] = 0.0; diff --git a/source/blender/compositor/operations/COM_RotateOperation.cpp b/source/blender/compositor/operations/COM_RotateOperation.cpp index 313e49d8609..af2633f0e53 100644 --- a/source/blender/compositor/operations/COM_RotateOperation.cpp +++ b/source/blender/compositor/operations/COM_RotateOperation.cpp @@ -43,7 +43,7 @@ void RotateOperation::initExecution() this->degreeSocket->read(degree, 0, 0, COM_PS_NEAREST, NULL); double rad; if (this->doDegree2RadConversion) { - rad = DEG2RAD(degree[0]); + rad = DEG2RAD((double)degree[0]); } else { rad = degree[0]; diff --git a/source/blender/compositor/operations/COM_TonemapOperation.cpp b/source/blender/compositor/operations/COM_TonemapOperation.cpp index 56830f4970d..d8089bdf3ea 100644 --- a/source/blender/compositor/operations/COM_TonemapOperation.cpp +++ b/source/blender/compositor/operations/COM_TonemapOperation.cpp @@ -53,14 +53,14 @@ void TonemapOperation::executePixel(float *color, int x, int y, MemoryBuffer *in float dr = output[0] + this->data->offset; float dg = output[1] + this->data->offset; float db = output[2] + this->data->offset; - output[0] /= ((dr == 0.f) ? 1.f : dr); - output[1] /= ((dg == 0.f) ? 1.f : dg); - output[2] /= ((db == 0.f) ? 1.f : db); + output[0] /= ((dr == 0.f) ? 1.0f : dr); + output[1] /= ((dg == 0.f) ? 1.0f : dg); + output[2] /= ((db == 0.f) ? 1.0f : db); const float igm = avg->igm; - if (igm != 0.f) { - output[0] = pow((double)MAX2(output[0], 0.), (double)igm); - output[1] = pow((double)MAX2(output[1], 0.), (double)igm); - output[2] = pow((double)MAX2(output[2], 0.), (double)igm); + if (igm != 0.0f) { + output[0] = powf(MAX2(output[0], 0.0f), igm); + output[1] = powf(MAX2(output[1], 0.0f), igm); + output[2] = powf(MAX2(output[2], 0.0f), igm); } color[0] = output[0]; @@ -68,31 +68,31 @@ void TonemapOperation::executePixel(float *color, int x, int y, MemoryBuffer *in color[2] = output[2]; color[3] = output[3]; } -void PhotoreceptorTonemapOperation::executePixel(float *color, int x, int y, MemoryBuffer *inputBuffers[], void * data) +void PhotoreceptorTonemapOperation::executePixel(float *color, int x, int y, MemoryBuffer *inputBuffers[], void *data) { - AvgLogLum * avg = (AvgLogLum*)data; + AvgLogLum *avg = (AvgLogLum *)data; NodeTonemap *ntm = this->data; - const float f = exp((double)-this->data->f); - const float m = (ntm->m > 0.f) ? ntm->m : (0.3f + 0.7f*pow((double)avg->auto_key, 1.4)); - const float ic = 1.f - ntm->c, ia = 1.f - ntm->a; + const float f = expf(-this->data->f); + const float m = (ntm->m > 0.0f) ? ntm->m : (0.3f + 0.7f * powf(avg->auto_key, 1.4f)); + const float ic = 1.0f - ntm->c, ia = 1.0f - ntm->a; float output[4]; this->imageReader->read(output, x, y, inputBuffers, NULL); - const float L = 0.212671f*output[0] + 0.71516f*output[1] + 0.072169f*output[2]; - float I_l = output[0] + ic*(L - output[0]); - float I_g = avg->cav[0] + ic*(avg->lav - avg->cav[0]); - float I_a = I_l + ia*(I_g - I_l); - output[0] /= (output[0] + pow((double)f*I_a, (double)m)); - I_l = output[1] + ic*(L - output[1]); - I_g = avg->cav[1] + ic*(avg->lav - avg->cav[1]); - I_a = I_l + ia*(I_g - I_l); - output[1] /= (output[1] + pow((double)f*I_a,(double)m)); - I_l = output[2] + ic*(L - output[2]); - I_g = avg->cav[2] + ic*(avg->lav - avg->cav[2]); - I_a = I_l + ia*(I_g - I_l); - output[2] /= (output[2] + pow((double)f*I_a, (double)m)); + const float L = 0.212671f * output[0] + 0.71516f * output[1] + 0.072169f * output[2]; + float I_l = output[0] + ic * (L - output[0]); + float I_g = avg->cav[0] + ic * (avg->lav - avg->cav[0]); + float I_a = I_l + ia * (I_g - I_l); + output[0] /= (output[0] + powf(f * I_a, m)); + I_l = output[1] + ic * (L - output[1]); + I_g = avg->cav[1] + ic * (avg->lav - avg->cav[1]); + I_a = I_l + ia * (I_g - I_l); + output[1] /= (output[1] + powf(f * I_a, m)); + I_l = output[2] + ic * (L - output[2]); + I_g = avg->cav[2] + ic * (avg->lav - avg->cav[2]); + I_a = I_l + ia * (I_g - I_l); + output[2] /= (output[2] + powf(f * I_a, m)); color[0] = output[0]; color[1] = output[1]; @@ -133,20 +133,20 @@ void *TonemapOperation::initializeTileData(rcti *rect, MemoryBuffer **memoryBuff float * buffer = tile->getBuffer(); - float lsum = 0; + float lsum = 0.0f; int p = tile->getWidth() * tile->getHeight(); float *bc = buffer; float avl, maxl = -1e10f, minl = 1e10f; - const float sc = 1.f/(p); + const float sc = 1.0f / p; float Lav = 0.f; float cav[4] = {0.0f,0.0f,0.0f,0.0f}; while (p--) { - float L = 0.212671f*bc[0] + 0.71516f*bc[1] + 0.072169f*bc[2]; + float L = 0.212671f * bc[0] + 0.71516f * bc[1] + 0.072169f * bc[2]; Lav += L; cav[0] += bc[0]; cav[1] += bc[1]; cav[2] += bc[2]; - lsum += (float)log((double)MAX2(L, 0.0) + 1e-5); + lsum += logf(MAX2(L, 0.0f) + 1e-5f); maxl = (L > maxl) ? L : maxl; minl = (L < minl) ? L : minl; bc+=4; @@ -155,7 +155,7 @@ void *TonemapOperation::initializeTileData(rcti *rect, MemoryBuffer **memoryBuff data->cav[0] = cav[0]*sc; data->cav[1] = cav[1]*sc; data->cav[2] = cav[2]*sc; - maxl = log((double)maxl + 1e-5); minl = log((double)minl + 1e-5f); avl = lsum*sc; + maxl = log((double)maxl + 1e-5); minl = log((double)minl + 1e-5); avl = lsum * sc; data->auto_key = (maxl > minl) ? ((maxl - avl) / (maxl - minl)) : 1.f; float al = exp((double)avl); data->al = (al == 0.f) ? 0.f : (this->data->key / al); diff --git a/source/blender/compositor/operations/COM_VariableSizeBokehBlurOperation.cpp b/source/blender/compositor/operations/COM_VariableSizeBokehBlurOperation.cpp index f14de097dfd..270fedc174b 100644 --- a/source/blender/compositor/operations/COM_VariableSizeBokehBlurOperation.cpp +++ b/source/blender/compositor/operations/COM_VariableSizeBokehBlurOperation.cpp @@ -89,7 +89,7 @@ void VariableSizeBokehBlurOperation::executePixel(float *color, int x, int y, Me if (nx == x && ny == y) { /* pass */ } - else if (size>= fabs(dx) && size >= fabs(dy)) { + else if (size >= fabsf(dx) && size >= fabsf(dy)) { float u = 256 + dx*256/size; float v = 256 + dy*256/size; inputBokehProgram->read(bokeh, u, v, COM_PS_NEAREST, inputBuffers); @@ -104,9 +104,9 @@ void VariableSizeBokehBlurOperation::executePixel(float *color, int x, int y, Me } } } - color[0] = tempColor[0]*(1.0/overallmultiplyerr); - color[1] = tempColor[1]*(1.0/overallmultiplyerg); - color[2] = tempColor[2]*(1.0/overallmultiplyerb); + color[0] = tempColor[0] * (1.0f / overallmultiplyerr); + color[1] = tempColor[1] * (1.0f / overallmultiplyerg); + color[2] = tempColor[2] * (1.0f / overallmultiplyerb); color[3] = 1.0f; } -- cgit v1.2.3