[Bf-blender-cvs] [c566e40] master: Cleanup: Renamed compositor executePixel functions and their 'read' wrappers in SocketReader.

Lukas Tönne noreply at git.blender.org
Tue Nov 19 11:11:35 CET 2013


Commit: c566e408e42836c136d8818cbea93ce870be09ea
Author: Lukas Tönne
Date:   Tue Nov 19 11:06:16 2013 +0100
http://developer.blender.org/rBc566e408e42836c136d8818cbea93ce870be09ea

Cleanup: Renamed compositor executePixel functions and their 'read' wrappers in SocketReader.

Distinguish the 3 different methods for acquiring pixel color values (executePixel, executePixelSampled, executePixelFiltered).
This makes it easier to keep track of the different sampling methods (and works nicer with IDEs that do code parsing).

Differential Revision: http://developer.blender.org/D7

===================================================================

M	source/blender/compositor/intern/COM_SocketReader.h
M	source/blender/compositor/operations/COM_AlphaOverKeyOperation.cpp
M	source/blender/compositor/operations/COM_AlphaOverKeyOperation.h
M	source/blender/compositor/operations/COM_AlphaOverMixedOperation.cpp
M	source/blender/compositor/operations/COM_AlphaOverMixedOperation.h
M	source/blender/compositor/operations/COM_AlphaOverPremultiplyOperation.cpp
M	source/blender/compositor/operations/COM_AlphaOverPremultiplyOperation.h
M	source/blender/compositor/operations/COM_BlurBaseOperation.cpp
M	source/blender/compositor/operations/COM_BokehBlurOperation.cpp
M	source/blender/compositor/operations/COM_BokehImageOperation.cpp
M	source/blender/compositor/operations/COM_BokehImageOperation.h
M	source/blender/compositor/operations/COM_BoxMaskOperation.cpp
M	source/blender/compositor/operations/COM_BoxMaskOperation.h
M	source/blender/compositor/operations/COM_BrightnessOperation.cpp
M	source/blender/compositor/operations/COM_BrightnessOperation.h
M	source/blender/compositor/operations/COM_ChangeHSVOperation.cpp
M	source/blender/compositor/operations/COM_ChangeHSVOperation.h
M	source/blender/compositor/operations/COM_ChannelMatteOperation.cpp
M	source/blender/compositor/operations/COM_ChannelMatteOperation.h
M	source/blender/compositor/operations/COM_ChromaMatteOperation.cpp
M	source/blender/compositor/operations/COM_ChromaMatteOperation.h
M	source/blender/compositor/operations/COM_ColorBalanceASCCDLOperation.cpp
M	source/blender/compositor/operations/COM_ColorBalanceASCCDLOperation.h
M	source/blender/compositor/operations/COM_ColorBalanceLGGOperation.cpp
M	source/blender/compositor/operations/COM_ColorBalanceLGGOperation.h
M	source/blender/compositor/operations/COM_ColorCorrectionOperation.cpp
M	source/blender/compositor/operations/COM_ColorCorrectionOperation.h
M	source/blender/compositor/operations/COM_ColorCurveOperation.cpp
M	source/blender/compositor/operations/COM_ColorCurveOperation.h
M	source/blender/compositor/operations/COM_ColorMatteOperation.cpp
M	source/blender/compositor/operations/COM_ColorMatteOperation.h
M	source/blender/compositor/operations/COM_ColorRampOperation.cpp
M	source/blender/compositor/operations/COM_ColorRampOperation.h
M	source/blender/compositor/operations/COM_ColorSpillOperation.cpp
M	source/blender/compositor/operations/COM_ColorSpillOperation.h
M	source/blender/compositor/operations/COM_CompositorOperation.cpp
M	source/blender/compositor/operations/COM_ConvertColorProfileOperation.cpp
M	source/blender/compositor/operations/COM_ConvertColorProfileOperation.h
M	source/blender/compositor/operations/COM_ConvertDepthToRadiusOperation.cpp
M	source/blender/compositor/operations/COM_ConvertDepthToRadiusOperation.h
M	source/blender/compositor/operations/COM_ConvertOperation.cpp
M	source/blender/compositor/operations/COM_ConvertOperation.h
M	source/blender/compositor/operations/COM_CropOperation.cpp
M	source/blender/compositor/operations/COM_CropOperation.h
M	source/blender/compositor/operations/COM_DifferenceMatteOperation.cpp
M	source/blender/compositor/operations/COM_DifferenceMatteOperation.h
M	source/blender/compositor/operations/COM_DirectionalBlurOperation.cpp
M	source/blender/compositor/operations/COM_DisplaceOperation.cpp
M	source/blender/compositor/operations/COM_DisplaceSimpleOperation.cpp
M	source/blender/compositor/operations/COM_DisplaceSimpleOperation.h
M	source/blender/compositor/operations/COM_DistanceRGBMatteOperation.cpp
M	source/blender/compositor/operations/COM_DistanceRGBMatteOperation.h
M	source/blender/compositor/operations/COM_DotproductOperation.cpp
M	source/blender/compositor/operations/COM_DotproductOperation.h
M	source/blender/compositor/operations/COM_EllipseMaskOperation.cpp
M	source/blender/compositor/operations/COM_EllipseMaskOperation.h
M	source/blender/compositor/operations/COM_FlipOperation.cpp
M	source/blender/compositor/operations/COM_FlipOperation.h
M	source/blender/compositor/operations/COM_GammaCorrectOperation.cpp
M	source/blender/compositor/operations/COM_GammaCorrectOperation.h
M	source/blender/compositor/operations/COM_GammaOperation.cpp
M	source/blender/compositor/operations/COM_GammaOperation.h
M	source/blender/compositor/operations/COM_GlareThresholdOperation.cpp
M	source/blender/compositor/operations/COM_GlareThresholdOperation.h
M	source/blender/compositor/operations/COM_HueSaturationValueCorrectOperation.cpp
M	source/blender/compositor/operations/COM_HueSaturationValueCorrectOperation.h
M	source/blender/compositor/operations/COM_IDMaskOperation.cpp
M	source/blender/compositor/operations/COM_IDMaskOperation.h
M	source/blender/compositor/operations/COM_ImageOperation.cpp
M	source/blender/compositor/operations/COM_ImageOperation.h
M	source/blender/compositor/operations/COM_InvertOperation.cpp
M	source/blender/compositor/operations/COM_InvertOperation.h
M	source/blender/compositor/operations/COM_KeyingDespillOperation.cpp
M	source/blender/compositor/operations/COM_KeyingDespillOperation.h
M	source/blender/compositor/operations/COM_KeyingOperation.cpp
M	source/blender/compositor/operations/COM_KeyingOperation.h
M	source/blender/compositor/operations/COM_LuminanceMatteOperation.cpp
M	source/blender/compositor/operations/COM_LuminanceMatteOperation.h
M	source/blender/compositor/operations/COM_MapRangeOperation.cpp
M	source/blender/compositor/operations/COM_MapRangeOperation.h
M	source/blender/compositor/operations/COM_MapUVOperation.cpp
M	source/blender/compositor/operations/COM_MapUVOperation.h
M	source/blender/compositor/operations/COM_MapValueOperation.cpp
M	source/blender/compositor/operations/COM_MapValueOperation.h
M	source/blender/compositor/operations/COM_MaskOperation.cpp
M	source/blender/compositor/operations/COM_MaskOperation.h
M	source/blender/compositor/operations/COM_MathBaseOperation.cpp
M	source/blender/compositor/operations/COM_MathBaseOperation.h
M	source/blender/compositor/operations/COM_MixOperation.cpp
M	source/blender/compositor/operations/COM_MixOperation.h
M	source/blender/compositor/operations/COM_MovieClipAttributeOperation.cpp
M	source/blender/compositor/operations/COM_MovieClipAttributeOperation.h
M	source/blender/compositor/operations/COM_MovieClipOperation.cpp
M	source/blender/compositor/operations/COM_MovieClipOperation.h
M	source/blender/compositor/operations/COM_MovieDistortionOperation.cpp
M	source/blender/compositor/operations/COM_MovieDistortionOperation.h
M	source/blender/compositor/operations/COM_MultilayerImageOperation.cpp
M	source/blender/compositor/operations/COM_MultilayerImageOperation.h
M	source/blender/compositor/operations/COM_OutputFileOperation.cpp
M	source/blender/compositor/operations/COM_PixelateOperation.cpp
M	source/blender/compositor/operations/COM_PixelateOperation.h
M	source/blender/compositor/operations/COM_PlaneTrackMaskOperation.cpp
M	source/blender/compositor/operations/COM_PlaneTrackMaskOperation.h
M	source/blender/compositor/operations/COM_PlaneTrackWarpImageOperation.cpp
M	source/blender/compositor/operations/COM_PlaneTrackWarpImageOperation.h
M	source/blender/compositor/operations/COM_PreviewOperation.cpp
M	source/blender/compositor/operations/COM_ProjectorLensDistortionOperation.cpp
M	source/blender/compositor/operations/COM_ReadBufferOperation.cpp
M	source/blender/compositor/operations/COM_ReadBufferOperation.h
M	source/blender/compositor/operations/COM_RenderLayersProg.cpp
M	source/blender/compositor/operations/COM_RenderLayersProg.h
M	source/blender/compositor/operations/COM_RotateOperation.cpp
M	source/blender/compositor/operations/COM_RotateOperation.h
M	source/blender/compositor/operations/COM_ScaleOperation.cpp
M	source/blender/compositor/operations/COM_ScaleOperation.h
M	source/blender/compositor/operations/COM_ScreenLensDistortionOperation.cpp
M	source/blender/compositor/operations/COM_SetAlphaOperation.cpp
M	source/blender/compositor/operations/COM_SetAlphaOperation.h
M	source/blender/compositor/operations/COM_SetColorOperation.cpp
M	source/blender/compositor/operations/COM_SetColorOperation.h
M	source/blender/compositor/operations/COM_SetSamplerOperation.cpp
M	source/blender/compositor/operations/COM_SetSamplerOperation.h
M	source/blender/compositor/operations/COM_SetValueOperation.cpp
M	source/blender/compositor/operations/COM_SetValueOperation.h
M	source/blender/compositor/operations/COM_SetVectorOperation.cpp
M	source/blender/compositor/operations/COM_SetVectorOperation.h
M	source/blender/compositor/operations/COM_SocketProxyOperation.cpp
M	source/blender/compositor/operations/COM_SocketProxyOperation.h
M	source/blender/compositor/operations/COM_SplitOperation.cpp
M	source/blender/compositor/operations/COM_SplitOperation.h
M	source/blender/compositor/operations/COM_TextureOperation.cpp
M	source/blender/compositor/operations/COM_TextureOperation.h
M	source/blender/compositor/operations/COM_TrackPositionOperation.cpp
M	source/blender/compositor/operations/COM_TrackPositionOperation.h
M	source/blender/compositor/operations/COM_TranslateOperation.cpp
M	source/blender/compositor/operations/COM_TranslateOperation.h
M	source/blender/compositor/operations/COM_VariableSizeBokehBlurOperation.cpp
M	source/blender/compositor/operations/COM_VariableSizeBokehBlurOperation.h
M	source/blender/compositor/operations/COM_VectorCurveOperation.cpp
M	source/blender/compositor/operations/COM_VectorCurveOperation.h
M	source/blender/compositor/operations/COM_ViewerOperation.cpp
M	source/blender/compositor/operations/COM_WrapOperation.cpp
M	source/blender/compositor/operations/COM_WrapOperation.h
M	source/blender/compositor/operations/COM_WriteBufferOperation.cpp
M	source/blender/compositor/operations/COM_WriteBufferOperation.h
M	source/blender/compositor/operations/COM_ZCombineOperation.cpp
M	source/blender/compositor/operations/COM_ZCombineOperation.h

===================================================================

diff --git a/source/blender/compositor/intern/COM_SocketReader.h b/source/blender/compositor/intern/COM_SocketReader.h
index b7aae8b..2eaeb66 100644
--- a/source/blender/compositor/intern/COM_SocketReader.h
+++ b/source/blender/compositor/intern/COM_SocketReader.h
@@ -63,7 +63,7 @@ protected:
 	 * @param y the y-coordinate of the pixel to calculate in image space
 	 * @param inputBuffers chunks that can be read by their ReadBufferOperation.
 	 */
-	virtual void executePixel(float output[4], float x, float y, PixelSampler sampler) {}
+	virtual void executePixelSampled(float output[4], float x, float y, PixelSampler sampler) {}
 
 	/**
 	 * @brief calculate a single pixel
@@ -75,7 +75,7 @@ protected:
 	 * @param chunkData chunk specific data a during execution time.
 	 */
 	virtual void executePixel(float output[4], int x, int y, void *chunkData) {
-		executePixel(output, x, y, COM_PS_NEAREST);
+		executePixelSampled(output, x, y, COM_PS_NEAREST);
 	}
 
 	/**
@@ -88,17 +88,17 @@ protected:
 	 * @param dy
 	 * @param inputBuffers chunks that can be read by their ReadBufferOperation.
 	 */
-	virtual void executePixel(float output[4], float x, float y, float dx, float dy, PixelSampler sampler) {}
+	virtual void executePixelFiltered(float output[4], float x, float y, float dx, float dy, PixelSampler sampler) {}
 
 public:
-	inline void read(float result[4], float x, float y, PixelSampler sampler) {
-		executePixel(result, x, y, sampler);
+	inline void readSampled(float result[4], float x, float y, PixelSampler sampler) {
+		executePixelSampled(result, x, y, sampler);
 	}
 	inline void read(float result[4], int x, int y, void *chunkData) {
 		executePixel(result, x, y, chunkData);
 	}
-	inline void read(float result[4], float x, float y, float dx, float dy, PixelSampler sampler) {
-		executePixel(result, x, y, dx, dy, sampler);
+	inline void readFiltered(float result[4], float x, float y, float dx, float dy, PixelSampler sampler) {
+		executePixelFiltered(result, x, y, dx, dy, sampler);
 	}
 
 	virtual void *initializeTileData(rcti *rect) { return 0; }
diff --git a/source/blender/compositor/operations/COM_AlphaOverKeyOperation.cpp b/source/blender/compositor/operations/COM_AlphaOverKeyOperation.cpp
index 6cc9aae..d4103a6 100644
--- a/source/blender/compositor/operations/COM_AlphaOverKeyOperation.cpp
+++ b/source/blender/compositor/operations/COM_AlphaOverKeyOperation.cpp
@@ -27,15 +27,15 @@ AlphaOverKeyOperation::AlphaOverKeyOperation() : MixBaseOperation()
 	/* pass */
 }
 
-void AlphaOverKeyOperation::executePixel(float output[4], float x, float y, PixelSampler sampler)
+void AlphaOverKeyOperation::executePixelSampled(float output[4], float x, float y, PixelSampler sampler)
 {
 	float inputColor1[4];
 	float inputOverColor[4];
 	float value[4];
 	
-	this->m_inputValueOperation->read(value, x, y, sampler);
-	this->m_inputColor1Operation->read(inputColor1, x, y, sampler);
-	this->m_inputColor2Operation->read(inputOverColor, x, y, sampler);
+	this->m_inputValueOperation->readSampled(value, x, y, sampler);
+	this->m_inputColor1Operation->readSampled(inputColor1, x, y, sampler);
+	this->m_inputColor2Operation->readSampled(inputOverColor, x, y, sampler);
 	
 	if (inputOverColor[3] <= 0.0f) {
 		copy_v4_v4(output, inputColor1);
diff --git a/source/blender/compositor/operations/COM_AlphaOverKeyOperation.h b/source/blender/compositor/operations/COM_AlphaOverKeyOperation.h
index 31b0422..eceee43 100644
--- a/source/blender/compositor/operations/COM_AlphaOverKeyOperation.h
+++ b/source/blender/compositor/operations/COM_AlphaOverKeyOperation.h
@@ -39,6 +39,6 @@ public:
 	/**
 	 * the inner loop of this program
 	 */
-	void executePixel(float output[4], float x, float y, PixelSampler sampler);
+	void executePixelSampled(float output[4], float x, float y, PixelSampler sampler);
 };
 #endif
diff --git a/source/blender/compositor/operations/COM_AlphaOverMixedOperation.cpp b/source/blender/compositor/operations/COM_AlphaOverMixedOperation.cpp
index 111dc89..1dba542 100644
--- a/source/blender/compositor/operations/COM_AlphaOverMixedOperation.cpp
+++ b/source/blender/compositor/operations/COM_AlphaOverMixedOperation.cpp
@@ -27,15 +27,15 @@ AlphaOverMixedOperation::AlphaOverMixedOperation() : MixBaseOperation()
 	this->m_x = 0.0f;
 }
 
-void AlphaOverMixedOperation::executePixel(float output[4], float x, float y, PixelSampler sampler)
+void AlphaOverMixedOperation::executePixelSampled(float output[4], float x, float y, PixelSampler sampler)
 {
 	float inputColor1[4];
 	float inputOverColor[4];
 	float value[4];
 	
-	this->m_inputValueOperation->read(value, x, y, sampler);
-	this->m_inputColor1Operation->read(inputColor1, x, y, sampler);
-	this->m_inputColor2Operation->read(inputOverColor, x, y, sampler);
+	this->m_inputValueOperation->readSampled(value, x, y, sampler);
+	this->m_inputColor1Operation->readSampled(inputColor1, x, y, sampler);
+	this->m_inputColor2Operation->readSampled(inputOverColor, x, y, sampler);
 	
 	if (inputOverColor[3] <= 0.0f) {
 		copy_v4_v4(output, inputColor1);
diff --git a/source/blender/compositor/operations/COM_AlphaOverMixedOperation.h b/source/blender/compositor/operations/COM_AlphaOverMixedOperation.h
index 14e7325..ff6d1a9 100644
--- a/source/blender/compositor/operations/COM_AlphaOverMixedOperation.h
+++ b/source/blender/compositor/operations/COM_AlphaOverMixedOperation.h
@@ -41,7 +41,7 @@ public:
 	/**
 	 * the inner loop of this program
 	 */
-	void executePixel(float output[4], float x, float y, PixelSampler sampler);
+	void executePixelSampled(float output[4], float x, float y, PixelSampler sampler);
 	
 	void setX(float x) { this->m_x = x; }
 };
diff --git a/source/blender/compositor/operations/COM_AlphaOverPremultiplyOperation.cpp b/source/blender/compositor/operations/COM_AlphaOverPremultiplyOperation.cpp
index ac7906f..60a2fd6 100644
--- a/source/blender/compositor/operations/COM_AlphaOverPremultiplyOperation.cpp
+++ b/source/blender/compositor/operations/COM_AlphaOverPremultiplyOperation.cpp
@@ -27,15 +27,15 @@ AlphaOverPremultiplyOperation::AlphaOverPremultiplyOperation() : MixBaseOperatio
 	/* pass */
 }
 
-void AlphaOverPremultiplyOperation::executePixel(float output[4], float x, float y, PixelSampler sampler)
+void AlphaOverPremultiplyOperation::executePixelSampled(float output[4], float x, float y, PixelSampler sampler)
 {
 	float inputColor1[4];
 	float inputOverColor[4];
 	float value[4];
 	
-	this->m_inputValueOperation->read(value, x, y, sampler);
-	this->m_inputColor1Operation->read(inputColor1, x, y, sampler);
-	this->m_inputColor2Operation->read(inputOverColor, x, y, sampler);
+	this->m_inputValueOperation->readSampled(value, x, y, sampler);
+	this->m_inputColor1Operation->readSampled(inputColor1, x, y, sampler);
+	this->m_inputColor2Operation->readSampled(inputOverColor, x, y, sampler);
 	
 	/* Zero alpha values should still permit an add of RGB data */
 	if (inputOverColor[3] < 0.0f) {
diff --git a/source/blender/compositor/operations/COM_AlphaOverPremultiplyOperation.h b/source/blender/compositor/operations/COM_AlphaOverPremultiplyOperation.h
index 16bd2ae..db68583 100644
--- a/source/blender/compositor/operations/COM_AlphaOverPremultiplyOperation.h
+++ b/source/blender/compositor/operations/COM_AlphaOverPremultiplyOperation.h
@@ -39,7 +39,7 @@ public:
 	/**
 	 * the inner loop of this program
 	 */
-	void executePixel(float output[4], float x, float y, PixelSampler sampler);
+	void executePixelSampled(float output[4], float x, float y, PixelSampler sampler);
 
 };
 #endif
diff --git a/source/blender/compositor/operations/COM_BlurBaseOperation.cpp b/source/blender/compositor/operations/COM_BlurBaseOperation.cpp
index cc91210..dfff2bf 100644
--- a/source/blender/compositor/operations/COM_BlurBaseOperation.cpp
+++ b/source/blender/compositor/operations/COM_BlurBaseOperation.cpp
@@ -152,7 +152,7 @@ void BlurBaseOperation::updateSize()
 {
 	if (!this->m_sizeavailable) {
 		float result[4];
-		this->getInputSocketReader(1)->read(result, 0, 0, COM_PS_NEAREST);
+		this->getInputSocketReader(1)->readSampled(result, 0, 0, COM_PS_NEAREST);
 		this->m_size = result[0];
 		this->m_sizeavailable = true;
 	}
diff --git a/source/blender/compositor/operations/COM_BokehBlurOperation.cpp b/source/blender/compositor/operations/COM_BokehBlurOperation.cpp
index 1c91af2..7f17db1 100644
--- a/source/blender/compositor/operations/COM_BokehBlurOperation.cpp
+++ b/source/blender/compositor/operations/COM_BokehBlurOperation.cpp
@@ -80,7 +80,7 @@ void BokehBlurOperation::executePixel(float output[4], int x, int y, void *data)
 	float tempBoundingBox[4];
 	float bokeh[4];
 
-	this->m_inputBoundingBoxReader->read(tempBoundingBox, x, y, COM_PS_NEAREST);
+	this->m_inputBoundingBoxReader->readSampled(tempBoundingBox, x, y, COM_PS_NEAREST);
 	if (tempBoundingBox[0] > 0.0f) {
 		float multiplier_accum[4] = {0.0f, 0.0f, 0.0f, 0.0f};
 		MemoryBuffer *inputBuffer = (MemoryBuffer *)data;
@@ -93,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->read(color_accum, x, y, COM_PS_NEAREST);
+			this->m_inputProgram->readSampled(color_accum, x, y, COM_PS_NEAREST);
 			multiplier_accum[0] = 1.0f;
 			multiplier_accum[1] = 1.0f;
 			multiplier_accum[2] = 1.0f;
@@ -118,7 +118,7 @@ void BokehBlurOperation::executePixel(float output[4], int x, int y, void *data)
 			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->read(bokeh, u, v, COM_PS_NEAREST);
+				this->m_inputBokehProgram->readSampled(bokeh, u, v, COM_PS_NEAREST);
 				madd_v4_v4v4(color_accum, bokeh, &buffer[bufferindex]);
 				add_v4_v4(multiplier_accum, bokeh);
 				bufferindex += offsetadd;
@@ -130,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->read(output, x, y, COM_PS_NEAREST);
+		this->m_inputProgram->readSampled(output, x, y, COM_PS_NEAREST);
 	}
 }
 
@@ -220,7 +220,7 @@ void BokehBlurOperation::updateSize()
 {
 

@@ Diff output truncated at 10240 characters. @@




More information about the Bf-blender-cvs mailing list