Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'source/blender/compositor/operations')
-rw-r--r--source/blender/compositor/operations/COM_AlphaOverKeyOperation.cc7
-rw-r--r--source/blender/compositor/operations/COM_AlphaOverKeyOperation.h9
-rw-r--r--source/blender/compositor/operations/COM_AlphaOverMixedOperation.cc4
-rw-r--r--source/blender/compositor/operations/COM_AlphaOverMixedOperation.h4
-rw-r--r--source/blender/compositor/operations/COM_AlphaOverPremultiplyOperation.cc7
-rw-r--r--source/blender/compositor/operations/COM_AlphaOverPremultiplyOperation.h9
-rw-r--r--source/blender/compositor/operations/COM_AntiAliasOperation.cc6
-rw-r--r--source/blender/compositor/operations/COM_AntiAliasOperation.h4
-rw-r--r--source/blender/compositor/operations/COM_BilateralBlurOperation.cc6
-rw-r--r--source/blender/compositor/operations/COM_BilateralBlurOperation.h4
-rw-r--r--source/blender/compositor/operations/COM_BlurBaseOperation.cc8
-rw-r--r--source/blender/compositor/operations/COM_BlurBaseOperation.h4
-rw-r--r--source/blender/compositor/operations/COM_BokehBlurOperation.cc27
-rw-r--r--source/blender/compositor/operations/COM_BokehBlurOperation.h4
-rw-r--r--source/blender/compositor/operations/COM_BokehImageOperation.cc4
-rw-r--r--source/blender/compositor/operations/COM_BokehImageOperation.h4
-rw-r--r--source/blender/compositor/operations/COM_BoxMaskOperation.cc4
-rw-r--r--source/blender/compositor/operations/COM_BoxMaskOperation.h4
-rw-r--r--source/blender/compositor/operations/COM_BrightnessOperation.cc4
-rw-r--r--source/blender/compositor/operations/COM_BrightnessOperation.h4
-rw-r--r--source/blender/compositor/operations/COM_CalculateMeanOperation.cc8
-rw-r--r--source/blender/compositor/operations/COM_CalculateMeanOperation.h4
-rw-r--r--source/blender/compositor/operations/COM_CalculateStandardDeviationOperation.cc7
-rw-r--r--source/blender/compositor/operations/COM_CalculateStandardDeviationOperation.h7
-rw-r--r--source/blender/compositor/operations/COM_ChangeHSVOperation.cc4
-rw-r--r--source/blender/compositor/operations/COM_ChangeHSVOperation.h4
-rw-r--r--source/blender/compositor/operations/COM_ChannelMatteOperation.cc4
-rw-r--r--source/blender/compositor/operations/COM_ChannelMatteOperation.h4
-rw-r--r--source/blender/compositor/operations/COM_ChromaMatteOperation.cc4
-rw-r--r--source/blender/compositor/operations/COM_ChromaMatteOperation.h4
-rw-r--r--source/blender/compositor/operations/COM_ColorBalanceASCCDLOperation.cc4
-rw-r--r--source/blender/compositor/operations/COM_ColorBalanceASCCDLOperation.h4
-rw-r--r--source/blender/compositor/operations/COM_ColorBalanceLGGOperation.cc4
-rw-r--r--source/blender/compositor/operations/COM_ColorBalanceLGGOperation.h4
-rw-r--r--source/blender/compositor/operations/COM_ColorCorrectionOperation.cc4
-rw-r--r--source/blender/compositor/operations/COM_ColorCorrectionOperation.h4
-rw-r--r--source/blender/compositor/operations/COM_ColorCurveOperation.cc4
-rw-r--r--source/blender/compositor/operations/COM_ColorCurveOperation.h4
-rw-r--r--source/blender/compositor/operations/COM_ColorExposureOperation.cc4
-rw-r--r--source/blender/compositor/operations/COM_ColorExposureOperation.h4
-rw-r--r--source/blender/compositor/operations/COM_ColorMatteOperation.cc4
-rw-r--r--source/blender/compositor/operations/COM_ColorMatteOperation.h4
-rw-r--r--source/blender/compositor/operations/COM_ColorRampOperation.cc4
-rw-r--r--source/blender/compositor/operations/COM_ColorRampOperation.h4
-rw-r--r--source/blender/compositor/operations/COM_ColorSpillOperation.cc4
-rw-r--r--source/blender/compositor/operations/COM_ColorSpillOperation.h4
-rw-r--r--source/blender/compositor/operations/COM_CompositorOperation.cc18
-rw-r--r--source/blender/compositor/operations/COM_CompositorOperation.h8
-rw-r--r--source/blender/compositor/operations/COM_ConvertColorProfileOperation.cc4
-rw-r--r--source/blender/compositor/operations/COM_ConvertColorProfileOperation.h4
-rw-r--r--source/blender/compositor/operations/COM_ConvertDepthToRadiusOperation.cc4
-rw-r--r--source/blender/compositor/operations/COM_ConvertDepthToRadiusOperation.h5
-rw-r--r--source/blender/compositor/operations/COM_ConvertOperation.cc39
-rw-r--r--source/blender/compositor/operations/COM_ConvertOperation.h4
-rw-r--r--source/blender/compositor/operations/COM_ConvolutionEdgeFilterOperation.cc7
-rw-r--r--source/blender/compositor/operations/COM_ConvolutionEdgeFilterOperation.h5
-rw-r--r--source/blender/compositor/operations/COM_ConvolutionFilterOperation.cc6
-rw-r--r--source/blender/compositor/operations/COM_ConvolutionFilterOperation.h4
-rw-r--r--source/blender/compositor/operations/COM_CropOperation.cc6
-rw-r--r--source/blender/compositor/operations/COM_CropOperation.h4
-rw-r--r--source/blender/compositor/operations/COM_CryptomatteOperation.cc16
-rw-r--r--source/blender/compositor/operations/COM_CryptomatteOperation.h8
-rw-r--r--source/blender/compositor/operations/COM_CurveBaseOperation.cc4
-rw-r--r--source/blender/compositor/operations/COM_CurveBaseOperation.h4
-rw-r--r--source/blender/compositor/operations/COM_DenoiseOperation.cc13
-rw-r--r--source/blender/compositor/operations/COM_DenoiseOperation.h4
-rw-r--r--source/blender/compositor/operations/COM_DespeckleOperation.cc6
-rw-r--r--source/blender/compositor/operations/COM_DespeckleOperation.h4
-rw-r--r--source/blender/compositor/operations/COM_DifferenceMatteOperation.cc4
-rw-r--r--source/blender/compositor/operations/COM_DifferenceMatteOperation.h4
-rw-r--r--source/blender/compositor/operations/COM_DilateErodeOperation.cc12
-rw-r--r--source/blender/compositor/operations/COM_DilateErodeOperation.h4
-rw-r--r--source/blender/compositor/operations/COM_DirectionalBlurOperation.cc13
-rw-r--r--source/blender/compositor/operations/COM_DirectionalBlurOperation.h4
-rw-r--r--source/blender/compositor/operations/COM_DisplaceOperation.cc14
-rw-r--r--source/blender/compositor/operations/COM_DisplaceOperation.h4
-rw-r--r--source/blender/compositor/operations/COM_DisplaceSimpleOperation.cc4
-rw-r--r--source/blender/compositor/operations/COM_DisplaceSimpleOperation.h4
-rw-r--r--source/blender/compositor/operations/COM_DistanceRGBMatteOperation.cc4
-rw-r--r--source/blender/compositor/operations/COM_DistanceRGBMatteOperation.h4
-rw-r--r--source/blender/compositor/operations/COM_DistanceYCCMatteOperation.cc7
-rw-r--r--source/blender/compositor/operations/COM_DistanceYCCMatteOperation.h10
-rw-r--r--source/blender/compositor/operations/COM_DotproductOperation.cc4
-rw-r--r--source/blender/compositor/operations/COM_DotproductOperation.h4
-rw-r--r--source/blender/compositor/operations/COM_DoubleEdgeMaskOperation.cc6
-rw-r--r--source/blender/compositor/operations/COM_DoubleEdgeMaskOperation.h4
-rw-r--r--source/blender/compositor/operations/COM_EllipseMaskOperation.cc4
-rw-r--r--source/blender/compositor/operations/COM_EllipseMaskOperation.h4
-rw-r--r--source/blender/compositor/operations/COM_FastGaussianBlurOperation.cc16
-rw-r--r--source/blender/compositor/operations/COM_FastGaussianBlurOperation.h4
-rw-r--r--source/blender/compositor/operations/COM_FlipOperation.cc4
-rw-r--r--source/blender/compositor/operations/COM_FlipOperation.h4
-rw-r--r--source/blender/compositor/operations/COM_GammaCorrectOperation.cc4
-rw-r--r--source/blender/compositor/operations/COM_GammaCorrectOperation.h4
-rw-r--r--source/blender/compositor/operations/COM_GammaOperation.cc4
-rw-r--r--source/blender/compositor/operations/COM_GammaOperation.h4
-rw-r--r--source/blender/compositor/operations/COM_GaussianAlphaXBlurOperation.cc4
-rw-r--r--source/blender/compositor/operations/COM_GaussianAlphaXBlurOperation.h4
-rw-r--r--source/blender/compositor/operations/COM_GaussianAlphaYBlurOperation.cc4
-rw-r--r--source/blender/compositor/operations/COM_GaussianAlphaYBlurOperation.h4
-rw-r--r--source/blender/compositor/operations/COM_GaussianBokehBlurOperation.cc10
-rw-r--r--source/blender/compositor/operations/COM_GaussianBokehBlurOperation.h4
-rw-r--r--source/blender/compositor/operations/COM_GaussianXBlurOperation.cc4
-rw-r--r--source/blender/compositor/operations/COM_GaussianXBlurOperation.h6
-rw-r--r--source/blender/compositor/operations/COM_GaussianYBlurOperation.cc4
-rw-r--r--source/blender/compositor/operations/COM_GaussianYBlurOperation.h6
-rw-r--r--source/blender/compositor/operations/COM_GlareBaseOperation.cc4
-rw-r--r--source/blender/compositor/operations/COM_GlareBaseOperation.h4
-rw-r--r--source/blender/compositor/operations/COM_GlareFogGlowOperation.cc21
-rw-r--r--source/blender/compositor/operations/COM_GlareFogGlowOperation.h4
-rw-r--r--source/blender/compositor/operations/COM_GlareGhostOperation.cc10
-rw-r--r--source/blender/compositor/operations/COM_GlareGhostOperation.h4
-rw-r--r--source/blender/compositor/operations/COM_GlareSimpleStarOperation.cc4
-rw-r--r--source/blender/compositor/operations/COM_GlareSimpleStarOperation.h4
-rw-r--r--source/blender/compositor/operations/COM_GlareStreaksOperation.cc4
-rw-r--r--source/blender/compositor/operations/COM_GlareStreaksOperation.h4
-rw-r--r--source/blender/compositor/operations/COM_GlareThresholdOperation.cc6
-rw-r--r--source/blender/compositor/operations/COM_GlareThresholdOperation.h4
-rw-r--r--source/blender/compositor/operations/COM_HueSaturationValueCorrectOperation.cc4
-rw-r--r--source/blender/compositor/operations/COM_HueSaturationValueCorrectOperation.h4
-rw-r--r--source/blender/compositor/operations/COM_IDMaskOperation.cc6
-rw-r--r--source/blender/compositor/operations/COM_IDMaskOperation.h4
-rw-r--r--source/blender/compositor/operations/COM_ImageOperation.cc16
-rw-r--r--source/blender/compositor/operations/COM_ImageOperation.h4
-rw-r--r--source/blender/compositor/operations/COM_InpaintOperation.cc9
-rw-r--r--source/blender/compositor/operations/COM_InpaintOperation.h4
-rw-r--r--source/blender/compositor/operations/COM_InvertOperation.cc4
-rw-r--r--source/blender/compositor/operations/COM_InvertOperation.h4
-rw-r--r--source/blender/compositor/operations/COM_KeyingBlurOperation.cc6
-rw-r--r--source/blender/compositor/operations/COM_KeyingBlurOperation.h4
-rw-r--r--source/blender/compositor/operations/COM_KeyingClipOperation.cc6
-rw-r--r--source/blender/compositor/operations/COM_KeyingClipOperation.h4
-rw-r--r--source/blender/compositor/operations/COM_KeyingDespillOperation.cc4
-rw-r--r--source/blender/compositor/operations/COM_KeyingDespillOperation.h4
-rw-r--r--source/blender/compositor/operations/COM_KeyingOperation.cc4
-rw-r--r--source/blender/compositor/operations/COM_KeyingOperation.h4
-rw-r--r--source/blender/compositor/operations/COM_KeyingScreenOperation.cc6
-rw-r--r--source/blender/compositor/operations/COM_KeyingScreenOperation.h4
-rw-r--r--source/blender/compositor/operations/COM_LuminanceMatteOperation.cc4
-rw-r--r--source/blender/compositor/operations/COM_LuminanceMatteOperation.h4
-rw-r--r--source/blender/compositor/operations/COM_MapRangeOperation.cc4
-rw-r--r--source/blender/compositor/operations/COM_MapRangeOperation.h4
-rw-r--r--source/blender/compositor/operations/COM_MapUVOperation.cc10
-rw-r--r--source/blender/compositor/operations/COM_MapUVOperation.h4
-rw-r--r--source/blender/compositor/operations/COM_MapValueOperation.cc4
-rw-r--r--source/blender/compositor/operations/COM_MapValueOperation.h4
-rw-r--r--source/blender/compositor/operations/COM_MaskOperation.cc4
-rw-r--r--source/blender/compositor/operations/COM_MaskOperation.h7
-rw-r--r--source/blender/compositor/operations/COM_MathBaseOperation.cc4
-rw-r--r--source/blender/compositor/operations/COM_MathBaseOperation.h4
-rw-r--r--source/blender/compositor/operations/COM_MixOperation.cc126
-rw-r--r--source/blender/compositor/operations/COM_MixOperation.h23
-rw-r--r--source/blender/compositor/operations/COM_MovieClipAttributeOperation.cc4
-rw-r--r--source/blender/compositor/operations/COM_MovieClipAttributeOperation.h4
-rw-r--r--source/blender/compositor/operations/COM_MovieClipOperation.cc10
-rw-r--r--source/blender/compositor/operations/COM_MovieClipOperation.h4
-rw-r--r--source/blender/compositor/operations/COM_MovieDistortionOperation.cc8
-rw-r--r--source/blender/compositor/operations/COM_MovieDistortionOperation.h4
-rw-r--r--source/blender/compositor/operations/COM_MultilayerImageOperation.cc12
-rw-r--r--source/blender/compositor/operations/COM_MultilayerImageOperation.h6
-rw-r--r--source/blender/compositor/operations/COM_NormalizeOperation.cc6
-rw-r--r--source/blender/compositor/operations/COM_NormalizeOperation.h4
-rw-r--r--source/blender/compositor/operations/COM_OutputFileMultiViewOperation.cc4
-rw-r--r--source/blender/compositor/operations/COM_OutputFileMultiViewOperation.h4
-rw-r--r--source/blender/compositor/operations/COM_OutputFileOperation.cc18
-rw-r--r--source/blender/compositor/operations/COM_OutputFileOperation.h26
-rw-r--r--source/blender/compositor/operations/COM_PixelateOperation.cc4
-rw-r--r--source/blender/compositor/operations/COM_PixelateOperation.h4
-rw-r--r--source/blender/compositor/operations/COM_PlaneCornerPinOperation.cc8
-rw-r--r--source/blender/compositor/operations/COM_PlaneCornerPinOperation.h4
-rw-r--r--source/blender/compositor/operations/COM_PlaneDistortCommonOperation.cc76
-rw-r--r--source/blender/compositor/operations/COM_PlaneDistortCommonOperation.h62
-rw-r--r--source/blender/compositor/operations/COM_PlaneTrackOperation.cc57
-rw-r--r--source/blender/compositor/operations/COM_PlaneTrackOperation.h9
-rw-r--r--source/blender/compositor/operations/COM_PreviewOperation.cc14
-rw-r--r--source/blender/compositor/operations/COM_PreviewOperation.h10
-rw-r--r--source/blender/compositor/operations/COM_ProjectorLensDistortionOperation.cc8
-rw-r--r--source/blender/compositor/operations/COM_ProjectorLensDistortionOperation.h4
-rw-r--r--source/blender/compositor/operations/COM_QualityStepHelper.cc18
-rw-r--r--source/blender/compositor/operations/COM_QualityStepHelper.h10
-rw-r--r--source/blender/compositor/operations/COM_ReadBufferOperation.cc13
-rw-r--r--source/blender/compositor/operations/COM_ReadBufferOperation.h12
-rw-r--r--source/blender/compositor/operations/COM_RenderLayersProg.cc12
-rw-r--r--source/blender/compositor/operations/COM_RenderLayersProg.h6
-rw-r--r--source/blender/compositor/operations/COM_RotateOperation.cc6
-rw-r--r--source/blender/compositor/operations/COM_RotateOperation.h4
-rw-r--r--source/blender/compositor/operations/COM_SMAAOperation.cc868
-rw-r--r--source/blender/compositor/operations/COM_SMAAOperation.h149
-rw-r--r--source/blender/compositor/operations/COM_ScaleOperation.cc16
-rw-r--r--source/blender/compositor/operations/COM_ScaleOperation.h4
-rw-r--r--source/blender/compositor/operations/COM_ScreenLensDistortionOperation.cc10
-rw-r--r--source/blender/compositor/operations/COM_ScreenLensDistortionOperation.h6
-rw-r--r--source/blender/compositor/operations/COM_SetAlphaMultiplyOperation.cc4
-rw-r--r--source/blender/compositor/operations/COM_SetAlphaMultiplyOperation.h4
-rw-r--r--source/blender/compositor/operations/COM_SetAlphaReplaceOperation.cc4
-rw-r--r--source/blender/compositor/operations/COM_SetAlphaReplaceOperation.h4
-rw-r--r--source/blender/compositor/operations/COM_SetColorOperation.cc5
-rw-r--r--source/blender/compositor/operations/COM_SetColorOperation.h8
-rw-r--r--source/blender/compositor/operations/COM_SetSamplerOperation.cc4
-rw-r--r--source/blender/compositor/operations/COM_SetSamplerOperation.h4
-rw-r--r--source/blender/compositor/operations/COM_SetValueOperation.cc5
-rw-r--r--source/blender/compositor/operations/COM_SetValueOperation.h9
-rw-r--r--source/blender/compositor/operations/COM_SetVectorOperation.cc5
-rw-r--r--source/blender/compositor/operations/COM_SetVectorOperation.h8
-rw-r--r--source/blender/compositor/operations/COM_SocketProxyOperation.cc9
-rw-r--r--source/blender/compositor/operations/COM_SocketProxyOperation.h26
-rw-r--r--source/blender/compositor/operations/COM_SplitOperation.cc8
-rw-r--r--source/blender/compositor/operations/COM_SplitOperation.h4
-rw-r--r--source/blender/compositor/operations/COM_SunBeamsOperation.cc14
-rw-r--r--source/blender/compositor/operations/COM_SunBeamsOperation.h4
-rw-r--r--source/blender/compositor/operations/COM_TextureOperation.cc40
-rw-r--r--source/blender/compositor/operations/COM_TextureOperation.h6
-rw-r--r--source/blender/compositor/operations/COM_TonemapOperation.cc8
-rw-r--r--source/blender/compositor/operations/COM_TonemapOperation.h4
-rw-r--r--source/blender/compositor/operations/COM_TrackPositionOperation.cc5
-rw-r--r--source/blender/compositor/operations/COM_TrackPositionOperation.h9
-rw-r--r--source/blender/compositor/operations/COM_TranslateOperation.cc6
-rw-r--r--source/blender/compositor/operations/COM_TranslateOperation.h8
-rw-r--r--source/blender/compositor/operations/COM_VariableSizeBokehBlurOperation.cc22
-rw-r--r--source/blender/compositor/operations/COM_VariableSizeBokehBlurOperation.h4
-rw-r--r--source/blender/compositor/operations/COM_VectorBlurOperation.cc8
-rw-r--r--source/blender/compositor/operations/COM_VectorBlurOperation.h4
-rw-r--r--source/blender/compositor/operations/COM_VectorCurveOperation.cc4
-rw-r--r--source/blender/compositor/operations/COM_VectorCurveOperation.h4
-rw-r--r--source/blender/compositor/operations/COM_ViewerOperation.cc18
-rw-r--r--source/blender/compositor/operations/COM_ViewerOperation.h10
-rw-r--r--source/blender/compositor/operations/COM_WrapOperation.cc4
-rw-r--r--source/blender/compositor/operations/COM_WrapOperation.h4
-rw-r--r--source/blender/compositor/operations/COM_WriteBufferOperation.cc9
-rw-r--r--source/blender/compositor/operations/COM_WriteBufferOperation.h13
-rw-r--r--source/blender/compositor/operations/COM_ZCombineOperation.cc4
-rw-r--r--source/blender/compositor/operations/COM_ZCombineOperation.h4
232 files changed, 2284 insertions, 565 deletions
diff --git a/source/blender/compositor/operations/COM_AlphaOverKeyOperation.cc b/source/blender/compositor/operations/COM_AlphaOverKeyOperation.cc
index 668d07c7c3d..0c656753a51 100644
--- a/source/blender/compositor/operations/COM_AlphaOverKeyOperation.cc
+++ b/source/blender/compositor/operations/COM_AlphaOverKeyOperation.cc
@@ -18,10 +18,7 @@
#include "COM_AlphaOverKeyOperation.h"
-AlphaOverKeyOperation::AlphaOverKeyOperation()
-{
- /* pass */
-}
+namespace blender::compositor {
void AlphaOverKeyOperation::executePixelSampled(float output[4],
float x,
@@ -52,3 +49,5 @@ void AlphaOverKeyOperation::executePixelSampled(float output[4],
output[3] = (mul * inputColor1[3]) + value[0] * inputOverColor[3];
}
}
+
+} // namespace blender::compositor
diff --git a/source/blender/compositor/operations/COM_AlphaOverKeyOperation.h b/source/blender/compositor/operations/COM_AlphaOverKeyOperation.h
index b62105d7c41..83713d18971 100644
--- a/source/blender/compositor/operations/COM_AlphaOverKeyOperation.h
+++ b/source/blender/compositor/operations/COM_AlphaOverKeyOperation.h
@@ -20,6 +20,8 @@
#include "COM_MixOperation.h"
+namespace blender::compositor {
+
/**
* this program converts an input color to an output value.
* it assumes we are in sRGB color space.
@@ -27,12 +29,9 @@
class AlphaOverKeyOperation : public MixBaseOperation {
public:
/**
- * Default constructor
- */
- AlphaOverKeyOperation();
-
- /**
* The inner loop of this operation.
*/
void executePixelSampled(float output[4], float x, float y, PixelSampler sampler) override;
};
+
+} // namespace blender::compositor
diff --git a/source/blender/compositor/operations/COM_AlphaOverMixedOperation.cc b/source/blender/compositor/operations/COM_AlphaOverMixedOperation.cc
index b8465ab7ccf..c68c79d2263 100644
--- a/source/blender/compositor/operations/COM_AlphaOverMixedOperation.cc
+++ b/source/blender/compositor/operations/COM_AlphaOverMixedOperation.cc
@@ -18,6 +18,8 @@
#include "COM_AlphaOverMixedOperation.h"
+namespace blender::compositor {
+
AlphaOverMixedOperation::AlphaOverMixedOperation()
{
this->m_x = 0.0f;
@@ -53,3 +55,5 @@ void AlphaOverMixedOperation::executePixelSampled(float output[4],
output[3] = (mul * inputColor1[3]) + value[0] * inputOverColor[3];
}
}
+
+} // namespace blender::compositor
diff --git a/source/blender/compositor/operations/COM_AlphaOverMixedOperation.h b/source/blender/compositor/operations/COM_AlphaOverMixedOperation.h
index 3f7137a8d36..e2b3af84162 100644
--- a/source/blender/compositor/operations/COM_AlphaOverMixedOperation.h
+++ b/source/blender/compositor/operations/COM_AlphaOverMixedOperation.h
@@ -20,6 +20,8 @@
#include "COM_MixOperation.h"
+namespace blender::compositor {
+
/**
* this program converts an input color to an output value.
* it assumes we are in sRGB color space.
@@ -44,3 +46,5 @@ class AlphaOverMixedOperation : public MixBaseOperation {
this->m_x = x;
}
};
+
+} // namespace blender::compositor
diff --git a/source/blender/compositor/operations/COM_AlphaOverPremultiplyOperation.cc b/source/blender/compositor/operations/COM_AlphaOverPremultiplyOperation.cc
index 4510c027d46..3dd4607e273 100644
--- a/source/blender/compositor/operations/COM_AlphaOverPremultiplyOperation.cc
+++ b/source/blender/compositor/operations/COM_AlphaOverPremultiplyOperation.cc
@@ -18,10 +18,7 @@
#include "COM_AlphaOverPremultiplyOperation.h"
-AlphaOverPremultiplyOperation::AlphaOverPremultiplyOperation()
-{
- /* pass */
-}
+namespace blender::compositor {
void AlphaOverPremultiplyOperation::executePixelSampled(float output[4],
float x,
@@ -52,3 +49,5 @@ void AlphaOverPremultiplyOperation::executePixelSampled(float output[4],
output[3] = (mul * inputColor1[3]) + value[0] * inputOverColor[3];
}
}
+
+} // namespace blender::compositor
diff --git a/source/blender/compositor/operations/COM_AlphaOverPremultiplyOperation.h b/source/blender/compositor/operations/COM_AlphaOverPremultiplyOperation.h
index cb60f8393d0..f1d4b668fce 100644
--- a/source/blender/compositor/operations/COM_AlphaOverPremultiplyOperation.h
+++ b/source/blender/compositor/operations/COM_AlphaOverPremultiplyOperation.h
@@ -20,6 +20,8 @@
#include "COM_MixOperation.h"
+namespace blender::compositor {
+
/**
* this program converts an input color to an output value.
* it assumes we are in sRGB color space.
@@ -27,12 +29,9 @@
class AlphaOverPremultiplyOperation : public MixBaseOperation {
public:
/**
- * Default constructor
- */
- AlphaOverPremultiplyOperation();
-
- /**
* The inner loop of this operation.
*/
void executePixelSampled(float output[4], float x, float y, PixelSampler sampler) override;
};
+
+} // namespace blender::compositor
diff --git a/source/blender/compositor/operations/COM_AntiAliasOperation.cc b/source/blender/compositor/operations/COM_AntiAliasOperation.cc
index 740cd3ff609..23d6f4b80c7 100644
--- a/source/blender/compositor/operations/COM_AntiAliasOperation.cc
+++ b/source/blender/compositor/operations/COM_AntiAliasOperation.cc
@@ -24,6 +24,8 @@
#include "RE_texture.h"
+namespace blender::compositor {
+
/* An implementation of the Scale3X edge-extrapolation algorithm.
*
* Code from GIMP plugin, based on code from Adam D. Moss <adam@gimp.org>
@@ -117,7 +119,7 @@ AntiAliasOperation::AntiAliasOperation()
this->addInputSocket(DataType::Value);
this->addOutputSocket(DataType::Value);
this->m_valueReader = nullptr;
- this->setComplex(true);
+ this->flags.complex = true;
}
void AntiAliasOperation::initExecution()
@@ -199,3 +201,5 @@ void *AntiAliasOperation::initializeTileData(rcti *rect)
{
return getInputOperation(0)->initializeTileData(rect);
}
+
+} // namespace blender::compositor
diff --git a/source/blender/compositor/operations/COM_AntiAliasOperation.h b/source/blender/compositor/operations/COM_AntiAliasOperation.h
index 691fb970b11..fc9102b5b4c 100644
--- a/source/blender/compositor/operations/COM_AntiAliasOperation.h
+++ b/source/blender/compositor/operations/COM_AntiAliasOperation.h
@@ -21,6 +21,8 @@
#include "COM_NodeOperation.h"
#include "DNA_node_types.h"
+namespace blender::compositor {
+
/**
* \brief AntiAlias operations
* it only supports anti aliasing on BW buffers.
@@ -56,3 +58,5 @@ class AntiAliasOperation : public NodeOperation {
ReadBufferOperation *readOperation,
rcti *output) override;
};
+
+} // namespace blender::compositor
diff --git a/source/blender/compositor/operations/COM_BilateralBlurOperation.cc b/source/blender/compositor/operations/COM_BilateralBlurOperation.cc
index d04fade2e93..64448e2ae95 100644
--- a/source/blender/compositor/operations/COM_BilateralBlurOperation.cc
+++ b/source/blender/compositor/operations/COM_BilateralBlurOperation.cc
@@ -21,12 +21,14 @@
#include "RE_pipeline.h"
+namespace blender::compositor {
+
BilateralBlurOperation::BilateralBlurOperation()
{
this->addInputSocket(DataType::Color);
this->addInputSocket(DataType::Color);
this->addOutputSocket(DataType::Color);
- this->setComplex(true);
+ this->flags.complex = true;
this->m_inputColorProgram = nullptr;
this->m_inputDeterminatorProgram = nullptr;
@@ -112,3 +114,5 @@ bool BilateralBlurOperation::determineDependingAreaOfInterest(rcti *input,
return NodeOperation::determineDependingAreaOfInterest(&newInput, readOperation, output);
}
+
+} // namespace blender::compositor
diff --git a/source/blender/compositor/operations/COM_BilateralBlurOperation.h b/source/blender/compositor/operations/COM_BilateralBlurOperation.h
index bdc77325aaf..c56cef35050 100644
--- a/source/blender/compositor/operations/COM_BilateralBlurOperation.h
+++ b/source/blender/compositor/operations/COM_BilateralBlurOperation.h
@@ -21,6 +21,8 @@
#include "COM_NodeOperation.h"
#include "COM_QualityStepHelper.h"
+namespace blender::compositor {
+
class BilateralBlurOperation : public NodeOperation, public QualityStepHelper {
private:
SocketReader *m_inputColorProgram;
@@ -55,3 +57,5 @@ class BilateralBlurOperation : public NodeOperation, public QualityStepHelper {
this->m_data = data;
}
};
+
+} // namespace blender::compositor
diff --git a/source/blender/compositor/operations/COM_BlurBaseOperation.cc b/source/blender/compositor/operations/COM_BlurBaseOperation.cc
index fe6ca1cfd4e..8b73624ca79 100644
--- a/source/blender/compositor/operations/COM_BlurBaseOperation.cc
+++ b/source/blender/compositor/operations/COM_BlurBaseOperation.cc
@@ -22,13 +22,15 @@
#include "RE_pipeline.h"
+namespace blender::compositor {
+
BlurBaseOperation::BlurBaseOperation(DataType data_type)
{
/* data_type is almost always DataType::Color except for alpha-blur */
this->addInputSocket(data_type);
this->addInputSocket(DataType::Value);
this->addOutputSocket(data_type);
- this->setComplex(true);
+ this->flags.complex = true;
this->m_inputProgram = nullptr;
memset(&m_data, 0, sizeof(NodeBlurData));
this->m_size = 1.0f;
@@ -167,7 +169,7 @@ void BlurBaseOperation::updateSize()
{
if (!this->m_sizeavailable) {
float result[4];
- this->getInputSocketReader(1)->readSampled(result, 0, 0, COM_PS_NEAREST);
+ this->getInputSocketReader(1)->readSampled(result, 0, 0, PixelSampler::Nearest);
this->m_size = result[0];
this->m_sizeavailable = true;
}
@@ -182,3 +184,5 @@ void BlurBaseOperation::determineResolution(unsigned int resolution[2],
resolution[1] += 2 * this->m_size * m_data.sizey;
}
}
+
+} // namespace blender::compositor
diff --git a/source/blender/compositor/operations/COM_BlurBaseOperation.h b/source/blender/compositor/operations/COM_BlurBaseOperation.h
index 84f94dfe124..7937ebd69dc 100644
--- a/source/blender/compositor/operations/COM_BlurBaseOperation.h
+++ b/source/blender/compositor/operations/COM_BlurBaseOperation.h
@@ -25,6 +25,8 @@
#include "BLI_simd.h"
+namespace blender::compositor {
+
class BlurBaseOperation : public NodeOperation, public QualityStepHelper {
private:
protected:
@@ -76,3 +78,5 @@ class BlurBaseOperation : public NodeOperation, public QualityStepHelper {
void determineResolution(unsigned int resolution[2],
unsigned int preferredResolution[2]) override;
};
+
+} // namespace blender::compositor
diff --git a/source/blender/compositor/operations/COM_BokehBlurOperation.cc b/source/blender/compositor/operations/COM_BokehBlurOperation.cc
index 7bb8cd49bfc..3f98732b403 100644
--- a/source/blender/compositor/operations/COM_BokehBlurOperation.cc
+++ b/source/blender/compositor/operations/COM_BokehBlurOperation.cc
@@ -22,15 +22,18 @@
#include "RE_pipeline.h"
+namespace blender::compositor {
+
BokehBlurOperation::BokehBlurOperation()
{
this->addInputSocket(DataType::Color);
- this->addInputSocket(DataType::Color, COM_SC_NO_RESIZE);
+ this->addInputSocket(DataType::Color, ResizeMode::None);
this->addInputSocket(DataType::Value);
this->addInputSocket(DataType::Value);
this->addOutputSocket(DataType::Color);
- this->setComplex(true);
- this->setOpenCL(true);
+
+ flags.complex = true;
+ flags.open_cl = true;
this->m_size = 1.0f;
this->m_sizeavailable = false;
@@ -76,7 +79,7 @@ void BokehBlurOperation::executePixel(float output[4], int x, int y, void *data)
float tempBoundingBox[4];
float bokeh[4];
- this->m_inputBoundingBoxReader->readSampled(tempBoundingBox, x, y, COM_PS_NEAREST);
+ this->m_inputBoundingBoxReader->readSampled(tempBoundingBox, x, y, PixelSampler::Nearest);
if (tempBoundingBox[0] > 0.0f) {
float multiplier_accum[4] = {0.0f, 0.0f, 0.0f, 0.0f};
MemoryBuffer *inputBuffer = (MemoryBuffer *)data;
@@ -90,7 +93,7 @@ void BokehBlurOperation::executePixel(float output[4], int x, int y, void *data)
zero_v4(color_accum);
if (pixelSize < 2) {
- this->m_inputProgram->readSampled(color_accum, x, y, COM_PS_NEAREST);
+ this->m_inputProgram->readSampled(color_accum, x, y, PixelSampler::Nearest);
multiplier_accum[0] = 1.0f;
multiplier_accum[1] = 1.0f;
multiplier_accum[2] = 1.0f;
@@ -106,16 +109,16 @@ void BokehBlurOperation::executePixel(float output[4], int x, int y, void *data)
maxx = MIN2(maxx, input_rect.xmax);
int step = getStep();
- int offsetadd = getOffsetAdd() * COM_NUM_CHANNELS_COLOR;
+ int offsetadd = getOffsetAdd() * COM_DATA_TYPE_COLOR_CHANNELS;
float m = this->m_bokehDimension / pixelSize;
for (int ny = miny; ny < maxy; ny += step) {
- int bufferindex = ((minx - bufferstartx) * COM_NUM_CHANNELS_COLOR) +
- ((ny - bufferstarty) * COM_NUM_CHANNELS_COLOR * bufferwidth);
+ int bufferindex = ((minx - bufferstartx) * COM_DATA_TYPE_COLOR_CHANNELS) +
+ ((ny - bufferstarty) * COM_DATA_TYPE_COLOR_CHANNELS * bufferwidth);
for (int nx = minx; nx < maxx; nx += step) {
float u = this->m_bokehMidX - (nx - x) * m;
float v = this->m_bokehMidY - (ny - y) * m;
- this->m_inputBokehProgram->readSampled(bokeh, u, v, COM_PS_NEAREST);
+ this->m_inputBokehProgram->readSampled(bokeh, u, v, PixelSampler::Nearest);
madd_v4_v4v4(color_accum, bokeh, &buffer[bufferindex]);
add_v4_v4(multiplier_accum, bokeh);
bufferindex += offsetadd;
@@ -127,7 +130,7 @@ void BokehBlurOperation::executePixel(float output[4], int x, int y, void *data)
output[3] = color_accum[3] * (1.0f / multiplier_accum[3]);
}
else {
- this->m_inputProgram->readSampled(output, x, y, COM_PS_NEAREST);
+ this->m_inputProgram->readSampled(output, x, y, PixelSampler::Nearest);
}
}
@@ -224,7 +227,7 @@ void BokehBlurOperation::updateSize()
{
if (!this->m_sizeavailable) {
float result[4];
- this->getInputSocketReader(3)->readSampled(result, 0, 0, COM_PS_NEAREST);
+ this->getInputSocketReader(3)->readSampled(result, 0, 0, PixelSampler::Nearest);
this->m_size = result[0];
CLAMP(this->m_size, 0.0f, 10.0f);
this->m_sizeavailable = true;
@@ -241,3 +244,5 @@ void BokehBlurOperation::determineResolution(unsigned int resolution[2],
resolution[1] += 2 * this->m_size * max_dim / 100.0f;
}
}
+
+} // namespace blender::compositor
diff --git a/source/blender/compositor/operations/COM_BokehBlurOperation.h b/source/blender/compositor/operations/COM_BokehBlurOperation.h
index 9bdf8bc4035..3ce06adb5d6 100644
--- a/source/blender/compositor/operations/COM_BokehBlurOperation.h
+++ b/source/blender/compositor/operations/COM_BokehBlurOperation.h
@@ -21,6 +21,8 @@
#include "COM_NodeOperation.h"
#include "COM_QualityStepHelper.h"
+namespace blender::compositor {
+
class BokehBlurOperation : public NodeOperation, public QualityStepHelper {
private:
SocketReader *m_inputProgram;
@@ -78,3 +80,5 @@ class BokehBlurOperation : public NodeOperation, public QualityStepHelper {
void determineResolution(unsigned int resolution[2],
unsigned int preferredResolution[2]) override;
};
+
+} // namespace blender::compositor
diff --git a/source/blender/compositor/operations/COM_BokehImageOperation.cc b/source/blender/compositor/operations/COM_BokehImageOperation.cc
index 01f8c81b3b7..63f283b6acc 100644
--- a/source/blender/compositor/operations/COM_BokehImageOperation.cc
+++ b/source/blender/compositor/operations/COM_BokehImageOperation.cc
@@ -19,6 +19,8 @@
#include "COM_BokehImageOperation.h"
#include "BLI_math.h"
+namespace blender::compositor {
+
BokehImageOperation::BokehImageOperation()
{
this->addOutputSocket(DataType::Color);
@@ -124,3 +126,5 @@ void BokehImageOperation::determineResolution(unsigned int resolution[2],
resolution[0] = COM_BLUR_BOKEH_PIXELS;
resolution[1] = COM_BLUR_BOKEH_PIXELS;
}
+
+} // namespace blender::compositor
diff --git a/source/blender/compositor/operations/COM_BokehImageOperation.h b/source/blender/compositor/operations/COM_BokehImageOperation.h
index 34fd4f6411b..2e0bc8a34dc 100644
--- a/source/blender/compositor/operations/COM_BokehImageOperation.h
+++ b/source/blender/compositor/operations/COM_BokehImageOperation.h
@@ -20,6 +20,8 @@
#include "COM_NodeOperation.h"
+namespace blender::compositor {
+
/**
* \brief The BokehImageOperation class is an operation that creates an image useful to mimic the
*internals of a camera.
@@ -150,3 +152,5 @@ class BokehImageOperation : public NodeOperation {
this->m_deleteData = true;
}
};
+
+} // namespace blender::compositor
diff --git a/source/blender/compositor/operations/COM_BoxMaskOperation.cc b/source/blender/compositor/operations/COM_BoxMaskOperation.cc
index 51b1ea98456..9938d4a85ed 100644
--- a/source/blender/compositor/operations/COM_BoxMaskOperation.cc
+++ b/source/blender/compositor/operations/COM_BoxMaskOperation.cc
@@ -20,6 +20,8 @@
#include "BLI_math.h"
#include "DNA_node_types.h"
+namespace blender::compositor {
+
BoxMaskOperation::BoxMaskOperation()
{
this->addInputSocket(DataType::Value);
@@ -108,3 +110,5 @@ void BoxMaskOperation::deinitExecution()
this->m_inputMask = nullptr;
this->m_inputValue = nullptr;
}
+
+} // namespace blender::compositor
diff --git a/source/blender/compositor/operations/COM_BoxMaskOperation.h b/source/blender/compositor/operations/COM_BoxMaskOperation.h
index 6ffa7d98aff..fdec7bdd8ca 100644
--- a/source/blender/compositor/operations/COM_BoxMaskOperation.h
+++ b/source/blender/compositor/operations/COM_BoxMaskOperation.h
@@ -20,6 +20,8 @@
#include "COM_NodeOperation.h"
+namespace blender::compositor {
+
class BoxMaskOperation : public NodeOperation {
private:
/**
@@ -63,3 +65,5 @@ class BoxMaskOperation : public NodeOperation {
this->m_maskType = maskType;
}
};
+
+} // namespace blender::compositor
diff --git a/source/blender/compositor/operations/COM_BrightnessOperation.cc b/source/blender/compositor/operations/COM_BrightnessOperation.cc
index 3a6ddd178e8..92cab47318a 100644
--- a/source/blender/compositor/operations/COM_BrightnessOperation.cc
+++ b/source/blender/compositor/operations/COM_BrightnessOperation.cc
@@ -18,6 +18,8 @@
#include "COM_BrightnessOperation.h"
+namespace blender::compositor {
+
BrightnessOperation::BrightnessOperation()
{
this->addInputSocket(DataType::Color);
@@ -89,3 +91,5 @@ void BrightnessOperation::deinitExecution()
this->m_inputBrightnessProgram = nullptr;
this->m_inputContrastProgram = nullptr;
}
+
+} // namespace blender::compositor
diff --git a/source/blender/compositor/operations/COM_BrightnessOperation.h b/source/blender/compositor/operations/COM_BrightnessOperation.h
index fa2c80ab3f1..7c33e0b35ec 100644
--- a/source/blender/compositor/operations/COM_BrightnessOperation.h
+++ b/source/blender/compositor/operations/COM_BrightnessOperation.h
@@ -20,6 +20,8 @@
#include "COM_NodeOperation.h"
+namespace blender::compositor {
+
class BrightnessOperation : public NodeOperation {
private:
/**
@@ -51,3 +53,5 @@ class BrightnessOperation : public NodeOperation {
void setUsePremultiply(bool use_premultiply);
};
+
+} // namespace blender::compositor
diff --git a/source/blender/compositor/operations/COM_CalculateMeanOperation.cc b/source/blender/compositor/operations/COM_CalculateMeanOperation.cc
index fdeecd0cb29..a7ea49aed8d 100644
--- a/source/blender/compositor/operations/COM_CalculateMeanOperation.cc
+++ b/source/blender/compositor/operations/COM_CalculateMeanOperation.cc
@@ -22,14 +22,16 @@
#include "IMB_colormanagement.h"
+namespace blender::compositor {
+
CalculateMeanOperation::CalculateMeanOperation()
{
- this->addInputSocket(DataType::Color, COM_SC_NO_RESIZE);
+ this->addInputSocket(DataType::Color, ResizeMode::None);
this->addOutputSocket(DataType::Value);
this->m_imageReader = nullptr;
this->m_iscalculated = false;
this->m_setting = 1;
- this->setComplex(true);
+ this->flags.complex = true;
}
void CalculateMeanOperation::initExecution()
{
@@ -125,3 +127,5 @@ void CalculateMeanOperation::calculateMean(MemoryBuffer *tile)
}
this->m_result = sum / pixels;
}
+
+} // namespace blender::compositor
diff --git a/source/blender/compositor/operations/COM_CalculateMeanOperation.h b/source/blender/compositor/operations/COM_CalculateMeanOperation.h
index e1a5bc3fd75..8b3bf281c93 100644
--- a/source/blender/compositor/operations/COM_CalculateMeanOperation.h
+++ b/source/blender/compositor/operations/COM_CalculateMeanOperation.h
@@ -21,6 +21,8 @@
#include "COM_NodeOperation.h"
#include "DNA_node_types.h"
+namespace blender::compositor {
+
/**
* \brief base class of CalculateMean, implementing the simple CalculateMean
* \ingroup operation
@@ -67,3 +69,5 @@ class CalculateMeanOperation : public NodeOperation {
protected:
void calculateMean(MemoryBuffer *tile);
};
+
+} // namespace blender::compositor
diff --git a/source/blender/compositor/operations/COM_CalculateStandardDeviationOperation.cc b/source/blender/compositor/operations/COM_CalculateStandardDeviationOperation.cc
index 9a1e48177ed..ed554b9ac06 100644
--- a/source/blender/compositor/operations/COM_CalculateStandardDeviationOperation.cc
+++ b/source/blender/compositor/operations/COM_CalculateStandardDeviationOperation.cc
@@ -22,10 +22,7 @@
#include "IMB_colormanagement.h"
-CalculateStandardDeviationOperation::CalculateStandardDeviationOperation()
-{
- /* pass */
-}
+namespace blender::compositor {
void CalculateStandardDeviationOperation::executePixel(float output[4],
int /*x*/,
@@ -98,3 +95,5 @@ void *CalculateStandardDeviationOperation::initializeTileData(rcti *rect)
unlockMutex();
return nullptr;
}
+
+} // namespace blender::compositor
diff --git a/source/blender/compositor/operations/COM_CalculateStandardDeviationOperation.h b/source/blender/compositor/operations/COM_CalculateStandardDeviationOperation.h
index f377f96418a..bc4aca69546 100644
--- a/source/blender/compositor/operations/COM_CalculateStandardDeviationOperation.h
+++ b/source/blender/compositor/operations/COM_CalculateStandardDeviationOperation.h
@@ -21,6 +21,9 @@
#include "COM_CalculateMeanOperation.h"
#include "COM_NodeOperation.h"
#include "DNA_node_types.h"
+
+namespace blender::compositor {
+
/**
* \brief base class of CalculateStandardDeviation,
* implementing the simple CalculateStandardDeviation.
@@ -31,8 +34,6 @@ class CalculateStandardDeviationOperation : public CalculateMeanOperation {
float m_standardDeviation;
public:
- CalculateStandardDeviationOperation();
-
/**
* The inner loop of this operation.
*/
@@ -40,3 +41,5 @@ class CalculateStandardDeviationOperation : public CalculateMeanOperation {
void *initializeTileData(rcti *rect) override;
};
+
+} // namespace blender::compositor
diff --git a/source/blender/compositor/operations/COM_ChangeHSVOperation.cc b/source/blender/compositor/operations/COM_ChangeHSVOperation.cc
index e53a416f0dd..eee007ce9e6 100644
--- a/source/blender/compositor/operations/COM_ChangeHSVOperation.cc
+++ b/source/blender/compositor/operations/COM_ChangeHSVOperation.cc
@@ -18,6 +18,8 @@
#include "COM_ChangeHSVOperation.h"
+namespace blender::compositor {
+
ChangeHSVOperation::ChangeHSVOperation()
{
this->addInputSocket(DataType::Color);
@@ -68,3 +70,5 @@ void ChangeHSVOperation::executePixelSampled(float output[4],
output[2] = inputColor1[2] * value[0];
output[3] = inputColor1[3];
}
+
+} // namespace blender::compositor
diff --git a/source/blender/compositor/operations/COM_ChangeHSVOperation.h b/source/blender/compositor/operations/COM_ChangeHSVOperation.h
index f448956df16..d38b4be3efe 100644
--- a/source/blender/compositor/operations/COM_ChangeHSVOperation.h
+++ b/source/blender/compositor/operations/COM_ChangeHSVOperation.h
@@ -20,6 +20,8 @@
#include "COM_MixOperation.h"
+namespace blender::compositor {
+
/**
* this program converts an input color to an output value.
* it assumes we are in sRGB color space.
@@ -45,3 +47,5 @@ class ChangeHSVOperation : public NodeOperation {
*/
void executePixelSampled(float output[4], float x, float y, PixelSampler sampler) override;
};
+
+} // namespace blender::compositor
diff --git a/source/blender/compositor/operations/COM_ChannelMatteOperation.cc b/source/blender/compositor/operations/COM_ChannelMatteOperation.cc
index 98105a9dfde..89290978608 100644
--- a/source/blender/compositor/operations/COM_ChannelMatteOperation.cc
+++ b/source/blender/compositor/operations/COM_ChannelMatteOperation.cc
@@ -19,6 +19,8 @@
#include "COM_ChannelMatteOperation.h"
#include "BLI_math.h"
+namespace blender::compositor {
+
ChannelMatteOperation::ChannelMatteOperation()
{
addInputSocket(DataType::Color);
@@ -118,3 +120,5 @@ void ChannelMatteOperation::executePixelSampled(float output[4],
/* Don't make something that was more transparent less transparent. */
output[0] = MIN2(alpha, inColor[3]);
}
+
+} // namespace blender::compositor
diff --git a/source/blender/compositor/operations/COM_ChannelMatteOperation.h b/source/blender/compositor/operations/COM_ChannelMatteOperation.h
index b295f7709d6..6e9dcccd36e 100644
--- a/source/blender/compositor/operations/COM_ChannelMatteOperation.h
+++ b/source/blender/compositor/operations/COM_ChannelMatteOperation.h
@@ -20,6 +20,8 @@
#include "COM_MixOperation.h"
+namespace blender::compositor {
+
/**
* this program converts an input color to an output value.
* it assumes we are in sRGB color space.
@@ -70,3 +72,5 @@ class ChannelMatteOperation : public NodeOperation {
this->m_matte_channel = custom2;
}
};
+
+} // namespace blender::compositor
diff --git a/source/blender/compositor/operations/COM_ChromaMatteOperation.cc b/source/blender/compositor/operations/COM_ChromaMatteOperation.cc
index 09bf9c76e55..69aa4aac163 100644
--- a/source/blender/compositor/operations/COM_ChromaMatteOperation.cc
+++ b/source/blender/compositor/operations/COM_ChromaMatteOperation.cc
@@ -19,6 +19,8 @@
#include "COM_ChromaMatteOperation.h"
#include "BLI_math.h"
+namespace blender::compositor {
+
ChromaMatteOperation::ChromaMatteOperation()
{
addInputSocket(DataType::Color);
@@ -107,3 +109,5 @@ void ChromaMatteOperation::executePixelSampled(float output[4],
output[0] = inImage[3]; /* make pixel just as transparent as it was before */
}
}
+
+} // namespace blender::compositor
diff --git a/source/blender/compositor/operations/COM_ChromaMatteOperation.h b/source/blender/compositor/operations/COM_ChromaMatteOperation.h
index 11f8c540a4b..48c3a785011 100644
--- a/source/blender/compositor/operations/COM_ChromaMatteOperation.h
+++ b/source/blender/compositor/operations/COM_ChromaMatteOperation.h
@@ -20,6 +20,8 @@
#include "COM_MixOperation.h"
+namespace blender::compositor {
+
/**
* this program converts an input color to an output value.
* it assumes we are in sRGB color space.
@@ -49,3 +51,5 @@ class ChromaMatteOperation : public NodeOperation {
this->m_settings = nodeChroma;
}
};
+
+} // namespace blender::compositor
diff --git a/source/blender/compositor/operations/COM_ColorBalanceASCCDLOperation.cc b/source/blender/compositor/operations/COM_ColorBalanceASCCDLOperation.cc
index b21e453699b..d1d3752e402 100644
--- a/source/blender/compositor/operations/COM_ColorBalanceASCCDLOperation.cc
+++ b/source/blender/compositor/operations/COM_ColorBalanceASCCDLOperation.cc
@@ -19,6 +19,8 @@
#include "COM_ColorBalanceASCCDLOperation.h"
#include "BLI_math.h"
+namespace blender::compositor {
+
inline float colorbalance_cdl(float in, float offset, float power, float slope)
{
float x = in * slope + offset;
@@ -79,3 +81,5 @@ void ColorBalanceASCCDLOperation::deinitExecution()
this->m_inputValueOperation = nullptr;
this->m_inputColorOperation = nullptr;
}
+
+} // namespace blender::compositor
diff --git a/source/blender/compositor/operations/COM_ColorBalanceASCCDLOperation.h b/source/blender/compositor/operations/COM_ColorBalanceASCCDLOperation.h
index b7ee5d341ad..5851600190f 100644
--- a/source/blender/compositor/operations/COM_ColorBalanceASCCDLOperation.h
+++ b/source/blender/compositor/operations/COM_ColorBalanceASCCDLOperation.h
@@ -20,6 +20,8 @@
#include "COM_NodeOperation.h"
+namespace blender::compositor {
+
/**
* this program converts an input color to an output value.
* it assumes we are in sRGB color space.
@@ -70,3 +72,5 @@ class ColorBalanceASCCDLOperation : public NodeOperation {
copy_v3_v3(this->m_slope, slope);
}
};
+
+} // namespace blender::compositor
diff --git a/source/blender/compositor/operations/COM_ColorBalanceLGGOperation.cc b/source/blender/compositor/operations/COM_ColorBalanceLGGOperation.cc
index b6ff636bce9..cac16a3f7b0 100644
--- a/source/blender/compositor/operations/COM_ColorBalanceLGGOperation.cc
+++ b/source/blender/compositor/operations/COM_ColorBalanceLGGOperation.cc
@@ -19,6 +19,8 @@
#include "COM_ColorBalanceLGGOperation.h"
#include "BLI_math.h"
+namespace blender::compositor {
+
inline float colorbalance_lgg(float in, float lift_lgg, float gamma_inv, float gain)
{
/* 1:1 match with the sequencer with linear/srgb conversions, the conversion isn't pretty
@@ -84,3 +86,5 @@ void ColorBalanceLGGOperation::deinitExecution()
this->m_inputValueOperation = nullptr;
this->m_inputColorOperation = nullptr;
}
+
+} // namespace blender::compositor
diff --git a/source/blender/compositor/operations/COM_ColorBalanceLGGOperation.h b/source/blender/compositor/operations/COM_ColorBalanceLGGOperation.h
index 4b2db3da134..23f70247b66 100644
--- a/source/blender/compositor/operations/COM_ColorBalanceLGGOperation.h
+++ b/source/blender/compositor/operations/COM_ColorBalanceLGGOperation.h
@@ -20,6 +20,8 @@
#include "COM_NodeOperation.h"
+namespace blender::compositor {
+
/**
* this program converts an input color to an output value.
* it assumes we are in sRGB color space.
@@ -70,3 +72,5 @@ class ColorBalanceLGGOperation : public NodeOperation {
copy_v3_v3(this->m_gamma_inv, gamma_inv);
}
};
+
+} // namespace blender::compositor
diff --git a/source/blender/compositor/operations/COM_ColorCorrectionOperation.cc b/source/blender/compositor/operations/COM_ColorCorrectionOperation.cc
index b2578451180..168e9b57eb2 100644
--- a/source/blender/compositor/operations/COM_ColorCorrectionOperation.cc
+++ b/source/blender/compositor/operations/COM_ColorCorrectionOperation.cc
@@ -21,6 +21,8 @@
#include "IMB_colormanagement.h"
+namespace blender::compositor {
+
ColorCorrectionOperation::ColorCorrectionOperation()
{
this->addInputSocket(DataType::Color);
@@ -160,3 +162,5 @@ void ColorCorrectionOperation::deinitExecution()
this->m_inputImage = nullptr;
this->m_inputMask = nullptr;
}
+
+} // namespace blender::compositor
diff --git a/source/blender/compositor/operations/COM_ColorCorrectionOperation.h b/source/blender/compositor/operations/COM_ColorCorrectionOperation.h
index be0c9c198cf..c5826ed0152 100644
--- a/source/blender/compositor/operations/COM_ColorCorrectionOperation.h
+++ b/source/blender/compositor/operations/COM_ColorCorrectionOperation.h
@@ -20,6 +20,8 @@
#include "COM_NodeOperation.h"
+namespace blender::compositor {
+
class ColorCorrectionOperation : public NodeOperation {
private:
/**
@@ -68,3 +70,5 @@ class ColorCorrectionOperation : public NodeOperation {
this->m_blueChannelEnabled = enabled;
}
};
+
+} // namespace blender::compositor
diff --git a/source/blender/compositor/operations/COM_ColorCurveOperation.cc b/source/blender/compositor/operations/COM_ColorCurveOperation.cc
index 35218cef7cc..cb0565a81a2 100644
--- a/source/blender/compositor/operations/COM_ColorCurveOperation.cc
+++ b/source/blender/compositor/operations/COM_ColorCurveOperation.cc
@@ -22,6 +22,8 @@
#include "MEM_guardedalloc.h"
+namespace blender::compositor {
+
ColorCurveOperation::ColorCurveOperation()
{
this->addInputSocket(DataType::Value);
@@ -151,3 +153,5 @@ void ConstantLevelColorCurveOperation::deinitExecution()
this->m_inputFacProgram = nullptr;
this->m_inputImageProgram = nullptr;
}
+
+} // namespace blender::compositor
diff --git a/source/blender/compositor/operations/COM_ColorCurveOperation.h b/source/blender/compositor/operations/COM_ColorCurveOperation.h
index d57ff81bbe7..6fc7759b8d2 100644
--- a/source/blender/compositor/operations/COM_ColorCurveOperation.h
+++ b/source/blender/compositor/operations/COM_ColorCurveOperation.h
@@ -22,6 +22,8 @@
#include "COM_NodeOperation.h"
#include "DNA_color_types.h"
+namespace blender::compositor {
+
class ColorCurveOperation : public CurveBaseOperation {
private:
/**
@@ -88,3 +90,5 @@ class ConstantLevelColorCurveOperation : public CurveBaseOperation {
copy_v3_v3(this->m_white, white);
}
};
+
+} // namespace blender::compositor
diff --git a/source/blender/compositor/operations/COM_ColorExposureOperation.cc b/source/blender/compositor/operations/COM_ColorExposureOperation.cc
index 0e24620846e..1512ff87658 100644
--- a/source/blender/compositor/operations/COM_ColorExposureOperation.cc
+++ b/source/blender/compositor/operations/COM_ColorExposureOperation.cc
@@ -18,6 +18,8 @@
#include "COM_ColorExposureOperation.h"
+namespace blender::compositor {
+
ExposureOperation::ExposureOperation()
{
this->addInputSocket(DataType::Color);
@@ -55,3 +57,5 @@ void ExposureOperation::deinitExecution()
this->m_inputProgram = nullptr;
this->m_inputExposureProgram = nullptr;
}
+
+} // namespace blender::compositor
diff --git a/source/blender/compositor/operations/COM_ColorExposureOperation.h b/source/blender/compositor/operations/COM_ColorExposureOperation.h
index 981caeb2663..0cfaa059e41 100644
--- a/source/blender/compositor/operations/COM_ColorExposureOperation.h
+++ b/source/blender/compositor/operations/COM_ColorExposureOperation.h
@@ -20,6 +20,8 @@
#include "COM_NodeOperation.h"
+namespace blender::compositor {
+
class ExposureOperation : public NodeOperation {
private:
/**
@@ -46,3 +48,5 @@ class ExposureOperation : public NodeOperation {
*/
void deinitExecution() override;
};
+
+} // namespace blender::compositor
diff --git a/source/blender/compositor/operations/COM_ColorMatteOperation.cc b/source/blender/compositor/operations/COM_ColorMatteOperation.cc
index cc7a81f68d1..89f56ac4aae 100644
--- a/source/blender/compositor/operations/COM_ColorMatteOperation.cc
+++ b/source/blender/compositor/operations/COM_ColorMatteOperation.cc
@@ -19,6 +19,8 @@
#include "COM_ColorMatteOperation.h"
#include "BLI_math.h"
+namespace blender::compositor {
+
ColorMatteOperation::ColorMatteOperation()
{
addInputSocket(DataType::Color);
@@ -79,3 +81,5 @@ void ColorMatteOperation::executePixelSampled(float output[4],
output[0] = inColor[3]; /* make pixel just as transparent as it was before */
}
}
+
+} // namespace blender::compositor
diff --git a/source/blender/compositor/operations/COM_ColorMatteOperation.h b/source/blender/compositor/operations/COM_ColorMatteOperation.h
index 643dc83b3d9..439a3b0741d 100644
--- a/source/blender/compositor/operations/COM_ColorMatteOperation.h
+++ b/source/blender/compositor/operations/COM_ColorMatteOperation.h
@@ -20,6 +20,8 @@
#include "COM_MixOperation.h"
+namespace blender::compositor {
+
/**
* this program converts an input color to an output value.
* it assumes we are in sRGB color space.
@@ -49,3 +51,5 @@ class ColorMatteOperation : public NodeOperation {
this->m_settings = nodeChroma;
}
};
+
+} // namespace blender::compositor
diff --git a/source/blender/compositor/operations/COM_ColorRampOperation.cc b/source/blender/compositor/operations/COM_ColorRampOperation.cc
index 4fde951fd3c..0ee65a6529e 100644
--- a/source/blender/compositor/operations/COM_ColorRampOperation.cc
+++ b/source/blender/compositor/operations/COM_ColorRampOperation.cc
@@ -20,6 +20,8 @@
#include "BKE_colorband.h"
+namespace blender::compositor {
+
ColorRampOperation::ColorRampOperation()
{
this->addInputSocket(DataType::Value);
@@ -48,3 +50,5 @@ void ColorRampOperation::deinitExecution()
{
this->m_inputProgram = nullptr;
}
+
+} // namespace blender::compositor
diff --git a/source/blender/compositor/operations/COM_ColorRampOperation.h b/source/blender/compositor/operations/COM_ColorRampOperation.h
index 8e725ccf709..d32af9bea24 100644
--- a/source/blender/compositor/operations/COM_ColorRampOperation.h
+++ b/source/blender/compositor/operations/COM_ColorRampOperation.h
@@ -21,6 +21,8 @@
#include "COM_NodeOperation.h"
#include "DNA_texture_types.h"
+namespace blender::compositor {
+
class ColorRampOperation : public NodeOperation {
private:
/**
@@ -52,3 +54,5 @@ class ColorRampOperation : public NodeOperation {
this->m_colorBand = colorBand;
}
};
+
+} // namespace blender::compositor
diff --git a/source/blender/compositor/operations/COM_ColorSpillOperation.cc b/source/blender/compositor/operations/COM_ColorSpillOperation.cc
index 8e8eaabfc6b..7dc7e2775fc 100644
--- a/source/blender/compositor/operations/COM_ColorSpillOperation.cc
+++ b/source/blender/compositor/operations/COM_ColorSpillOperation.cc
@@ -20,6 +20,8 @@
#include "BLI_math.h"
#define AVG(a, b) ((a + b) / 2)
+namespace blender::compositor {
+
ColorSpillOperation::ColorSpillOperation()
{
addInputSocket(DataType::Color);
@@ -115,3 +117,5 @@ void ColorSpillOperation::executePixelSampled(float output[4],
copy_v4_v4(output, input);
}
}
+
+} // namespace blender::compositor
diff --git a/source/blender/compositor/operations/COM_ColorSpillOperation.h b/source/blender/compositor/operations/COM_ColorSpillOperation.h
index e8cd15fb3bc..9b82e720527 100644
--- a/source/blender/compositor/operations/COM_ColorSpillOperation.h
+++ b/source/blender/compositor/operations/COM_ColorSpillOperation.h
@@ -20,6 +20,8 @@
#include "COM_NodeOperation.h"
+namespace blender::compositor {
+
/**
* this program converts an input color to an output value.
* it assumes we are in sRGB color space.
@@ -64,3 +66,5 @@ class ColorSpillOperation : public NodeOperation {
float calculateMapValue(float fac, float *input);
};
+
+} // namespace blender::compositor
diff --git a/source/blender/compositor/operations/COM_CompositorOperation.cc b/source/blender/compositor/operations/COM_CompositorOperation.cc
index 0454bae8b38..94d41b28f5d 100644
--- a/source/blender/compositor/operations/COM_CompositorOperation.cc
+++ b/source/blender/compositor/operations/COM_CompositorOperation.cc
@@ -31,6 +31,8 @@
#include "PIL_time.h"
+namespace blender::compositor {
+
CompositorOperation::CompositorOperation()
{
this->addInputSocket(DataType::Color);
@@ -50,6 +52,8 @@ CompositorOperation::CompositorOperation()
this->m_scene = nullptr;
this->m_sceneName[0] = '\0';
this->m_viewName = nullptr;
+
+ flags.use_render_border = true;
}
void CompositorOperation::initExecution()
@@ -147,7 +151,7 @@ void CompositorOperation::executeRegion(rcti *rect, unsigned int /*tileNumber*/)
int y2 = rect->ymax;
int offset = (y1 * this->getWidth() + x1);
int add = (this->getWidth() - (x2 - x1));
- int offset4 = offset * COM_NUM_CHANNELS_COLOR;
+ int offset4 = offset * COM_DATA_TYPE_COLOR_CHANNELS;
int x;
int y;
bool breaked = false;
@@ -196,23 +200,23 @@ void CompositorOperation::executeRegion(rcti *rect, unsigned int /*tileNumber*/)
for (x = x1; x < x2 && (!breaked); x++) {
int input_x = x + dx, input_y = y + dy;
- this->m_imageInput->readSampled(color, input_x, input_y, COM_PS_NEAREST);
+ this->m_imageInput->readSampled(color, input_x, input_y, PixelSampler::Nearest);
if (this->m_useAlphaInput) {
- this->m_alphaInput->readSampled(&(color[3]), input_x, input_y, COM_PS_NEAREST);
+ this->m_alphaInput->readSampled(&(color[3]), input_x, input_y, PixelSampler::Nearest);
}
copy_v4_v4(buffer + offset4, color);
- this->m_depthInput->readSampled(color, input_x, input_y, COM_PS_NEAREST);
+ this->m_depthInput->readSampled(color, input_x, input_y, PixelSampler::Nearest);
zbuffer[offset] = color[0];
- offset4 += COM_NUM_CHANNELS_COLOR;
+ offset4 += COM_DATA_TYPE_COLOR_CHANNELS;
offset++;
if (isBraked()) {
breaked = true;
}
}
offset += add;
- offset4 += add * COM_NUM_CHANNELS_COLOR;
+ offset4 += add * COM_DATA_TYPE_COLOR_CHANNELS;
}
}
@@ -242,3 +246,5 @@ void CompositorOperation::determineResolution(unsigned int resolution[2],
resolution[0] = width;
resolution[1] = height;
}
+
+} // namespace blender::compositor
diff --git a/source/blender/compositor/operations/COM_CompositorOperation.h b/source/blender/compositor/operations/COM_CompositorOperation.h
index 1c964a80093..65988c86cc5 100644
--- a/source/blender/compositor/operations/COM_CompositorOperation.h
+++ b/source/blender/compositor/operations/COM_CompositorOperation.h
@@ -24,6 +24,8 @@
struct Scene;
+namespace blender::compositor {
+
/**
* \brief Compositor output operation
*/
@@ -109,9 +111,9 @@ class CompositorOperation : public NodeOperation {
}
void initExecution() override;
void deinitExecution() override;
- CompositorPriority getRenderPriority() const override
+ eCompositorPriority getRenderPriority() const override
{
- return CompositorPriority::Medium;
+ return eCompositorPriority::Medium;
}
void determineResolution(unsigned int resolution[2],
unsigned int preferredResolution[2]) override;
@@ -124,3 +126,5 @@ class CompositorOperation : public NodeOperation {
this->m_active = active;
}
};
+
+} // namespace blender::compositor
diff --git a/source/blender/compositor/operations/COM_ConvertColorProfileOperation.cc b/source/blender/compositor/operations/COM_ConvertColorProfileOperation.cc
index 431f0e9c880..c00fe5d5f61 100644
--- a/source/blender/compositor/operations/COM_ConvertColorProfileOperation.cc
+++ b/source/blender/compositor/operations/COM_ConvertColorProfileOperation.cc
@@ -20,6 +20,8 @@
#include "IMB_imbuf.h"
+namespace blender::compositor {
+
ConvertColorProfileOperation::ConvertColorProfileOperation()
{
this->addInputSocket(DataType::Color);
@@ -48,3 +50,5 @@ void ConvertColorProfileOperation::deinitExecution()
{
this->m_inputOperation = nullptr;
}
+
+} // namespace blender::compositor
diff --git a/source/blender/compositor/operations/COM_ConvertColorProfileOperation.h b/source/blender/compositor/operations/COM_ConvertColorProfileOperation.h
index 927a5a7fef1..6162408501b 100644
--- a/source/blender/compositor/operations/COM_ConvertColorProfileOperation.h
+++ b/source/blender/compositor/operations/COM_ConvertColorProfileOperation.h
@@ -20,6 +20,8 @@
#include "COM_NodeOperation.h"
+namespace blender::compositor {
+
/**
* this program converts an input color to an output value.
* it assumes we are in sRGB color space.
@@ -80,3 +82,5 @@ class ConvertColorProfileOperation : public NodeOperation {
this->m_predivided = predivided;
}
};
+
+} // namespace blender::compositor
diff --git a/source/blender/compositor/operations/COM_ConvertDepthToRadiusOperation.cc b/source/blender/compositor/operations/COM_ConvertDepthToRadiusOperation.cc
index 17b351cb14c..57027c11949 100644
--- a/source/blender/compositor/operations/COM_ConvertDepthToRadiusOperation.cc
+++ b/source/blender/compositor/operations/COM_ConvertDepthToRadiusOperation.cc
@@ -21,6 +21,8 @@
#include "BLI_math.h"
#include "DNA_camera_types.h"
+namespace blender::compositor {
+
ConvertDepthToRadiusOperation::ConvertDepthToRadiusOperation()
{
this->addInputSocket(DataType::Value);
@@ -113,3 +115,5 @@ void ConvertDepthToRadiusOperation::deinitExecution()
{
this->m_inputOperation = nullptr;
}
+
+} // namespace blender::compositor
diff --git a/source/blender/compositor/operations/COM_ConvertDepthToRadiusOperation.h b/source/blender/compositor/operations/COM_ConvertDepthToRadiusOperation.h
index 6a7cc4e004a..1f4e856b128 100644
--- a/source/blender/compositor/operations/COM_ConvertDepthToRadiusOperation.h
+++ b/source/blender/compositor/operations/COM_ConvertDepthToRadiusOperation.h
@@ -21,6 +21,9 @@
#include "COM_FastGaussianBlurOperation.h"
#include "COM_NodeOperation.h"
#include "DNA_object_types.h"
+
+namespace blender::compositor {
+
/**
* this program converts an input color to an output value.
* it assumes we are in sRGB color space.
@@ -81,3 +84,5 @@ class ConvertDepthToRadiusOperation : public NodeOperation {
this->m_blurPostOperation = operation;
}
};
+
+} // namespace blender::compositor
diff --git a/source/blender/compositor/operations/COM_ConvertOperation.cc b/source/blender/compositor/operations/COM_ConvertOperation.cc
index 648b3f0b30a..384936533c7 100644
--- a/source/blender/compositor/operations/COM_ConvertOperation.cc
+++ b/source/blender/compositor/operations/COM_ConvertOperation.cc
@@ -18,8 +18,12 @@
#include "COM_ConvertOperation.h"
+#include "BLI_color.hh"
+
#include "IMB_colormanagement.h"
+namespace blender::compositor {
+
ConvertBaseOperation::ConvertBaseOperation()
{
this->m_inputOperation = nullptr;
@@ -353,21 +357,10 @@ void ConvertPremulToStraightOperation::executePixelSampled(float output[4],
float y,
PixelSampler sampler)
{
- float inputValue[4];
- float alpha;
-
- this->m_inputOperation->readSampled(inputValue, x, y, sampler);
- alpha = inputValue[3];
-
- if (fabsf(alpha) < 1e-5f) {
- zero_v3(output);
- }
- else {
- mul_v3_v3fl(output, inputValue, 1.0f / alpha);
- }
-
- /* never touches the alpha */
- output[3] = alpha;
+ ColorSceneLinear4f<eAlpha::Premultiplied> input;
+ this->m_inputOperation->readSampled(input, x, y, sampler);
+ ColorSceneLinear4f<eAlpha::Straight> converted = input.unpremultiply_alpha();
+ copy_v4_v4(output, converted);
}
/* ******** Straight to Premul ******** */
@@ -383,16 +376,10 @@ void ConvertStraightToPremulOperation::executePixelSampled(float output[4],
float y,
PixelSampler sampler)
{
- float inputValue[4];
- float alpha;
-
- this->m_inputOperation->readSampled(inputValue, x, y, sampler);
- alpha = inputValue[3];
-
- mul_v3_v3fl(output, inputValue, alpha);
-
- /* never touches the alpha */
- output[3] = alpha;
+ ColorSceneLinear4f<eAlpha::Straight> input;
+ this->m_inputOperation->readSampled(input, x, y, sampler);
+ ColorSceneLinear4f<eAlpha::Premultiplied> converted = input.premultiply_alpha();
+ copy_v4_v4(output, converted);
}
/* ******** Separate Channels ******** */
@@ -478,3 +465,5 @@ void CombineChannelsOperation::executePixelSampled(float output[4],
output[3] = input[0];
}
}
+
+} // namespace blender::compositor
diff --git a/source/blender/compositor/operations/COM_ConvertOperation.h b/source/blender/compositor/operations/COM_ConvertOperation.h
index 7e359a30d6c..7a726e35c7c 100644
--- a/source/blender/compositor/operations/COM_ConvertOperation.h
+++ b/source/blender/compositor/operations/COM_ConvertOperation.h
@@ -20,6 +20,8 @@
#include "COM_NodeOperation.h"
+namespace blender::compositor {
+
class ConvertBaseOperation : public NodeOperation {
protected:
SocketReader *m_inputOperation;
@@ -182,3 +184,5 @@ class CombineChannelsOperation : public NodeOperation {
void initExecution() override;
void deinitExecution() override;
};
+
+} // namespace blender::compositor
diff --git a/source/blender/compositor/operations/COM_ConvolutionEdgeFilterOperation.cc b/source/blender/compositor/operations/COM_ConvolutionEdgeFilterOperation.cc
index a5f2ae404e3..5ead300a368 100644
--- a/source/blender/compositor/operations/COM_ConvolutionEdgeFilterOperation.cc
+++ b/source/blender/compositor/operations/COM_ConvolutionEdgeFilterOperation.cc
@@ -19,10 +19,7 @@
#include "COM_ConvolutionEdgeFilterOperation.h"
#include "BLI_math.h"
-ConvolutionEdgeFilterOperation::ConvolutionEdgeFilterOperation()
-{
- /* pass */
-}
+namespace blender::compositor {
void ConvolutionEdgeFilterOperation::executePixel(float output[4], int x, int y, void * /*data*/)
{
@@ -97,3 +94,5 @@ void ConvolutionEdgeFilterOperation::executePixel(float output[4], int x, int y,
output[2] = MAX2(output[2], 0.0f);
output[3] = MAX2(output[3], 0.0f);
}
+
+} // namespace blender::compositor
diff --git a/source/blender/compositor/operations/COM_ConvolutionEdgeFilterOperation.h b/source/blender/compositor/operations/COM_ConvolutionEdgeFilterOperation.h
index 4ee72ffdd97..319b424bd4a 100644
--- a/source/blender/compositor/operations/COM_ConvolutionEdgeFilterOperation.h
+++ b/source/blender/compositor/operations/COM_ConvolutionEdgeFilterOperation.h
@@ -20,8 +20,11 @@
#include "COM_ConvolutionFilterOperation.h"
+namespace blender::compositor {
+
class ConvolutionEdgeFilterOperation : public ConvolutionFilterOperation {
public:
- ConvolutionEdgeFilterOperation();
void executePixel(float output[4], int x, int y, void *data) override;
};
+
+} // namespace blender::compositor
diff --git a/source/blender/compositor/operations/COM_ConvolutionFilterOperation.cc b/source/blender/compositor/operations/COM_ConvolutionFilterOperation.cc
index f80144fb06d..72cbbf4283a 100644
--- a/source/blender/compositor/operations/COM_ConvolutionFilterOperation.cc
+++ b/source/blender/compositor/operations/COM_ConvolutionFilterOperation.cc
@@ -22,6 +22,8 @@
#include "MEM_guardedalloc.h"
+namespace blender::compositor {
+
ConvolutionFilterOperation::ConvolutionFilterOperation()
{
this->addInputSocket(DataType::Color);
@@ -29,7 +31,7 @@ ConvolutionFilterOperation::ConvolutionFilterOperation()
this->addOutputSocket(DataType::Color);
this->setResolutionInputSocketIndex(0);
this->m_inputOperation = nullptr;
- this->setComplex(true);
+ this->flags.complex = true;
}
void ConvolutionFilterOperation::initExecution()
{
@@ -124,3 +126,5 @@ bool ConvolutionFilterOperation::determineDependingAreaOfInterest(
return NodeOperation::determineDependingAreaOfInterest(&newInput, readOperation, output);
}
+
+} // namespace blender::compositor
diff --git a/source/blender/compositor/operations/COM_ConvolutionFilterOperation.h b/source/blender/compositor/operations/COM_ConvolutionFilterOperation.h
index 08353fecca3..16dee502929 100644
--- a/source/blender/compositor/operations/COM_ConvolutionFilterOperation.h
+++ b/source/blender/compositor/operations/COM_ConvolutionFilterOperation.h
@@ -20,6 +20,8 @@
#include "COM_NodeOperation.h"
+namespace blender::compositor {
+
class ConvolutionFilterOperation : public NodeOperation {
private:
int m_filterWidth;
@@ -42,3 +44,5 @@ class ConvolutionFilterOperation : public NodeOperation {
void initExecution() override;
void deinitExecution() override;
};
+
+} // namespace blender::compositor
diff --git a/source/blender/compositor/operations/COM_CropOperation.cc b/source/blender/compositor/operations/COM_CropOperation.cc
index 55a1e505ec8..f12d93bc8d3 100644
--- a/source/blender/compositor/operations/COM_CropOperation.cc
+++ b/source/blender/compositor/operations/COM_CropOperation.cc
@@ -19,9 +19,11 @@
#include "COM_CropOperation.h"
#include "BLI_math.h"
+namespace blender::compositor {
+
CropBaseOperation::CropBaseOperation()
{
- this->addInputSocket(DataType::Color, COM_SC_NO_RESIZE);
+ this->addInputSocket(DataType::Color, ResizeMode::None);
this->addOutputSocket(DataType::Color);
this->m_inputOperation = nullptr;
this->m_settings = nullptr;
@@ -133,3 +135,5 @@ void CropImageOperation::executePixelSampled(float output[4],
zero_v4(output);
}
}
+
+} // namespace blender::compositor
diff --git a/source/blender/compositor/operations/COM_CropOperation.h b/source/blender/compositor/operations/COM_CropOperation.h
index d2b9aee0bf3..acdff79a77c 100644
--- a/source/blender/compositor/operations/COM_CropOperation.h
+++ b/source/blender/compositor/operations/COM_CropOperation.h
@@ -20,6 +20,8 @@
#include "COM_NodeOperation.h"
+namespace blender::compositor {
+
class CropBaseOperation : public NodeOperation {
protected:
SocketReader *m_inputOperation;
@@ -64,3 +66,5 @@ class CropImageOperation : public CropBaseOperation {
unsigned int preferredResolution[2]) override;
void executePixelSampled(float output[4], float x, float y, PixelSampler sampler) override;
};
+
+} // namespace blender::compositor
diff --git a/source/blender/compositor/operations/COM_CryptomatteOperation.cc b/source/blender/compositor/operations/COM_CryptomatteOperation.cc
index 8d42a756f51..52ae1d6d5b5 100644
--- a/source/blender/compositor/operations/COM_CryptomatteOperation.cc
+++ b/source/blender/compositor/operations/COM_CryptomatteOperation.cc
@@ -18,14 +18,16 @@
#include "COM_CryptomatteOperation.h"
+namespace blender::compositor {
+
CryptomatteOperation::CryptomatteOperation(size_t num_inputs)
{
+ inputs.resize(num_inputs);
for (size_t i = 0; i < num_inputs; i++) {
this->addInputSocket(DataType::Color);
}
- inputs.resize(num_inputs);
this->addOutputSocket(DataType::Color);
- this->setComplex(true);
+ this->flags.complex = true;
}
void CryptomatteOperation::initExecution()
@@ -38,7 +40,7 @@ void CryptomatteOperation::initExecution()
void CryptomatteOperation::addObjectIndex(float objectIndex)
{
if (objectIndex != 0.0f) {
- m_objectIndex.push_back(objectIndex);
+ m_objectIndex.append(objectIndex);
}
}
@@ -58,13 +60,15 @@ void CryptomatteOperation::executePixel(float output[4], int x, int y, void *dat
output[1] = ((float)((m3hash << 8)) / (float)UINT32_MAX);
output[2] = ((float)((m3hash << 16)) / (float)UINT32_MAX);
}
- for (size_t i = 0; i < m_objectIndex.size(); i++) {
- if (m_objectIndex[i] == input[0]) {
+ for (float hash : m_objectIndex) {
+ if (input[0] == hash) {
output[3] += input[1];
}
- if (m_objectIndex[i] == input[2]) {
+ if (input[2] == hash) {
output[3] += input[3];
}
}
}
}
+
+} // namespace blender::compositor
diff --git a/source/blender/compositor/operations/COM_CryptomatteOperation.h b/source/blender/compositor/operations/COM_CryptomatteOperation.h
index a9cef7fe24b..1b91358d228 100644
--- a/source/blender/compositor/operations/COM_CryptomatteOperation.h
+++ b/source/blender/compositor/operations/COM_CryptomatteOperation.h
@@ -20,12 +20,14 @@
#include "COM_NodeOperation.h"
+namespace blender::compositor {
+
class CryptomatteOperation : public NodeOperation {
private:
- std::vector<float> m_objectIndex;
+ Vector<float> m_objectIndex;
public:
- std::vector<SocketReader *> inputs;
+ Vector<SocketReader *> inputs;
CryptomatteOperation(size_t num_inputs = 6);
@@ -34,3 +36,5 @@ class CryptomatteOperation : public NodeOperation {
void addObjectIndex(float objectIndex);
};
+
+} // namespace blender::compositor
diff --git a/source/blender/compositor/operations/COM_CurveBaseOperation.cc b/source/blender/compositor/operations/COM_CurveBaseOperation.cc
index b58efcf0cca..8f655964570 100644
--- a/source/blender/compositor/operations/COM_CurveBaseOperation.cc
+++ b/source/blender/compositor/operations/COM_CurveBaseOperation.cc
@@ -20,6 +20,8 @@
#include "BKE_colortools.h"
+namespace blender::compositor {
+
CurveBaseOperation::CurveBaseOperation()
{
this->m_curveMapping = nullptr;
@@ -53,3 +55,5 @@ void CurveBaseOperation::setCurveMapping(CurveMapping *mapping)
}
this->m_curveMapping = BKE_curvemapping_copy(mapping);
}
+
+} // namespace blender::compositor
diff --git a/source/blender/compositor/operations/COM_CurveBaseOperation.h b/source/blender/compositor/operations/COM_CurveBaseOperation.h
index 15e484f4762..fff0f3168ba 100644
--- a/source/blender/compositor/operations/COM_CurveBaseOperation.h
+++ b/source/blender/compositor/operations/COM_CurveBaseOperation.h
@@ -21,6 +21,8 @@
#include "COM_NodeOperation.h"
#include "DNA_color_types.h"
+namespace blender::compositor {
+
class CurveBaseOperation : public NodeOperation {
protected:
/**
@@ -40,3 +42,5 @@ class CurveBaseOperation : public NodeOperation {
void setCurveMapping(CurveMapping *mapping);
};
+
+} // namespace blender::compositor
diff --git a/source/blender/compositor/operations/COM_DenoiseOperation.cc b/source/blender/compositor/operations/COM_DenoiseOperation.cc
index 66d0f3fd9bd..ec11ad4d69a 100644
--- a/source/blender/compositor/operations/COM_DenoiseOperation.cc
+++ b/source/blender/compositor/operations/COM_DenoiseOperation.cc
@@ -26,6 +26,8 @@ static pthread_mutex_t oidn_lock = BLI_MUTEX_INITIALIZER;
#endif
#include <iostream>
+namespace blender::compositor {
+
DenoiseOperation::DenoiseOperation()
{
this->addInputSocket(DataType::Color);
@@ -99,6 +101,11 @@ void DenoiseOperation::generateDenoise(float *data,
if (BLI_cpu_support_sse41())
# endif
{
+ /* Since it's memory intensive, it's better to run only one instance of OIDN at a time.
+ * OpenImageDenoise is multithreaded internally and should use all available cores nonetheless.
+ */
+ BLI_mutex_lock(&oidn_lock);
+
oidn::DeviceRef device = oidn::newDevice();
device.commit();
@@ -143,10 +150,6 @@ void DenoiseOperation::generateDenoise(float *data,
}
filter.commit();
- /* Since it's memory intensive, it's better to run only one instance of OIDN at a time.
- * OpenImageDenoise is multithreaded internally and should use all available cores nonetheless.
- */
- BLI_mutex_lock(&oidn_lock);
filter.execute();
BLI_mutex_unlock(&oidn_lock);
@@ -164,3 +167,5 @@ void DenoiseOperation::generateDenoise(float *data,
inputBufferColor,
sizeof(float[4]) * inputTileColor->getWidth() * inputTileColor->getHeight());
}
+
+} // namespace blender::compositor
diff --git a/source/blender/compositor/operations/COM_DenoiseOperation.h b/source/blender/compositor/operations/COM_DenoiseOperation.h
index 162fe70617f..a9298c17e92 100644
--- a/source/blender/compositor/operations/COM_DenoiseOperation.h
+++ b/source/blender/compositor/operations/COM_DenoiseOperation.h
@@ -21,6 +21,8 @@
#include "COM_SingleThreadedOperation.h"
#include "DNA_node_types.h"
+namespace blender::compositor {
+
class DenoiseOperation : public SingleThreadedOperation {
private:
/**
@@ -64,3 +66,5 @@ class DenoiseOperation : public SingleThreadedOperation {
MemoryBuffer *createMemoryBuffer(rcti *rect) override;
};
+
+} // namespace blender::compositor
diff --git a/source/blender/compositor/operations/COM_DespeckleOperation.cc b/source/blender/compositor/operations/COM_DespeckleOperation.cc
index 813ae07a97a..fc8778c7d2e 100644
--- a/source/blender/compositor/operations/COM_DespeckleOperation.cc
+++ b/source/blender/compositor/operations/COM_DespeckleOperation.cc
@@ -22,6 +22,8 @@
#include "BLI_utildefines.h"
+namespace blender::compositor {
+
DespeckleOperation::DespeckleOperation()
{
this->addInputSocket(DataType::Color);
@@ -29,7 +31,7 @@ DespeckleOperation::DespeckleOperation()
this->addOutputSocket(DataType::Color);
this->setResolutionInputSocketIndex(0);
this->m_inputOperation = nullptr;
- this->setComplex(true);
+ this->flags.complex = true;
}
void DespeckleOperation::initExecution()
{
@@ -141,3 +143,5 @@ bool DespeckleOperation::determineDependingAreaOfInterest(rcti *input,
return NodeOperation::determineDependingAreaOfInterest(&newInput, readOperation, output);
}
+
+} // namespace blender::compositor
diff --git a/source/blender/compositor/operations/COM_DespeckleOperation.h b/source/blender/compositor/operations/COM_DespeckleOperation.h
index dee355696af..e8d3461d2ec 100644
--- a/source/blender/compositor/operations/COM_DespeckleOperation.h
+++ b/source/blender/compositor/operations/COM_DespeckleOperation.h
@@ -20,6 +20,8 @@
#include "COM_NodeOperation.h"
+namespace blender::compositor {
+
class DespeckleOperation : public NodeOperation {
private:
float m_threshold;
@@ -51,3 +53,5 @@ class DespeckleOperation : public NodeOperation {
void initExecution() override;
void deinitExecution() override;
};
+
+} // namespace blender::compositor
diff --git a/source/blender/compositor/operations/COM_DifferenceMatteOperation.cc b/source/blender/compositor/operations/COM_DifferenceMatteOperation.cc
index 1ce91aeb4c3..e380131634f 100644
--- a/source/blender/compositor/operations/COM_DifferenceMatteOperation.cc
+++ b/source/blender/compositor/operations/COM_DifferenceMatteOperation.cc
@@ -19,6 +19,8 @@
#include "COM_DifferenceMatteOperation.h"
#include "BLI_math.h"
+namespace blender::compositor {
+
DifferenceMatteOperation::DifferenceMatteOperation()
{
addInputSocket(DataType::Color);
@@ -83,3 +85,5 @@ void DifferenceMatteOperation::executePixelSampled(float output[4],
output[0] = inColor1[3];
}
}
+
+} // namespace blender::compositor
diff --git a/source/blender/compositor/operations/COM_DifferenceMatteOperation.h b/source/blender/compositor/operations/COM_DifferenceMatteOperation.h
index ded819850f8..d3963fee1c1 100644
--- a/source/blender/compositor/operations/COM_DifferenceMatteOperation.h
+++ b/source/blender/compositor/operations/COM_DifferenceMatteOperation.h
@@ -20,6 +20,8 @@
#include "COM_MixOperation.h"
+namespace blender::compositor {
+
/**
* this program converts an input color to an output value.
* it assumes we are in sRGB color space.
@@ -49,3 +51,5 @@ class DifferenceMatteOperation : public NodeOperation {
this->m_settings = nodeChroma;
}
};
+
+} // namespace blender::compositor
diff --git a/source/blender/compositor/operations/COM_DilateErodeOperation.cc b/source/blender/compositor/operations/COM_DilateErodeOperation.cc
index 33ddf9187b0..9e18a8e2f2c 100644
--- a/source/blender/compositor/operations/COM_DilateErodeOperation.cc
+++ b/source/blender/compositor/operations/COM_DilateErodeOperation.cc
@@ -22,12 +22,14 @@
#include "MEM_guardedalloc.h"
+namespace blender::compositor {
+
// DilateErode Distance Threshold
DilateErodeThresholdOperation::DilateErodeThresholdOperation()
{
this->addInputSocket(DataType::Value);
this->addOutputSocket(DataType::Value);
- this->setComplex(true);
+ this->flags.complex = true;
this->m_inputProgram = nullptr;
this->m_inset = 0.0f;
this->m__switch = 0.5f;
@@ -163,10 +165,10 @@ DilateDistanceOperation::DilateDistanceOperation()
{
this->addInputSocket(DataType::Value);
this->addOutputSocket(DataType::Value);
- this->setComplex(true);
this->m_inputProgram = nullptr;
this->m_distance = 0.0f;
- this->setOpenCL(true);
+ flags.complex = true;
+ flags.open_cl = true;
}
void DilateDistanceOperation::initExecution()
{
@@ -321,7 +323,7 @@ DilateStepOperation::DilateStepOperation()
{
this->addInputSocket(DataType::Value);
this->addOutputSocket(DataType::Value);
- this->setComplex(true);
+ this->flags.complex = true;
this->m_inputProgram = nullptr;
}
void DilateStepOperation::initExecution()
@@ -568,3 +570,5 @@ void *ErodeStepOperation::initializeTileData(rcti *rect)
return result;
}
+
+} // namespace blender::compositor
diff --git a/source/blender/compositor/operations/COM_DilateErodeOperation.h b/source/blender/compositor/operations/COM_DilateErodeOperation.h
index 7497fb8ab08..a489e293e8e 100644
--- a/source/blender/compositor/operations/COM_DilateErodeOperation.h
+++ b/source/blender/compositor/operations/COM_DilateErodeOperation.h
@@ -20,6 +20,8 @@
#include "COM_NodeOperation.h"
+namespace blender::compositor {
+
class DilateErodeThresholdOperation : public NodeOperation {
private:
/**
@@ -180,3 +182,5 @@ class ErodeStepOperation : public DilateStepOperation {
void *initializeTileData(rcti *rect) override;
};
+
+} // namespace blender::compositor
diff --git a/source/blender/compositor/operations/COM_DirectionalBlurOperation.cc b/source/blender/compositor/operations/COM_DirectionalBlurOperation.cc
index 1a2701a681d..97bdc25af3b 100644
--- a/source/blender/compositor/operations/COM_DirectionalBlurOperation.cc
+++ b/source/blender/compositor/operations/COM_DirectionalBlurOperation.cc
@@ -23,13 +23,14 @@
#include "RE_pipeline.h"
+namespace blender::compositor {
+
DirectionalBlurOperation::DirectionalBlurOperation()
{
this->addInputSocket(DataType::Color);
this->addOutputSocket(DataType::Color);
- this->setComplex(true);
-
- this->setOpenCL(true);
+ flags.complex = true;
+ flags.open_cl = true;
this->m_inputProgram = nullptr;
}
@@ -66,7 +67,7 @@ void DirectionalBlurOperation::executePixel(float output[4], int x, int y, void
const int iterations = pow(2.0f, this->m_data->iter);
float col[4] = {0.0f, 0.0f, 0.0f, 0.0f};
float col2[4] = {0.0f, 0.0f, 0.0f, 0.0f};
- this->m_inputProgram->readSampled(col2, x, y, COM_PS_BILINEAR);
+ this->m_inputProgram->readSampled(col2, x, y, PixelSampler::Bilinear);
float ltx = this->m_tx;
float lty = this->m_ty;
float lsc = this->m_sc;
@@ -82,7 +83,7 @@ void DirectionalBlurOperation::executePixel(float output[4], int x, int y, void
this->m_inputProgram->readSampled(col,
cs * u + ss * v + this->m_center_x_pix,
cs * v - ss * u + this->m_center_y_pix,
- COM_PS_BILINEAR);
+ PixelSampler::Bilinear);
add_v4_v4(col2, col);
@@ -144,3 +145,5 @@ bool DirectionalBlurOperation::determineDependingAreaOfInterest(rcti * /*input*/
return NodeOperation::determineDependingAreaOfInterest(&newInput, readOperation, output);
}
+
+} // namespace blender::compositor
diff --git a/source/blender/compositor/operations/COM_DirectionalBlurOperation.h b/source/blender/compositor/operations/COM_DirectionalBlurOperation.h
index daf6bc75254..5555520462b 100644
--- a/source/blender/compositor/operations/COM_DirectionalBlurOperation.h
+++ b/source/blender/compositor/operations/COM_DirectionalBlurOperation.h
@@ -21,6 +21,8 @@
#include "COM_NodeOperation.h"
#include "COM_QualityStepHelper.h"
+namespace blender::compositor {
+
class DirectionalBlurOperation : public NodeOperation, public QualityStepHelper {
private:
SocketReader *m_inputProgram;
@@ -64,3 +66,5 @@ class DirectionalBlurOperation : public NodeOperation, public QualityStepHelper
std::list<cl_mem> *clMemToCleanUp,
std::list<cl_kernel> *clKernelsToCleanUp) override;
};
+
+} // namespace blender::compositor
diff --git a/source/blender/compositor/operations/COM_DisplaceOperation.cc b/source/blender/compositor/operations/COM_DisplaceOperation.cc
index 12c7d29a210..9f3f5cfe489 100644
--- a/source/blender/compositor/operations/COM_DisplaceOperation.cc
+++ b/source/blender/compositor/operations/COM_DisplaceOperation.cc
@@ -20,6 +20,8 @@
#include "BLI_math.h"
#include "BLI_utildefines.h"
+namespace blender::compositor {
+
DisplaceOperation::DisplaceOperation()
{
this->addInputSocket(DataType::Color);
@@ -27,7 +29,7 @@ DisplaceOperation::DisplaceOperation()
this->addInputSocket(DataType::Value);
this->addInputSocket(DataType::Value);
this->addOutputSocket(DataType::Color);
- this->setComplex(true);
+ this->flags.complex = true;
this->m_inputColorProgram = nullptr;
this->m_inputVectorProgram = nullptr;
@@ -56,7 +58,7 @@ void DisplaceOperation::executePixelSampled(float output[4],
pixelTransform(xy, uv, deriv);
if (is_zero_v2(deriv[0]) && is_zero_v2(deriv[1])) {
- this->m_inputColorProgram->readSampled(output, uv[0], uv[1], COM_PS_BILINEAR);
+ this->m_inputColorProgram->readSampled(output, uv[0], uv[1], PixelSampler::Bilinear);
}
else {
/* EWA filtering (without nearest it gets blurry with NO distortion) */
@@ -76,7 +78,7 @@ bool DisplaceOperation::read_displacement(
}
float col[4];
- m_inputVectorProgram->readSampled(col, x, y, COM_PS_BILINEAR);
+ m_inputVectorProgram->readSampled(col, x, y, PixelSampler::Bilinear);
r_u = origin[0] - col[0] * xscale;
r_v = origin[1] - col[1] * yscale;
return true;
@@ -88,9 +90,9 @@ void DisplaceOperation::pixelTransform(const float xy[2], float r_uv[2], float r
float uv[2]; /* temporary variables for derivative estimation */
int num;
- m_inputScaleXProgram->readSampled(col, xy[0], xy[1], COM_PS_NEAREST);
+ m_inputScaleXProgram->readSampled(col, xy[0], xy[1], PixelSampler::Nearest);
float xs = col[0];
- m_inputScaleYProgram->readSampled(col, xy[0], xy[1], COM_PS_NEAREST);
+ m_inputScaleYProgram->readSampled(col, xy[0], xy[1], PixelSampler::Nearest);
float ys = col[0];
/* clamp x and y displacement to triple image resolution -
* to prevent hangs from huge values mistakenly plugged in eg. z buffers */
@@ -192,3 +194,5 @@ bool DisplaceOperation::determineDependingAreaOfInterest(rcti *input,
return false;
}
+
+} // namespace blender::compositor
diff --git a/source/blender/compositor/operations/COM_DisplaceOperation.h b/source/blender/compositor/operations/COM_DisplaceOperation.h
index 368ed29ff0b..fd82692f687 100644
--- a/source/blender/compositor/operations/COM_DisplaceOperation.h
+++ b/source/blender/compositor/operations/COM_DisplaceOperation.h
@@ -20,6 +20,8 @@
#include "COM_NodeOperation.h"
+namespace blender::compositor {
+
class DisplaceOperation : public NodeOperation {
private:
/**
@@ -64,3 +66,5 @@ class DisplaceOperation : public NodeOperation {
bool read_displacement(
float x, float y, float xscale, float yscale, const float origin[2], float &r_u, float &r_v);
};
+
+} // namespace blender::compositor
diff --git a/source/blender/compositor/operations/COM_DisplaceSimpleOperation.cc b/source/blender/compositor/operations/COM_DisplaceSimpleOperation.cc
index 9d00c2cb148..f4b77f5d32c 100644
--- a/source/blender/compositor/operations/COM_DisplaceSimpleOperation.cc
+++ b/source/blender/compositor/operations/COM_DisplaceSimpleOperation.cc
@@ -20,6 +20,8 @@
#include "BLI_math.h"
#include "BLI_utildefines.h"
+namespace blender::compositor {
+
DisplaceSimpleOperation::DisplaceSimpleOperation()
{
this->addInputSocket(DataType::Color);
@@ -129,3 +131,5 @@ bool DisplaceSimpleOperation::determineDependingAreaOfInterest(rcti *input,
return false;
}
+
+} // namespace blender::compositor
diff --git a/source/blender/compositor/operations/COM_DisplaceSimpleOperation.h b/source/blender/compositor/operations/COM_DisplaceSimpleOperation.h
index 63fe569c812..15e6fcd0523 100644
--- a/source/blender/compositor/operations/COM_DisplaceSimpleOperation.h
+++ b/source/blender/compositor/operations/COM_DisplaceSimpleOperation.h
@@ -20,6 +20,8 @@
#include "COM_NodeOperation.h"
+namespace blender::compositor {
+
class DisplaceSimpleOperation : public NodeOperation {
private:
/**
@@ -58,3 +60,5 @@ class DisplaceSimpleOperation : public NodeOperation {
*/
void deinitExecution() override;
};
+
+} // namespace blender::compositor
diff --git a/source/blender/compositor/operations/COM_DistanceRGBMatteOperation.cc b/source/blender/compositor/operations/COM_DistanceRGBMatteOperation.cc
index ae024d497d6..12cb7e7d075 100644
--- a/source/blender/compositor/operations/COM_DistanceRGBMatteOperation.cc
+++ b/source/blender/compositor/operations/COM_DistanceRGBMatteOperation.cc
@@ -19,6 +19,8 @@
#include "COM_DistanceRGBMatteOperation.h"
#include "BLI_math.h"
+namespace blender::compositor {
+
DistanceRGBMatteOperation::DistanceRGBMatteOperation()
{
this->addInputSocket(DataType::Color);
@@ -90,3 +92,5 @@ void DistanceRGBMatteOperation::executePixelSampled(float output[4],
output[0] = inImage[3];
}
}
+
+} // namespace blender::compositor
diff --git a/source/blender/compositor/operations/COM_DistanceRGBMatteOperation.h b/source/blender/compositor/operations/COM_DistanceRGBMatteOperation.h
index 0593dc6b976..6fe603233b7 100644
--- a/source/blender/compositor/operations/COM_DistanceRGBMatteOperation.h
+++ b/source/blender/compositor/operations/COM_DistanceRGBMatteOperation.h
@@ -20,6 +20,8 @@
#include "COM_MixOperation.h"
+namespace blender::compositor {
+
/**
* this program converts an input color to an output value.
* it assumes we are in sRGB color space.
@@ -51,3 +53,5 @@ class DistanceRGBMatteOperation : public NodeOperation {
this->m_settings = nodeChroma;
}
};
+
+} // namespace blender::compositor
diff --git a/source/blender/compositor/operations/COM_DistanceYCCMatteOperation.cc b/source/blender/compositor/operations/COM_DistanceYCCMatteOperation.cc
index f333cc1ecd9..597545dd706 100644
--- a/source/blender/compositor/operations/COM_DistanceYCCMatteOperation.cc
+++ b/source/blender/compositor/operations/COM_DistanceYCCMatteOperation.cc
@@ -19,13 +19,12 @@
#include "COM_DistanceYCCMatteOperation.h"
#include "BLI_math.h"
-DistanceYCCMatteOperation::DistanceYCCMatteOperation()
-{
- /* pass */
-}
+namespace blender::compositor {
float DistanceYCCMatteOperation::calculateDistance(float key[4], float image[4])
{
/* only measure the second 2 values */
return len_v2v2(key + 1, image + 1);
}
+
+} // namespace blender::compositor
diff --git a/source/blender/compositor/operations/COM_DistanceYCCMatteOperation.h b/source/blender/compositor/operations/COM_DistanceYCCMatteOperation.h
index ce91e3a62ba..a87e885e5d8 100644
--- a/source/blender/compositor/operations/COM_DistanceYCCMatteOperation.h
+++ b/source/blender/compositor/operations/COM_DistanceYCCMatteOperation.h
@@ -21,6 +21,8 @@
#include "COM_DistanceRGBMatteOperation.h"
#include "COM_MixOperation.h"
+namespace blender::compositor {
+
/**
* this program converts an input color to an output value.
* it assumes we are in sRGB color space.
@@ -28,10 +30,6 @@
class DistanceYCCMatteOperation : public DistanceRGBMatteOperation {
protected:
float calculateDistance(float key[4], float image[4]) override;
-
- public:
- /**
- * Default constructor
- */
- DistanceYCCMatteOperation();
};
+
+} // namespace blender::compositor
diff --git a/source/blender/compositor/operations/COM_DotproductOperation.cc b/source/blender/compositor/operations/COM_DotproductOperation.cc
index c5b89bb7fae..07075ae1d9d 100644
--- a/source/blender/compositor/operations/COM_DotproductOperation.cc
+++ b/source/blender/compositor/operations/COM_DotproductOperation.cc
@@ -18,6 +18,8 @@
#include "COM_DotproductOperation.h"
+namespace blender::compositor {
+
DotproductOperation::DotproductOperation()
{
this->addInputSocket(DataType::Vector);
@@ -52,3 +54,5 @@ void DotproductOperation::executePixelSampled(float output[4],
this->m_input2Operation->readSampled(input2, x, y, sampler);
output[0] = -(input1[0] * input2[0] + input1[1] * input2[1] + input1[2] * input2[2]);
}
+
+} // namespace blender::compositor
diff --git a/source/blender/compositor/operations/COM_DotproductOperation.h b/source/blender/compositor/operations/COM_DotproductOperation.h
index deff3ae5896..728033bcf32 100644
--- a/source/blender/compositor/operations/COM_DotproductOperation.h
+++ b/source/blender/compositor/operations/COM_DotproductOperation.h
@@ -20,6 +20,8 @@
#include "COM_NodeOperation.h"
+namespace blender::compositor {
+
class DotproductOperation : public NodeOperation {
private:
SocketReader *m_input1Operation;
@@ -32,3 +34,5 @@ class DotproductOperation : public NodeOperation {
void initExecution() override;
void deinitExecution() override;
};
+
+} // namespace blender::compositor
diff --git a/source/blender/compositor/operations/COM_DoubleEdgeMaskOperation.cc b/source/blender/compositor/operations/COM_DoubleEdgeMaskOperation.cc
index 4c7cbb3cc7e..a3a86a6c502 100644
--- a/source/blender/compositor/operations/COM_DoubleEdgeMaskOperation.cc
+++ b/source/blender/compositor/operations/COM_DoubleEdgeMaskOperation.cc
@@ -23,6 +23,8 @@
#include "DNA_node_types.h"
#include "MEM_guardedalloc.h"
+namespace blender::compositor {
+
// this part has been copied from the double edge mask
static void do_adjacentKeepBorders(unsigned int t,
unsigned int rw,
@@ -1315,7 +1317,7 @@ DoubleEdgeMaskOperation::DoubleEdgeMaskOperation()
this->m_inputOuterMask = nullptr;
this->m_adjacentOnly = false;
this->m_keepInside = false;
- this->setComplex(true);
+ this->flags.complex = true;
}
bool DoubleEdgeMaskOperation::determineDependingAreaOfInterest(rcti * /*input*/,
@@ -1379,3 +1381,5 @@ void DoubleEdgeMaskOperation::deinitExecution()
this->m_cachedInstance = nullptr;
}
}
+
+} // namespace blender::compositor
diff --git a/source/blender/compositor/operations/COM_DoubleEdgeMaskOperation.h b/source/blender/compositor/operations/COM_DoubleEdgeMaskOperation.h
index 228c8edc53e..e956e8edc3e 100644
--- a/source/blender/compositor/operations/COM_DoubleEdgeMaskOperation.h
+++ b/source/blender/compositor/operations/COM_DoubleEdgeMaskOperation.h
@@ -20,6 +20,8 @@
#include "COM_NodeOperation.h"
+namespace blender::compositor {
+
class DoubleEdgeMaskOperation : public NodeOperation {
private:
/**
@@ -65,3 +67,5 @@ class DoubleEdgeMaskOperation : public NodeOperation {
this->m_keepInside = keepInside;
}
};
+
+} // namespace blender::compositor
diff --git a/source/blender/compositor/operations/COM_EllipseMaskOperation.cc b/source/blender/compositor/operations/COM_EllipseMaskOperation.cc
index 956b5e50edc..5a4503fecec 100644
--- a/source/blender/compositor/operations/COM_EllipseMaskOperation.cc
+++ b/source/blender/compositor/operations/COM_EllipseMaskOperation.cc
@@ -20,6 +20,8 @@
#include "BLI_math.h"
#include "DNA_node_types.h"
+namespace blender::compositor {
+
EllipseMaskOperation::EllipseMaskOperation()
{
this->addInputSocket(DataType::Value);
@@ -117,3 +119,5 @@ void EllipseMaskOperation::deinitExecution()
this->m_inputMask = nullptr;
this->m_inputValue = nullptr;
}
+
+} // namespace blender::compositor
diff --git a/source/blender/compositor/operations/COM_EllipseMaskOperation.h b/source/blender/compositor/operations/COM_EllipseMaskOperation.h
index c7d7336600d..64afe0145cf 100644
--- a/source/blender/compositor/operations/COM_EllipseMaskOperation.h
+++ b/source/blender/compositor/operations/COM_EllipseMaskOperation.h
@@ -20,6 +20,8 @@
#include "COM_NodeOperation.h"
+namespace blender::compositor {
+
class EllipseMaskOperation : public NodeOperation {
private:
/**
@@ -63,3 +65,5 @@ class EllipseMaskOperation : public NodeOperation {
this->m_maskType = maskType;
}
};
+
+} // namespace blender::compositor
diff --git a/source/blender/compositor/operations/COM_FastGaussianBlurOperation.cc b/source/blender/compositor/operations/COM_FastGaussianBlurOperation.cc
index 4dded61fba5..2be6e4d1be7 100644
--- a/source/blender/compositor/operations/COM_FastGaussianBlurOperation.cc
+++ b/source/blender/compositor/operations/COM_FastGaussianBlurOperation.cc
@@ -22,6 +22,8 @@
#include "COM_FastGaussianBlurOperation.h"
#include "MEM_guardedalloc.h"
+namespace blender::compositor {
+
FastGaussianBlurOperation::FastGaussianBlurOperation() : BlurBaseOperation(DataType::Color)
{
this->m_iirgaus = nullptr;
@@ -88,18 +90,18 @@ void *FastGaussianBlurOperation::initializeTileData(rcti *rect)
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++) {
+ for (c = 0; c < COM_DATA_TYPE_COLOR_CHANNELS; c++) {
IIR_gauss(copy, this->m_sx, c, 3);
}
}
else {
if (this->m_sx > 0.0f) {
- for (c = 0; c < COM_NUM_CHANNELS_COLOR; c++) {
+ for (c = 0; c < COM_DATA_TYPE_COLOR_CHANNELS; c++) {
IIR_gauss(copy, this->m_sx, c, 1);
}
}
if (this->m_sy > 0.0f) {
- for (c = 0; c < COM_NUM_CHANNELS_COLOR; c++) {
+ for (c = 0; c < COM_DATA_TYPE_COLOR_CHANNELS; c++) {
IIR_gauss(copy, this->m_sy, c, 2);
}
}
@@ -264,7 +266,7 @@ FastGaussianBlurValueOperation::FastGaussianBlurValueOperation()
this->m_inputprogram = nullptr;
this->m_sigma = 1.0f;
this->m_overlay = 0;
- setComplex(true);
+ flags.complex = true;
}
void FastGaussianBlurValueOperation::executePixel(float output[4], int x, int y, void *data)
@@ -317,7 +319,7 @@ void *FastGaussianBlurValueOperation::initializeTileData(rcti *rect)
float *src = newBuf->getBuffer();
float *dst = copy->getBuffer();
for (int i = copy->getWidth() * copy->getHeight(); i != 0;
- i--, src += COM_NUM_CHANNELS_VALUE, dst += COM_NUM_CHANNELS_VALUE) {
+ i--, src += COM_DATA_TYPE_VALUE_CHANNELS, dst += COM_DATA_TYPE_VALUE_CHANNELS) {
if (*src < *dst) {
*dst = *src;
}
@@ -327,7 +329,7 @@ void *FastGaussianBlurValueOperation::initializeTileData(rcti *rect)
float *src = newBuf->getBuffer();
float *dst = copy->getBuffer();
for (int i = copy->getWidth() * copy->getHeight(); i != 0;
- i--, src += COM_NUM_CHANNELS_VALUE, dst += COM_NUM_CHANNELS_VALUE) {
+ i--, src += COM_DATA_TYPE_VALUE_CHANNELS, dst += COM_DATA_TYPE_VALUE_CHANNELS) {
if (*src > *dst) {
*dst = *src;
}
@@ -341,3 +343,5 @@ void *FastGaussianBlurValueOperation::initializeTileData(rcti *rect)
unlockMutex();
return this->m_iirgaus;
}
+
+} // namespace blender::compositor
diff --git a/source/blender/compositor/operations/COM_FastGaussianBlurOperation.h b/source/blender/compositor/operations/COM_FastGaussianBlurOperation.h
index c710baaaff8..c25afe6c4a4 100644
--- a/source/blender/compositor/operations/COM_FastGaussianBlurOperation.h
+++ b/source/blender/compositor/operations/COM_FastGaussianBlurOperation.h
@@ -21,6 +21,8 @@
#include "COM_BlurBaseOperation.h"
#include "DNA_node_types.h"
+namespace blender::compositor {
+
class FastGaussianBlurOperation : public BlurBaseOperation {
private:
float m_sx;
@@ -79,3 +81,5 @@ class FastGaussianBlurValueOperation : public NodeOperation {
this->m_overlay = overlay;
}
};
+
+} // namespace blender::compositor
diff --git a/source/blender/compositor/operations/COM_FlipOperation.cc b/source/blender/compositor/operations/COM_FlipOperation.cc
index 4837766b5eb..8afbec4ddbe 100644
--- a/source/blender/compositor/operations/COM_FlipOperation.cc
+++ b/source/blender/compositor/operations/COM_FlipOperation.cc
@@ -18,6 +18,8 @@
#include "COM_FlipOperation.h"
+namespace blender::compositor {
+
FlipOperation::FlipOperation()
{
this->addInputSocket(DataType::Color);
@@ -72,3 +74,5 @@ bool FlipOperation::determineDependingAreaOfInterest(rcti *input,
return NodeOperation::determineDependingAreaOfInterest(&newInput, readOperation, output);
}
+
+} // namespace blender::compositor
diff --git a/source/blender/compositor/operations/COM_FlipOperation.h b/source/blender/compositor/operations/COM_FlipOperation.h
index e571e57913f..f26d587fde6 100644
--- a/source/blender/compositor/operations/COM_FlipOperation.h
+++ b/source/blender/compositor/operations/COM_FlipOperation.h
@@ -20,6 +20,8 @@
#include "COM_NodeOperation.h"
+namespace blender::compositor {
+
class FlipOperation : public NodeOperation {
private:
SocketReader *m_inputOperation;
@@ -44,3 +46,5 @@ class FlipOperation : public NodeOperation {
this->m_flipY = flipY;
}
};
+
+} // namespace blender::compositor
diff --git a/source/blender/compositor/operations/COM_GammaCorrectOperation.cc b/source/blender/compositor/operations/COM_GammaCorrectOperation.cc
index 51c033498ef..16b79fddd06 100644
--- a/source/blender/compositor/operations/COM_GammaCorrectOperation.cc
+++ b/source/blender/compositor/operations/COM_GammaCorrectOperation.cc
@@ -19,6 +19,8 @@
#include "COM_GammaCorrectOperation.h"
#include "BLI_math.h"
+namespace blender::compositor {
+
GammaCorrectOperation::GammaCorrectOperation()
{
this->addInputSocket(DataType::Color);
@@ -102,3 +104,5 @@ void GammaUncorrectOperation::deinitExecution()
{
this->m_inputProgram = nullptr;
}
+
+} // namespace blender::compositor
diff --git a/source/blender/compositor/operations/COM_GammaCorrectOperation.h b/source/blender/compositor/operations/COM_GammaCorrectOperation.h
index 81724581f55..ac3d45b94b1 100644
--- a/source/blender/compositor/operations/COM_GammaCorrectOperation.h
+++ b/source/blender/compositor/operations/COM_GammaCorrectOperation.h
@@ -20,6 +20,8 @@
#include "COM_NodeOperation.h"
+namespace blender::compositor {
+
class GammaCorrectOperation : public NodeOperation {
private:
/**
@@ -71,3 +73,5 @@ class GammaUncorrectOperation : public NodeOperation {
*/
void deinitExecution() override;
};
+
+} // namespace blender::compositor
diff --git a/source/blender/compositor/operations/COM_GammaOperation.cc b/source/blender/compositor/operations/COM_GammaOperation.cc
index 327c5c24929..343e335070a 100644
--- a/source/blender/compositor/operations/COM_GammaOperation.cc
+++ b/source/blender/compositor/operations/COM_GammaOperation.cc
@@ -19,6 +19,8 @@
#include "COM_GammaOperation.h"
#include "BLI_math.h"
+namespace blender::compositor {
+
GammaOperation::GammaOperation()
{
this->addInputSocket(DataType::Color);
@@ -54,3 +56,5 @@ void GammaOperation::deinitExecution()
this->m_inputProgram = nullptr;
this->m_inputGammaProgram = nullptr;
}
+
+} // namespace blender::compositor
diff --git a/source/blender/compositor/operations/COM_GammaOperation.h b/source/blender/compositor/operations/COM_GammaOperation.h
index c18f3bc3688..034046106d6 100644
--- a/source/blender/compositor/operations/COM_GammaOperation.h
+++ b/source/blender/compositor/operations/COM_GammaOperation.h
@@ -20,6 +20,8 @@
#include "COM_NodeOperation.h"
+namespace blender::compositor {
+
class GammaOperation : public NodeOperation {
private:
/**
@@ -46,3 +48,5 @@ class GammaOperation : public NodeOperation {
*/
void deinitExecution() override;
};
+
+} // namespace blender::compositor
diff --git a/source/blender/compositor/operations/COM_GaussianAlphaXBlurOperation.cc b/source/blender/compositor/operations/COM_GaussianAlphaXBlurOperation.cc
index 1f03bb8d9cb..7ca5dc4ca76 100644
--- a/source/blender/compositor/operations/COM_GaussianAlphaXBlurOperation.cc
+++ b/source/blender/compositor/operations/COM_GaussianAlphaXBlurOperation.cc
@@ -22,6 +22,8 @@
#include "RE_pipeline.h"
+namespace blender::compositor {
+
GaussianAlphaXBlurOperation::GaussianAlphaXBlurOperation() : BlurBaseOperation(DataType::Value)
{
this->m_gausstab = nullptr;
@@ -190,3 +192,5 @@ bool GaussianAlphaXBlurOperation::determineDependingAreaOfInterest(
return NodeOperation::determineDependingAreaOfInterest(&newInput, readOperation, output);
}
}
+
+} // namespace blender::compositor
diff --git a/source/blender/compositor/operations/COM_GaussianAlphaXBlurOperation.h b/source/blender/compositor/operations/COM_GaussianAlphaXBlurOperation.h
index 51ca8359067..949956fae04 100644
--- a/source/blender/compositor/operations/COM_GaussianAlphaXBlurOperation.h
+++ b/source/blender/compositor/operations/COM_GaussianAlphaXBlurOperation.h
@@ -21,6 +21,8 @@
#include "COM_BlurBaseOperation.h"
#include "COM_NodeOperation.h"
+namespace blender::compositor {
+
class GaussianAlphaXBlurOperation : public BlurBaseOperation {
private:
float *m_gausstab;
@@ -65,3 +67,5 @@ class GaussianAlphaXBlurOperation : public BlurBaseOperation {
this->m_falloff = falloff;
}
};
+
+} // namespace blender::compositor
diff --git a/source/blender/compositor/operations/COM_GaussianAlphaYBlurOperation.cc b/source/blender/compositor/operations/COM_GaussianAlphaYBlurOperation.cc
index de35c164fc7..d2385a972dd 100644
--- a/source/blender/compositor/operations/COM_GaussianAlphaYBlurOperation.cc
+++ b/source/blender/compositor/operations/COM_GaussianAlphaYBlurOperation.cc
@@ -22,6 +22,8 @@
#include "RE_pipeline.h"
+namespace blender::compositor {
+
GaussianAlphaYBlurOperation::GaussianAlphaYBlurOperation() : BlurBaseOperation(DataType::Value)
{
this->m_gausstab = nullptr;
@@ -189,3 +191,5 @@ bool GaussianAlphaYBlurOperation::determineDependingAreaOfInterest(
return NodeOperation::determineDependingAreaOfInterest(&newInput, readOperation, output);
}
}
+
+} // namespace blender::compositor
diff --git a/source/blender/compositor/operations/COM_GaussianAlphaYBlurOperation.h b/source/blender/compositor/operations/COM_GaussianAlphaYBlurOperation.h
index edd60acf2fc..d25770386c4 100644
--- a/source/blender/compositor/operations/COM_GaussianAlphaYBlurOperation.h
+++ b/source/blender/compositor/operations/COM_GaussianAlphaYBlurOperation.h
@@ -21,6 +21,8 @@
#include "COM_BlurBaseOperation.h"
#include "COM_NodeOperation.h"
+namespace blender::compositor {
+
class GaussianAlphaYBlurOperation : public BlurBaseOperation {
private:
float *m_gausstab;
@@ -65,3 +67,5 @@ class GaussianAlphaYBlurOperation : public BlurBaseOperation {
this->m_falloff = falloff;
}
};
+
+} // namespace blender::compositor
diff --git a/source/blender/compositor/operations/COM_GaussianBokehBlurOperation.cc b/source/blender/compositor/operations/COM_GaussianBokehBlurOperation.cc
index 73b0914c086..b2c65ff2c96 100644
--- a/source/blender/compositor/operations/COM_GaussianBokehBlurOperation.cc
+++ b/source/blender/compositor/operations/COM_GaussianBokehBlurOperation.cc
@@ -22,6 +22,8 @@
#include "RE_pipeline.h"
+namespace blender::compositor {
+
GaussianBokehBlurOperation::GaussianBokehBlurOperation() : BlurBaseOperation(DataType::Color)
{
this->m_gausstab = nullptr;
@@ -303,7 +305,7 @@ void GaussianBlurReferenceOperation::executePixel(float output[4], int x, int y,
int minyr = y - refrady < 0 ? -y : -refrady;
int maxyr = y + refrady > imgy ? imgy - y : refrady;
- float *srcd = buffer + COM_NUM_CHANNELS_COLOR * ((y + minyr) * imgx + x + minxr);
+ float *srcd = buffer + COM_DATA_TYPE_COLOR_CHANNELS * ((y + minyr) * imgx + x + minxr);
gausstabx = m_maintabs[refradx - 1];
gausstabcentx = gausstabx + refradx;
@@ -311,9 +313,9 @@ void GaussianBlurReferenceOperation::executePixel(float output[4], int x, int y,
gausstabcenty = gausstaby + refrady;
sum = gval = rval = bval = aval = 0.0f;
- for (i = minyr; i < maxyr; i++, srcd += COM_NUM_CHANNELS_COLOR * imgx) {
+ for (i = minyr; i < maxyr; i++, srcd += COM_DATA_TYPE_COLOR_CHANNELS * imgx) {
src = srcd;
- for (j = minxr; j < maxxr; j++, src += COM_NUM_CHANNELS_COLOR) {
+ for (j = minxr; j < maxxr; j++, src += COM_DATA_TYPE_COLOR_CHANNELS) {
val = gausstabcenty[i] * gausstabcentx[j];
sum += val;
@@ -360,3 +362,5 @@ bool GaussianBlurReferenceOperation::determineDependingAreaOfInterest(
newInput.ymin = input->ymin - addy;
return NodeOperation::determineDependingAreaOfInterest(&newInput, readOperation, output);
}
+
+} // namespace blender::compositor
diff --git a/source/blender/compositor/operations/COM_GaussianBokehBlurOperation.h b/source/blender/compositor/operations/COM_GaussianBokehBlurOperation.h
index 0eb8379dfc8..59ba3d06619 100644
--- a/source/blender/compositor/operations/COM_GaussianBokehBlurOperation.h
+++ b/source/blender/compositor/operations/COM_GaussianBokehBlurOperation.h
@@ -22,6 +22,8 @@
#include "COM_NodeOperation.h"
#include "COM_QualityStepHelper.h"
+namespace blender::compositor {
+
class GaussianBokehBlurOperation : public BlurBaseOperation {
private:
float *m_gausstab;
@@ -75,3 +77,5 @@ class GaussianBlurReferenceOperation : public BlurBaseOperation {
ReadBufferOperation *readOperation,
rcti *output) override;
};
+
+} // namespace blender::compositor
diff --git a/source/blender/compositor/operations/COM_GaussianXBlurOperation.cc b/source/blender/compositor/operations/COM_GaussianXBlurOperation.cc
index 43bf961cfc4..4b46cfc8776 100644
--- a/source/blender/compositor/operations/COM_GaussianXBlurOperation.cc
+++ b/source/blender/compositor/operations/COM_GaussianXBlurOperation.cc
@@ -23,6 +23,8 @@
#include "RE_pipeline.h"
+namespace blender::compositor {
+
GaussianXBlurOperation::GaussianXBlurOperation() : BlurBaseOperation(DataType::Color)
{
this->m_gausstab = nullptr;
@@ -205,3 +207,5 @@ bool GaussianXBlurOperation::determineDependingAreaOfInterest(rcti *input,
return NodeOperation::determineDependingAreaOfInterest(&newInput, readOperation, output);
}
}
+
+} // namespace blender::compositor
diff --git a/source/blender/compositor/operations/COM_GaussianXBlurOperation.h b/source/blender/compositor/operations/COM_GaussianXBlurOperation.h
index 44e6044e59b..15277f0a42d 100644
--- a/source/blender/compositor/operations/COM_GaussianXBlurOperation.h
+++ b/source/blender/compositor/operations/COM_GaussianXBlurOperation.h
@@ -21,6 +21,8 @@
#include "COM_BlurBaseOperation.h"
#include "COM_NodeOperation.h"
+namespace blender::compositor {
+
class GaussianXBlurOperation : public BlurBaseOperation {
private:
float *m_gausstab;
@@ -62,6 +64,8 @@ class GaussianXBlurOperation : public BlurBaseOperation {
void checkOpenCL()
{
- this->setOpenCL(m_data.sizex >= 128);
+ flags.open_cl = (m_data.sizex >= 128);
}
};
+
+} // namespace blender::compositor
diff --git a/source/blender/compositor/operations/COM_GaussianYBlurOperation.cc b/source/blender/compositor/operations/COM_GaussianYBlurOperation.cc
index 1e853dfb8f9..590ac5faa6a 100644
--- a/source/blender/compositor/operations/COM_GaussianYBlurOperation.cc
+++ b/source/blender/compositor/operations/COM_GaussianYBlurOperation.cc
@@ -23,6 +23,8 @@
#include "RE_pipeline.h"
+namespace blender::compositor {
+
GaussianYBlurOperation::GaussianYBlurOperation() : BlurBaseOperation(DataType::Color)
{
this->m_gausstab = nullptr;
@@ -205,3 +207,5 @@ bool GaussianYBlurOperation::determineDependingAreaOfInterest(rcti *input,
return NodeOperation::determineDependingAreaOfInterest(&newInput, readOperation, output);
}
}
+
+} // namespace blender::compositor
diff --git a/source/blender/compositor/operations/COM_GaussianYBlurOperation.h b/source/blender/compositor/operations/COM_GaussianYBlurOperation.h
index a0abb0dd050..56d40849ba4 100644
--- a/source/blender/compositor/operations/COM_GaussianYBlurOperation.h
+++ b/source/blender/compositor/operations/COM_GaussianYBlurOperation.h
@@ -21,6 +21,8 @@
#include "COM_BlurBaseOperation.h"
#include "COM_NodeOperation.h"
+namespace blender::compositor {
+
class GaussianYBlurOperation : public BlurBaseOperation {
private:
float *m_gausstab;
@@ -62,6 +64,8 @@ class GaussianYBlurOperation : public BlurBaseOperation {
void checkOpenCL()
{
- this->setOpenCL(m_data.sizex >= 128);
+ flags.open_cl = (m_data.sizex >= 128);
}
};
+
+} // namespace blender::compositor
diff --git a/source/blender/compositor/operations/COM_GlareBaseOperation.cc b/source/blender/compositor/operations/COM_GlareBaseOperation.cc
index cdf64ed8b5a..90755d9f27a 100644
--- a/source/blender/compositor/operations/COM_GlareBaseOperation.cc
+++ b/source/blender/compositor/operations/COM_GlareBaseOperation.cc
@@ -19,6 +19,8 @@
#include "COM_GlareBaseOperation.h"
#include "BLI_math.h"
+namespace blender::compositor {
+
GlareBaseOperation::GlareBaseOperation()
{
this->addInputSocket(DataType::Color);
@@ -66,3 +68,5 @@ bool GlareBaseOperation::determineDependingAreaOfInterest(rcti * /*input*/,
newInput.ymin = 0;
return NodeOperation::determineDependingAreaOfInterest(&newInput, readOperation, output);
}
+
+} // namespace blender::compositor
diff --git a/source/blender/compositor/operations/COM_GlareBaseOperation.h b/source/blender/compositor/operations/COM_GlareBaseOperation.h
index 563877b734c..7ae15595e3b 100644
--- a/source/blender/compositor/operations/COM_GlareBaseOperation.h
+++ b/source/blender/compositor/operations/COM_GlareBaseOperation.h
@@ -21,6 +21,8 @@
#include "COM_SingleThreadedOperation.h"
#include "DNA_node_types.h"
+namespace blender::compositor {
+
/* utility functions used by glare, tonemap and lens distortion */
/* soms macros for color handling */
typedef float fRGB[4];
@@ -73,3 +75,5 @@ class GlareBaseOperation : public SingleThreadedOperation {
MemoryBuffer *createMemoryBuffer(rcti *rect) override;
};
+
+} // namespace blender::compositor
diff --git a/source/blender/compositor/operations/COM_GlareFogGlowOperation.cc b/source/blender/compositor/operations/COM_GlareFogGlowOperation.cc
index 23dfc95f9e3..1c1eaebd331 100644
--- a/source/blender/compositor/operations/COM_GlareFogGlowOperation.cc
+++ b/source/blender/compositor/operations/COM_GlareFogGlowOperation.cc
@@ -19,6 +19,8 @@
#include "COM_GlareFogGlowOperation.h"
#include "MEM_guardedalloc.h"
+namespace blender::compositor {
+
/*
* 2D Fast Hartley Transform, used for convolution
*/
@@ -271,7 +273,7 @@ static void convolve(float *dst, MemoryBuffer *in1, MemoryBuffer *in2)
MemoryBuffer *rdst = new MemoryBuffer(DataType::Color, in1->get_rect());
memset(rdst->getBuffer(),
0,
- rdst->getWidth() * rdst->getHeight() * COM_NUM_CHANNELS_COLOR * sizeof(float));
+ rdst->getWidth() * rdst->getHeight() * COM_DATA_TYPE_COLOR_CHANNELS * sizeof(float));
// convolution result width & height
w2 = 2 * kernelWidth - 1;
@@ -287,7 +289,7 @@ static void convolve(float *dst, MemoryBuffer *in1, MemoryBuffer *in2)
// normalize convolutor
wt[0] = wt[1] = wt[2] = 0.0f;
for (y = 0; y < kernelHeight; y++) {
- colp = (fRGB *)&kernelBuffer[y * kernelWidth * COM_NUM_CHANNELS_COLOR];
+ colp = (fRGB *)&kernelBuffer[y * kernelWidth * COM_DATA_TYPE_COLOR_CHANNELS];
for (x = 0; x < kernelWidth; x++) {
add_v3_v3(wt, colp[x]);
}
@@ -302,7 +304,7 @@ static void convolve(float *dst, MemoryBuffer *in1, MemoryBuffer *in2)
wt[2] = 1.0f / wt[2];
}
for (y = 0; y < kernelHeight; y++) {
- colp = (fRGB *)&kernelBuffer[y * kernelWidth * COM_NUM_CHANNELS_COLOR];
+ colp = (fRGB *)&kernelBuffer[y * kernelWidth * COM_DATA_TYPE_COLOR_CHANNELS];
for (x = 0; x < kernelWidth; x++) {
mul_v3_v3(colp[x], wt);
}
@@ -336,7 +338,7 @@ static void convolve(float *dst, MemoryBuffer *in1, MemoryBuffer *in2)
// in2, channel ch -> data1
for (y = 0; y < kernelHeight; y++) {
fp = &data1ch[y * w2];
- colp = (fRGB *)&kernelBuffer[y * kernelWidth * COM_NUM_CHANNELS_COLOR];
+ colp = (fRGB *)&kernelBuffer[y * kernelWidth * COM_DATA_TYPE_COLOR_CHANNELS];
for (x = 0; x < kernelWidth; x++) {
fp[x] = colp[x][ch];
}
@@ -351,7 +353,7 @@ static void convolve(float *dst, MemoryBuffer *in1, MemoryBuffer *in2)
continue;
}
fp = &data2[y * w2];
- colp = (fRGB *)&imageBuffer[yy * imageWidth * COM_NUM_CHANNELS_COLOR];
+ colp = (fRGB *)&imageBuffer[yy * imageWidth * COM_DATA_TYPE_COLOR_CHANNELS];
for (x = 0; x < xbsz; x++) {
int xx = xbl * xbsz + x;
if (xx >= imageWidth) {
@@ -381,7 +383,7 @@ static void convolve(float *dst, MemoryBuffer *in1, MemoryBuffer *in2)
continue;
}
fp = &data2[y * w2];
- colp = (fRGB *)&rdst->getBuffer()[yy * imageWidth * COM_NUM_CHANNELS_COLOR];
+ colp = (fRGB *)&rdst->getBuffer()[yy * imageWidth * COM_DATA_TYPE_COLOR_CHANNELS];
for (x = 0; x < (int)w2; x++) {
const int xx = xbl * xbsz + x - hw;
if ((xx < 0) || (xx >= imageWidth)) {
@@ -397,8 +399,9 @@ static void convolve(float *dst, MemoryBuffer *in1, MemoryBuffer *in2)
MEM_freeN(data2);
MEM_freeN(data1);
- memcpy(
- dst, rdst->getBuffer(), sizeof(float) * imageWidth * imageHeight * COM_NUM_CHANNELS_COLOR);
+ memcpy(dst,
+ rdst->getBuffer(),
+ sizeof(float) * imageWidth * imageHeight * COM_DATA_TYPE_COLOR_CHANNELS);
delete (rdst);
}
@@ -442,3 +445,5 @@ void GlareFogGlowOperation::generateGlare(float *data,
convolve(data, inputTile, ckrn);
delete ckrn;
}
+
+} // namespace blender::compositor
diff --git a/source/blender/compositor/operations/COM_GlareFogGlowOperation.h b/source/blender/compositor/operations/COM_GlareFogGlowOperation.h
index 844600527ee..5701f76ab13 100644
--- a/source/blender/compositor/operations/COM_GlareFogGlowOperation.h
+++ b/source/blender/compositor/operations/COM_GlareFogGlowOperation.h
@@ -22,6 +22,8 @@
#include "COM_NodeOperation.h"
#include "DNA_node_types.h"
+namespace blender::compositor {
+
class GlareFogGlowOperation : public GlareBaseOperation {
public:
GlareFogGlowOperation() : GlareBaseOperation()
@@ -31,3 +33,5 @@ class GlareFogGlowOperation : public GlareBaseOperation {
protected:
void generateGlare(float *data, MemoryBuffer *inputTile, NodeGlare *settings) override;
};
+
+} // namespace blender::compositor
diff --git a/source/blender/compositor/operations/COM_GlareGhostOperation.cc b/source/blender/compositor/operations/COM_GlareGhostOperation.cc
index a4cd6dc60c1..22c8767632e 100644
--- a/source/blender/compositor/operations/COM_GlareGhostOperation.cc
+++ b/source/blender/compositor/operations/COM_GlareGhostOperation.cc
@@ -20,6 +20,8 @@
#include "BLI_math.h"
#include "COM_FastGaussianBlurOperation.h"
+namespace blender::compositor {
+
static float smoothMask(float x, float y)
{
float t;
@@ -123,7 +125,7 @@ void GlareGhostOperation::generateGlare(float *data, MemoryBuffer *inputTile, No
memset(tbuf1.getBuffer(),
0,
- tbuf1.getWidth() * tbuf1.getHeight() * COM_NUM_CHANNELS_COLOR * sizeof(float));
+ tbuf1.getWidth() * tbuf1.getHeight() * COM_DATA_TYPE_COLOR_CHANNELS * sizeof(float));
for (n = 1; n < settings->iter && (!breaked); n++) {
for (y = 0; y < gbuf.getHeight() && (!breaked); y++) {
v = ((float)y + 0.5f) / (float)gbuf.getHeight();
@@ -147,9 +149,11 @@ void GlareGhostOperation::generateGlare(float *data, MemoryBuffer *inputTile, No
}
memcpy(gbuf.getBuffer(),
tbuf1.getBuffer(),
- tbuf1.getWidth() * tbuf1.getHeight() * COM_NUM_CHANNELS_COLOR * sizeof(float));
+ tbuf1.getWidth() * tbuf1.getHeight() * COM_DATA_TYPE_COLOR_CHANNELS * sizeof(float));
}
memcpy(data,
gbuf.getBuffer(),
- gbuf.getWidth() * gbuf.getHeight() * COM_NUM_CHANNELS_COLOR * sizeof(float));
+ gbuf.getWidth() * gbuf.getHeight() * COM_DATA_TYPE_COLOR_CHANNELS * sizeof(float));
}
+
+} // namespace blender::compositor
diff --git a/source/blender/compositor/operations/COM_GlareGhostOperation.h b/source/blender/compositor/operations/COM_GlareGhostOperation.h
index 1b6bf3b2603..60256d8e0ef 100644
--- a/source/blender/compositor/operations/COM_GlareGhostOperation.h
+++ b/source/blender/compositor/operations/COM_GlareGhostOperation.h
@@ -22,6 +22,8 @@
#include "COM_NodeOperation.h"
#include "DNA_node_types.h"
+namespace blender::compositor {
+
class GlareGhostOperation : public GlareBaseOperation {
public:
GlareGhostOperation() : GlareBaseOperation()
@@ -31,3 +33,5 @@ class GlareGhostOperation : public GlareBaseOperation {
protected:
void generateGlare(float *data, MemoryBuffer *inputTile, NodeGlare *settings) override;
};
+
+} // namespace blender::compositor
diff --git a/source/blender/compositor/operations/COM_GlareSimpleStarOperation.cc b/source/blender/compositor/operations/COM_GlareSimpleStarOperation.cc
index a2cecb7e171..cc24a50a307 100644
--- a/source/blender/compositor/operations/COM_GlareSimpleStarOperation.cc
+++ b/source/blender/compositor/operations/COM_GlareSimpleStarOperation.cc
@@ -18,6 +18,8 @@
#include "COM_GlareSimpleStarOperation.h"
+namespace blender::compositor {
+
void GlareSimpleStarOperation::generateGlare(float *data,
MemoryBuffer *inputTile,
NodeGlare *settings)
@@ -97,3 +99,5 @@ void GlareSimpleStarOperation::generateGlare(float *data,
data[i] = tbuf1.getBuffer()[i] + tbuf2.getBuffer()[i];
}
}
+
+} // namespace blender::compositor
diff --git a/source/blender/compositor/operations/COM_GlareSimpleStarOperation.h b/source/blender/compositor/operations/COM_GlareSimpleStarOperation.h
index ab92e0019fa..4a074f53e7b 100644
--- a/source/blender/compositor/operations/COM_GlareSimpleStarOperation.h
+++ b/source/blender/compositor/operations/COM_GlareSimpleStarOperation.h
@@ -22,6 +22,8 @@
#include "COM_NodeOperation.h"
#include "DNA_node_types.h"
+namespace blender::compositor {
+
class GlareSimpleStarOperation : public GlareBaseOperation {
public:
GlareSimpleStarOperation() : GlareBaseOperation()
@@ -31,3 +33,5 @@ class GlareSimpleStarOperation : public GlareBaseOperation {
protected:
void generateGlare(float *data, MemoryBuffer *inputTile, NodeGlare *settings) override;
};
+
+} // namespace blender::compositor
diff --git a/source/blender/compositor/operations/COM_GlareStreaksOperation.cc b/source/blender/compositor/operations/COM_GlareStreaksOperation.cc
index 0ea277881da..0af4eb43624 100644
--- a/source/blender/compositor/operations/COM_GlareStreaksOperation.cc
+++ b/source/blender/compositor/operations/COM_GlareStreaksOperation.cc
@@ -19,6 +19,8 @@
#include "COM_GlareStreaksOperation.h"
#include "BLI_math.h"
+namespace blender::compositor {
+
void GlareStreaksOperation::generateGlare(float *data,
MemoryBuffer *inputTile,
NodeGlare *settings)
@@ -97,3 +99,5 @@ void GlareStreaksOperation::generateGlare(float *data,
nump++;
}
}
+
+} // namespace blender::compositor
diff --git a/source/blender/compositor/operations/COM_GlareStreaksOperation.h b/source/blender/compositor/operations/COM_GlareStreaksOperation.h
index 833dbcfbb95..487c910960a 100644
--- a/source/blender/compositor/operations/COM_GlareStreaksOperation.h
+++ b/source/blender/compositor/operations/COM_GlareStreaksOperation.h
@@ -22,6 +22,8 @@
#include "COM_NodeOperation.h"
#include "DNA_node_types.h"
+namespace blender::compositor {
+
class GlareStreaksOperation : public GlareBaseOperation {
public:
GlareStreaksOperation() : GlareBaseOperation()
@@ -31,3 +33,5 @@ class GlareStreaksOperation : public GlareBaseOperation {
protected:
void generateGlare(float *data, MemoryBuffer *inputTile, NodeGlare *settings) override;
};
+
+} // namespace blender::compositor
diff --git a/source/blender/compositor/operations/COM_GlareThresholdOperation.cc b/source/blender/compositor/operations/COM_GlareThresholdOperation.cc
index 984b433469a..1d3402f5b7b 100644
--- a/source/blender/compositor/operations/COM_GlareThresholdOperation.cc
+++ b/source/blender/compositor/operations/COM_GlareThresholdOperation.cc
@@ -21,9 +21,11 @@
#include "IMB_colormanagement.h"
+namespace blender::compositor {
+
GlareThresholdOperation::GlareThresholdOperation()
{
- this->addInputSocket(DataType::Color, COM_SC_FIT);
+ this->addInputSocket(DataType::Color, ResizeMode::FitAny);
this->addOutputSocket(DataType::Color);
this->m_inputProgram = nullptr;
}
@@ -67,3 +69,5 @@ void GlareThresholdOperation::deinitExecution()
{
this->m_inputProgram = nullptr;
}
+
+} // namespace blender::compositor
diff --git a/source/blender/compositor/operations/COM_GlareThresholdOperation.h b/source/blender/compositor/operations/COM_GlareThresholdOperation.h
index 34df10a0f81..a6e971dada7 100644
--- a/source/blender/compositor/operations/COM_GlareThresholdOperation.h
+++ b/source/blender/compositor/operations/COM_GlareThresholdOperation.h
@@ -21,6 +21,8 @@
#include "COM_NodeOperation.h"
#include "DNA_light_types.h"
+namespace blender::compositor {
+
class GlareThresholdOperation : public NodeOperation {
private:
/**
@@ -59,3 +61,5 @@ class GlareThresholdOperation : public NodeOperation {
void determineResolution(unsigned int resolution[2],
unsigned int preferredResolution[2]) override;
};
+
+} // namespace blender::compositor
diff --git a/source/blender/compositor/operations/COM_HueSaturationValueCorrectOperation.cc b/source/blender/compositor/operations/COM_HueSaturationValueCorrectOperation.cc
index 0ef15b2b3d7..e341a88ff71 100644
--- a/source/blender/compositor/operations/COM_HueSaturationValueCorrectOperation.cc
+++ b/source/blender/compositor/operations/COM_HueSaturationValueCorrectOperation.cc
@@ -22,6 +22,8 @@
#include "BKE_colortools.h"
+namespace blender::compositor {
+
HueSaturationValueCorrectOperation::HueSaturationValueCorrectOperation()
{
this->addInputSocket(DataType::Color);
@@ -70,3 +72,5 @@ void HueSaturationValueCorrectOperation::deinitExecution()
CurveBaseOperation::deinitExecution();
this->m_inputProgram = nullptr;
}
+
+} // namespace blender::compositor
diff --git a/source/blender/compositor/operations/COM_HueSaturationValueCorrectOperation.h b/source/blender/compositor/operations/COM_HueSaturationValueCorrectOperation.h
index 79eb40bbf60..703b2894bdb 100644
--- a/source/blender/compositor/operations/COM_HueSaturationValueCorrectOperation.h
+++ b/source/blender/compositor/operations/COM_HueSaturationValueCorrectOperation.h
@@ -21,6 +21,8 @@
#include "COM_CurveBaseOperation.h"
#include "COM_NodeOperation.h"
+namespace blender::compositor {
+
class HueSaturationValueCorrectOperation : public CurveBaseOperation {
private:
/**
@@ -46,3 +48,5 @@ class HueSaturationValueCorrectOperation : public CurveBaseOperation {
*/
void deinitExecution() override;
};
+
+} // namespace blender::compositor
diff --git a/source/blender/compositor/operations/COM_IDMaskOperation.cc b/source/blender/compositor/operations/COM_IDMaskOperation.cc
index 8757908e354..1bb247e9bc5 100644
--- a/source/blender/compositor/operations/COM_IDMaskOperation.cc
+++ b/source/blender/compositor/operations/COM_IDMaskOperation.cc
@@ -18,11 +18,13 @@
#include "COM_IDMaskOperation.h"
+namespace blender::compositor {
+
IDMaskOperation::IDMaskOperation()
{
this->addInputSocket(DataType::Value);
this->addOutputSocket(DataType::Value);
- this->setComplex(true);
+ this->flags.complex = true;
}
void *IDMaskOperation::initializeTileData(rcti *rect)
@@ -39,3 +41,5 @@ void IDMaskOperation::executePixel(float output[4], int x, int y, void *data)
int buffer_index = (y * buffer_width + x);
output[0] = (roundf(buffer[buffer_index]) == this->m_objectIndex) ? 1.0f : 0.0f;
}
+
+} // namespace blender::compositor
diff --git a/source/blender/compositor/operations/COM_IDMaskOperation.h b/source/blender/compositor/operations/COM_IDMaskOperation.h
index 9a8d553b184..79b7e53b67c 100644
--- a/source/blender/compositor/operations/COM_IDMaskOperation.h
+++ b/source/blender/compositor/operations/COM_IDMaskOperation.h
@@ -20,6 +20,8 @@
#include "COM_NodeOperation.h"
+namespace blender::compositor {
+
class IDMaskOperation : public NodeOperation {
private:
float m_objectIndex;
@@ -35,3 +37,5 @@ class IDMaskOperation : public NodeOperation {
this->m_objectIndex = objectIndex;
}
};
+
+} // namespace blender::compositor
diff --git a/source/blender/compositor/operations/COM_ImageOperation.cc b/source/blender/compositor/operations/COM_ImageOperation.cc
index 06e8db7b467..a1d401d4499 100644
--- a/source/blender/compositor/operations/COM_ImageOperation.cc
+++ b/source/blender/compositor/operations/COM_ImageOperation.cc
@@ -31,6 +31,8 @@
#include "RE_pipeline.h"
#include "RE_texture.h"
+namespace blender::compositor {
+
BaseImageOperation::BaseImageOperation()
{
this->m_image = nullptr;
@@ -123,13 +125,13 @@ static void sampleImageAtLocation(
{
if (ibuf->rect_float) {
switch (sampler) {
- case COM_PS_NEAREST:
+ case PixelSampler::Nearest:
nearest_interpolation_color(ibuf, nullptr, color, x, y);
break;
- case COM_PS_BILINEAR:
+ case PixelSampler::Bilinear:
bilinear_interpolation_color(ibuf, nullptr, color, x, y);
break;
- case COM_PS_BICUBIC:
+ case PixelSampler::Bicubic:
bicubic_interpolation_color(ibuf, nullptr, color, x, y);
break;
}
@@ -137,13 +139,13 @@ static void sampleImageAtLocation(
else {
unsigned char byte_color[4];
switch (sampler) {
- case COM_PS_NEAREST:
+ case PixelSampler::Nearest:
nearest_interpolation_color(ibuf, byte_color, nullptr, x, y);
break;
- case COM_PS_BILINEAR:
+ case PixelSampler::Bilinear:
bilinear_interpolation_color(ibuf, byte_color, nullptr, x, y);
break;
- case COM_PS_BICUBIC:
+ case PixelSampler::Bicubic:
bicubic_interpolation_color(ibuf, byte_color, nullptr, x, y);
break;
}
@@ -203,3 +205,5 @@ void ImageDepthOperation::executePixelSampled(float output[4],
}
}
}
+
+} // namespace blender::compositor
diff --git a/source/blender/compositor/operations/COM_ImageOperation.h b/source/blender/compositor/operations/COM_ImageOperation.h
index 0bb92ce1b7e..58373663db5 100644
--- a/source/blender/compositor/operations/COM_ImageOperation.h
+++ b/source/blender/compositor/operations/COM_ImageOperation.h
@@ -27,6 +27,8 @@
#include "RE_pipeline.h"
#include "RE_texture.h"
+namespace blender::compositor {
+
/**
* \brief Base class for all image operations
*/
@@ -102,3 +104,5 @@ class ImageDepthOperation : public BaseImageOperation {
ImageDepthOperation();
void executePixelSampled(float output[4], float x, float y, PixelSampler sampler) override;
};
+
+} // namespace blender::compositor
diff --git a/source/blender/compositor/operations/COM_InpaintOperation.cc b/source/blender/compositor/operations/COM_InpaintOperation.cc
index f4e38c85e50..413ed2694a9 100644
--- a/source/blender/compositor/operations/COM_InpaintOperation.cc
+++ b/source/blender/compositor/operations/COM_InpaintOperation.cc
@@ -23,6 +23,8 @@
#include "BLI_math.h"
+namespace blender::compositor {
+
#define ASSERT_XY_RANGE(x, y) \
BLI_assert(x >= 0 && x < this->getWidth() && y >= 0 && y < this->getHeight())
@@ -31,7 +33,7 @@ InpaintSimpleOperation::InpaintSimpleOperation()
{
this->addInputSocket(DataType::Color);
this->addOutputSocket(DataType::Color);
- this->setComplex(true);
+ this->flags.complex = true;
this->m_inputImageProgram = nullptr;
this->m_pixelorder = nullptr;
this->m_manhattan_distance = nullptr;
@@ -76,7 +78,8 @@ float *InpaintSimpleOperation::get_pixel(int x, int y)
ASSERT_XY_RANGE(x, y);
- return &this->m_cached_buffer[y * width * COM_NUM_CHANNELS_COLOR + x * COM_NUM_CHANNELS_COLOR];
+ return &this->m_cached_buffer[y * width * COM_DATA_TYPE_COLOR_CHANNELS +
+ x * COM_DATA_TYPE_COLOR_CHANNELS];
}
int InpaintSimpleOperation::mdist(int x, int y)
@@ -282,3 +285,5 @@ bool InpaintSimpleOperation::determineDependingAreaOfInterest(rcti * /*input*/,
return NodeOperation::determineDependingAreaOfInterest(&newInput, readOperation, output);
}
+
+} // namespace blender::compositor
diff --git a/source/blender/compositor/operations/COM_InpaintOperation.h b/source/blender/compositor/operations/COM_InpaintOperation.h
index 8fefa475b4a..e3d27bf7704 100644
--- a/source/blender/compositor/operations/COM_InpaintOperation.h
+++ b/source/blender/compositor/operations/COM_InpaintOperation.h
@@ -20,6 +20,8 @@
#include "COM_NodeOperation.h"
+namespace blender::compositor {
+
class InpaintSimpleOperation : public NodeOperation {
protected:
/**
@@ -72,3 +74,5 @@ class InpaintSimpleOperation : public NodeOperation {
bool next_pixel(int &x, int &y, int &curr, int iters);
void pix_step(int x, int y);
};
+
+} // namespace blender::compositor
diff --git a/source/blender/compositor/operations/COM_InvertOperation.cc b/source/blender/compositor/operations/COM_InvertOperation.cc
index 53e32baaa3d..339e40a5d1f 100644
--- a/source/blender/compositor/operations/COM_InvertOperation.cc
+++ b/source/blender/compositor/operations/COM_InvertOperation.cc
@@ -18,6 +18,8 @@
#include "COM_InvertOperation.h"
+namespace blender::compositor {
+
InvertOperation::InvertOperation()
{
this->addInputSocket(DataType::Value);
@@ -67,3 +69,5 @@ void InvertOperation::deinitExecution()
this->m_inputValueProgram = nullptr;
this->m_inputColorProgram = nullptr;
}
+
+} // namespace blender::compositor
diff --git a/source/blender/compositor/operations/COM_InvertOperation.h b/source/blender/compositor/operations/COM_InvertOperation.h
index a7b0f823ae2..17e5eb95f3e 100644
--- a/source/blender/compositor/operations/COM_InvertOperation.h
+++ b/source/blender/compositor/operations/COM_InvertOperation.h
@@ -20,6 +20,8 @@
#include "COM_NodeOperation.h"
+namespace blender::compositor {
+
class InvertOperation : public NodeOperation {
private:
/**
@@ -58,3 +60,5 @@ class InvertOperation : public NodeOperation {
this->m_alpha = alpha;
}
};
+
+} // namespace blender::compositor
diff --git a/source/blender/compositor/operations/COM_KeyingBlurOperation.cc b/source/blender/compositor/operations/COM_KeyingBlurOperation.cc
index 0d9613eea96..994b00cd3f4 100644
--- a/source/blender/compositor/operations/COM_KeyingBlurOperation.cc
+++ b/source/blender/compositor/operations/COM_KeyingBlurOperation.cc
@@ -23,6 +23,8 @@
#include "BLI_listbase.h"
#include "BLI_math.h"
+namespace blender::compositor {
+
KeyingBlurOperation::KeyingBlurOperation()
{
this->addInputSocket(DataType::Value);
@@ -31,7 +33,7 @@ KeyingBlurOperation::KeyingBlurOperation()
this->m_size = 0;
this->m_axis = BLUR_AXIS_X;
- this->setComplex(true);
+ this->flags.complex = true;
}
void *KeyingBlurOperation::initializeTileData(rcti *rect)
@@ -93,3 +95,5 @@ bool KeyingBlurOperation::determineDependingAreaOfInterest(rcti *input,
return NodeOperation::determineDependingAreaOfInterest(&newInput, readOperation, output);
}
+
+} // namespace blender::compositor
diff --git a/source/blender/compositor/operations/COM_KeyingBlurOperation.h b/source/blender/compositor/operations/COM_KeyingBlurOperation.h
index b1ea4229b6d..b055d7713f1 100644
--- a/source/blender/compositor/operations/COM_KeyingBlurOperation.h
+++ b/source/blender/compositor/operations/COM_KeyingBlurOperation.h
@@ -20,6 +20,8 @@
#include "COM_NodeOperation.h"
+namespace blender::compositor {
+
/**
* Class with implementation of blurring for keying node
*/
@@ -53,3 +55,5 @@ class KeyingBlurOperation : public NodeOperation {
ReadBufferOperation *readOperation,
rcti *output) override;
};
+
+} // namespace blender::compositor
diff --git a/source/blender/compositor/operations/COM_KeyingClipOperation.cc b/source/blender/compositor/operations/COM_KeyingClipOperation.cc
index e8556d9d8c9..4029be4e077 100644
--- a/source/blender/compositor/operations/COM_KeyingClipOperation.cc
+++ b/source/blender/compositor/operations/COM_KeyingClipOperation.cc
@@ -23,6 +23,8 @@
#include "BLI_listbase.h"
#include "BLI_math.h"
+namespace blender::compositor {
+
KeyingClipOperation::KeyingClipOperation()
{
this->addInputSocket(DataType::Value);
@@ -36,7 +38,7 @@ KeyingClipOperation::KeyingClipOperation()
this->m_isEdgeMatte = false;
- this->setComplex(true);
+ this->flags.complex = true;
}
void *KeyingClipOperation::initializeTileData(rcti *rect)
@@ -127,3 +129,5 @@ bool KeyingClipOperation::determineDependingAreaOfInterest(rcti *input,
return NodeOperation::determineDependingAreaOfInterest(&newInput, readOperation, output);
}
+
+} // namespace blender::compositor
diff --git a/source/blender/compositor/operations/COM_KeyingClipOperation.h b/source/blender/compositor/operations/COM_KeyingClipOperation.h
index 1b2fa886814..0a21fb48c99 100644
--- a/source/blender/compositor/operations/COM_KeyingClipOperation.h
+++ b/source/blender/compositor/operations/COM_KeyingClipOperation.h
@@ -20,6 +20,8 @@
#include "COM_NodeOperation.h"
+namespace blender::compositor {
+
/**
* Class with implementation of black/white clipping for keying node
*/
@@ -67,3 +69,5 @@ class KeyingClipOperation : public NodeOperation {
ReadBufferOperation *readOperation,
rcti *output) override;
};
+
+} // namespace blender::compositor
diff --git a/source/blender/compositor/operations/COM_KeyingDespillOperation.cc b/source/blender/compositor/operations/COM_KeyingDespillOperation.cc
index 5caa450a878..d31a88cb91e 100644
--- a/source/blender/compositor/operations/COM_KeyingDespillOperation.cc
+++ b/source/blender/compositor/operations/COM_KeyingDespillOperation.cc
@@ -23,6 +23,8 @@
#include "BLI_listbase.h"
#include "BLI_math.h"
+namespace blender::compositor {
+
KeyingDespillOperation::KeyingDespillOperation()
{
this->addInputSocket(DataType::Color);
@@ -79,3 +81,5 @@ void KeyingDespillOperation::executePixelSampled(float output[4],
output[screen_primary_channel] = pixelColor[screen_primary_channel] - amount_despill;
}
}
+
+} // namespace blender::compositor
diff --git a/source/blender/compositor/operations/COM_KeyingDespillOperation.h b/source/blender/compositor/operations/COM_KeyingDespillOperation.h
index c201388c1c1..279ac60e6e9 100644
--- a/source/blender/compositor/operations/COM_KeyingDespillOperation.h
+++ b/source/blender/compositor/operations/COM_KeyingDespillOperation.h
@@ -20,6 +20,8 @@
#include "COM_NodeOperation.h"
+namespace blender::compositor {
+
/**
* Class with implementation of keying despill node
*/
@@ -47,3 +49,5 @@ class KeyingDespillOperation : public NodeOperation {
void executePixelSampled(float output[4], float x, float y, PixelSampler sampler) override;
};
+
+} // namespace blender::compositor
diff --git a/source/blender/compositor/operations/COM_KeyingOperation.cc b/source/blender/compositor/operations/COM_KeyingOperation.cc
index 108b7c60874..e786e4b8219 100644
--- a/source/blender/compositor/operations/COM_KeyingOperation.cc
+++ b/source/blender/compositor/operations/COM_KeyingOperation.cc
@@ -23,6 +23,8 @@
#include "BLI_listbase.h"
#include "BLI_math.h"
+namespace blender::compositor {
+
static float get_pixel_saturation(const float pixelColor[4],
float screen_balance,
int primary_channel)
@@ -107,3 +109,5 @@ void KeyingOperation::executePixelSampled(float output[4], float x, float y, Pix
}
}
}
+
+} // namespace blender::compositor
diff --git a/source/blender/compositor/operations/COM_KeyingOperation.h b/source/blender/compositor/operations/COM_KeyingOperation.h
index 13f4e5e247b..3d41ecaa0f6 100644
--- a/source/blender/compositor/operations/COM_KeyingOperation.h
+++ b/source/blender/compositor/operations/COM_KeyingOperation.h
@@ -24,6 +24,8 @@
#include "BLI_listbase.h"
+namespace blender::compositor {
+
/**
* Class with implementation of keying node
*/
@@ -47,3 +49,5 @@ class KeyingOperation : public NodeOperation {
void executePixelSampled(float output[4], float x, float y, PixelSampler sampler) override;
};
+
+} // namespace blender::compositor
diff --git a/source/blender/compositor/operations/COM_KeyingScreenOperation.cc b/source/blender/compositor/operations/COM_KeyingScreenOperation.cc
index 801750d99d0..17b613246ad 100644
--- a/source/blender/compositor/operations/COM_KeyingScreenOperation.cc
+++ b/source/blender/compositor/operations/COM_KeyingScreenOperation.cc
@@ -30,13 +30,15 @@
#include "IMB_imbuf.h"
#include "IMB_imbuf_types.h"
+namespace blender::compositor {
+
KeyingScreenOperation::KeyingScreenOperation()
{
this->addOutputSocket(DataType::Color);
this->m_movieClip = nullptr;
this->m_framenumber = 0;
this->m_trackingObject[0] = 0;
- setComplex(true);
+ flags.complex = true;
}
void KeyingScreenOperation::initExecution()
@@ -344,3 +346,5 @@ void KeyingScreenOperation::executePixel(float output[4], int x, int y, void *da
}
}
}
+
+} // namespace blender::compositor
diff --git a/source/blender/compositor/operations/COM_KeyingScreenOperation.h b/source/blender/compositor/operations/COM_KeyingScreenOperation.h
index 86cd94e308d..4118d229be9 100644
--- a/source/blender/compositor/operations/COM_KeyingScreenOperation.h
+++ b/source/blender/compositor/operations/COM_KeyingScreenOperation.h
@@ -29,6 +29,8 @@
#include "BLI_voronoi_2d.h"
+namespace blender::compositor {
+
/**
* Class with implementation of green screen gradient rasterization
*/
@@ -83,3 +85,5 @@ class KeyingScreenOperation : public NodeOperation {
void executePixel(float output[4], int x, int y, void *data) override;
};
+
+} // namespace blender::compositor
diff --git a/source/blender/compositor/operations/COM_LuminanceMatteOperation.cc b/source/blender/compositor/operations/COM_LuminanceMatteOperation.cc
index 43cc8f8bf71..0afc4278a45 100644
--- a/source/blender/compositor/operations/COM_LuminanceMatteOperation.cc
+++ b/source/blender/compositor/operations/COM_LuminanceMatteOperation.cc
@@ -21,6 +21,8 @@
#include "IMB_colormanagement.h"
+namespace blender::compositor {
+
LuminanceMatteOperation::LuminanceMatteOperation()
{
addInputSocket(DataType::Color);
@@ -75,3 +77,5 @@ void LuminanceMatteOperation::executePixelSampled(float output[4],
/* don't make something that was more transparent less transparent */
output[0] = min_ff(alpha, inColor[3]);
}
+
+} // namespace blender::compositor
diff --git a/source/blender/compositor/operations/COM_LuminanceMatteOperation.h b/source/blender/compositor/operations/COM_LuminanceMatteOperation.h
index 4e716468568..035c68b9d59 100644
--- a/source/blender/compositor/operations/COM_LuminanceMatteOperation.h
+++ b/source/blender/compositor/operations/COM_LuminanceMatteOperation.h
@@ -20,6 +20,8 @@
#include "COM_MixOperation.h"
+namespace blender::compositor {
+
/**
* this program converts an input color to an output value.
* it assumes we are in sRGB color space.
@@ -48,3 +50,5 @@ class LuminanceMatteOperation : public NodeOperation {
this->m_settings = nodeChroma;
}
};
+
+} // namespace blender::compositor
diff --git a/source/blender/compositor/operations/COM_MapRangeOperation.cc b/source/blender/compositor/operations/COM_MapRangeOperation.cc
index 78ba446051e..ada3cd6f159 100644
--- a/source/blender/compositor/operations/COM_MapRangeOperation.cc
+++ b/source/blender/compositor/operations/COM_MapRangeOperation.cc
@@ -18,6 +18,8 @@
#include "COM_MapRangeOperation.h"
+namespace blender::compositor {
+
MapRangeOperation::MapRangeOperation()
{
this->addInputSocket(DataType::Value);
@@ -101,3 +103,5 @@ void MapRangeOperation::deinitExecution()
this->m_destMinOperation = nullptr;
this->m_destMaxOperation = nullptr;
}
+
+} // namespace blender::compositor
diff --git a/source/blender/compositor/operations/COM_MapRangeOperation.h b/source/blender/compositor/operations/COM_MapRangeOperation.h
index 27a7cfd90c3..a544c59887e 100644
--- a/source/blender/compositor/operations/COM_MapRangeOperation.h
+++ b/source/blender/compositor/operations/COM_MapRangeOperation.h
@@ -21,6 +21,8 @@
#include "COM_NodeOperation.h"
#include "DNA_texture_types.h"
+namespace blender::compositor {
+
/**
* this program converts an input color to an output value.
* it assumes we are in sRGB color space.
@@ -67,3 +69,5 @@ class MapRangeOperation : public NodeOperation {
this->m_useClamp = value;
}
};
+
+} // namespace blender::compositor
diff --git a/source/blender/compositor/operations/COM_MapUVOperation.cc b/source/blender/compositor/operations/COM_MapUVOperation.cc
index 7328de7f49f..74e3d965d41 100644
--- a/source/blender/compositor/operations/COM_MapUVOperation.cc
+++ b/source/blender/compositor/operations/COM_MapUVOperation.cc
@@ -19,13 +19,15 @@
#include "COM_MapUVOperation.h"
#include "BLI_math.h"
+namespace blender::compositor {
+
MapUVOperation::MapUVOperation()
{
- this->addInputSocket(DataType::Color, COM_SC_NO_RESIZE);
+ this->addInputSocket(DataType::Color, ResizeMode::None);
this->addInputSocket(DataType::Vector);
this->addOutputSocket(DataType::Color);
this->m_alpha = 0.0f;
- this->setComplex(true);
+ this->flags.complex = true;
setResolutionInputSocketIndex(1);
this->m_inputUVProgram = nullptr;
@@ -89,7 +91,7 @@ bool MapUVOperation::read_uv(float x, float y, float &r_u, float &r_v, float &r_
}
float vector[3];
- m_inputUVProgram->readSampled(vector, x, y, COM_PS_BILINEAR);
+ m_inputUVProgram->readSampled(vector, x, y, PixelSampler::Bilinear);
r_u = vector[0] * m_inputColorProgram->getWidth();
r_v = vector[1] * m_inputColorProgram->getHeight();
r_alpha = vector[2];
@@ -183,3 +185,5 @@ bool MapUVOperation::determineDependingAreaOfInterest(rcti *input,
return false;
}
+
+} // namespace blender::compositor
diff --git a/source/blender/compositor/operations/COM_MapUVOperation.h b/source/blender/compositor/operations/COM_MapUVOperation.h
index e3481b9cae9..eb5f7d49122 100644
--- a/source/blender/compositor/operations/COM_MapUVOperation.h
+++ b/source/blender/compositor/operations/COM_MapUVOperation.h
@@ -20,6 +20,8 @@
#include "COM_NodeOperation.h"
+namespace blender::compositor {
+
class MapUVOperation : public NodeOperation {
private:
/**
@@ -65,3 +67,5 @@ class MapUVOperation : public NodeOperation {
private:
bool read_uv(float x, float y, float &r_u, float &r_v, float &r_alpha);
};
+
+} // namespace blender::compositor
diff --git a/source/blender/compositor/operations/COM_MapValueOperation.cc b/source/blender/compositor/operations/COM_MapValueOperation.cc
index 9c28e3c2577..03fa80d220d 100644
--- a/source/blender/compositor/operations/COM_MapValueOperation.cc
+++ b/source/blender/compositor/operations/COM_MapValueOperation.cc
@@ -18,6 +18,8 @@
#include "COM_MapValueOperation.h"
+namespace blender::compositor {
+
MapValueOperation::MapValueOperation()
{
this->addInputSocket(DataType::Value);
@@ -57,3 +59,5 @@ void MapValueOperation::deinitExecution()
{
this->m_inputOperation = nullptr;
}
+
+} // namespace blender::compositor
diff --git a/source/blender/compositor/operations/COM_MapValueOperation.h b/source/blender/compositor/operations/COM_MapValueOperation.h
index 98417001f4a..eb7714714e9 100644
--- a/source/blender/compositor/operations/COM_MapValueOperation.h
+++ b/source/blender/compositor/operations/COM_MapValueOperation.h
@@ -21,6 +21,8 @@
#include "COM_NodeOperation.h"
#include "DNA_texture_types.h"
+namespace blender::compositor {
+
/**
* this program converts an input color to an output value.
* it assumes we are in sRGB color space.
@@ -62,3 +64,5 @@ class MapValueOperation : public NodeOperation {
this->m_settings = settings;
}
};
+
+} // namespace blender::compositor
diff --git a/source/blender/compositor/operations/COM_MaskOperation.cc b/source/blender/compositor/operations/COM_MaskOperation.cc
index 64d8c9a5492..c7763f08e71 100644
--- a/source/blender/compositor/operations/COM_MaskOperation.cc
+++ b/source/blender/compositor/operations/COM_MaskOperation.cc
@@ -26,6 +26,8 @@
#include "BKE_lib_id.h"
#include "BKE_mask.h"
+namespace blender::compositor {
+
MaskOperation::MaskOperation()
{
this->addOutputSocket(DataType::Value);
@@ -158,3 +160,5 @@ void MaskOperation::executePixelSampled(float output[4],
output[0] /= this->m_rasterMaskHandleTot;
}
}
+
+} // namespace blender::compositor
diff --git a/source/blender/compositor/operations/COM_MaskOperation.h b/source/blender/compositor/operations/COM_MaskOperation.h
index 909af921625..48fd54b00fe 100644
--- a/source/blender/compositor/operations/COM_MaskOperation.h
+++ b/source/blender/compositor/operations/COM_MaskOperation.h
@@ -23,6 +23,11 @@
#include "DNA_mask_types.h"
#include "IMB_imbuf_types.h"
+/* Forward declarations. */
+struct MaskRasterHandle;
+
+namespace blender::compositor {
+
/**
* Class with implementation of mask rasterization
*/
@@ -94,3 +99,5 @@ class MaskOperation : public NodeOperation {
void executePixelSampled(float output[4], float x, float y, PixelSampler sampler) override;
};
+
+} // namespace blender::compositor
diff --git a/source/blender/compositor/operations/COM_MathBaseOperation.cc b/source/blender/compositor/operations/COM_MathBaseOperation.cc
index 57ccbe7792b..a94c14347fb 100644
--- a/source/blender/compositor/operations/COM_MathBaseOperation.cc
+++ b/source/blender/compositor/operations/COM_MathBaseOperation.cc
@@ -20,6 +20,8 @@
#include "BLI_math.h"
+namespace blender::compositor {
+
MathBaseOperation::MathBaseOperation()
{
this->addInputSocket(DataType::Value);
@@ -748,3 +750,5 @@ void MathSmoothMaxOperation::executePixelSampled(float output[4],
clampIfNeeded(output);
}
+
+} // namespace blender::compositor
diff --git a/source/blender/compositor/operations/COM_MathBaseOperation.h b/source/blender/compositor/operations/COM_MathBaseOperation.h
index 27a01667da5..69555524274 100644
--- a/source/blender/compositor/operations/COM_MathBaseOperation.h
+++ b/source/blender/compositor/operations/COM_MathBaseOperation.h
@@ -20,6 +20,8 @@
#include "COM_NodeOperation.h"
+namespace blender::compositor {
+
/**
* this program converts an input color to an output value.
* it assumes we are in sRGB color space.
@@ -368,3 +370,5 @@ class MathSmoothMaxOperation : public MathBaseOperation {
}
void executePixelSampled(float output[4], float x, float y, PixelSampler sampler) override;
};
+
+} // namespace blender::compositor
diff --git a/source/blender/compositor/operations/COM_MixOperation.cc b/source/blender/compositor/operations/COM_MixOperation.cc
index e70c59c6a01..58fa09fa2a8 100644
--- a/source/blender/compositor/operations/COM_MixOperation.cc
+++ b/source/blender/compositor/operations/COM_MixOperation.cc
@@ -20,6 +20,8 @@
#include "BLI_math.h"
+namespace blender::compositor {
+
/* ******** Mix Base Operation ******** */
MixBaseOperation::MixBaseOperation()
@@ -97,11 +99,6 @@ void MixBaseOperation::deinitExecution()
/* ******** Mix Add Operation ******** */
-MixAddOperation::MixAddOperation()
-{
- /* pass */
-}
-
void MixAddOperation::executePixelSampled(float output[4], float x, float y, PixelSampler sampler)
{
float inputColor1[4];
@@ -126,11 +123,6 @@ void MixAddOperation::executePixelSampled(float output[4], float x, float y, Pix
/* ******** Mix Blend Operation ******** */
-MixBlendOperation::MixBlendOperation()
-{
- /* pass */
-}
-
void MixBlendOperation::executePixelSampled(float output[4],
float x,
float y,
@@ -160,11 +152,6 @@ void MixBlendOperation::executePixelSampled(float output[4],
/* ******** Mix Burn Operation ******** */
-MixColorBurnOperation::MixColorBurnOperation()
-{
- /* pass */
-}
-
void MixColorBurnOperation::executePixelSampled(float output[4],
float x,
float y,
@@ -243,11 +230,6 @@ void MixColorBurnOperation::executePixelSampled(float output[4],
/* ******** Mix Color Operation ******** */
-MixColorOperation::MixColorOperation()
-{
- /* pass */
-}
-
void MixColorOperation::executePixelSampled(float output[4],
float x,
float y,
@@ -288,11 +270,6 @@ void MixColorOperation::executePixelSampled(float output[4],
/* ******** Mix Darken Operation ******** */
-MixDarkenOperation::MixDarkenOperation()
-{
- /* pass */
-}
-
void MixDarkenOperation::executePixelSampled(float output[4],
float x,
float y,
@@ -321,11 +298,6 @@ void MixDarkenOperation::executePixelSampled(float output[4],
/* ******** Mix Difference Operation ******** */
-MixDifferenceOperation::MixDifferenceOperation()
-{
- /* pass */
-}
-
void MixDifferenceOperation::executePixelSampled(float output[4],
float x,
float y,
@@ -354,11 +326,6 @@ void MixDifferenceOperation::executePixelSampled(float output[4],
/* ******** Mix Difference Operation ******** */
-MixDivideOperation::MixDivideOperation()
-{
- /* pass */
-}
-
void MixDivideOperation::executePixelSampled(float output[4],
float x,
float y,
@@ -404,11 +371,6 @@ void MixDivideOperation::executePixelSampled(float output[4],
/* ******** Mix Dodge Operation ******** */
-MixDodgeOperation::MixDodgeOperation()
-{
- /* pass */
-}
-
void MixDodgeOperation::executePixelSampled(float output[4],
float x,
float y,
@@ -492,11 +454,6 @@ void MixDodgeOperation::executePixelSampled(float output[4],
/* ******** Mix Glare Operation ******** */
-MixGlareOperation::MixGlareOperation()
-{
- /* pass */
-}
-
void MixGlareOperation::executePixelSampled(float output[4],
float x,
float y,
@@ -505,27 +462,26 @@ void MixGlareOperation::executePixelSampled(float output[4],
float inputColor1[4];
float inputColor2[4];
float inputValue[4];
- float value;
+ float value, input_weight, glare_weight;
this->m_inputValueOperation->readSampled(inputValue, x, y, sampler);
this->m_inputColor1Operation->readSampled(inputColor1, x, y, sampler);
this->m_inputColor2Operation->readSampled(inputColor2, x, y, sampler);
value = inputValue[0];
- float mf = 2.0f - 2.0f * fabsf(value - 0.5f);
-
- if (inputColor1[0] < 0.0f) {
- inputColor1[0] = 0.0f;
+ /* Linear interpolation between 3 cases:
+ * value=-1:output=input value=0:output=input+glare value=1:output=glare
+ */
+ if (value < 0.0f) {
+ input_weight = 1.0f;
+ glare_weight = 1.0f + value;
}
- if (inputColor1[1] < 0.0f) {
- inputColor1[1] = 0.0f;
- }
- if (inputColor1[2] < 0.0f) {
- inputColor1[2] = 0.0f;
+ else {
+ input_weight = 1.0f - value;
+ glare_weight = 1.0f;
}
-
- output[0] = mf * MAX2(inputColor1[0] + value * (inputColor2[0] - inputColor1[0]), 0.0f);
- output[1] = mf * MAX2(inputColor1[1] + value * (inputColor2[1] - inputColor1[1]), 0.0f);
- output[2] = mf * MAX2(inputColor1[2] + value * (inputColor2[2] - inputColor1[2]), 0.0f);
+ output[0] = input_weight * MAX2(inputColor1[0], 0.0f) + glare_weight * inputColor2[0];
+ output[1] = input_weight * MAX2(inputColor1[1], 0.0f) + glare_weight * inputColor2[1];
+ output[2] = input_weight * MAX2(inputColor1[2], 0.0f) + glare_weight * inputColor2[2];
output[3] = inputColor1[3];
clampIfNeeded(output);
@@ -533,11 +489,6 @@ void MixGlareOperation::executePixelSampled(float output[4],
/* ******** Mix Hue Operation ******** */
-MixHueOperation::MixHueOperation()
-{
- /* pass */
-}
-
void MixHueOperation::executePixelSampled(float output[4], float x, float y, PixelSampler sampler)
{
float inputColor1[4];
@@ -575,11 +526,6 @@ void MixHueOperation::executePixelSampled(float output[4], float x, float y, Pix
/* ******** Mix Lighten Operation ******** */
-MixLightenOperation::MixLightenOperation()
-{
- /* pass */
-}
-
void MixLightenOperation::executePixelSampled(float output[4],
float x,
float y,
@@ -626,11 +572,6 @@ void MixLightenOperation::executePixelSampled(float output[4],
/* ******** Mix Linear Light Operation ******** */
-MixLinearLightOperation::MixLinearLightOperation()
-{
- /* pass */
-}
-
void MixLinearLightOperation::executePixelSampled(float output[4],
float x,
float y,
@@ -674,11 +615,6 @@ void MixLinearLightOperation::executePixelSampled(float output[4],
/* ******** Mix Multiply Operation ******** */
-MixMultiplyOperation::MixMultiplyOperation()
-{
- /* pass */
-}
-
void MixMultiplyOperation::executePixelSampled(float output[4],
float x,
float y,
@@ -707,11 +643,6 @@ void MixMultiplyOperation::executePixelSampled(float output[4],
/* ******** Mix Overlay Operation ******** */
-MixOverlayOperation::MixOverlayOperation()
-{
- /* pass */
-}
-
void MixOverlayOperation::executePixelSampled(float output[4],
float x,
float y,
@@ -757,11 +688,6 @@ void MixOverlayOperation::executePixelSampled(float output[4],
/* ******** Mix Saturation Operation ******** */
-MixSaturationOperation::MixSaturationOperation()
-{
- /* pass */
-}
-
void MixSaturationOperation::executePixelSampled(float output[4],
float x,
float y,
@@ -799,11 +725,6 @@ void MixSaturationOperation::executePixelSampled(float output[4],
/* ******** Mix Screen Operation ******** */
-MixScreenOperation::MixScreenOperation()
-{
- /* pass */
-}
-
void MixScreenOperation::executePixelSampled(float output[4],
float x,
float y,
@@ -833,11 +754,6 @@ void MixScreenOperation::executePixelSampled(float output[4],
/* ******** Mix Soft Light Operation ******** */
-MixSoftLightOperation::MixSoftLightOperation()
-{
- /* pass */
-}
-
void MixSoftLightOperation::executePixelSampled(float output[4],
float x,
float y,
@@ -879,11 +795,6 @@ void MixSoftLightOperation::executePixelSampled(float output[4],
/* ******** Mix Subtract Operation ******** */
-MixSubtractOperation::MixSubtractOperation()
-{
- /* pass */
-}
-
void MixSubtractOperation::executePixelSampled(float output[4],
float x,
float y,
@@ -911,11 +822,6 @@ void MixSubtractOperation::executePixelSampled(float output[4],
/* ******** Mix Value Operation ******** */
-MixValueOperation::MixValueOperation()
-{
- /* pass */
-}
-
void MixValueOperation::executePixelSampled(float output[4],
float x,
float y,
@@ -944,3 +850,5 @@ void MixValueOperation::executePixelSampled(float output[4],
clampIfNeeded(output);
}
+
+} // namespace blender::compositor
diff --git a/source/blender/compositor/operations/COM_MixOperation.h b/source/blender/compositor/operations/COM_MixOperation.h
index dd1f34a5322..6c241bc5762 100644
--- a/source/blender/compositor/operations/COM_MixOperation.h
+++ b/source/blender/compositor/operations/COM_MixOperation.h
@@ -20,6 +20,8 @@
#include "COM_NodeOperation.h"
+namespace blender::compositor {
+
/**
* All this programs converts an input color to an output value.
* it assumes we are in sRGB color space.
@@ -83,114 +85,97 @@ class MixBaseOperation : public NodeOperation {
class MixAddOperation : public MixBaseOperation {
public:
- MixAddOperation();
void executePixelSampled(float output[4], float x, float y, PixelSampler sampler) override;
};
class MixBlendOperation : public MixBaseOperation {
public:
- MixBlendOperation();
void executePixelSampled(float output[4], float x, float y, PixelSampler sampler) override;
};
class MixColorBurnOperation : public MixBaseOperation {
public:
- MixColorBurnOperation();
void executePixelSampled(float output[4], float x, float y, PixelSampler sampler) override;
};
class MixColorOperation : public MixBaseOperation {
public:
- MixColorOperation();
void executePixelSampled(float output[4], float x, float y, PixelSampler sampler) override;
};
class MixDarkenOperation : public MixBaseOperation {
public:
- MixDarkenOperation();
void executePixelSampled(float output[4], float x, float y, PixelSampler sampler) override;
};
class MixDifferenceOperation : public MixBaseOperation {
public:
- MixDifferenceOperation();
void executePixelSampled(float output[4], float x, float y, PixelSampler sampler) override;
};
class MixDivideOperation : public MixBaseOperation {
public:
- MixDivideOperation();
void executePixelSampled(float output[4], float x, float y, PixelSampler sampler) override;
};
class MixDodgeOperation : public MixBaseOperation {
public:
- MixDodgeOperation();
void executePixelSampled(float output[4], float x, float y, PixelSampler sampler) override;
};
class MixGlareOperation : public MixBaseOperation {
public:
- MixGlareOperation();
void executePixelSampled(float output[4], float x, float y, PixelSampler sampler) override;
};
class MixHueOperation : public MixBaseOperation {
public:
- MixHueOperation();
void executePixelSampled(float output[4], float x, float y, PixelSampler sampler) override;
};
class MixLightenOperation : public MixBaseOperation {
public:
- MixLightenOperation();
void executePixelSampled(float output[4], float x, float y, PixelSampler sampler) override;
};
class MixLinearLightOperation : public MixBaseOperation {
public:
- MixLinearLightOperation();
void executePixelSampled(float output[4], float x, float y, PixelSampler sampler) override;
};
class MixMultiplyOperation : public MixBaseOperation {
public:
- MixMultiplyOperation();
void executePixelSampled(float output[4], float x, float y, PixelSampler sampler) override;
};
class MixOverlayOperation : public MixBaseOperation {
public:
- MixOverlayOperation();
void executePixelSampled(float output[4], float x, float y, PixelSampler sampler) override;
};
class MixSaturationOperation : public MixBaseOperation {
public:
- MixSaturationOperation();
void executePixelSampled(float output[4], float x, float y, PixelSampler sampler) override;
};
class MixScreenOperation : public MixBaseOperation {
public:
- MixScreenOperation();
void executePixelSampled(float output[4], float x, float y, PixelSampler sampler) override;
};
class MixSoftLightOperation : public MixBaseOperation {
public:
- MixSoftLightOperation();
void executePixelSampled(float output[4], float x, float y, PixelSampler sampler) override;
};
class MixSubtractOperation : public MixBaseOperation {
public:
- MixSubtractOperation();
void executePixelSampled(float output[4], float x, float y, PixelSampler sampler) override;
};
class MixValueOperation : public MixBaseOperation {
public:
- MixValueOperation();
void executePixelSampled(float output[4], float x, float y, PixelSampler sampler) override;
};
+
+} // namespace blender::compositor
diff --git a/source/blender/compositor/operations/COM_MovieClipAttributeOperation.cc b/source/blender/compositor/operations/COM_MovieClipAttributeOperation.cc
index 3920b4c02bd..a9f187258b2 100644
--- a/source/blender/compositor/operations/COM_MovieClipAttributeOperation.cc
+++ b/source/blender/compositor/operations/COM_MovieClipAttributeOperation.cc
@@ -21,6 +21,8 @@
#include "BKE_movieclip.h"
#include "BKE_tracking.h"
+namespace blender::compositor {
+
MovieClipAttributeOperation::MovieClipAttributeOperation()
{
this->addOutputSocket(DataType::Value);
@@ -80,3 +82,5 @@ void MovieClipAttributeOperation::determineResolution(unsigned int resolution[2]
resolution[0] = preferredResolution[0];
resolution[1] = preferredResolution[1];
}
+
+} // namespace blender::compositor
diff --git a/source/blender/compositor/operations/COM_MovieClipAttributeOperation.h b/source/blender/compositor/operations/COM_MovieClipAttributeOperation.h
index 6a6920247e6..8507e98d08f 100644
--- a/source/blender/compositor/operations/COM_MovieClipAttributeOperation.h
+++ b/source/blender/compositor/operations/COM_MovieClipAttributeOperation.h
@@ -21,6 +21,8 @@
#include "COM_NodeOperation.h"
#include "DNA_movieclip_types.h"
+namespace blender::compositor {
+
typedef enum MovieClipAttribute {
MCA_SCALE,
MCA_X,
@@ -71,3 +73,5 @@ class MovieClipAttributeOperation : public NodeOperation {
this->m_invert = invert;
}
};
+
+} // namespace blender::compositor
diff --git a/source/blender/compositor/operations/COM_MovieClipOperation.cc b/source/blender/compositor/operations/COM_MovieClipOperation.cc
index 5d5880e14b0..d93a75407c4 100644
--- a/source/blender/compositor/operations/COM_MovieClipOperation.cc
+++ b/source/blender/compositor/operations/COM_MovieClipOperation.cc
@@ -26,6 +26,8 @@
#include "IMB_imbuf.h"
+namespace blender::compositor {
+
MovieClipBaseOperation::MovieClipBaseOperation()
{
this->m_movieClip = nullptr;
@@ -101,13 +103,13 @@ void MovieClipBaseOperation::executePixelSampled(float output[4],
}
else {
switch (sampler) {
- case COM_PS_NEAREST:
+ case PixelSampler::Nearest:
nearest_interpolation_color(ibuf, nullptr, output, x, y);
break;
- case COM_PS_BILINEAR:
+ case PixelSampler::Bilinear:
bilinear_interpolation_color(ibuf, nullptr, output, x, y);
break;
- case COM_PS_BICUBIC:
+ case PixelSampler::Bicubic:
bicubic_interpolation_color(ibuf, nullptr, output, x, y);
break;
}
@@ -133,3 +135,5 @@ void MovieClipAlphaOperation::executePixelSampled(float output[4],
MovieClipBaseOperation::executePixelSampled(result, x, y, sampler);
output[0] = result[3];
}
+
+} // namespace blender::compositor
diff --git a/source/blender/compositor/operations/COM_MovieClipOperation.h b/source/blender/compositor/operations/COM_MovieClipOperation.h
index 78cd1cc0c90..c853ea43762 100644
--- a/source/blender/compositor/operations/COM_MovieClipOperation.h
+++ b/source/blender/compositor/operations/COM_MovieClipOperation.h
@@ -23,6 +23,8 @@
#include "DNA_movieclip_types.h"
#include "IMB_imbuf_types.h"
+namespace blender::compositor {
+
/**
* Base class for movie clip
*/
@@ -77,3 +79,5 @@ class MovieClipAlphaOperation : public MovieClipBaseOperation {
MovieClipAlphaOperation();
void executePixelSampled(float output[4], float x, float y, PixelSampler sampler) override;
};
+
+} // namespace blender::compositor
diff --git a/source/blender/compositor/operations/COM_MovieDistortionOperation.cc b/source/blender/compositor/operations/COM_MovieDistortionOperation.cc
index fcd482a69ef..c8e045ea117 100644
--- a/source/blender/compositor/operations/COM_MovieDistortionOperation.cc
+++ b/source/blender/compositor/operations/COM_MovieDistortionOperation.cc
@@ -23,6 +23,8 @@
#include "BLI_linklist.h"
+namespace blender::compositor {
+
MovieDistortionOperation::MovieDistortionOperation(bool distortion)
{
this->addInputSocket(DataType::Color);
@@ -107,10 +109,10 @@ void MovieDistortionOperation::executePixelSampled(float output[4],
float u = out[0] * aspx /* + 0.5 * overscan * w */,
v = (out[1] * aspy /* + 0.5 * overscan * h */) * pixel_aspect;
- this->m_inputOperation->readSampled(output, u, v, COM_PS_BILINEAR);
+ this->m_inputOperation->readSampled(output, u, v, PixelSampler::Bilinear);
}
else {
- this->m_inputOperation->readSampled(output, x, y, COM_PS_BILINEAR);
+ this->m_inputOperation->readSampled(output, x, y, PixelSampler::Bilinear);
}
}
@@ -125,3 +127,5 @@ bool MovieDistortionOperation::determineDependingAreaOfInterest(rcti *input,
newInput.ymax = input->ymax + m_margin[1];
return NodeOperation::determineDependingAreaOfInterest(&newInput, readOperation, output);
}
+
+} // namespace blender::compositor
diff --git a/source/blender/compositor/operations/COM_MovieDistortionOperation.h b/source/blender/compositor/operations/COM_MovieDistortionOperation.h
index ef9d6be697b..631a62f7ebf 100644
--- a/source/blender/compositor/operations/COM_MovieDistortionOperation.h
+++ b/source/blender/compositor/operations/COM_MovieDistortionOperation.h
@@ -24,6 +24,8 @@
#include "BKE_tracking.h"
+namespace blender::compositor {
+
class MovieDistortionOperation : public NodeOperation {
private:
SocketReader *m_inputOperation;
@@ -57,3 +59,5 @@ class MovieDistortionOperation : public NodeOperation {
ReadBufferOperation *readOperation,
rcti *output) override;
};
+
+} // namespace blender::compositor
diff --git a/source/blender/compositor/operations/COM_MultilayerImageOperation.cc b/source/blender/compositor/operations/COM_MultilayerImageOperation.cc
index 60936ee1939..647e93225e5 100644
--- a/source/blender/compositor/operations/COM_MultilayerImageOperation.cc
+++ b/source/blender/compositor/operations/COM_MultilayerImageOperation.cc
@@ -21,6 +21,8 @@
#include "IMB_imbuf.h"
#include "IMB_imbuf_types.h"
+namespace blender::compositor {
+
MultilayerBaseOperation::MultilayerBaseOperation(RenderLayer *render_layer,
RenderPass *render_pass,
int view)
@@ -49,7 +51,7 @@ ImBuf *MultilayerBaseOperation::getImBuf()
return nullptr;
}
-std::unique_ptr<MetaData> MultilayerColorOperation::getMetaData() const
+std::unique_ptr<MetaData> MultilayerColorOperation::getMetaData()
{
BLI_assert(this->m_buffer);
MetaDataExtractCallbackData callback_data = {nullptr};
@@ -86,13 +88,13 @@ void MultilayerColorOperation::executePixelSampled(float output[4],
else {
if (this->m_numberOfChannels == 4) {
switch (sampler) {
- case COM_PS_NEAREST:
+ case PixelSampler::Nearest:
nearest_interpolation_color(this->m_buffer, nullptr, output, x, y);
break;
- case COM_PS_BILINEAR:
+ case PixelSampler::Bilinear:
bilinear_interpolation_color(this->m_buffer, nullptr, output, x, y);
break;
- case COM_PS_BICUBIC:
+ case PixelSampler::Bicubic:
bicubic_interpolation_color(this->m_buffer, nullptr, output, x, y);
break;
}
@@ -155,3 +157,5 @@ void MultilayerVectorOperation::executePixelSampled(float output[4],
}
}
}
+
+} // namespace blender::compositor
diff --git a/source/blender/compositor/operations/COM_MultilayerImageOperation.h b/source/blender/compositor/operations/COM_MultilayerImageOperation.h
index dceb57de140..6e6062cf854 100644
--- a/source/blender/compositor/operations/COM_MultilayerImageOperation.h
+++ b/source/blender/compositor/operations/COM_MultilayerImageOperation.h
@@ -20,6 +20,8 @@
#include "COM_ImageOperation.h"
+namespace blender::compositor {
+
class MultilayerBaseOperation : public BaseImageOperation {
private:
int m_passId;
@@ -45,7 +47,7 @@ class MultilayerColorOperation : public MultilayerBaseOperation {
this->addOutputSocket(DataType::Color);
}
void executePixelSampled(float output[4], float x, float y, PixelSampler sampler) override;
- std::unique_ptr<MetaData> getMetaData() const override;
+ std::unique_ptr<MetaData> getMetaData() override;
};
class MultilayerValueOperation : public MultilayerBaseOperation {
@@ -67,3 +69,5 @@ class MultilayerVectorOperation : public MultilayerBaseOperation {
}
void executePixelSampled(float output[4], float x, float y, PixelSampler sampler) override;
};
+
+} // namespace blender::compositor
diff --git a/source/blender/compositor/operations/COM_NormalizeOperation.cc b/source/blender/compositor/operations/COM_NormalizeOperation.cc
index fd3b951c842..faacb429f71 100644
--- a/source/blender/compositor/operations/COM_NormalizeOperation.cc
+++ b/source/blender/compositor/operations/COM_NormalizeOperation.cc
@@ -18,13 +18,15 @@
#include "COM_NormalizeOperation.h"
+namespace blender::compositor {
+
NormalizeOperation::NormalizeOperation()
{
this->addInputSocket(DataType::Value);
this->addOutputSocket(DataType::Value);
this->m_imageReader = nullptr;
this->m_cachedInstance = nullptr;
- this->setComplex(true);
+ this->flags.complex = true;
}
void NormalizeOperation::initExecution()
{
@@ -124,3 +126,5 @@ void NormalizeOperation::deinitializeTileData(rcti * /*rect*/, void * /*data*/)
{
/* pass */
}
+
+} // namespace blender::compositor
diff --git a/source/blender/compositor/operations/COM_NormalizeOperation.h b/source/blender/compositor/operations/COM_NormalizeOperation.h
index 6447aa930f1..93d4a0fc67d 100644
--- a/source/blender/compositor/operations/COM_NormalizeOperation.h
+++ b/source/blender/compositor/operations/COM_NormalizeOperation.h
@@ -21,6 +21,8 @@
#include "COM_NodeOperation.h"
#include "DNA_node_types.h"
+namespace blender::compositor {
+
/**
* \brief base class of normalize, implementing the simple normalize
* \ingroup operation
@@ -63,3 +65,5 @@ class NormalizeOperation : public NodeOperation {
ReadBufferOperation *readOperation,
rcti *output) override;
};
+
+} // namespace blender::compositor
diff --git a/source/blender/compositor/operations/COM_OutputFileMultiViewOperation.cc b/source/blender/compositor/operations/COM_OutputFileMultiViewOperation.cc
index 7044fe402eb..5b6f650d40e 100644
--- a/source/blender/compositor/operations/COM_OutputFileMultiViewOperation.cc
+++ b/source/blender/compositor/operations/COM_OutputFileMultiViewOperation.cc
@@ -37,6 +37,8 @@
#include "IMB_imbuf.h"
#include "IMB_imbuf_types.h"
+namespace blender::compositor {
+
/************************************ OpenEXR Singlelayer Multiview ******************************/
OutputOpenExrSingleLayerMultiViewOperation::OutputOpenExrSingleLayerMultiViewOperation(
@@ -380,3 +382,5 @@ void OutputStereoOperation::deinitExecution()
}
}
}
+
+} // namespace blender::compositor
diff --git a/source/blender/compositor/operations/COM_OutputFileMultiViewOperation.h b/source/blender/compositor/operations/COM_OutputFileMultiViewOperation.h
index 90c683a57b5..6230a6f306b 100644
--- a/source/blender/compositor/operations/COM_OutputFileMultiViewOperation.h
+++ b/source/blender/compositor/operations/COM_OutputFileMultiViewOperation.h
@@ -28,6 +28,8 @@
#include "intern/openexr/openexr_multi.h"
+namespace blender::compositor {
+
class OutputOpenExrSingleLayerMultiViewOperation : public OutputSingleLayerOperation {
private:
public:
@@ -80,3 +82,5 @@ class OutputStereoOperation : public OutputSingleLayerOperation {
void *get_handle(const char *filename);
void deinitExecution() override;
};
+
+} // namespace blender::compositor
diff --git a/source/blender/compositor/operations/COM_OutputFileOperation.cc b/source/blender/compositor/operations/COM_OutputFileOperation.cc
index a6135ef064c..1ee749b1a49 100644
--- a/source/blender/compositor/operations/COM_OutputFileOperation.cc
+++ b/source/blender/compositor/operations/COM_OutputFileOperation.cc
@@ -40,6 +40,8 @@
#include "RE_pipeline.h"
+namespace blender::compositor {
+
void add_exr_channels(void *exrhandle,
const char *layerName,
const DataType datatype,
@@ -191,7 +193,7 @@ static void write_buffer_rect(rcti *rect,
for (y = y1; y < y2 && (!breaked); y++) {
for (x = x1; x < x2 && (!breaked); x++) {
- reader->readSampled(color, x, y, COM_PS_NEAREST);
+ reader->readSampled(color, x, y, PixelSampler::Nearest);
for (i = 0; i < size; i++) {
buffer[offset + i] = color[i];
@@ -321,6 +323,7 @@ OutputOpenExrMultiLayerOperation::OutputOpenExrMultiLayerOperation(const Scene *
this->m_exr_codec = exr_codec;
this->m_exr_half_float = exr_half_float;
this->m_viewName = viewName;
+ this->setResolutionInputSocketIndex(RESOLUTION_INPUT_ANY);
}
void OutputOpenExrMultiLayerOperation::add_layer(const char *name,
@@ -328,7 +331,7 @@ void OutputOpenExrMultiLayerOperation::add_layer(const char *name,
bool use_layer)
{
this->addInputSocket(datatype);
- this->m_layers.push_back(OutputOpenExrLayer(name, datatype, use_layer));
+ this->m_layers.append(OutputOpenExrLayer(name, datatype, use_layer));
}
StampData *OutputOpenExrMultiLayerOperation::createStampData() const
@@ -338,17 +341,16 @@ StampData *OutputOpenExrMultiLayerOperation::createStampData() const
RenderResult render_result;
StampData *stamp_data = BKE_stamp_info_from_scene_static(m_scene);
render_result.stamp_data = stamp_data;
- for (int i = 0; i < this->m_layers.size(); i++) {
- const OutputOpenExrLayer *layer = &this->m_layers[i];
+ for (const OutputOpenExrLayer &layer : m_layers) {
/* Skip unconnected sockets. */
- if (layer->imageInput == nullptr) {
+ if (layer.imageInput == nullptr) {
continue;
}
- std::unique_ptr<MetaData> meta_data = layer->imageInput->getMetaData();
+ std::unique_ptr<MetaData> meta_data = layer.imageInput->getMetaData();
if (meta_data) {
blender::StringRef layer_name =
blender::bke::cryptomatte::BKE_cryptomatte_extract_layer_name(
- blender::StringRef(layer->name, BLI_strnlen(layer->name, sizeof(layer->name))));
+ blender::StringRef(layer.name, BLI_strnlen(layer.name, sizeof(layer.name))));
meta_data->replaceHashNeutralCryptomatteKeys(layer_name);
meta_data->addToRenderResult(&render_result);
}
@@ -441,3 +443,5 @@ void OutputOpenExrMultiLayerOperation::deinitExecution()
BKE_stamp_data_free(stamp_data);
}
}
+
+} // namespace blender::compositor
diff --git a/source/blender/compositor/operations/COM_OutputFileOperation.h b/source/blender/compositor/operations/COM_OutputFileOperation.h
index aa7ba35ddee..64ab4c06e7c 100644
--- a/source/blender/compositor/operations/COM_OutputFileOperation.h
+++ b/source/blender/compositor/operations/COM_OutputFileOperation.h
@@ -27,6 +27,8 @@
#include "intern/openexr/openexr_multi.h"
+namespace blender::compositor {
+
/* Writes the image to a single-layer file. */
class OutputSingleLayerOperation : public NodeOperation {
protected:
@@ -64,14 +66,9 @@ class OutputSingleLayerOperation : public NodeOperation {
}
void initExecution() override;
void deinitExecution() override;
- CompositorPriority getRenderPriority() const override
- {
- return CompositorPriority::Low;
- }
-
- bool isFileOutputOperation() const override
+ eCompositorPriority getRenderPriority() const override
{
- return true;
+ return eCompositorPriority::Low;
}
};
@@ -91,8 +88,6 @@ struct OutputOpenExrLayer {
/* Writes inputs into OpenEXR multilayer channels. */
class OutputOpenExrMultiLayerOperation : public NodeOperation {
protected:
- typedef std::vector<OutputOpenExrLayer> LayerList;
-
const Scene *m_scene;
const RenderData *m_rd;
const bNodeTree *m_tree;
@@ -100,7 +95,7 @@ class OutputOpenExrMultiLayerOperation : public NodeOperation {
char m_path[FILE_MAX];
char m_exr_codec;
bool m_exr_half_float;
- LayerList m_layers;
+ Vector<OutputOpenExrLayer> m_layers;
const char *m_viewName;
StampData *createStampData() const;
@@ -123,14 +118,9 @@ class OutputOpenExrMultiLayerOperation : public NodeOperation {
}
void initExecution() override;
void deinitExecution() override;
- CompositorPriority getRenderPriority() const override
+ eCompositorPriority getRenderPriority() const override
{
- return CompositorPriority::Low;
- }
-
- bool isFileOutputOperation() const override
- {
- return true;
+ return eCompositorPriority::Low;
}
};
@@ -146,3 +136,5 @@ void free_exr_channels(void *exrhandle,
const char *layerName,
const DataType datatype);
int get_datatype_size(DataType datatype);
+
+} // namespace blender::compositor
diff --git a/source/blender/compositor/operations/COM_PixelateOperation.cc b/source/blender/compositor/operations/COM_PixelateOperation.cc
index 0d810c80ab4..94827cd1b02 100644
--- a/source/blender/compositor/operations/COM_PixelateOperation.cc
+++ b/source/blender/compositor/operations/COM_PixelateOperation.cc
@@ -18,6 +18,8 @@
#include "COM_PixelateOperation.h"
+namespace blender::compositor {
+
PixelateOperation::PixelateOperation(DataType datatype)
{
this->addInputSocket(datatype);
@@ -45,3 +47,5 @@ void PixelateOperation::executePixelSampled(float output[4],
float ny = round(y);
this->m_inputOperation->readSampled(output, nx, ny, sampler);
}
+
+} // namespace blender::compositor
diff --git a/source/blender/compositor/operations/COM_PixelateOperation.h b/source/blender/compositor/operations/COM_PixelateOperation.h
index aae54965aa4..e8b272853da 100644
--- a/source/blender/compositor/operations/COM_PixelateOperation.h
+++ b/source/blender/compositor/operations/COM_PixelateOperation.h
@@ -20,6 +20,8 @@
#include "COM_NodeOperation.h"
+namespace blender::compositor {
+
/**
* \brief Pixelate operation
*
@@ -60,3 +62,5 @@ class PixelateOperation : public NodeOperation {
*/
void executePixelSampled(float output[4], float x, float y, PixelSampler sampler) override;
};
+
+} // namespace blender::compositor
diff --git a/source/blender/compositor/operations/COM_PlaneCornerPinOperation.cc b/source/blender/compositor/operations/COM_PlaneCornerPinOperation.cc
index bcf79e1c6c6..3577860b93d 100644
--- a/source/blender/compositor/operations/COM_PlaneCornerPinOperation.cc
+++ b/source/blender/compositor/operations/COM_PlaneCornerPinOperation.cc
@@ -26,6 +26,8 @@
#include "BKE_node.h"
+namespace blender::compositor {
+
static bool check_corners(float corners[4][2])
{
int i, next, prev;
@@ -60,7 +62,7 @@ static void readCornersFromSockets(rcti *rect, SocketReader *readers[4], float c
{
for (int i = 0; i < 4; i++) {
float result[4] = {0.0f, 0.0f, 0.0f, 0.0f};
- readers[i]->readSampled(result, rect->xmin, rect->ymin, COM_PS_NEAREST);
+ readers[i]->readSampled(result, rect->xmin, rect->ymin, PixelSampler::Nearest);
corners[i][0] = result[0];
corners[i][1] = result[1];
}
@@ -98,7 +100,7 @@ PlaneCornerPinMaskOperation::PlaneCornerPinMaskOperation() : m_corners_ready(fal
* so we can use the initializeTileData function
* to read corners from input sockets ...
*/
- setComplex(true);
+ flags.complex = true;
}
void PlaneCornerPinMaskOperation::initExecution()
@@ -224,3 +226,5 @@ bool PlaneCornerPinWarpImageOperation::determineDependingAreaOfInterest(
input, readOperation, output);
#endif
}
+
+} // namespace blender::compositor
diff --git a/source/blender/compositor/operations/COM_PlaneCornerPinOperation.h b/source/blender/compositor/operations/COM_PlaneCornerPinOperation.h
index 6edecff0d54..91c0cd9e16b 100644
--- a/source/blender/compositor/operations/COM_PlaneCornerPinOperation.h
+++ b/source/blender/compositor/operations/COM_PlaneCornerPinOperation.h
@@ -27,6 +27,8 @@
#include "BLI_listbase.h"
#include "BLI_string.h"
+namespace blender::compositor {
+
class PlaneCornerPinMaskOperation : public PlaneDistortMaskOperation {
private:
bool m_corners_ready;
@@ -59,3 +61,5 @@ class PlaneCornerPinWarpImageOperation : public PlaneDistortWarpImageOperation {
ReadBufferOperation *readOperation,
rcti *output) override;
};
+
+} // namespace blender::compositor
diff --git a/source/blender/compositor/operations/COM_PlaneDistortCommonOperation.cc b/source/blender/compositor/operations/COM_PlaneDistortCommonOperation.cc
index 87f837973d2..4edcc206f5b 100644
--- a/source/blender/compositor/operations/COM_PlaneDistortCommonOperation.cc
+++ b/source/blender/compositor/operations/COM_PlaneDistortCommonOperation.cc
@@ -29,6 +29,33 @@
#include "BKE_node.h"
#include "BKE_tracking.h"
+namespace blender::compositor {
+
+PlaneDistortBaseOperation::PlaneDistortBaseOperation()
+ : m_motion_blur_samples(1), m_motion_blur_shutter(0.5f)
+{
+}
+
+void PlaneDistortBaseOperation::calculateCorners(const float corners[4][2],
+ bool normalized,
+ int sample)
+{
+ BLI_assert(sample < this->m_motion_blur_samples);
+ MotionSample *sample_data = &this->m_samples[sample];
+ if (normalized) {
+ for (int i = 0; i < 4; i++) {
+ sample_data->frameSpaceCorners[i][0] = corners[i][0] * this->getWidth();
+ sample_data->frameSpaceCorners[i][1] = corners[i][1] * this->getHeight();
+ }
+ }
+ else {
+ for (int i = 0; i < 4; i++) {
+ sample_data->frameSpaceCorners[i][0] = corners[i][0];
+ sample_data->frameSpaceCorners[i][1] = corners[i][1];
+ }
+ }
+}
+
/* ******** PlaneDistort WarpImage ******** */
BLI_INLINE void warpCoord(float x, float y, float matrix[3][3], float uv[2], float deriv[2][2])
@@ -44,38 +71,25 @@ BLI_INLINE void warpCoord(float x, float y, float matrix[3][3], float uv[2], flo
deriv[1][1] = (matrix[1][1] - matrix[1][2] * uv[1]) / vec[2];
}
-PlaneDistortWarpImageOperation::PlaneDistortWarpImageOperation()
+PlaneDistortWarpImageOperation::PlaneDistortWarpImageOperation() : PlaneDistortBaseOperation()
{
- this->addInputSocket(DataType::Color, COM_SC_NO_RESIZE);
+ this->addInputSocket(DataType::Color, ResizeMode::None);
this->addOutputSocket(DataType::Color);
this->m_pixelReader = nullptr;
- this->m_motion_blur_samples = 1;
- this->m_motion_blur_shutter = 0.5f;
- this->setComplex(true);
+ this->flags.complex = true;
}
void PlaneDistortWarpImageOperation::calculateCorners(const float corners[4][2],
bool normalized,
int sample)
{
- BLI_assert(sample < this->m_motion_blur_samples);
+ PlaneDistortBaseOperation::calculateCorners(corners, normalized, sample);
+
const int width = this->m_pixelReader->getWidth();
const int height = this->m_pixelReader->getHeight();
float frame_corners[4][2] = {
{0.0f, 0.0f}, {(float)width, 0.0f}, {(float)width, (float)height}, {0.0f, (float)height}};
MotionSample *sample_data = &this->m_samples[sample];
- if (normalized) {
- for (int i = 0; i < 4; i++) {
- sample_data->frameSpaceCorners[i][0] = corners[i][0] * this->getWidth();
- sample_data->frameSpaceCorners[i][1] = corners[i][1] * this->getHeight();
- }
- }
- else {
- for (int i = 0; i < 4; i++) {
- sample_data->frameSpaceCorners[i][0] = corners[i][0];
- sample_data->frameSpaceCorners[i][1] = corners[i][1];
- }
- }
BKE_tracking_homography_between_two_quads(
sample_data->frameSpaceCorners, frame_corners, sample_data->perspectiveMatrix);
}
@@ -145,34 +159,12 @@ bool PlaneDistortWarpImageOperation::determineDependingAreaOfInterest(
/* ******** PlaneDistort Mask ******** */
-PlaneDistortMaskOperation::PlaneDistortMaskOperation()
+PlaneDistortMaskOperation::PlaneDistortMaskOperation() : PlaneDistortBaseOperation()
{
addOutputSocket(DataType::Value);
/* Currently hardcoded to 8 samples. */
m_osa = 8;
- this->m_motion_blur_samples = 1;
- this->m_motion_blur_shutter = 0.5f;
-}
-
-void PlaneDistortMaskOperation::calculateCorners(const float corners[4][2],
- bool normalized,
- int sample)
-{
- BLI_assert(sample < this->m_motion_blur_samples);
- MotionSample *sample_data = &this->m_samples[sample];
- if (normalized) {
- for (int i = 0; i < 4; i++) {
- sample_data->frameSpaceCorners[i][0] = corners[i][0] * this->getWidth();
- sample_data->frameSpaceCorners[i][1] = corners[i][1] * this->getHeight();
- }
- }
- else {
- for (int i = 0; i < 4; i++) {
- sample_data->frameSpaceCorners[i][0] = corners[i][0];
- sample_data->frameSpaceCorners[i][1] = corners[i][1];
- }
- }
}
void PlaneDistortMaskOperation::initExecution()
@@ -226,3 +218,5 @@ void PlaneDistortMaskOperation::executePixelSampled(float output[4],
output[0] = (float)inside_counter / (this->m_osa * this->m_motion_blur_samples);
}
}
+
+} // namespace blender::compositor
diff --git a/source/blender/compositor/operations/COM_PlaneDistortCommonOperation.h b/source/blender/compositor/operations/COM_PlaneDistortCommonOperation.h
index c17f99a6710..cc6e4d00d71 100644
--- a/source/blender/compositor/operations/COM_PlaneDistortCommonOperation.h
+++ b/source/blender/compositor/operations/COM_PlaneDistortCommonOperation.h
@@ -28,23 +28,47 @@
#include "BLI_listbase.h"
#include "BLI_string.h"
+namespace blender::compositor {
+
#define PLANE_DISTORT_MAX_SAMPLES 64
-class PlaneDistortWarpImageOperation : public NodeOperation {
+class PlaneDistortBaseOperation : public NodeOperation {
protected:
struct MotionSample {
float frameSpaceCorners[4][2]; /* Corners coordinates in pixel space. */
float perspectiveMatrix[3][3];
};
- SocketReader *m_pixelReader;
MotionSample m_samples[PLANE_DISTORT_MAX_SAMPLES];
int m_motion_blur_samples;
float m_motion_blur_shutter;
public:
+ PlaneDistortBaseOperation();
+
+ void setMotionBlurSamples(int samples)
+ {
+ BLI_assert(samples <= PLANE_DISTORT_MAX_SAMPLES);
+ this->m_motion_blur_samples = samples;
+ }
+ void setMotionBlurShutter(float shutter)
+ {
+ this->m_motion_blur_shutter = shutter;
+ }
+
+ virtual void calculateCorners(const float corners[4][2], bool normalized, int sample);
+
+ private:
+ friend class PlaneTrackCommon;
+};
+
+class PlaneDistortWarpImageOperation : public PlaneDistortBaseOperation {
+ protected:
+ SocketReader *m_pixelReader;
+
+ public:
PlaneDistortWarpImageOperation();
- void calculateCorners(const float corners[4][2], bool normalized, int sample);
+ void calculateCorners(const float corners[4][2], bool normalized, int sample) override;
void initExecution() override;
void deinitExecution() override;
@@ -54,45 +78,19 @@ class PlaneDistortWarpImageOperation : public NodeOperation {
bool determineDependingAreaOfInterest(rcti *input,
ReadBufferOperation *readOperation,
rcti *output) override;
-
- void setMotionBlurSamples(int samples)
- {
- BLI_assert(samples <= PLANE_DISTORT_MAX_SAMPLES);
- this->m_motion_blur_samples = samples;
- }
- void setMotionBlurShutter(float shutter)
- {
- this->m_motion_blur_shutter = shutter;
- }
};
-class PlaneDistortMaskOperation : public NodeOperation {
+class PlaneDistortMaskOperation : public PlaneDistortBaseOperation {
protected:
- struct MotionSample {
- float frameSpaceCorners[4][2]; /* Corners coordinates in pixel space. */
- };
int m_osa;
- MotionSample m_samples[PLANE_DISTORT_MAX_SAMPLES];
float m_jitter[32][2];
- int m_motion_blur_samples;
- float m_motion_blur_shutter;
public:
PlaneDistortMaskOperation();
- void calculateCorners(const float corners[4][2], bool normalized, int sample);
-
void initExecution() override;
void executePixelSampled(float output[4], float x, float y, PixelSampler sampler) override;
-
- void setMotionBlurSamples(int samples)
- {
- BLI_assert(samples <= PLANE_DISTORT_MAX_SAMPLES);
- this->m_motion_blur_samples = samples;
- }
- void setMotionBlurShutter(float shutter)
- {
- this->m_motion_blur_shutter = shutter;
- }
};
+
+} // namespace blender::compositor
diff --git a/source/blender/compositor/operations/COM_PlaneTrackOperation.cc b/source/blender/compositor/operations/COM_PlaneTrackOperation.cc
index 81a598e937b..0884f2ad979 100644
--- a/source/blender/compositor/operations/COM_PlaneTrackOperation.cc
+++ b/source/blender/compositor/operations/COM_PlaneTrackOperation.cc
@@ -29,6 +29,8 @@
#include "BKE_node.h"
#include "BKE_tracking.h"
+namespace blender::compositor {
+
/* ******** PlaneTrackCommon ******** */
PlaneTrackCommon::PlaneTrackCommon()
@@ -39,6 +41,26 @@ PlaneTrackCommon::PlaneTrackCommon()
this->m_planeTrackName[0] = '\0';
}
+void PlaneTrackCommon::read_and_calculate_corners(PlaneDistortBaseOperation *distort_op)
+{
+ float corners[4][2];
+ if (distort_op->m_motion_blur_samples == 1) {
+ readCornersFromTrack(corners, this->m_framenumber);
+ distort_op->calculateCorners(corners, true, 0);
+ }
+ else {
+ const float frame = (float)this->m_framenumber - distort_op->m_motion_blur_shutter;
+ const float frame_step = (distort_op->m_motion_blur_shutter * 2.0f) /
+ distort_op->m_motion_blur_samples;
+ float frame_iter = frame;
+ for (int sample = 0; sample < distort_op->m_motion_blur_samples; sample++) {
+ readCornersFromTrack(corners, frame_iter);
+ distort_op->calculateCorners(corners, true, sample);
+ frame_iter += frame_step;
+ }
+ }
+}
+
void PlaneTrackCommon::readCornersFromTrack(float corners[4][2], float frame)
{
MovieTracking *tracking;
@@ -82,21 +104,7 @@ void PlaneTrackCommon::determineResolution(unsigned int resolution[2],
void PlaneTrackMaskOperation::initExecution()
{
PlaneDistortMaskOperation::initExecution();
- float corners[4][2];
- if (this->m_motion_blur_samples == 1) {
- readCornersFromTrack(corners, this->m_framenumber);
- calculateCorners(corners, true, 0);
- }
- else {
- const float frame = (float)this->m_framenumber - this->m_motion_blur_shutter;
- const float frame_step = (this->m_motion_blur_shutter * 2.0f) / this->m_motion_blur_samples;
- float frame_iter = frame;
- for (int sample = 0; sample < this->m_motion_blur_samples; sample++) {
- readCornersFromTrack(corners, frame_iter);
- calculateCorners(corners, true, sample);
- frame_iter += frame_step;
- }
- }
+ PlaneTrackCommon::read_and_calculate_corners(this);
}
/* ******** PlaneTrackWarpImageOperation ******** */
@@ -104,20 +112,7 @@ void PlaneTrackMaskOperation::initExecution()
void PlaneTrackWarpImageOperation::initExecution()
{
PlaneDistortWarpImageOperation::initExecution();
- /* TODO(sergey): De-duplicate with mask operation. */
- float corners[4][2];
- if (this->m_motion_blur_samples == 1) {
- readCornersFromTrack(corners, this->m_framenumber);
- calculateCorners(corners, true, 0);
- }
- else {
- const float frame = (float)this->m_framenumber - this->m_motion_blur_shutter;
- const float frame_step = (this->m_motion_blur_shutter * 2.0f) / this->m_motion_blur_samples;
- float frame_iter = frame;
- for (int sample = 0; sample < this->m_motion_blur_samples; sample++) {
- readCornersFromTrack(corners, frame_iter);
- calculateCorners(corners, true, sample);
- frame_iter += frame_step;
- }
- }
+ PlaneTrackCommon::read_and_calculate_corners(this);
}
+
+} // namespace blender::compositor
diff --git a/source/blender/compositor/operations/COM_PlaneTrackOperation.h b/source/blender/compositor/operations/COM_PlaneTrackOperation.h
index 6cfb3accaa3..d240c8b06e9 100644
--- a/source/blender/compositor/operations/COM_PlaneTrackOperation.h
+++ b/source/blender/compositor/operations/COM_PlaneTrackOperation.h
@@ -28,6 +28,8 @@
#include "BLI_listbase.h"
#include "BLI_string.h"
+namespace blender::compositor {
+
class PlaneTrackCommon {
protected:
MovieClip *m_movieClip;
@@ -38,7 +40,7 @@ class PlaneTrackCommon {
/* note: this class is not an operation itself (to prevent virtual inheritance issues)
* implementation classes must make wrappers to use these methods, see below.
*/
- void readCornersFromTrack(float corners[4][2], float frame);
+ void read_and_calculate_corners(PlaneDistortBaseOperation *distort_op);
void determineResolution(unsigned int resolution[2], unsigned int preferredResolution[2]);
public:
@@ -60,6 +62,9 @@ class PlaneTrackCommon {
{
this->m_framenumber = framenumber;
}
+
+ private:
+ void readCornersFromTrack(float corners[4][2], float frame);
};
class PlaneTrackMaskOperation : public PlaneDistortMaskOperation, public PlaneTrackCommon {
@@ -97,3 +102,5 @@ class PlaneTrackWarpImageOperation : public PlaneDistortWarpImageOperation,
NodeOperation::determineResolution(temp, resolution);
}
};
+
+} // namespace blender::compositor
diff --git a/source/blender/compositor/operations/COM_PreviewOperation.cc b/source/blender/compositor/operations/COM_PreviewOperation.cc
index 6d1199ab118..e7c11613aa3 100644
--- a/source/blender/compositor/operations/COM_PreviewOperation.cc
+++ b/source/blender/compositor/operations/COM_PreviewOperation.cc
@@ -33,13 +33,15 @@
#include "IMB_imbuf.h"
#include "IMB_imbuf_types.h"
+namespace blender::compositor {
+
PreviewOperation::PreviewOperation(const ColorManagedViewSettings *viewSettings,
const ColorManagedDisplaySettings *displaySettings,
const unsigned int defaultWidth,
const unsigned int defaultHeight)
{
- this->addInputSocket(DataType::Color, COM_SC_NO_RESIZE);
+ this->addInputSocket(DataType::Color, ResizeMode::None);
this->m_preview = nullptr;
this->m_outputBuffer = nullptr;
this->m_input = nullptr;
@@ -48,6 +50,8 @@ PreviewOperation::PreviewOperation(const ColorManagedViewSettings *viewSettings,
this->m_displaySettings = displaySettings;
this->m_defaultWidth = defaultWidth;
this->m_defaultHeight = defaultHeight;
+ flags.use_viewer_border = true;
+ flags.is_preview_operation = true;
}
void PreviewOperation::verifyPreview(bNodeInstanceHash *previews, bNodeInstanceKey key)
@@ -104,7 +108,7 @@ void PreviewOperation::executeRegion(rcti *rect, unsigned int /*tileNumber*/)
color[1] = 0.0f;
color[2] = 0.0f;
color[3] = 1.0f;
- this->m_input->readSampled(color, rx, ry, COM_PS_NEAREST);
+ this->m_input->readSampled(color, rx, ry, PixelSampler::Nearest);
IMB_colormanagement_processor_apply_v4(cm_processor, color);
rgba_float_to_uchar(this->m_outputBuffer + offset, color);
offset += 4;
@@ -162,7 +166,9 @@ void PreviewOperation::determineResolution(unsigned int resolution[2],
resolution[1] = height;
}
-CompositorPriority PreviewOperation::getRenderPriority() const
+eCompositorPriority PreviewOperation::getRenderPriority() const
{
- return CompositorPriority::Low;
+ return eCompositorPriority::Low;
}
+
+} // namespace blender::compositor
diff --git a/source/blender/compositor/operations/COM_PreviewOperation.h b/source/blender/compositor/operations/COM_PreviewOperation.h
index 36ae5f59bb9..0f43f01c5d6 100644
--- a/source/blender/compositor/operations/COM_PreviewOperation.h
+++ b/source/blender/compositor/operations/COM_PreviewOperation.h
@@ -24,6 +24,8 @@
#include "DNA_color_types.h"
#include "DNA_image_types.h"
+namespace blender::compositor {
+
class PreviewOperation : public NodeOperation {
protected:
unsigned char *m_outputBuffer;
@@ -53,7 +55,7 @@ class PreviewOperation : public NodeOperation {
}
void initExecution() override;
void deinitExecution() override;
- CompositorPriority getRenderPriority() const override;
+ eCompositorPriority getRenderPriority() const override;
void executeRegion(rcti *rect, unsigned int tileNumber) override;
void determineResolution(unsigned int resolution[2],
@@ -61,8 +63,6 @@ class PreviewOperation : public NodeOperation {
bool determineDependingAreaOfInterest(rcti *input,
ReadBufferOperation *readOperation,
rcti *output) override;
- bool isPreviewOperation() const override
- {
- return true;
- }
};
+
+} // namespace blender::compositor
diff --git a/source/blender/compositor/operations/COM_ProjectorLensDistortionOperation.cc b/source/blender/compositor/operations/COM_ProjectorLensDistortionOperation.cc
index 5494c3cd46b..93702d3f0cf 100644
--- a/source/blender/compositor/operations/COM_ProjectorLensDistortionOperation.cc
+++ b/source/blender/compositor/operations/COM_ProjectorLensDistortionOperation.cc
@@ -20,12 +20,14 @@
#include "BLI_math.h"
#include "BLI_utildefines.h"
+namespace blender::compositor {
+
ProjectorLensDistortionOperation::ProjectorLensDistortionOperation()
{
this->addInputSocket(DataType::Color);
this->addInputSocket(DataType::Value);
this->addOutputSocket(DataType::Color);
- this->setComplex(true);
+ this->flags.complex = true;
this->m_inputProgram = nullptr;
this->m_dispersionAvailable = false;
this->m_dispersion = 0.0f;
@@ -103,7 +105,7 @@ void ProjectorLensDistortionOperation::updateDispersion()
this->lockMutex();
if (!this->m_dispersionAvailable) {
float result[4];
- this->getInputSocketReader(1)->readSampled(result, 1, 1, COM_PS_NEAREST);
+ this->getInputSocketReader(1)->readSampled(result, 1, 1, PixelSampler::Nearest);
this->m_dispersion = result[0];
this->m_kr = 0.25f * max_ff(min_ff(this->m_dispersion, 1.0f), 0.0f);
this->m_kr2 = this->m_kr * 20;
@@ -111,3 +113,5 @@ void ProjectorLensDistortionOperation::updateDispersion()
}
this->unlockMutex();
}
+
+} // namespace blender::compositor
diff --git a/source/blender/compositor/operations/COM_ProjectorLensDistortionOperation.h b/source/blender/compositor/operations/COM_ProjectorLensDistortionOperation.h
index b47d4f37589..bce61d3de15 100644
--- a/source/blender/compositor/operations/COM_ProjectorLensDistortionOperation.h
+++ b/source/blender/compositor/operations/COM_ProjectorLensDistortionOperation.h
@@ -21,6 +21,8 @@
#include "COM_NodeOperation.h"
#include "DNA_node_types.h"
+namespace blender::compositor {
+
class ProjectorLensDistortionOperation : public NodeOperation {
private:
/**
@@ -58,3 +60,5 @@ class ProjectorLensDistortionOperation : public NodeOperation {
void updateDispersion();
};
+
+} // namespace blender::compositor
diff --git a/source/blender/compositor/operations/COM_QualityStepHelper.cc b/source/blender/compositor/operations/COM_QualityStepHelper.cc
index c0d86314fb7..e347d278ce4 100644
--- a/source/blender/compositor/operations/COM_QualityStepHelper.cc
+++ b/source/blender/compositor/operations/COM_QualityStepHelper.cc
@@ -18,9 +18,11 @@
#include "COM_QualityStepHelper.h"
+namespace blender::compositor {
+
QualityStepHelper::QualityStepHelper()
{
- this->m_quality = CompositorQuality::High;
+ this->m_quality = eCompositorQuality::High;
this->m_step = 1;
this->m_offsetadd = 4;
}
@@ -30,16 +32,16 @@ void QualityStepHelper::initExecution(QualityHelper helper)
switch (helper) {
case COM_QH_INCREASE:
switch (this->m_quality) {
- case CompositorQuality::High:
+ case eCompositorQuality::High:
default:
this->m_step = 1;
this->m_offsetadd = 1;
break;
- case CompositorQuality::Medium:
+ case eCompositorQuality::Medium:
this->m_step = 2;
this->m_offsetadd = 2;
break;
- case CompositorQuality::Low:
+ case eCompositorQuality::Low:
this->m_step = 3;
this->m_offsetadd = 3;
break;
@@ -47,16 +49,16 @@ void QualityStepHelper::initExecution(QualityHelper helper)
break;
case COM_QH_MULTIPLY:
switch (this->m_quality) {
- case CompositorQuality::High:
+ case eCompositorQuality::High:
default:
this->m_step = 1;
this->m_offsetadd = 4;
break;
- case CompositorQuality::Medium:
+ case eCompositorQuality::Medium:
this->m_step = 2;
this->m_offsetadd = 8;
break;
- case CompositorQuality::Low:
+ case eCompositorQuality::Low:
this->m_step = 4;
this->m_offsetadd = 16;
break;
@@ -64,3 +66,5 @@ void QualityStepHelper::initExecution(QualityHelper helper)
break;
}
}
+
+} // namespace blender::compositor
diff --git a/source/blender/compositor/operations/COM_QualityStepHelper.h b/source/blender/compositor/operations/COM_QualityStepHelper.h
index e437613fb29..c5f16a58686 100644
--- a/source/blender/compositor/operations/COM_QualityStepHelper.h
+++ b/source/blender/compositor/operations/COM_QualityStepHelper.h
@@ -18,7 +18,9 @@
#pragma once
-#include "COM_defines.h"
+#include "COM_Enums.h"
+
+namespace blender::compositor {
typedef enum QualityHelper {
COM_QH_INCREASE,
@@ -27,7 +29,7 @@ typedef enum QualityHelper {
class QualityStepHelper {
private:
- CompositorQuality m_quality;
+ eCompositorQuality m_quality;
int m_step;
int m_offsetadd;
@@ -49,8 +51,10 @@ class QualityStepHelper {
public:
QualityStepHelper();
- void setQuality(CompositorQuality quality)
+ void setQuality(eCompositorQuality quality)
{
this->m_quality = quality;
}
};
+
+} // namespace blender::compositor
diff --git a/source/blender/compositor/operations/COM_ReadBufferOperation.cc b/source/blender/compositor/operations/COM_ReadBufferOperation.cc
index 2977e6685d2..cc58f29e8d9 100644
--- a/source/blender/compositor/operations/COM_ReadBufferOperation.cc
+++ b/source/blender/compositor/operations/COM_ReadBufferOperation.cc
@@ -20,12 +20,15 @@
#include "COM_WriteBufferOperation.h"
#include "COM_defines.h"
+namespace blender::compositor {
+
ReadBufferOperation::ReadBufferOperation(DataType datatype)
{
this->addOutputSocket(datatype);
this->m_single_value = false;
this->m_offset = 0;
this->m_buffer = nullptr;
+ flags.is_read_buffer_operation = true;
}
void *ReadBufferOperation::initializeTileData(rcti * /*rect*/)
@@ -60,14 +63,14 @@ void ReadBufferOperation::executePixelSampled(float output[4],
}
else {
switch (sampler) {
- case COM_PS_NEAREST:
+ case PixelSampler::Nearest:
m_buffer->read(output, x, y);
break;
- case COM_PS_BILINEAR:
+ case PixelSampler::Bilinear:
default:
m_buffer->readBilinear(output, x, y);
break;
- case COM_PS_BICUBIC:
+ case PixelSampler::Bicubic:
m_buffer->readBilinear(output, x, y);
break;
}
@@ -85,7 +88,7 @@ void ReadBufferOperation::executePixelExtend(float output[4],
/* write buffer has a single value stored at (0,0) */
m_buffer->read(output, 0, 0);
}
- else if (sampler == COM_PS_NEAREST) {
+ else if (sampler == PixelSampler::Nearest) {
m_buffer->read(output, x, y, extend_x, extend_y);
}
else {
@@ -131,3 +134,5 @@ void ReadBufferOperation::updateMemoryBuffer()
{
this->m_buffer = this->getMemoryProxy()->getBuffer();
}
+
+} // namespace blender::compositor
diff --git a/source/blender/compositor/operations/COM_ReadBufferOperation.h b/source/blender/compositor/operations/COM_ReadBufferOperation.h
index 21ef716b727..8b96b961a43 100644
--- a/source/blender/compositor/operations/COM_ReadBufferOperation.h
+++ b/source/blender/compositor/operations/COM_ReadBufferOperation.h
@@ -22,6 +22,8 @@
#include "COM_MemoryProxy.h"
#include "COM_NodeOperation.h"
+namespace blender::compositor {
+
class ReadBufferOperation : public NodeOperation {
private:
MemoryProxy *m_memoryProxy;
@@ -35,10 +37,12 @@ class ReadBufferOperation : public NodeOperation {
{
this->m_memoryProxy = memoryProxy;
}
- MemoryProxy *getMemoryProxy()
+
+ MemoryProxy *getMemoryProxy() const
{
return this->m_memoryProxy;
}
+
void determineResolution(unsigned int resolution[2],
unsigned int preferredResolution[2]) override;
@@ -51,10 +55,6 @@ class ReadBufferOperation : public NodeOperation {
MemoryBufferExtend extend_x,
MemoryBufferExtend extend_y);
void executePixelFiltered(float output[4], float x, float y, float dx[2], float dy[2]) override;
- bool isReadBufferOperation() const override
- {
- return true;
- }
void setOffset(unsigned int offset)
{
this->m_offset = offset;
@@ -73,3 +73,5 @@ class ReadBufferOperation : public NodeOperation {
void readResolutionFromWriteBuffer();
void updateMemoryBuffer();
};
+
+} // namespace blender::compositor
diff --git a/source/blender/compositor/operations/COM_RenderLayersProg.cc b/source/blender/compositor/operations/COM_RenderLayersProg.cc
index d622e14b585..1ac451b95c2 100644
--- a/source/blender/compositor/operations/COM_RenderLayersProg.cc
+++ b/source/blender/compositor/operations/COM_RenderLayersProg.cc
@@ -32,6 +32,8 @@
#include "RE_pipeline.h"
#include "RE_texture.h"
+namespace blender::compositor {
+
/* ******** Render Layers Base Prog ******** */
RenderLayersProg::RenderLayersProg(const char *passName, DataType type, int elementsize)
@@ -92,7 +94,7 @@ void RenderLayersProg::doInterpolation(float output[4], float x, float y, PixelS
}
switch (sampler) {
- case COM_PS_NEAREST: {
+ case PixelSampler::Nearest: {
offset = (iy * width + ix) * this->m_elementsize;
if (this->m_elementsize == 1) {
@@ -107,12 +109,12 @@ void RenderLayersProg::doInterpolation(float output[4], float x, float y, PixelS
break;
}
- case COM_PS_BILINEAR:
+ case PixelSampler::Bilinear:
BLI_bilinear_interpolation_fl(
this->m_inputBuffer, output, width, height, this->m_elementsize, x, y);
break;
- case COM_PS_BICUBIC:
+ case PixelSampler::Bicubic:
BLI_bicubic_interpolation_fl(
this->m_inputBuffer, output, width, height, this->m_elementsize, x, y);
break;
@@ -216,7 +218,7 @@ void RenderLayersProg::determineResolution(unsigned int resolution[2],
}
}
-std::unique_ptr<MetaData> RenderLayersProg::getMetaData() const
+std::unique_ptr<MetaData> RenderLayersProg::getMetaData()
{
Scene *scene = this->getScene();
Render *re = (scene) ? RE_GetSceneRender(scene) : nullptr;
@@ -306,3 +308,5 @@ void RenderLayersDepthProg::executePixelSampled(float output[4],
output[0] = inputBuffer[offset];
}
}
+
+} // namespace blender::compositor
diff --git a/source/blender/compositor/operations/COM_RenderLayersProg.h b/source/blender/compositor/operations/COM_RenderLayersProg.h
index f3e1c892a83..33e4fb163c5 100644
--- a/source/blender/compositor/operations/COM_RenderLayersProg.h
+++ b/source/blender/compositor/operations/COM_RenderLayersProg.h
@@ -26,6 +26,8 @@
#include "RE_pipeline.h"
+namespace blender::compositor {
+
/**
* Base class for all renderlayeroperations
*
@@ -123,7 +125,7 @@ class RenderLayersProg : public NodeOperation {
void deinitExecution() override;
void executePixelSampled(float output[4], float x, float y, PixelSampler sampler) override;
- std::unique_ptr<MetaData> getMetaData() const override;
+ std::unique_ptr<MetaData> getMetaData() override;
};
class RenderLayersAOOperation : public RenderLayersProg {
@@ -152,3 +154,5 @@ class RenderLayersDepthProg : public RenderLayersProg {
}
void executePixelSampled(float output[4], float x, float y, PixelSampler sampler) override;
};
+
+} // namespace blender::compositor
diff --git a/source/blender/compositor/operations/COM_RotateOperation.cc b/source/blender/compositor/operations/COM_RotateOperation.cc
index c2105efe246..4fb3d324992 100644
--- a/source/blender/compositor/operations/COM_RotateOperation.cc
+++ b/source/blender/compositor/operations/COM_RotateOperation.cc
@@ -19,6 +19,8 @@
#include "COM_RotateOperation.h"
#include "BLI_math.h"
+namespace blender::compositor {
+
RotateOperation::RotateOperation()
{
this->addInputSocket(DataType::Color);
@@ -48,7 +50,7 @@ inline void RotateOperation::ensureDegree()
{
if (!this->m_isDegreeSet) {
float degree[4];
- this->m_degreeSocket->readSampled(degree, 0, 0, COM_PS_NEAREST);
+ this->m_degreeSocket->readSampled(degree, 0, 0, PixelSampler::Nearest);
double rad;
if (this->m_doDegree2RadConversion) {
rad = DEG2RAD((double)degree[0]);
@@ -105,3 +107,5 @@ bool RotateOperation::determineDependingAreaOfInterest(rcti *input,
return NodeOperation::determineDependingAreaOfInterest(&newInput, readOperation, output);
}
+
+} // namespace blender::compositor
diff --git a/source/blender/compositor/operations/COM_RotateOperation.h b/source/blender/compositor/operations/COM_RotateOperation.h
index 9b9d5987a8e..d76507f9816 100644
--- a/source/blender/compositor/operations/COM_RotateOperation.h
+++ b/source/blender/compositor/operations/COM_RotateOperation.h
@@ -20,6 +20,8 @@
#include "COM_NodeOperation.h"
+namespace blender::compositor {
+
class RotateOperation : public NodeOperation {
private:
SocketReader *m_imageSocket;
@@ -46,3 +48,5 @@ class RotateOperation : public NodeOperation {
void ensureDegree();
};
+
+} // namespace blender::compositor
diff --git a/source/blender/compositor/operations/COM_SMAAOperation.cc b/source/blender/compositor/operations/COM_SMAAOperation.cc
new file mode 100644
index 00000000000..74807f281d7
--- /dev/null
+++ b/source/blender/compositor/operations/COM_SMAAOperation.cc
@@ -0,0 +1,868 @@
+/*
+ * Copyright 2017, Blender Foundation.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ * Contributor: IRIE Shinsuke
+ */
+
+#include "COM_SMAAOperation.h"
+#include "BLI_math.h"
+#include "COM_SMAAAreaTexture.h"
+
+extern "C" {
+#include "IMB_colormanagement.h"
+}
+
+namespace blender::compositor {
+
+/*
+ * An implementation of Enhanced Subpixel Morphological Antialiasing (SMAA)
+ *
+ * The algorithm was proposed by:
+ * Jorge Jimenez, Jose I. Echevarria, Tiago Sousa, Diego Gutierrez
+ *
+ * http://www.iryoku.com/smaa/
+ *
+ * This file is based on smaa-cpp:
+ *
+ * https://github.com/iRi-E/smaa-cpp
+ *
+ * Currently only SMAA 1x mode is provided, so the operation will be done
+ * with no spatial multisampling nor temporal supersampling.
+ *
+ * Note: This program assumes the screen coordinates are DirectX style, so
+ * the vertical direction is upside-down. "top" and "bottom" actually mean
+ * bottom and top, respectively.
+ */
+
+/*-----------------------------------------------------------------------------*/
+/* Non-Configurable Defines */
+
+#define SMAA_AREATEX_SIZE 80
+#define SMAA_AREATEX_MAX_DISTANCE 20
+#define SMAA_AREATEX_MAX_DISTANCE_DIAG 20
+#define SMAA_MAX_SEARCH_STEPS 362 /* 362 - 1 = 19^2 */
+#define SMAA_MAX_SEARCH_STEPS_DIAG 19
+
+/*-----------------------------------------------------------------------------*/
+/* Internal Functions to Sample Pixel Color from Image */
+
+static inline void sample(SocketReader *reader, int x, int y, float color[4])
+{
+ if (x < 0 || x >= reader->getWidth() || y < 0 || y >= reader->getHeight()) {
+ color[0] = color[1] = color[2] = color[3] = 0.0;
+ return;
+ }
+
+ reader->read(color, x, y, nullptr);
+}
+
+static void sample_bilinear_vertical(
+ SocketReader *reader, int x, int y, float yoffset, float color[4])
+{
+ float iy = floorf(yoffset);
+ float fy = yoffset - iy;
+ y += (int)iy;
+
+ float color00[4], color01[4];
+
+ sample(reader, x + 0, y + 0, color00);
+ sample(reader, x + 0, y + 1, color01);
+
+ color[0] = interpf(color01[0], color00[0], fy);
+ color[1] = interpf(color01[1], color00[1], fy);
+ color[2] = interpf(color01[2], color00[2], fy);
+ color[3] = interpf(color01[3], color00[3], fy);
+}
+
+static void sample_bilinear_horizontal(
+ SocketReader *reader, int x, int y, float xoffset, float color[4])
+{
+ float ix = floorf(xoffset);
+ float fx = xoffset - ix;
+ x += (int)ix;
+
+ float color00[4], color10[4];
+
+ sample(reader, x + 0, y + 0, color00);
+ sample(reader, x + 1, y + 0, color10);
+
+ color[0] = interpf(color10[0], color00[0], fx);
+ color[1] = interpf(color10[1], color00[1], fx);
+ color[2] = interpf(color10[2], color00[2], fx);
+ color[3] = interpf(color10[3], color00[3], fx);
+}
+
+/*-----------------------------------------------------------------------------*/
+/* Internal Functions to Sample Blending Weights from AreaTex */
+
+static inline const float *areatex_sample_internal(const float *areatex, int x, int y)
+{
+ return &areatex[(CLAMPIS(x, 0, SMAA_AREATEX_SIZE - 1) +
+ CLAMPIS(y, 0, SMAA_AREATEX_SIZE - 1) * SMAA_AREATEX_SIZE) *
+ 2];
+}
+
+/**
+ * We have the distance and both crossing edges. So, what are the areas
+ * at each side of current edge?
+ */
+static void area(int d1, int d2, int e1, int e2, float weights[2])
+{
+ /* The areas texture is compressed quadratically: */
+ float x = (float)(SMAA_AREATEX_MAX_DISTANCE * e1) + sqrtf((float)d1);
+ float y = (float)(SMAA_AREATEX_MAX_DISTANCE * e2) + sqrtf((float)d2);
+
+ float ix = floorf(x), iy = floorf(y);
+ float fx = x - ix, fy = y - iy;
+ int X = (int)ix, Y = (int)iy;
+
+ const float *weights00 = areatex_sample_internal(areatex, X + 0, Y + 0);
+ const float *weights10 = areatex_sample_internal(areatex, X + 1, Y + 0);
+ const float *weights01 = areatex_sample_internal(areatex, X + 0, Y + 1);
+ const float *weights11 = areatex_sample_internal(areatex, X + 1, Y + 1);
+
+ weights[0] = interpf(
+ interpf(weights11[0], weights01[0], fx), interpf(weights10[0], weights00[0], fx), fy);
+ weights[1] = interpf(
+ interpf(weights11[1], weights01[1], fx), interpf(weights10[1], weights00[1], fx), fy);
+}
+
+/**
+ * Similar to area(), this calculates the area corresponding to a certain
+ * diagonal distance and crossing edges 'e'.
+ */
+static void area_diag(int d1, int d2, int e1, int e2, float weights[2])
+{
+ int x = SMAA_AREATEX_MAX_DISTANCE_DIAG * e1 + d1;
+ int y = SMAA_AREATEX_MAX_DISTANCE_DIAG * e2 + d2;
+
+ const float *w = areatex_sample_internal(areatex_diag, x, y);
+ copy_v2_v2(weights, w);
+}
+
+/*-----------------------------------------------------------------------------*/
+/* Edge Detection (First Pass) */
+/*-----------------------------------------------------------------------------*/
+
+SMAAEdgeDetectionOperation::SMAAEdgeDetectionOperation()
+{
+ this->addInputSocket(DataType::Color); /* image */
+ this->addInputSocket(DataType::Value); /* depth, material ID, etc. */
+ this->addOutputSocket(DataType::Color);
+ this->flags.complex = true;
+ this->m_imageReader = nullptr;
+ this->m_valueReader = nullptr;
+ this->m_threshold = 0.1f;
+ this->m_contrast_limit = 2.0f;
+}
+
+void SMAAEdgeDetectionOperation::initExecution()
+{
+ this->m_imageReader = this->getInputSocketReader(0);
+ this->m_valueReader = this->getInputSocketReader(1);
+}
+
+void SMAAEdgeDetectionOperation::deinitExecution()
+{
+ this->m_imageReader = nullptr;
+ this->m_valueReader = nullptr;
+}
+
+void SMAAEdgeDetectionOperation::setThreshold(float threshold)
+{
+ /* UI values are between 0 and 1 for simplicity but algorithm expects values between 0 and 0.5 */
+ m_threshold = scalenorm(0, 0.5, threshold);
+}
+
+void SMAAEdgeDetectionOperation::setLocalContrastAdaptationFactor(float factor)
+{
+ /* UI values are between 0 and 1 for simplicity but algorithm expects values between 1 and 10 */
+ m_contrast_limit = scalenorm(1, 10, factor);
+}
+
+bool SMAAEdgeDetectionOperation::determineDependingAreaOfInterest(
+ rcti *input, ReadBufferOperation *readOperation, rcti *output)
+{
+ rcti newInput;
+ newInput.xmax = input->xmax + 1;
+ newInput.xmin = input->xmin - 2;
+ newInput.ymax = input->ymax + 1;
+ newInput.ymin = input->ymin - 2;
+
+ return NodeOperation::determineDependingAreaOfInterest(&newInput, readOperation, output);
+}
+
+void SMAAEdgeDetectionOperation::executePixel(float output[4], int x, int y, void * /*data*/)
+{
+ float color[4];
+
+ /* Calculate luma deltas: */
+ sample(m_imageReader, x, y, color);
+ float L = IMB_colormanagement_get_luminance(color);
+ sample(m_imageReader, x - 1, y, color);
+ float Lleft = IMB_colormanagement_get_luminance(color);
+ sample(m_imageReader, x, y - 1, color);
+ float Ltop = IMB_colormanagement_get_luminance(color);
+ float Dleft = fabsf(L - Lleft);
+ float Dtop = fabsf(L - Ltop);
+
+ /* We do the usual threshold: */
+ output[0] = (x > 0 && Dleft >= m_threshold) ? 1.0f : 0.0f;
+ output[1] = (y > 0 && Dtop >= m_threshold) ? 1.0f : 0.0f;
+ output[2] = 0.0f;
+ output[3] = 1.0f;
+
+ /* Then discard if there is no edge: */
+ if (is_zero_v2(output)) {
+ return;
+ }
+
+ /* Calculate right and bottom deltas: */
+ sample(m_imageReader, x + 1, y, color);
+ float Lright = IMB_colormanagement_get_luminance(color);
+ sample(m_imageReader, x, y + 1, color);
+ float Lbottom = IMB_colormanagement_get_luminance(color);
+ float Dright = fabsf(L - Lright);
+ float Dbottom = fabsf(L - Lbottom);
+
+ /* Calculate the maximum delta in the direct neighborhood: */
+ float maxDelta = fmaxf(fmaxf(Dleft, Dright), fmaxf(Dtop, Dbottom));
+
+ /* Calculate luma used for both left and top edges: */
+ sample(m_imageReader, x - 1, y - 1, color);
+ float Llefttop = IMB_colormanagement_get_luminance(color);
+
+ /* Left edge */
+ if (output[0] != 0.0f) {
+ /* Calculate deltas around the left pixel: */
+ sample(m_imageReader, x - 2, y, color);
+ float Lleftleft = IMB_colormanagement_get_luminance(color);
+ sample(m_imageReader, x - 1, y + 1, color);
+ float Lleftbottom = IMB_colormanagement_get_luminance(color);
+ float Dleftleft = fabsf(Lleft - Lleftleft);
+ float Dlefttop = fabsf(Lleft - Llefttop);
+ float Dleftbottom = fabsf(Lleft - Lleftbottom);
+
+ /* Calculate the final maximum delta: */
+ maxDelta = fmaxf(maxDelta, fmaxf(Dleftleft, fmaxf(Dlefttop, Dleftbottom)));
+
+ /* Local contrast adaptation: */
+ if (maxDelta > m_contrast_limit * Dleft) {
+ output[0] = 0.0f;
+ }
+ }
+
+ /* Top edge */
+ if (output[1] != 0.0f) {
+ /* Calculate top-top delta: */
+ sample(m_imageReader, x, y - 2, color);
+ float Ltoptop = IMB_colormanagement_get_luminance(color);
+ sample(m_imageReader, x + 1, y - 1, color);
+ float Ltopright = IMB_colormanagement_get_luminance(color);
+ float Dtoptop = fabsf(Ltop - Ltoptop);
+ float Dtopleft = fabsf(Ltop - Llefttop);
+ float Dtopright = fabsf(Ltop - Ltopright);
+
+ /* Calculate the final maximum delta: */
+ maxDelta = fmaxf(maxDelta, fmaxf(Dtoptop, fmaxf(Dtopleft, Dtopright)));
+
+ /* Local contrast adaptation: */
+ if (maxDelta > m_contrast_limit * Dtop) {
+ output[1] = 0.0f;
+ }
+ }
+}
+
+/*-----------------------------------------------------------------------------*/
+/* Blending Weight Calculation (Second Pass) */
+/*-----------------------------------------------------------------------------*/
+
+SMAABlendingWeightCalculationOperation::SMAABlendingWeightCalculationOperation()
+{
+ this->addInputSocket(DataType::Color); /* edges */
+ this->addOutputSocket(DataType::Color);
+ this->flags.complex = true;
+ this->m_imageReader = nullptr;
+ this->m_corner_rounding = 25;
+}
+
+void *SMAABlendingWeightCalculationOperation::initializeTileData(rcti *rect)
+{
+ return getInputOperation(0)->initializeTileData(rect);
+}
+
+void SMAABlendingWeightCalculationOperation::initExecution()
+{
+ this->m_imageReader = this->getInputSocketReader(0);
+}
+
+void SMAABlendingWeightCalculationOperation::setCornerRounding(float rounding)
+{
+ /* UI values are between 0 and 1 for simplicity but algorithm expects values between 0 and 100 */
+ m_corner_rounding = static_cast<int>(scalenorm(0, 100, rounding));
+}
+
+void SMAABlendingWeightCalculationOperation::executePixel(float output[4],
+ int x,
+ int y,
+ void * /*data*/)
+{
+ float edges[4], c[4];
+
+ zero_v4(output);
+ sample(m_imageReader, x, y, edges);
+
+ /* Edge at north */
+ if (edges[1] > 0.0f) {
+ /* Diagonals have both north and west edges, so calculating weights for them */
+ /* in one of the boundaries is enough. */
+ calculateDiagWeights(x, y, edges, output);
+
+ /* We give priority to diagonals, so if we find a diagonal we skip */
+ /* horizontal/vertical processing. */
+ if (!is_zero_v2(output)) {
+ return;
+ }
+
+ /* Find the distance to the left and the right: */
+ int left = searchXLeft(x, y);
+ int right = searchXRight(x, y);
+ int d1 = x - left, d2 = right - x;
+
+ /* Fetch the left and right crossing edges: */
+ int e1 = 0, e2 = 0;
+ sample(m_imageReader, left, y - 1, c);
+ if (c[0] > 0.0) {
+ e1 += 1;
+ }
+ sample(m_imageReader, left, y, c);
+ if (c[0] > 0.0) {
+ e1 += 2;
+ }
+ sample(m_imageReader, right + 1, y - 1, c);
+ if (c[0] > 0.0) {
+ e2 += 1;
+ }
+ sample(m_imageReader, right + 1, y, c);
+ if (c[0] > 0.0) {
+ e2 += 2;
+ }
+
+ /* Ok, we know how this pattern looks like, now it is time for getting */
+ /* the actual area: */
+ area(d1, d2, e1, e2, output); /* R, G */
+
+ /* Fix corners: */
+ if (m_corner_rounding) {
+ detectHorizontalCornerPattern(output, left, right, y, d1, d2);
+ }
+ }
+
+ /* Edge at west */
+ if (edges[0] > 0.0f) {
+ /* Did we already do diagonal search for this west edge from the left neighboring pixel? */
+ if (isVerticalSearchUnneeded(x, y)) {
+ return;
+ }
+
+ /* Find the distance to the top and the bottom: */
+ int top = searchYUp(x, y);
+ int bottom = searchYDown(x, y);
+ int d1 = y - top, d2 = bottom - y;
+
+ /* Fetch the top and bottom crossing edges: */
+ int e1 = 0, e2 = 0;
+ sample(m_imageReader, x - 1, top, c);
+ if (c[1] > 0.0) {
+ e1 += 1;
+ }
+ sample(m_imageReader, x, top, c);
+ if (c[1] > 0.0) {
+ e1 += 2;
+ }
+ sample(m_imageReader, x - 1, bottom + 1, c);
+ if (c[1] > 0.0) {
+ e2 += 1;
+ }
+ sample(m_imageReader, x, bottom + 1, c);
+ if (c[1] > 0.0) {
+ e2 += 2;
+ }
+
+ /* Get the area for this direction: */
+ area(d1, d2, e1, e2, output + 2); /* B, A */
+
+ /* Fix corners: */
+ if (m_corner_rounding) {
+ detectVerticalCornerPattern(output + 2, x, top, bottom, d1, d2);
+ }
+ }
+}
+
+void SMAABlendingWeightCalculationOperation::deinitExecution()
+{
+ this->m_imageReader = nullptr;
+}
+
+bool SMAABlendingWeightCalculationOperation::determineDependingAreaOfInterest(
+ rcti *input, ReadBufferOperation *readOperation, rcti *output)
+{
+ rcti newInput;
+
+ newInput.xmax = input->xmax + fmax(SMAA_MAX_SEARCH_STEPS, SMAA_MAX_SEARCH_STEPS_DIAG + 1);
+ newInput.xmin = input->xmin -
+ fmax(fmax(SMAA_MAX_SEARCH_STEPS - 1, 1), SMAA_MAX_SEARCH_STEPS_DIAG + 1);
+ newInput.ymax = input->ymax + fmax(SMAA_MAX_SEARCH_STEPS, SMAA_MAX_SEARCH_STEPS_DIAG);
+ newInput.ymin = input->ymin -
+ fmax(fmax(SMAA_MAX_SEARCH_STEPS - 1, 1), SMAA_MAX_SEARCH_STEPS_DIAG);
+
+ return NodeOperation::determineDependingAreaOfInterest(&newInput, readOperation, output);
+}
+
+/*-----------------------------------------------------------------------------*/
+/* Diagonal Search Functions */
+
+/**
+ * These functions allows to perform diagonal pattern searches.
+ */
+int SMAABlendingWeightCalculationOperation::searchDiag1(int x, int y, int dir, bool *found)
+{
+ float e[4];
+ int end = x + SMAA_MAX_SEARCH_STEPS_DIAG * dir;
+ *found = false;
+
+ while (x != end) {
+ x += dir;
+ y -= dir;
+ sample(m_imageReader, x, y, e);
+ if (e[1] == 0.0f) {
+ *found = true;
+ break;
+ }
+ if (e[0] == 0.0f) {
+ *found = true;
+ return (dir < 0) ? x : x - dir;
+ }
+ }
+
+ return x - dir;
+}
+
+int SMAABlendingWeightCalculationOperation::searchDiag2(int x, int y, int dir, bool *found)
+{
+ float e[4];
+ int end = x + SMAA_MAX_SEARCH_STEPS_DIAG * dir;
+ *found = false;
+
+ while (x != end) {
+ x += dir;
+ y += dir;
+ sample(m_imageReader, x, y, e);
+ if (e[1] == 0.0f) {
+ *found = true;
+ break;
+ }
+ sample(m_imageReader, x + 1, y, e);
+ if (e[0] == 0.0f) {
+ *found = true;
+ return (dir > 0) ? x : x - dir;
+ }
+ }
+
+ return x - dir;
+}
+
+/**
+ * This searches for diagonal patterns and returns the corresponding weights.
+ */
+void SMAABlendingWeightCalculationOperation::calculateDiagWeights(int x,
+ int y,
+ const float edges[2],
+ float weights[2])
+{
+ int d1, d2;
+ bool d1_found, d2_found;
+ float e[4], c[4];
+
+ zero_v2(weights);
+
+ if (SMAA_MAX_SEARCH_STEPS_DIAG <= 0) {
+ return;
+ }
+
+ /* Search for the line ends: */
+ if (edges[0] > 0.0f) {
+ d1 = x - searchDiag1(x, y, -1, &d1_found);
+ }
+ else {
+ d1 = 0;
+ d1_found = true;
+ }
+ d2 = searchDiag1(x, y, 1, &d2_found) - x;
+
+ if (d1 + d2 > 2) { /* d1 + d2 + 1 > 3 */
+ int e1 = 0, e2 = 0;
+
+ if (d1_found) {
+ /* Fetch the crossing edges: */
+ int left = x - d1, bottom = y + d1;
+
+ sample(m_imageReader, left - 1, bottom, c);
+ if (c[1] > 0.0) {
+ e1 += 2;
+ }
+ sample(m_imageReader, left, bottom, c);
+ if (c[0] > 0.0) {
+ e1 += 1;
+ }
+ }
+
+ if (d2_found) {
+ /* Fetch the crossing edges: */
+ int right = x + d2, top = y - d2;
+
+ sample(m_imageReader, right + 1, top, c);
+ if (c[1] > 0.0) {
+ e2 += 2;
+ }
+ sample(m_imageReader, right + 1, top - 1, c);
+ if (c[0] > 0.0) {
+ e2 += 1;
+ }
+ }
+
+ /* Fetch the areas for this line: */
+ area_diag(d1, d2, e1, e2, weights);
+ }
+
+ /* Search for the line ends: */
+ d1 = x - searchDiag2(x, y, -1, &d1_found);
+ sample(m_imageReader, x + 1, y, e);
+ if (e[0] > 0.0f) {
+ d2 = searchDiag2(x, y, 1, &d2_found) - x;
+ }
+ else {
+ d2 = 0;
+ d2_found = true;
+ }
+
+ if (d1 + d2 > 2) { /* d1 + d2 + 1 > 3 */
+ int e1 = 0, e2 = 0;
+
+ if (d1_found) {
+ /* Fetch the crossing edges: */
+ int left = x - d1, top = y - d1;
+
+ sample(m_imageReader, left - 1, top, c);
+ if (c[1] > 0.0) {
+ e1 += 2;
+ }
+ sample(m_imageReader, left, top - 1, c);
+ if (c[0] > 0.0) {
+ e1 += 1;
+ }
+ }
+
+ if (d2_found) {
+ /* Fetch the crossing edges: */
+ int right = x + d2, bottom = y + d2;
+
+ sample(m_imageReader, right + 1, bottom, c);
+ if (c[1] > 0.0) {
+ e2 += 2;
+ }
+ if (c[0] > 0.0) {
+ e2 += 1;
+ }
+ }
+
+ /* Fetch the areas for this line: */
+ float w[2];
+ area_diag(d1, d2, e1, e2, w);
+ weights[0] += w[1];
+ weights[1] += w[0];
+ }
+}
+
+bool SMAABlendingWeightCalculationOperation::isVerticalSearchUnneeded(int x, int y)
+{
+ int d1, d2;
+ bool found;
+ float e[4];
+
+ if (SMAA_MAX_SEARCH_STEPS_DIAG <= 0) {
+ return false;
+ }
+
+ /* Search for the line ends: */
+ sample(m_imageReader, x - 1, y, e);
+ if (e[1] > 0.0f) {
+ d1 = x - searchDiag2(x - 1, y, -1, &found);
+ }
+ else {
+ d1 = 0;
+ }
+ d2 = searchDiag2(x - 1, y, 1, &found) - x;
+
+ return (d1 + d2 > 2); /* d1 + d2 + 1 > 3 */
+}
+
+/*-----------------------------------------------------------------------------*/
+/* Horizontal/Vertical Search Functions */
+
+int SMAABlendingWeightCalculationOperation::searchXLeft(int x, int y)
+{
+ int end = x - SMAA_MAX_SEARCH_STEPS;
+ float e[4];
+
+ while (x > end) {
+ sample(m_imageReader, x, y, e);
+ if (e[1] == 0.0f) { /* Is the edge not activated? */
+ break;
+ }
+ if (e[0] != 0.0f) { /* Or is there a crossing edge that breaks the line? */
+ return x;
+ }
+ sample(m_imageReader, x, y - 1, e);
+ if (e[0] != 0.0f) { /* Or is there a crossing edge that breaks the line? */
+ return x;
+ }
+ x--;
+ }
+
+ return x + 1;
+}
+
+int SMAABlendingWeightCalculationOperation::searchXRight(int x, int y)
+{
+ int end = x + SMAA_MAX_SEARCH_STEPS;
+ float e[4];
+
+ while (x < end) {
+ x++;
+ sample(m_imageReader, x, y, e);
+ if (e[1] == 0.0f || /* Is the edge not activated? */
+ e[0] != 0.0f) { /* Or is there a crossing edge that breaks the line? */
+ break;
+ }
+ sample(m_imageReader, x, y - 1, e);
+ if (e[0] != 0.0f) { /* Or is there a crossing edge that breaks the line? */
+ break;
+ }
+ }
+
+ return x - 1;
+}
+
+int SMAABlendingWeightCalculationOperation::searchYUp(int x, int y)
+{
+ int end = y - SMAA_MAX_SEARCH_STEPS;
+ float e[4];
+
+ while (y > end) {
+ sample(m_imageReader, x, y, e);
+ if (e[0] == 0.0f) { /* Is the edge not activated? */
+ break;
+ }
+ if (e[1] != 0.0f) { /* Or is there a crossing edge that breaks the line? */
+ return y;
+ }
+ sample(m_imageReader, x - 1, y, e);
+ if (e[1] != 0.0f) { /* Or is there a crossing edge that breaks the line? */
+ return y;
+ }
+ y--;
+ }
+
+ return y + 1;
+}
+
+int SMAABlendingWeightCalculationOperation::searchYDown(int x, int y)
+{
+ int end = y + SMAA_MAX_SEARCH_STEPS;
+ float e[4];
+
+ while (y < end) {
+ y++;
+ sample(m_imageReader, x, y, e);
+ if (e[0] == 0.0f || /* Is the edge not activated? */
+ e[1] != 0.0f) { /* Or is there a crossing edge that breaks the line? */
+ break;
+ }
+ sample(m_imageReader, x - 1, y, e);
+ if (e[1] != 0.0f) { /* Or is there a crossing edge that breaks the line? */
+ break;
+ }
+ }
+
+ return y - 1;
+}
+
+/*-----------------------------------------------------------------------------*/
+/* Corner Detection Functions */
+
+void SMAABlendingWeightCalculationOperation::detectHorizontalCornerPattern(
+ float weights[2], int left, int right, int y, int d1, int d2)
+{
+ float factor[2] = {1.0f, 1.0f};
+ float rounding = m_corner_rounding / 100.0f;
+ float e[4];
+
+ /* Reduce blending for pixels in the center of a line. */
+ rounding *= (d1 == d2) ? 0.5f : 1.0f;
+
+ /* Near the left corner */
+ if (d1 <= d2) {
+ sample(m_imageReader, left, y + 1, e);
+ factor[0] -= rounding * e[0];
+ sample(m_imageReader, left, y - 2, e);
+ factor[1] -= rounding * e[0];
+ }
+ /* Near the right corner */
+ if (d1 >= d2) {
+ sample(m_imageReader, right + 1, y + 1, e);
+ factor[0] -= rounding * e[0];
+ sample(m_imageReader, right + 1, y - 2, e);
+ factor[1] -= rounding * e[0];
+ }
+
+ weights[0] *= CLAMPIS(factor[0], 0.0f, 1.0f);
+ weights[1] *= CLAMPIS(factor[1], 0.0f, 1.0f);
+}
+
+void SMAABlendingWeightCalculationOperation::detectVerticalCornerPattern(
+ float weights[2], int x, int top, int bottom, int d1, int d2)
+{
+ float factor[2] = {1.0f, 1.0f};
+ float rounding = m_corner_rounding / 100.0f;
+ float e[4];
+
+ /* Reduce blending for pixels in the center of a line. */
+ rounding *= (d1 == d2) ? 0.5f : 1.0f;
+
+ /* Near the top corner */
+ if (d1 <= d2) {
+ sample(m_imageReader, x + 1, top, e);
+ factor[0] -= rounding * e[1];
+ sample(m_imageReader, x - 2, top, e);
+ factor[1] -= rounding * e[1];
+ }
+ /* Near the bottom corner */
+ if (d1 >= d2) {
+ sample(m_imageReader, x + 1, bottom + 1, e);
+ factor[0] -= rounding * e[1];
+ sample(m_imageReader, x - 2, bottom + 1, e);
+ factor[1] -= rounding * e[1];
+ }
+
+ weights[0] *= CLAMPIS(factor[0], 0.0f, 1.0f);
+ weights[1] *= CLAMPIS(factor[1], 0.0f, 1.0f);
+}
+
+/*-----------------------------------------------------------------------------*/
+/* Neighborhood Blending (Third Pass) */
+/*-----------------------------------------------------------------------------*/
+
+SMAANeighborhoodBlendingOperation::SMAANeighborhoodBlendingOperation()
+{
+ this->addInputSocket(DataType::Color); /* image */
+ this->addInputSocket(DataType::Color); /* blend */
+ this->addOutputSocket(DataType::Color);
+ this->flags.complex = true;
+ this->m_image1Reader = nullptr;
+ this->m_image2Reader = nullptr;
+}
+
+void *SMAANeighborhoodBlendingOperation::initializeTileData(rcti *rect)
+{
+ return getInputOperation(0)->initializeTileData(rect);
+}
+
+void SMAANeighborhoodBlendingOperation::initExecution()
+{
+ this->m_image1Reader = this->getInputSocketReader(0);
+ this->m_image2Reader = this->getInputSocketReader(1);
+}
+
+void SMAANeighborhoodBlendingOperation::executePixel(float output[4],
+ int x,
+ int y,
+ void * /*data*/)
+{
+ float w[4];
+
+ /* Fetch the blending weights for current pixel: */
+ sample(m_image2Reader, x, y, w);
+ float left = w[2], top = w[0];
+ sample(m_image2Reader, x + 1, y, w);
+ float right = w[3];
+ sample(m_image2Reader, x, y + 1, w);
+ float bottom = w[1];
+
+ /* Is there any blending weight with a value greater than 0.0? */
+ if (right + bottom + left + top < 1e-5f) {
+ sample(m_image1Reader, x, y, output);
+ return;
+ }
+
+ /* Calculate the blending offsets: */
+ void (*samplefunc)(SocketReader * reader, int x, int y, float xoffset, float color[4]);
+ float offset1, offset2, weight1, weight2, color1[4], color2[4];
+
+ if (fmaxf(right, left) > fmaxf(bottom, top)) { /* max(horizontal) > max(vertical) */
+ samplefunc = sample_bilinear_horizontal;
+ offset1 = right;
+ offset2 = -left;
+ weight1 = right / (right + left);
+ weight2 = left / (right + left);
+ }
+ else {
+ samplefunc = sample_bilinear_vertical;
+ offset1 = bottom;
+ offset2 = -top;
+ weight1 = bottom / (bottom + top);
+ weight2 = top / (bottom + top);
+ }
+
+ /* We exploit bilinear filtering to mix current pixel with the chosen neighbor: */
+ samplefunc(m_image1Reader, x, y, offset1, color1);
+ samplefunc(m_image1Reader, x, y, offset2, color2);
+
+ mul_v4_v4fl(output, color1, weight1);
+ madd_v4_v4fl(output, color2, weight2);
+}
+
+void SMAANeighborhoodBlendingOperation::deinitExecution()
+{
+ this->m_image1Reader = nullptr;
+ this->m_image2Reader = nullptr;
+}
+
+bool SMAANeighborhoodBlendingOperation::determineDependingAreaOfInterest(
+ rcti *input, ReadBufferOperation *readOperation, rcti *output)
+{
+ rcti newInput;
+
+ newInput.xmax = input->xmax + 1;
+ newInput.xmin = input->xmin - 1;
+ newInput.ymax = input->ymax + 1;
+ newInput.ymin = input->ymin - 1;
+
+ return NodeOperation::determineDependingAreaOfInterest(&newInput, readOperation, output);
+}
+
+} // namespace blender::compositor
diff --git a/source/blender/compositor/operations/COM_SMAAOperation.h b/source/blender/compositor/operations/COM_SMAAOperation.h
new file mode 100644
index 00000000000..781762202b4
--- /dev/null
+++ b/source/blender/compositor/operations/COM_SMAAOperation.h
@@ -0,0 +1,149 @@
+/*
+ * Copyright 2017, Blender Foundation.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ * Contributor: IRIE Shinsuke
+ */
+
+#pragma once
+
+#include "COM_NodeOperation.h"
+
+namespace blender::compositor {
+
+/*-----------------------------------------------------------------------------*/
+/* Edge Detection (First Pass) */
+
+class SMAAEdgeDetectionOperation : public NodeOperation {
+ protected:
+ SocketReader *m_imageReader;
+ SocketReader *m_valueReader;
+
+ float m_threshold;
+ float m_contrast_limit;
+
+ public:
+ SMAAEdgeDetectionOperation();
+
+ /**
+ * the inner loop of this program
+ */
+ virtual void executePixel(float output[4], int x, int y, void *data) override;
+
+ /**
+ * Initialize the execution
+ */
+ void initExecution() override;
+
+ /**
+ * Deinitialize the execution
+ */
+ void deinitExecution() override;
+
+ void setThreshold(float threshold);
+
+ void setLocalContrastAdaptationFactor(float factor);
+
+ bool determineDependingAreaOfInterest(rcti *input,
+ ReadBufferOperation *readOperation,
+ rcti *output) override;
+};
+
+/*-----------------------------------------------------------------------------*/
+/* Blending Weight Calculation (Second Pass) */
+
+class SMAABlendingWeightCalculationOperation : public NodeOperation {
+ private:
+ SocketReader *m_imageReader;
+
+ int m_corner_rounding;
+
+ public:
+ SMAABlendingWeightCalculationOperation();
+
+ /**
+ * the inner loop of this program
+ */
+ void executePixel(float output[4], int x, int y, void *data) override;
+
+ /**
+ * Initialize the execution
+ */
+ void initExecution() override;
+ void *initializeTileData(rcti *rect) override;
+
+ /**
+ * Deinitialize the execution
+ */
+ void deinitExecution() override;
+
+ void setCornerRounding(float rounding);
+
+ bool determineDependingAreaOfInterest(rcti *input,
+ ReadBufferOperation *readOperation,
+ rcti *output) override;
+
+ private:
+ /* Diagonal Search Functions */
+ int searchDiag1(int x, int y, int dir, bool *found);
+ int searchDiag2(int x, int y, int dir, bool *found);
+ void calculateDiagWeights(int x, int y, const float edges[2], float weights[2]);
+ bool isVerticalSearchUnneeded(int x, int y);
+
+ /* Horizontal/Vertical Search Functions */
+ int searchXLeft(int x, int y);
+ int searchXRight(int x, int y);
+ int searchYUp(int x, int y);
+ int searchYDown(int x, int y);
+
+ /* Corner Detection Functions */
+ void detectHorizontalCornerPattern(float weights[2], int left, int right, int y, int d1, int d2);
+ void detectVerticalCornerPattern(float weights[2], int x, int top, int bottom, int d1, int d2);
+};
+
+/*-----------------------------------------------------------------------------*/
+/* Neighborhood Blending (Third Pass) */
+
+class SMAANeighborhoodBlendingOperation : public NodeOperation {
+ private:
+ SocketReader *m_image1Reader;
+ SocketReader *m_image2Reader;
+
+ public:
+ SMAANeighborhoodBlendingOperation();
+
+ /**
+ * the inner loop of this program
+ */
+ void executePixel(float output[4], int x, int y, void *data) override;
+
+ /**
+ * Initialize the execution
+ */
+ void initExecution() override;
+ void *initializeTileData(rcti *rect) override;
+
+ /**
+ * Deinitialize the execution
+ */
+ void deinitExecution() override;
+
+ bool determineDependingAreaOfInterest(rcti *input,
+ ReadBufferOperation *readOperation,
+ rcti *output) override;
+};
+
+} // namespace blender::compositor
diff --git a/source/blender/compositor/operations/COM_ScaleOperation.cc b/source/blender/compositor/operations/COM_ScaleOperation.cc
index b0c9bfb2663..03525d4ea01 100644
--- a/source/blender/compositor/operations/COM_ScaleOperation.cc
+++ b/source/blender/compositor/operations/COM_ScaleOperation.cc
@@ -18,6 +18,8 @@
#include "COM_ScaleOperation.h"
+namespace blender::compositor {
+
#define USE_FORCE_BILINEAR
/* XXX - ignore input and use default from old compositor,
* could become an option like the transform node - campbell
@@ -28,7 +30,7 @@
BaseScaleOperation::BaseScaleOperation()
{
#ifdef USE_FORCE_BILINEAR
- m_sampler = (int)COM_PS_BILINEAR;
+ m_sampler = (int)PixelSampler::Bilinear;
#else
m_sampler = -1;
#endif
@@ -89,8 +91,8 @@ bool ScaleOperation::determineDependingAreaOfInterest(rcti *input,
float scaleX[4];
float scaleY[4];
- this->m_inputXOperation->readSampled(scaleX, 0, 0, COM_PS_NEAREST);
- this->m_inputYOperation->readSampled(scaleY, 0, 0, COM_PS_NEAREST);
+ this->m_inputXOperation->readSampled(scaleX, 0, 0, PixelSampler::Nearest);
+ this->m_inputYOperation->readSampled(scaleY, 0, 0, PixelSampler::Nearest);
const float scx = scaleX[0];
const float scy = scaleY[0];
@@ -174,8 +176,8 @@ bool ScaleAbsoluteOperation::determineDependingAreaOfInterest(rcti *input,
float scaleX[4];
float scaleY[4];
- this->m_inputXOperation->readSampled(scaleX, 0, 0, COM_PS_NEAREST);
- this->m_inputYOperation->readSampled(scaleY, 0, 0, COM_PS_NEAREST);
+ this->m_inputXOperation->readSampled(scaleX, 0, 0, PixelSampler::Nearest);
+ this->m_inputYOperation->readSampled(scaleY, 0, 0, PixelSampler::Nearest);
const float scx = scaleX[0];
const float scy = scaleY[0];
@@ -203,7 +205,7 @@ bool ScaleAbsoluteOperation::determineDependingAreaOfInterest(rcti *input,
// Absolute fixed size
ScaleFixedSizeOperation::ScaleFixedSizeOperation() : BaseScaleOperation()
{
- this->addInputSocket(DataType::Color, COM_SC_NO_RESIZE);
+ this->addInputSocket(DataType::Color, ResizeMode::None);
this->addOutputSocket(DataType::Color);
this->setResolutionInputSocketIndex(0);
this->m_inputOperation = nullptr;
@@ -308,3 +310,5 @@ void ScaleFixedSizeOperation::determineResolution(unsigned int resolution[2],
resolution[0] = this->m_newWidth;
resolution[1] = this->m_newHeight;
}
+
+} // namespace blender::compositor
diff --git a/source/blender/compositor/operations/COM_ScaleOperation.h b/source/blender/compositor/operations/COM_ScaleOperation.h
index 780107910f9..dc3de3602bf 100644
--- a/source/blender/compositor/operations/COM_ScaleOperation.h
+++ b/source/blender/compositor/operations/COM_ScaleOperation.h
@@ -20,6 +20,8 @@
#include "COM_NodeOperation.h"
+namespace blender::compositor {
+
class BaseScaleOperation : public NodeOperation {
public:
void setSampler(PixelSampler sampler)
@@ -129,3 +131,5 @@ class ScaleFixedSizeOperation : public BaseScaleOperation {
this->m_offsetY = y;
}
};
+
+} // namespace blender::compositor
diff --git a/source/blender/compositor/operations/COM_ScreenLensDistortionOperation.cc b/source/blender/compositor/operations/COM_ScreenLensDistortionOperation.cc
index d5918dfa6f5..634fe66b0dd 100644
--- a/source/blender/compositor/operations/COM_ScreenLensDistortionOperation.cc
+++ b/source/blender/compositor/operations/COM_ScreenLensDistortionOperation.cc
@@ -24,13 +24,15 @@
#include "PIL_time.h"
+namespace blender::compositor {
+
ScreenLensDistortionOperation::ScreenLensDistortionOperation()
{
this->addInputSocket(DataType::Color);
this->addInputSocket(DataType::Value);
this->addInputSocket(DataType::Value);
this->addOutputSocket(DataType::Color);
- this->setComplex(true);
+ this->flags.complex = true;
this->m_inputProgram = nullptr;
this->m_distortion = 0.0f;
this->m_dispersion = 0.0f;
@@ -83,12 +85,12 @@ void *ScreenLensDistortionOperation::initializeTileData(rcti * /*rect*/)
if (!m_distortion_const) {
float result[4];
- getInputSocketReader(1)->readSampled(result, 0, 0, COM_PS_NEAREST);
+ getInputSocketReader(1)->readSampled(result, 0, 0, PixelSampler::Nearest);
m_distortion = result[0];
}
if (!m_dispersion_const) {
float result[4];
- getInputSocketReader(2)->readSampled(result, 0, 0, COM_PS_NEAREST);
+ getInputSocketReader(2)->readSampled(result, 0, 0, PixelSampler::Nearest);
m_dispersion = result[0];
}
@@ -351,3 +353,5 @@ void ScreenLensDistortionOperation::updateVariables(float distortion, float disp
mul_v3_v3fl(m_k4, m_k, 4.0f);
}
+
+} // namespace blender::compositor
diff --git a/source/blender/compositor/operations/COM_ScreenLensDistortionOperation.h b/source/blender/compositor/operations/COM_ScreenLensDistortionOperation.h
index 793fc95dc3d..98872bfe142 100644
--- a/source/blender/compositor/operations/COM_ScreenLensDistortionOperation.h
+++ b/source/blender/compositor/operations/COM_ScreenLensDistortionOperation.h
@@ -21,6 +21,10 @@
#include "COM_NodeOperation.h"
#include "DNA_node_types.h"
+struct RNG;
+
+namespace blender::compositor {
+
class ScreenLensDistortionOperation : public NodeOperation {
private:
/**
@@ -96,3 +100,5 @@ class ScreenLensDistortionOperation : public NodeOperation {
float sum[4],
int count[3]) const;
};
+
+} // namespace blender::compositor
diff --git a/source/blender/compositor/operations/COM_SetAlphaMultiplyOperation.cc b/source/blender/compositor/operations/COM_SetAlphaMultiplyOperation.cc
index 3151bad5e4a..24edbc61d40 100644
--- a/source/blender/compositor/operations/COM_SetAlphaMultiplyOperation.cc
+++ b/source/blender/compositor/operations/COM_SetAlphaMultiplyOperation.cc
@@ -18,6 +18,8 @@
#include "COM_SetAlphaMultiplyOperation.h"
+namespace blender::compositor {
+
SetAlphaMultiplyOperation::SetAlphaMultiplyOperation()
{
this->addInputSocket(DataType::Color);
@@ -53,3 +55,5 @@ void SetAlphaMultiplyOperation::deinitExecution()
this->m_inputColor = nullptr;
this->m_inputAlpha = nullptr;
}
+
+} // namespace blender::compositor
diff --git a/source/blender/compositor/operations/COM_SetAlphaMultiplyOperation.h b/source/blender/compositor/operations/COM_SetAlphaMultiplyOperation.h
index 094da1fd493..b4eea659fa2 100644
--- a/source/blender/compositor/operations/COM_SetAlphaMultiplyOperation.h
+++ b/source/blender/compositor/operations/COM_SetAlphaMultiplyOperation.h
@@ -20,6 +20,8 @@
#include "COM_NodeOperation.h"
+namespace blender::compositor {
+
/**
* This operation will apply a mask to its input image.
*
@@ -38,3 +40,5 @@ class SetAlphaMultiplyOperation : public NodeOperation {
void initExecution() override;
void deinitExecution() override;
};
+
+} // namespace blender::compositor
diff --git a/source/blender/compositor/operations/COM_SetAlphaReplaceOperation.cc b/source/blender/compositor/operations/COM_SetAlphaReplaceOperation.cc
index cd9bf039f3e..90bfc814b09 100644
--- a/source/blender/compositor/operations/COM_SetAlphaReplaceOperation.cc
+++ b/source/blender/compositor/operations/COM_SetAlphaReplaceOperation.cc
@@ -18,6 +18,8 @@
#include "COM_SetAlphaReplaceOperation.h"
+namespace blender::compositor {
+
SetAlphaReplaceOperation::SetAlphaReplaceOperation()
{
this->addInputSocket(DataType::Color);
@@ -51,3 +53,5 @@ void SetAlphaReplaceOperation::deinitExecution()
this->m_inputColor = nullptr;
this->m_inputAlpha = nullptr;
}
+
+} // namespace blender::compositor
diff --git a/source/blender/compositor/operations/COM_SetAlphaReplaceOperation.h b/source/blender/compositor/operations/COM_SetAlphaReplaceOperation.h
index 313d5f581eb..c84299b6d82 100644
--- a/source/blender/compositor/operations/COM_SetAlphaReplaceOperation.h
+++ b/source/blender/compositor/operations/COM_SetAlphaReplaceOperation.h
@@ -20,6 +20,8 @@
#include "COM_NodeOperation.h"
+namespace blender::compositor {
+
/**
* this program converts an input color to an output value.
* it assumes we are in sRGB color space.
@@ -43,3 +45,5 @@ class SetAlphaReplaceOperation : public NodeOperation {
void initExecution() override;
void deinitExecution() override;
};
+
+} // namespace blender::compositor
diff --git a/source/blender/compositor/operations/COM_SetColorOperation.cc b/source/blender/compositor/operations/COM_SetColorOperation.cc
index b08381963fd..dbe45fa60db 100644
--- a/source/blender/compositor/operations/COM_SetColorOperation.cc
+++ b/source/blender/compositor/operations/COM_SetColorOperation.cc
@@ -18,9 +18,12 @@
#include "COM_SetColorOperation.h"
+namespace blender::compositor {
+
SetColorOperation::SetColorOperation()
{
this->addOutputSocket(DataType::Color);
+ flags.is_set_operation = true;
}
void SetColorOperation::executePixelSampled(float output[4],
@@ -37,3 +40,5 @@ void SetColorOperation::determineResolution(unsigned int resolution[2],
resolution[0] = preferredResolution[0];
resolution[1] = preferredResolution[1];
}
+
+} // namespace blender::compositor
diff --git a/source/blender/compositor/operations/COM_SetColorOperation.h b/source/blender/compositor/operations/COM_SetColorOperation.h
index 147e76c433f..4b9b80013d4 100644
--- a/source/blender/compositor/operations/COM_SetColorOperation.h
+++ b/source/blender/compositor/operations/COM_SetColorOperation.h
@@ -20,6 +20,8 @@
#include "COM_NodeOperation.h"
+namespace blender::compositor {
+
/**
* this program converts an input color to an output value.
* it assumes we are in sRGB color space.
@@ -78,8 +80,6 @@ class SetColorOperation : public NodeOperation {
void determineResolution(unsigned int resolution[2],
unsigned int preferredResolution[2]) override;
- bool isSetOperation() const override
- {
- return true;
- }
};
+
+} // namespace blender::compositor
diff --git a/source/blender/compositor/operations/COM_SetSamplerOperation.cc b/source/blender/compositor/operations/COM_SetSamplerOperation.cc
index 8272ad7583d..e68774736f3 100644
--- a/source/blender/compositor/operations/COM_SetSamplerOperation.cc
+++ b/source/blender/compositor/operations/COM_SetSamplerOperation.cc
@@ -18,6 +18,8 @@
#include "COM_SetSamplerOperation.h"
+namespace blender::compositor {
+
SetSamplerOperation::SetSamplerOperation()
{
this->addInputSocket(DataType::Color);
@@ -40,3 +42,5 @@ void SetSamplerOperation::executePixelSampled(float output[4],
{
this->m_reader->readSampled(output, x, y, this->m_sampler);
}
+
+} // namespace blender::compositor
diff --git a/source/blender/compositor/operations/COM_SetSamplerOperation.h b/source/blender/compositor/operations/COM_SetSamplerOperation.h
index 4a0bd4563bb..d355d937806 100644
--- a/source/blender/compositor/operations/COM_SetSamplerOperation.h
+++ b/source/blender/compositor/operations/COM_SetSamplerOperation.h
@@ -20,6 +20,8 @@
#include "COM_NodeOperation.h"
+namespace blender::compositor {
+
/**
* this program converts an input color to an output Sampler.
* it assumes we are in sRGB color space.
@@ -47,3 +49,5 @@ class SetSamplerOperation : public NodeOperation {
void initExecution() override;
void deinitExecution() override;
};
+
+} // namespace blender::compositor
diff --git a/source/blender/compositor/operations/COM_SetValueOperation.cc b/source/blender/compositor/operations/COM_SetValueOperation.cc
index 98d0ad630ad..ef43cf64653 100644
--- a/source/blender/compositor/operations/COM_SetValueOperation.cc
+++ b/source/blender/compositor/operations/COM_SetValueOperation.cc
@@ -18,9 +18,12 @@
#include "COM_SetValueOperation.h"
+namespace blender::compositor {
+
SetValueOperation::SetValueOperation()
{
this->addOutputSocket(DataType::Value);
+ flags.is_set_operation = true;
}
void SetValueOperation::executePixelSampled(float output[4],
@@ -37,3 +40,5 @@ void SetValueOperation::determineResolution(unsigned int resolution[2],
resolution[0] = preferredResolution[0];
resolution[1] = preferredResolution[1];
}
+
+} // namespace blender::compositor
diff --git a/source/blender/compositor/operations/COM_SetValueOperation.h b/source/blender/compositor/operations/COM_SetValueOperation.h
index b3edb215010..5383f3b5fd3 100644
--- a/source/blender/compositor/operations/COM_SetValueOperation.h
+++ b/source/blender/compositor/operations/COM_SetValueOperation.h
@@ -20,6 +20,8 @@
#include "COM_NodeOperation.h"
+namespace blender::compositor {
+
/**
* this program converts an input color to an output value.
* it assumes we are in sRGB color space.
@@ -49,9 +51,6 @@ class SetValueOperation : public NodeOperation {
void executePixelSampled(float output[4], float x, float y, PixelSampler sampler) override;
void determineResolution(unsigned int resolution[2],
unsigned int preferredResolution[2]) override;
-
- bool isSetOperation() const override
- {
- return true;
- }
};
+
+} // namespace blender::compositor
diff --git a/source/blender/compositor/operations/COM_SetVectorOperation.cc b/source/blender/compositor/operations/COM_SetVectorOperation.cc
index 6b6bcad02f3..7152d5e61d4 100644
--- a/source/blender/compositor/operations/COM_SetVectorOperation.cc
+++ b/source/blender/compositor/operations/COM_SetVectorOperation.cc
@@ -19,9 +19,12 @@
#include "COM_SetVectorOperation.h"
#include "COM_defines.h"
+namespace blender::compositor {
+
SetVectorOperation::SetVectorOperation()
{
this->addOutputSocket(DataType::Vector);
+ flags.is_set_operation = true;
}
void SetVectorOperation::executePixelSampled(float output[4],
@@ -40,3 +43,5 @@ void SetVectorOperation::determineResolution(unsigned int resolution[2],
resolution[0] = preferredResolution[0];
resolution[1] = preferredResolution[1];
}
+
+} // namespace blender::compositor
diff --git a/source/blender/compositor/operations/COM_SetVectorOperation.h b/source/blender/compositor/operations/COM_SetVectorOperation.h
index a48584d7ded..b444339fcb2 100644
--- a/source/blender/compositor/operations/COM_SetVectorOperation.h
+++ b/source/blender/compositor/operations/COM_SetVectorOperation.h
@@ -20,6 +20,8 @@
#include "COM_NodeOperation.h"
+namespace blender::compositor {
+
/**
* this program converts an input color to an output value.
* it assumes we are in sRGB color space.
@@ -77,10 +79,6 @@ class SetVectorOperation : public NodeOperation {
void determineResolution(unsigned int resolution[2],
unsigned int preferredResolution[2]) override;
- bool isSetOperation() const override
- {
- return true;
- }
void setVector(const float vector[3])
{
@@ -89,3 +87,5 @@ class SetVectorOperation : public NodeOperation {
setZ(vector[2]);
}
};
+
+} // namespace blender::compositor
diff --git a/source/blender/compositor/operations/COM_SocketProxyOperation.cc b/source/blender/compositor/operations/COM_SocketProxyOperation.cc
index 53f5fea8795..39876439b7b 100644
--- a/source/blender/compositor/operations/COM_SocketProxyOperation.cc
+++ b/source/blender/compositor/operations/COM_SocketProxyOperation.cc
@@ -18,14 +18,19 @@
#include "COM_SocketProxyOperation.h"
+namespace blender::compositor {
+
SocketProxyOperation::SocketProxyOperation(DataType type, bool use_conversion)
- : m_use_conversion(use_conversion)
{
this->addInputSocket(type);
this->addOutputSocket(type);
+ flags.is_proxy_operation = true;
+ flags.use_datatype_conversion = use_conversion;
}
-std::unique_ptr<MetaData> SocketProxyOperation::getMetaData() const
+std::unique_ptr<MetaData> SocketProxyOperation::getMetaData()
{
return this->getInputSocket(0)->getReader()->getMetaData();
}
+
+} // namespace blender::compositor
diff --git a/source/blender/compositor/operations/COM_SocketProxyOperation.h b/source/blender/compositor/operations/COM_SocketProxyOperation.h
index 712347a8ea2..1d3b76055bd 100644
--- a/source/blender/compositor/operations/COM_SocketProxyOperation.h
+++ b/source/blender/compositor/operations/COM_SocketProxyOperation.h
@@ -20,29 +20,13 @@
#include "COM_NodeOperation.h"
+namespace blender::compositor {
+
class SocketProxyOperation : public NodeOperation {
public:
SocketProxyOperation(DataType type, bool use_conversion);
- bool isProxyOperation() const override
- {
- return true;
- }
- bool useDatatypeConversion() const override
- {
- return m_use_conversion;
- }
-
- bool getUseConversion() const
- {
- return m_use_conversion;
- }
- void setUseConversion(bool use_conversion)
- {
- m_use_conversion = use_conversion;
- }
- std::unique_ptr<MetaData> getMetaData() const override;
-
- private:
- bool m_use_conversion;
+ std::unique_ptr<MetaData> getMetaData() override;
};
+
+} // namespace blender::compositor
diff --git a/source/blender/compositor/operations/COM_SplitOperation.cc b/source/blender/compositor/operations/COM_SplitOperation.cc
index 25438259973..a4754de370d 100644
--- a/source/blender/compositor/operations/COM_SplitOperation.cc
+++ b/source/blender/compositor/operations/COM_SplitOperation.cc
@@ -27,6 +27,8 @@
#include "IMB_imbuf.h"
#include "IMB_imbuf_types.h"
+namespace blender::compositor {
+
SplitOperation::SplitOperation()
{
this->addInputSocket(DataType::Color);
@@ -58,10 +60,10 @@ void SplitOperation::executePixelSampled(float output[4],
this->m_splitPercentage * this->getHeight() / 100.0f;
bool image1 = this->m_xSplit ? x > perc : y > perc;
if (image1) {
- this->m_image1Input->readSampled(output, x, y, COM_PS_NEAREST);
+ this->m_image1Input->readSampled(output, x, y, PixelSampler::Nearest);
}
else {
- this->m_image2Input->readSampled(output, x, y, COM_PS_NEAREST);
+ this->m_image2Input->readSampled(output, x, y, PixelSampler::Nearest);
}
}
@@ -76,3 +78,5 @@ void SplitOperation::determineResolution(unsigned int resolution[2],
NodeOperation::determineResolution(resolution, preferredResolution);
}
+
+} // namespace blender::compositor
diff --git a/source/blender/compositor/operations/COM_SplitOperation.h b/source/blender/compositor/operations/COM_SplitOperation.h
index ace5fd62eb2..09e48821dd0 100644
--- a/source/blender/compositor/operations/COM_SplitOperation.h
+++ b/source/blender/compositor/operations/COM_SplitOperation.h
@@ -20,6 +20,8 @@
#include "COM_NodeOperation.h"
+namespace blender::compositor {
+
class SplitOperation : public NodeOperation {
private:
SocketReader *m_image1Input;
@@ -44,3 +46,5 @@ class SplitOperation : public NodeOperation {
this->m_xSplit = xsplit;
}
};
+
+} // namespace blender::compositor
diff --git a/source/blender/compositor/operations/COM_SunBeamsOperation.cc b/source/blender/compositor/operations/COM_SunBeamsOperation.cc
index 23bf5897297..839eeb9ff8f 100644
--- a/source/blender/compositor/operations/COM_SunBeamsOperation.cc
+++ b/source/blender/compositor/operations/COM_SunBeamsOperation.cc
@@ -19,13 +19,15 @@
#include "COM_SunBeamsOperation.h"
+namespace blender::compositor {
+
SunBeamsOperation::SunBeamsOperation()
{
this->addInputSocket(DataType::Color);
this->addOutputSocket(DataType::Color);
this->setResolutionInputSocketIndex(0);
- this->setComplex(true);
+ this->flags.complex = true;
}
void SunBeamsOperation::initExecution()
@@ -138,7 +140,7 @@ template<int fxu, int fxv, int fyu, int fyv> struct BufferLineAccumulator {
falloff_factor = dist_max > dist_min ? dr / (float)(dist_max - dist_min) : 0.0f;
- float *iter = input->getBuffer() + COM_NUM_CHANNELS_COLOR * (x + input->getWidth() * y);
+ float *iter = input->getBuffer() + COM_DATA_TYPE_COLOR_CHANNELS * (x + input->getWidth() * y);
return iter;
}
@@ -167,7 +169,7 @@ template<int fxu, int fxv, int fyu, int fyv> struct BufferLineAccumulator {
if ((int)(co[0] - source[0]) == 0 && (int)(co[1] - source[1]) == 0) {
copy_v4_v4(output,
- input->getBuffer() + COM_NUM_CHANNELS_COLOR *
+ input->getBuffer() + COM_DATA_TYPE_COLOR_CHANNELS *
((int)source[0] + input->getWidth() * (int)source[1]));
return;
}
@@ -208,7 +210,7 @@ template<int fxu, int fxv, int fyu, int fyv> struct BufferLineAccumulator {
/* decrement u */
x -= fxu;
y -= fyu;
- buffer -= (fxu + fyu * buffer_width) * COM_NUM_CHANNELS_COLOR;
+ buffer -= (fxu + fyu * buffer_width) * COM_DATA_TYPE_COLOR_CHANNELS;
/* decrement v (in steps of dv < 1) */
v_local -= dv;
@@ -217,7 +219,7 @@ template<int fxu, int fxv, int fyu, int fyv> struct BufferLineAccumulator {
x -= fxv;
y -= fyv;
- buffer -= (fxv + fyv * buffer_width) * COM_NUM_CHANNELS_COLOR;
+ buffer -= (fxv + fyv * buffer_width) * COM_DATA_TYPE_COLOR_CHANNELS;
}
}
@@ -353,3 +355,5 @@ bool SunBeamsOperation::determineDependingAreaOfInterest(rcti *input,
return NodeOperation::determineDependingAreaOfInterest(&rect, readOperation, output);
}
+
+} // namespace blender::compositor
diff --git a/source/blender/compositor/operations/COM_SunBeamsOperation.h b/source/blender/compositor/operations/COM_SunBeamsOperation.h
index 7cf5cf9971e..d3725021cde 100644
--- a/source/blender/compositor/operations/COM_SunBeamsOperation.h
+++ b/source/blender/compositor/operations/COM_SunBeamsOperation.h
@@ -19,6 +19,8 @@
#include "COM_NodeOperation.h"
+namespace blender::compositor {
+
class SunBeamsOperation : public NodeOperation {
public:
SunBeamsOperation();
@@ -44,3 +46,5 @@ class SunBeamsOperation : public NodeOperation {
float m_source_px[2];
float m_ray_length_px;
};
+
+} // namespace blender::compositor
diff --git a/source/blender/compositor/operations/COM_TextureOperation.cc b/source/blender/compositor/operations/COM_TextureOperation.cc
index 146f43dbe3a..059a289ae4d 100644
--- a/source/blender/compositor/operations/COM_TextureOperation.cc
+++ b/source/blender/compositor/operations/COM_TextureOperation.cc
@@ -25,6 +25,8 @@
#include "BLI_listbase.h"
#include "BLI_threads.h"
+namespace blender::compositor {
+
TextureBaseOperation::TextureBaseOperation()
{
this->addInputSocket(DataType::Vector); // offset
@@ -35,7 +37,7 @@ TextureBaseOperation::TextureBaseOperation()
this->m_rd = nullptr;
this->m_pool = nullptr;
this->m_sceneColorManage = false;
- setComplex(true);
+ flags.complex = true;
}
TextureOperation::TextureOperation() : TextureBaseOperation()
{
@@ -73,15 +75,31 @@ void TextureBaseOperation::deinitExecution()
void TextureBaseOperation::determineResolution(unsigned int resolution[2],
unsigned int preferredResolution[2])
{
- if (preferredResolution[0] == 0 || preferredResolution[1] == 0) {
- int width = this->m_rd->xsch * this->m_rd->size / 100;
- int height = this->m_rd->ysch * this->m_rd->size / 100;
- resolution[0] = width;
- resolution[1] = height;
- }
- else {
- resolution[0] = preferredResolution[0];
- resolution[1] = preferredResolution[1];
+ switch (execution_model_) {
+ case eExecutionModel::Tiled: {
+ if (preferredResolution[0] == 0 || preferredResolution[1] == 0) {
+ int width = this->m_rd->xsch * this->m_rd->size / 100;
+ int height = this->m_rd->ysch * this->m_rd->size / 100;
+ resolution[0] = width;
+ resolution[1] = height;
+ }
+ else {
+ resolution[0] = preferredResolution[0];
+ resolution[1] = preferredResolution[1];
+ }
+ break;
+ }
+ case eExecutionModel::FullFrame: {
+ /* Determine inputs resolutions. */
+ unsigned int temp[2];
+ NodeOperation::determineResolution(temp, preferredResolution);
+
+ /* We don't use inputs resolutions because they are only used as parameters, not image data.
+ */
+ resolution[0] = preferredResolution[0];
+ resolution[1] = preferredResolution[1];
+ break;
+ }
}
}
@@ -155,3 +173,5 @@ void TextureBaseOperation::executePixelSampled(float output[4],
output[0] = output[1] = output[2] = output[3];
}
}
+
+} // namespace blender::compositor
diff --git a/source/blender/compositor/operations/COM_TextureOperation.h b/source/blender/compositor/operations/COM_TextureOperation.h
index 1a6e005f752..e5f56673694 100644
--- a/source/blender/compositor/operations/COM_TextureOperation.h
+++ b/source/blender/compositor/operations/COM_TextureOperation.h
@@ -26,6 +26,8 @@
#include "RE_pipeline.h"
#include "RE_texture.h"
+namespace blender::compositor {
+
/**
* Base class for all renderlayeroperations
*
@@ -42,7 +44,7 @@ class TextureBaseOperation : public NodeOperation {
protected:
/**
- * Determine the output resolution. The resolution is retrieved from the Renderer
+ * Determine the output resolution.
*/
void determineResolution(unsigned int resolution[2],
unsigned int preferredResolution[2]) override;
@@ -80,3 +82,5 @@ class TextureAlphaOperation : public TextureBaseOperation {
TextureAlphaOperation();
void executePixelSampled(float output[4], float x, float y, PixelSampler sampler) override;
};
+
+} // namespace blender::compositor
diff --git a/source/blender/compositor/operations/COM_TonemapOperation.cc b/source/blender/compositor/operations/COM_TonemapOperation.cc
index 85011171432..6bfacb0c75d 100644
--- a/source/blender/compositor/operations/COM_TonemapOperation.cc
+++ b/source/blender/compositor/operations/COM_TonemapOperation.cc
@@ -22,14 +22,16 @@
#include "IMB_colormanagement.h"
+namespace blender::compositor {
+
TonemapOperation::TonemapOperation()
{
- this->addInputSocket(DataType::Color, COM_SC_NO_RESIZE);
+ this->addInputSocket(DataType::Color, ResizeMode::None);
this->addOutputSocket(DataType::Color);
this->m_imageReader = nullptr;
this->m_data = nullptr;
this->m_cachedInstance = nullptr;
- this->setComplex(true);
+ this->flags.complex = true;
}
void TonemapOperation::initExecution()
{
@@ -150,3 +152,5 @@ void TonemapOperation::deinitializeTileData(rcti * /*rect*/, void * /*data*/)
{
/* pass */
}
+
+} // namespace blender::compositor
diff --git a/source/blender/compositor/operations/COM_TonemapOperation.h b/source/blender/compositor/operations/COM_TonemapOperation.h
index e7da983fe61..7ecb179504d 100644
--- a/source/blender/compositor/operations/COM_TonemapOperation.h
+++ b/source/blender/compositor/operations/COM_TonemapOperation.h
@@ -21,6 +21,8 @@
#include "COM_NodeOperation.h"
#include "DNA_node_types.h"
+namespace blender::compositor {
+
/**
* \brief temporarily storage during execution of Tone-map
* \ingroup operation
@@ -98,3 +100,5 @@ class PhotoreceptorTonemapOperation : public TonemapOperation {
*/
void executePixel(float output[4], int x, int y, void *data) override;
};
+
+} // namespace blender::compositor
diff --git a/source/blender/compositor/operations/COM_TrackPositionOperation.cc b/source/blender/compositor/operations/COM_TrackPositionOperation.cc
index 97d602aa458..993410e3e84 100644
--- a/source/blender/compositor/operations/COM_TrackPositionOperation.cc
+++ b/source/blender/compositor/operations/COM_TrackPositionOperation.cc
@@ -28,6 +28,8 @@
#include "BKE_node.h"
#include "BKE_tracking.h"
+namespace blender::compositor {
+
TrackPositionOperation::TrackPositionOperation()
{
this->addOutputSocket(DataType::Value);
@@ -39,6 +41,7 @@ TrackPositionOperation::TrackPositionOperation()
this->m_position = CMP_TRACKPOS_ABSOLUTE;
this->m_relativeFrame = 0;
this->m_speed_output = false;
+ flags.is_set_operation = true;
}
void TrackPositionOperation::initExecution()
@@ -134,3 +137,5 @@ void TrackPositionOperation::determineResolution(unsigned int resolution[2],
resolution[0] = preferredResolution[0];
resolution[1] = preferredResolution[1];
}
+
+} // namespace blender::compositor
diff --git a/source/blender/compositor/operations/COM_TrackPositionOperation.h b/source/blender/compositor/operations/COM_TrackPositionOperation.h
index 2e2c1f36c52..b0b0a123bd6 100644
--- a/source/blender/compositor/operations/COM_TrackPositionOperation.h
+++ b/source/blender/compositor/operations/COM_TrackPositionOperation.h
@@ -28,6 +28,8 @@
#include "BLI_listbase.h"
#include "BLI_string.h"
+namespace blender::compositor {
+
/**
* Class with implementation of green screen gradient rasterization
*/
@@ -91,9 +93,6 @@ class TrackPositionOperation : public NodeOperation {
void initExecution() override;
void executePixelSampled(float output[4], float x, float y, PixelSampler sampler) override;
-
- bool isSetOperation() const override
- {
- return true;
- }
};
+
+} // namespace blender::compositor
diff --git a/source/blender/compositor/operations/COM_TranslateOperation.cc b/source/blender/compositor/operations/COM_TranslateOperation.cc
index 7efd655b1df..49135f25320 100644
--- a/source/blender/compositor/operations/COM_TranslateOperation.cc
+++ b/source/blender/compositor/operations/COM_TranslateOperation.cc
@@ -18,6 +18,8 @@
#include "COM_TranslateOperation.h"
+namespace blender::compositor {
+
TranslateOperation::TranslateOperation()
{
this->addInputSocket(DataType::Color);
@@ -56,7 +58,7 @@ void TranslateOperation::executePixelSampled(float output[4],
float originalXPos = x - this->getDeltaX();
float originalYPos = y - this->getDeltaY();
- this->m_inputOperation->readSampled(output, originalXPos, originalYPos, COM_PS_BILINEAR);
+ this->m_inputOperation->readSampled(output, originalXPos, originalYPos, PixelSampler::Bilinear);
}
bool TranslateOperation::determineDependingAreaOfInterest(rcti *input,
@@ -80,3 +82,5 @@ void TranslateOperation::setFactorXY(float factorX, float factorY)
m_factorX = factorX;
m_factorY = factorY;
}
+
+} // namespace blender::compositor
diff --git a/source/blender/compositor/operations/COM_TranslateOperation.h b/source/blender/compositor/operations/COM_TranslateOperation.h
index d55cc9096c0..eb3a664159f 100644
--- a/source/blender/compositor/operations/COM_TranslateOperation.h
+++ b/source/blender/compositor/operations/COM_TranslateOperation.h
@@ -20,6 +20,8 @@
#include "COM_NodeOperation.h"
+namespace blender::compositor {
+
class TranslateOperation : public NodeOperation {
private:
SocketReader *m_inputOperation;
@@ -54,9 +56,9 @@ class TranslateOperation : public NodeOperation {
{
if (!this->m_isDeltaSet) {
float tempDelta[4];
- this->m_inputXOperation->readSampled(tempDelta, 0, 0, COM_PS_NEAREST);
+ this->m_inputXOperation->readSampled(tempDelta, 0, 0, PixelSampler::Nearest);
this->m_deltaX = tempDelta[0];
- this->m_inputYOperation->readSampled(tempDelta, 0, 0, COM_PS_NEAREST);
+ this->m_inputYOperation->readSampled(tempDelta, 0, 0, PixelSampler::Nearest);
this->m_deltaY = tempDelta[0];
this->m_isDeltaSet = true;
}
@@ -64,3 +66,5 @@ class TranslateOperation : public NodeOperation {
void setFactorXY(float factorX, float factorY);
};
+
+} // namespace blender::compositor
diff --git a/source/blender/compositor/operations/COM_VariableSizeBokehBlurOperation.cc b/source/blender/compositor/operations/COM_VariableSizeBokehBlurOperation.cc
index ea33f3cd787..19cd5a53084 100644
--- a/source/blender/compositor/operations/COM_VariableSizeBokehBlurOperation.cc
+++ b/source/blender/compositor/operations/COM_VariableSizeBokehBlurOperation.cc
@@ -22,18 +22,20 @@
#include "RE_pipeline.h"
+namespace blender::compositor {
+
VariableSizeBokehBlurOperation::VariableSizeBokehBlurOperation()
{
this->addInputSocket(DataType::Color);
- this->addInputSocket(DataType::Color, COM_SC_NO_RESIZE); // do not resize the bokeh image.
+ this->addInputSocket(DataType::Color, ResizeMode::None); // do not resize the bokeh image.
this->addInputSocket(DataType::Value); // radius
#ifdef COM_DEFOCUS_SEARCH
this->addInputSocket(DataType::Color,
- COM_SC_NO_RESIZE); // inverse search radius optimization structure.
+ ResizeMode::None); // inverse search radius optimization structure.
#endif
this->addOutputSocket(DataType::Color);
- this->setComplex(true);
- this->setOpenCL(true);
+ flags.complex = true;
+ flags.open_cl = true;
this->m_inputProgram = nullptr;
this->m_inputBokehProgram = nullptr;
@@ -135,14 +137,14 @@ void VariableSizeBokehBlurOperation::executePixel(float output[4], int x, int y,
const int addXStepValue = QualityStepHelper::getStep();
const int addYStepValue = addXStepValue;
- const int addXStepColor = addXStepValue * COM_NUM_CHANNELS_COLOR;
+ const int addXStepColor = addXStepValue * COM_DATA_TYPE_COLOR_CHANNELS;
if (size_center > this->m_threshold) {
for (int ny = miny; ny < maxy; ny += addYStepValue) {
float dy = ny - y;
int offsetValueNy = ny * inputSizeBuffer->getWidth();
int offsetValueNxNy = offsetValueNy + (minx);
- int offsetColorNxNy = offsetValueNxNy * COM_NUM_CHANNELS_COLOR;
+ int offsetColorNxNy = offsetValueNxNy * COM_DATA_TYPE_COLOR_CHANNELS;
for (int nx = minx; nx < maxx; nx += addXStepValue) {
if (nx != x || ny != y) {
float size = MIN2(inputSizeFloatBuffer[offsetValueNxNy] * scalar, size_center);
@@ -278,9 +280,9 @@ bool VariableSizeBokehBlurOperation::determineDependingAreaOfInterest(
// InverseSearchRadiusOperation
InverseSearchRadiusOperation::InverseSearchRadiusOperation()
{
- this->addInputSocket(DataType::Value, COM_SC_NO_RESIZE); // radius
+ this->addInputSocket(DataType::Value, ResizeMode::None); // radius
this->addOutputSocket(DataType::Color);
- this->setComplex(true);
+ this->flags.complex = true;
this->m_inputRadius = nullptr;
}
@@ -319,7 +321,7 @@ void *InverseSearchRadiusOperation::initializeTileData(rcti *rect)
// 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);
+ // this->m_inputRadius->read(temp, rx+x2, ry+y2, PixelSampler::Nearest);
// if (radius < temp[0]) {
// radius = temp[0];
// maxx = x2;
@@ -381,3 +383,5 @@ bool InverseSearchRadiusOperation::determineDependingAreaOfInterest(
return NodeOperation::determineDependingAreaOfInterest(&newRect, readOperation, output);
}
#endif
+
+} // namespace blender::compositor
diff --git a/source/blender/compositor/operations/COM_VariableSizeBokehBlurOperation.h b/source/blender/compositor/operations/COM_VariableSizeBokehBlurOperation.h
index 5b859e5a2fd..baeab6a646e 100644
--- a/source/blender/compositor/operations/COM_VariableSizeBokehBlurOperation.h
+++ b/source/blender/compositor/operations/COM_VariableSizeBokehBlurOperation.h
@@ -21,6 +21,8 @@
#include "COM_NodeOperation.h"
#include "COM_QualityStepHelper.h"
+namespace blender::compositor {
+
//#define COM_DEFOCUS_SEARCH
class VariableSizeBokehBlurOperation : public NodeOperation, public QualityStepHelper {
@@ -124,3 +126,5 @@ class InverseSearchRadiusOperation : public NodeOperation {
}
};
#endif
+
+} // namespace blender::compositor
diff --git a/source/blender/compositor/operations/COM_VectorBlurOperation.cc b/source/blender/compositor/operations/COM_VectorBlurOperation.cc
index ff9eef8a7e1..fd64bda156b 100644
--- a/source/blender/compositor/operations/COM_VectorBlurOperation.cc
+++ b/source/blender/compositor/operations/COM_VectorBlurOperation.cc
@@ -25,6 +25,8 @@
#include "COM_VectorBlurOperation.h"
+namespace blender::compositor {
+
/* Defined */
#define PASS_VECTOR_MAX 10000.0f
@@ -54,7 +56,7 @@ VectorBlurOperation::VectorBlurOperation()
this->m_inputImageProgram = nullptr;
this->m_inputSpeedProgram = nullptr;
this->m_inputZProgram = nullptr;
- setComplex(true);
+ flags.complex = true;
}
void VectorBlurOperation::initExecution()
{
@@ -69,7 +71,7 @@ void VectorBlurOperation::initExecution()
void VectorBlurOperation::executePixel(float output[4], int x, int y, void *data)
{
float *buffer = (float *)data;
- int index = (y * this->getWidth() + x) * COM_NUM_CHANNELS_COLOR;
+ int index = (y * this->getWidth() + x) * COM_DATA_TYPE_COLOR_CHANNELS;
copy_v4_v4(output, &buffer[index]);
}
@@ -897,3 +899,5 @@ void zbuf_accumulate_vecblur(NodeBlurData *nbd,
}
zbuf_free_span(&zspan);
}
+
+} // namespace blender::compositor
diff --git a/source/blender/compositor/operations/COM_VectorBlurOperation.h b/source/blender/compositor/operations/COM_VectorBlurOperation.h
index 10affb48f20..dfcf1fb16f7 100644
--- a/source/blender/compositor/operations/COM_VectorBlurOperation.h
+++ b/source/blender/compositor/operations/COM_VectorBlurOperation.h
@@ -22,6 +22,8 @@
#include "COM_QualityStepHelper.h"
#include "DNA_node_types.h"
+namespace blender::compositor {
+
class VectorBlurOperation : public NodeOperation, public QualityStepHelper {
private:
/**
@@ -72,3 +74,5 @@ class VectorBlurOperation : public NodeOperation, public QualityStepHelper {
MemoryBuffer *inputSpeed,
MemoryBuffer *inputZ);
};
+
+} // namespace blender::compositor
diff --git a/source/blender/compositor/operations/COM_VectorCurveOperation.cc b/source/blender/compositor/operations/COM_VectorCurveOperation.cc
index a6638a78e88..9d53ed5d8ee 100644
--- a/source/blender/compositor/operations/COM_VectorCurveOperation.cc
+++ b/source/blender/compositor/operations/COM_VectorCurveOperation.cc
@@ -20,6 +20,8 @@
#include "BKE_colortools.h"
+namespace blender::compositor {
+
VectorCurveOperation::VectorCurveOperation()
{
this->addInputSocket(DataType::Vector);
@@ -50,3 +52,5 @@ void VectorCurveOperation::deinitExecution()
CurveBaseOperation::deinitExecution();
this->m_inputProgram = nullptr;
}
+
+} // namespace blender::compositor
diff --git a/source/blender/compositor/operations/COM_VectorCurveOperation.h b/source/blender/compositor/operations/COM_VectorCurveOperation.h
index 0c164a1f3c8..8cbb80e27c7 100644
--- a/source/blender/compositor/operations/COM_VectorCurveOperation.h
+++ b/source/blender/compositor/operations/COM_VectorCurveOperation.h
@@ -21,6 +21,8 @@
#include "COM_CurveBaseOperation.h"
#include "COM_NodeOperation.h"
+namespace blender::compositor {
+
class VectorCurveOperation : public CurveBaseOperation {
private:
/**
@@ -46,3 +48,5 @@ class VectorCurveOperation : public CurveBaseOperation {
*/
void deinitExecution() override;
};
+
+} // namespace blender::compositor
diff --git a/source/blender/compositor/operations/COM_ViewerOperation.cc b/source/blender/compositor/operations/COM_ViewerOperation.cc
index ea5937d8afb..860f56e23fa 100644
--- a/source/blender/compositor/operations/COM_ViewerOperation.cc
+++ b/source/blender/compositor/operations/COM_ViewerOperation.cc
@@ -32,6 +32,8 @@
#include "IMB_imbuf.h"
#include "IMB_imbuf_types.h"
+namespace blender::compositor {
+
ViewerOperation::ViewerOperation()
{
this->setImage(nullptr);
@@ -53,6 +55,8 @@ ViewerOperation::ViewerOperation()
this->m_depthInput = nullptr;
this->m_rd = nullptr;
this->m_viewName = nullptr;
+ flags.use_viewer_border = true;
+ flags.is_viewer_operation = true;
}
void ViewerOperation::initExecution()
@@ -98,12 +102,12 @@ void ViewerOperation::executeRegion(rcti *rect, unsigned int /*tileNumber*/)
for (y = y1; y < y2 && (!breaked); y++) {
for (x = x1; x < x2; x++) {
- this->m_imageInput->readSampled(&(buffer[offset4]), x, y, COM_PS_NEAREST);
+ this->m_imageInput->readSampled(&(buffer[offset4]), x, y, PixelSampler::Nearest);
if (this->m_useAlphaInput) {
- this->m_alphaInput->readSampled(alpha, x, y, COM_PS_NEAREST);
+ this->m_alphaInput->readSampled(alpha, x, y, PixelSampler::Nearest);
buffer[offset4 + 3] = alpha[0];
}
- this->m_depthInput->readSampled(depth, x, y, COM_PS_NEAREST);
+ this->m_depthInput->readSampled(depth, x, y, PixelSampler::Nearest);
depthbuffer[offset] = depth[0];
offset++;
@@ -205,11 +209,13 @@ void ViewerOperation::updateImage(rcti *rect)
this->updateDraw();
}
-CompositorPriority ViewerOperation::getRenderPriority() const
+eCompositorPriority ViewerOperation::getRenderPriority() const
{
if (this->isActiveViewerOutput()) {
- return CompositorPriority::High;
+ return eCompositorPriority::High;
}
- return CompositorPriority::Low;
+ return eCompositorPriority::Low;
}
+
+} // namespace blender::compositor
diff --git a/source/blender/compositor/operations/COM_ViewerOperation.h b/source/blender/compositor/operations/COM_ViewerOperation.h
index a3df19d5e90..c0f13ff79fc 100644
--- a/source/blender/compositor/operations/COM_ViewerOperation.h
+++ b/source/blender/compositor/operations/COM_ViewerOperation.h
@@ -23,6 +23,8 @@
#include "COM_NodeOperation.h"
#include "DNA_image_types.h"
+namespace blender::compositor {
+
class ViewerOperation : public NodeOperation {
private:
float *m_outputBuffer;
@@ -100,11 +102,7 @@ class ViewerOperation : public NodeOperation {
{
return this->m_chunkOrder;
}
- CompositorPriority getRenderPriority() const override;
- bool isViewerOperation() const override
- {
- return true;
- }
+ eCompositorPriority getRenderPriority() const override;
void setUseAlphaInput(bool value)
{
this->m_useAlphaInput = value;
@@ -131,3 +129,5 @@ class ViewerOperation : public NodeOperation {
void updateImage(rcti *rect);
void initImage();
};
+
+} // namespace blender::compositor
diff --git a/source/blender/compositor/operations/COM_WrapOperation.cc b/source/blender/compositor/operations/COM_WrapOperation.cc
index a869666967e..d0d2fcac3ac 100644
--- a/source/blender/compositor/operations/COM_WrapOperation.cc
+++ b/source/blender/compositor/operations/COM_WrapOperation.cc
@@ -20,6 +20,8 @@
#include "COM_WrapOperation.h"
+namespace blender::compositor {
+
WrapOperation::WrapOperation(DataType datatype) : ReadBufferOperation(datatype)
{
this->m_wrappingType = CMP_NODE_WRAP_NONE;
@@ -115,3 +117,5 @@ void WrapOperation::setWrapping(int wrapping_type)
{
m_wrappingType = wrapping_type;
}
+
+} // namespace blender::compositor
diff --git a/source/blender/compositor/operations/COM_WrapOperation.h b/source/blender/compositor/operations/COM_WrapOperation.h
index 21123ed490c..6279129a550 100644
--- a/source/blender/compositor/operations/COM_WrapOperation.h
+++ b/source/blender/compositor/operations/COM_WrapOperation.h
@@ -20,6 +20,8 @@
#include "COM_ReadBufferOperation.h"
+namespace blender::compositor {
+
class WrapOperation : public ReadBufferOperation {
private:
int m_wrappingType;
@@ -37,3 +39,5 @@ class WrapOperation : public ReadBufferOperation {
void setFactorXY(float factorX, float factorY);
};
+
+} // namespace blender::compositor
diff --git a/source/blender/compositor/operations/COM_WriteBufferOperation.cc b/source/blender/compositor/operations/COM_WriteBufferOperation.cc
index e426bc76ef3..1aa19f26e2b 100644
--- a/source/blender/compositor/operations/COM_WriteBufferOperation.cc
+++ b/source/blender/compositor/operations/COM_WriteBufferOperation.cc
@@ -21,12 +21,15 @@
#include "COM_defines.h"
#include <cstdio>
+namespace blender::compositor {
+
WriteBufferOperation::WriteBufferOperation(DataType datatype)
{
this->addInputSocket(datatype);
this->m_memoryProxy = new MemoryProxy(datatype);
this->m_memoryProxy->setWriteBufferOperation(this);
this->m_memoryProxy->setExecutor(nullptr);
+ flags.is_write_buffer_operation = true;
}
WriteBufferOperation::~WriteBufferOperation()
{
@@ -61,7 +64,7 @@ void WriteBufferOperation::executeRegion(rcti *rect, unsigned int /*tileNumber*/
MemoryBuffer *memoryBuffer = this->m_memoryProxy->getBuffer();
float *buffer = memoryBuffer->getBuffer();
const uint8_t num_channels = memoryBuffer->get_num_channels();
- if (this->m_input->isComplex()) {
+ if (this->m_input->get_flags().complex) {
void *data = this->m_input->initializeTileData(rect);
int x1 = rect->xmin;
int y1 = rect->ymin;
@@ -97,7 +100,7 @@ void WriteBufferOperation::executeRegion(rcti *rect, unsigned int /*tileNumber*/
for (y = y1; y < y2 && (!breaked); y++) {
int offset4 = (y * memoryBuffer->getWidth() + x1) * num_channels;
for (x = x1; x < x2; x++) {
- this->m_input->readSampled(&(buffer[offset4]), x, y, COM_PS_NEAREST);
+ this->m_input->readSampled(&(buffer[offset4]), x, y, PixelSampler::Nearest);
offset4 += num_channels;
}
if (isBraked()) {
@@ -225,3 +228,5 @@ void WriteBufferOperation::readResolutionFromInputSocket()
this->setWidth(inputOperation->getWidth());
this->setHeight(inputOperation->getHeight());
}
+
+} // namespace blender::compositor
diff --git a/source/blender/compositor/operations/COM_WriteBufferOperation.h b/source/blender/compositor/operations/COM_WriteBufferOperation.h
index 00d48e38fca..2817fbe24b9 100644
--- a/source/blender/compositor/operations/COM_WriteBufferOperation.h
+++ b/source/blender/compositor/operations/COM_WriteBufferOperation.h
@@ -20,7 +20,12 @@
#include "COM_MemoryProxy.h"
#include "COM_NodeOperation.h"
-#include "COM_SocketReader.h"
+
+namespace blender::compositor {
+
+class OpenCLDevice;
+class MemoryProxy;
+
/**
* \brief NodeOperation to write to a tile
* \ingroup Operation
@@ -38,10 +43,6 @@ class WriteBufferOperation : public NodeOperation {
return this->m_memoryProxy;
}
void executePixelSampled(float output[4], float x, float y, PixelSampler sampler) override;
- bool isWriteBufferOperation() const override
- {
- return true;
- }
bool isSingleValue() const
{
return m_single_value;
@@ -63,3 +64,5 @@ class WriteBufferOperation : public NodeOperation {
return m_input;
}
};
+
+} // namespace blender::compositor
diff --git a/source/blender/compositor/operations/COM_ZCombineOperation.cc b/source/blender/compositor/operations/COM_ZCombineOperation.cc
index 8afdbcc7c2d..9d3ca7e736e 100644
--- a/source/blender/compositor/operations/COM_ZCombineOperation.cc
+++ b/source/blender/compositor/operations/COM_ZCombineOperation.cc
@@ -19,6 +19,8 @@
#include "COM_ZCombineOperation.h"
#include "BLI_utildefines.h"
+namespace blender::compositor {
+
ZCombineOperation::ZCombineOperation()
{
this->addInputSocket(DataType::Color);
@@ -158,3 +160,5 @@ void ZCombineMaskOperation::deinitExecution()
this->m_maskReader = nullptr;
this->m_image2Reader = nullptr;
}
+
+} // namespace blender::compositor
diff --git a/source/blender/compositor/operations/COM_ZCombineOperation.h b/source/blender/compositor/operations/COM_ZCombineOperation.h
index 91044d44985..d0b1aee7310 100644
--- a/source/blender/compositor/operations/COM_ZCombineOperation.h
+++ b/source/blender/compositor/operations/COM_ZCombineOperation.h
@@ -20,6 +20,8 @@
#include "COM_MixOperation.h"
+namespace blender::compositor {
+
/**
* this program converts an input color to an output value.
* it assumes we are in sRGB color space.
@@ -66,3 +68,5 @@ class ZCombineMaskOperation : public NodeOperation {
class ZCombineMaskAlphaOperation : public ZCombineMaskOperation {
void executePixelSampled(float output[4], float x, float y, PixelSampler sampler) override;
};
+
+} // namespace blender::compositor