[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [49769] trunk/blender/source/blender/ compositor: use define for bokeh blur size, also define size of determineResolution args.

Campbell Barton ideasman42 at gmail.com
Fri Aug 10 15:23:32 CEST 2012


Revision: 49769
          http://projects.blender.org/scm/viewvc.php?view=rev&root=bf-blender&revision=49769
Author:   campbellbarton
Date:     2012-08-10 13:23:31 +0000 (Fri, 10 Aug 2012)
Log Message:
-----------
use define for bokeh blur size, also define size of determineResolution args.

Modified Paths:
--------------
    trunk/blender/source/blender/compositor/COM_defines.h
    trunk/blender/source/blender/compositor/intern/COM_ExecutionGroup.cpp
    trunk/blender/source/blender/compositor/intern/COM_ExecutionGroup.h
    trunk/blender/source/blender/compositor/intern/COM_InputSocket.cpp
    trunk/blender/source/blender/compositor/intern/COM_InputSocket.h
    trunk/blender/source/blender/compositor/intern/COM_MemoryBuffer.h
    trunk/blender/source/blender/compositor/intern/COM_NodeOperation.cpp
    trunk/blender/source/blender/compositor/intern/COM_NodeOperation.h
    trunk/blender/source/blender/compositor/intern/COM_OutputSocket.cpp
    trunk/blender/source/blender/compositor/intern/COM_OutputSocket.h
    trunk/blender/source/blender/compositor/intern/COM_Socket.h
    trunk/blender/source/blender/compositor/operations/COM_BokehImageOperation.cpp
    trunk/blender/source/blender/compositor/operations/COM_BokehImageOperation.h
    trunk/blender/source/blender/compositor/operations/COM_CompositorOperation.cpp
    trunk/blender/source/blender/compositor/operations/COM_CompositorOperation.h
    trunk/blender/source/blender/compositor/operations/COM_CropOperation.cpp
    trunk/blender/source/blender/compositor/operations/COM_CropOperation.h
    trunk/blender/source/blender/compositor/operations/COM_GlareThresholdOperation.cpp
    trunk/blender/source/blender/compositor/operations/COM_GlareThresholdOperation.h
    trunk/blender/source/blender/compositor/operations/COM_ImageOperation.cpp
    trunk/blender/source/blender/compositor/operations/COM_ImageOperation.h
    trunk/blender/source/blender/compositor/operations/COM_KeyingScreenOperation.cpp
    trunk/blender/source/blender/compositor/operations/COM_KeyingScreenOperation.h
    trunk/blender/source/blender/compositor/operations/COM_MaskOperation.cpp
    trunk/blender/source/blender/compositor/operations/COM_MaskOperation.h
    trunk/blender/source/blender/compositor/operations/COM_MathBaseOperation.cpp
    trunk/blender/source/blender/compositor/operations/COM_MathBaseOperation.h
    trunk/blender/source/blender/compositor/operations/COM_MixBaseOperation.cpp
    trunk/blender/source/blender/compositor/operations/COM_MixBaseOperation.h
    trunk/blender/source/blender/compositor/operations/COM_MovieClipAttributeOperation.cpp
    trunk/blender/source/blender/compositor/operations/COM_MovieClipAttributeOperation.h
    trunk/blender/source/blender/compositor/operations/COM_MovieClipOperation.cpp
    trunk/blender/source/blender/compositor/operations/COM_MovieClipOperation.h
    trunk/blender/source/blender/compositor/operations/COM_PreviewOperation.cpp
    trunk/blender/source/blender/compositor/operations/COM_PreviewOperation.h
    trunk/blender/source/blender/compositor/operations/COM_ReadBufferOperation.cpp
    trunk/blender/source/blender/compositor/operations/COM_ReadBufferOperation.h
    trunk/blender/source/blender/compositor/operations/COM_RenderLayersBaseProg.cpp
    trunk/blender/source/blender/compositor/operations/COM_RenderLayersBaseProg.h
    trunk/blender/source/blender/compositor/operations/COM_ScaleOperation.cpp
    trunk/blender/source/blender/compositor/operations/COM_ScaleOperation.h
    trunk/blender/source/blender/compositor/operations/COM_SetColorOperation.cpp
    trunk/blender/source/blender/compositor/operations/COM_SetColorOperation.h
    trunk/blender/source/blender/compositor/operations/COM_SetValueOperation.cpp
    trunk/blender/source/blender/compositor/operations/COM_SetValueOperation.h
    trunk/blender/source/blender/compositor/operations/COM_SetVectorOperation.cpp
    trunk/blender/source/blender/compositor/operations/COM_SetVectorOperation.h
    trunk/blender/source/blender/compositor/operations/COM_TextureOperation.cpp
    trunk/blender/source/blender/compositor/operations/COM_TextureOperation.h
    trunk/blender/source/blender/compositor/operations/COM_TrackPositionOperation.cpp
    trunk/blender/source/blender/compositor/operations/COM_TrackPositionOperation.h
    trunk/blender/source/blender/compositor/operations/COM_VariableSizeBokehBlurOperation.cpp
    trunk/blender/source/blender/compositor/operations/COM_VariableSizeBokehBlurOperation.h

Modified: trunk/blender/source/blender/compositor/COM_defines.h
===================================================================
--- trunk/blender/source/blender/compositor/COM_defines.h	2012-08-10 12:56:09 UTC (rev 49768)
+++ trunk/blender/source/blender/compositor/COM_defines.h	2012-08-10 13:23:31 UTC (rev 49769)
@@ -107,4 +107,6 @@
 
 #define COM_NUMBER_OF_CHANNELS 4
 
+#define COM_BLUR_BOKEH_PIXELS 512
+
 #endif

Modified: trunk/blender/source/blender/compositor/intern/COM_ExecutionGroup.cpp
===================================================================
--- trunk/blender/source/blender/compositor/intern/COM_ExecutionGroup.cpp	2012-08-10 12:56:09 UTC (rev 49768)
+++ trunk/blender/source/blender/compositor/intern/COM_ExecutionGroup.cpp	2012-08-10 13:23:31 UTC (rev 49769)
@@ -186,7 +186,7 @@
 	this->m_cachedReadOperations.clear();
 	this->m_bTree = NULL;
 }
-void ExecutionGroup::determineResolution(unsigned int resolution[])
+void ExecutionGroup::determineResolution(unsigned int resolution[2])
 {
 	NodeOperation *operation = this->getOutputNodeOperation();
 	resolution[0] = operation->getWidth();

Modified: trunk/blender/source/blender/compositor/intern/COM_ExecutionGroup.h
===================================================================
--- trunk/blender/source/blender/compositor/intern/COM_ExecutionGroup.h	2012-08-10 12:56:09 UTC (rev 49768)
+++ trunk/blender/source/blender/compositor/intern/COM_ExecutionGroup.h	2012-08-10 13:23:31 UTC (rev 49769)
@@ -270,13 +270,13 @@
 	 * @brief determine the resolution of this ExecutionGroup
 	 * @param resolution
 	 */
-	void determineResolution(unsigned int resolution[]);
+	void determineResolution(unsigned int resolution[2]);
 	
 	/**
 	 * @brief set the resolution of this executiongroup
 	 * @param resolution
 	 */
-	void setResolution(unsigned int resolution[]) { this->m_width = resolution[0]; this->m_height = resolution[1]; }
+	void setResolution(unsigned int resolution[2]) { this->m_width = resolution[0]; this->m_height = resolution[1]; }
 	
 	/**
 	 * @brief get the width of this execution group

Modified: trunk/blender/source/blender/compositor/intern/COM_InputSocket.cpp
===================================================================
--- trunk/blender/source/blender/compositor/intern/COM_InputSocket.cpp	2012-08-10 12:56:09 UTC (rev 49768)
+++ trunk/blender/source/blender/compositor/intern/COM_InputSocket.cpp	2012-08-10 13:23:31 UTC (rev 49769)
@@ -54,7 +54,7 @@
 	return this->m_connection;
 }
 
-void InputSocket::determineResolution(unsigned int resolution[], unsigned int preferredResolution[])
+void InputSocket::determineResolution(unsigned int resolution[2], unsigned int preferredResolution[2])
 {
 	if (this->isConnected()) {
 		this->m_connection->getFromSocket()->determineResolution(resolution, preferredResolution);

Modified: trunk/blender/source/blender/compositor/intern/COM_InputSocket.h
===================================================================
--- trunk/blender/source/blender/compositor/intern/COM_InputSocket.h	2012-08-10 12:56:09 UTC (rev 49768)
+++ trunk/blender/source/blender/compositor/intern/COM_InputSocket.h	2012-08-10 13:23:31 UTC (rev 49769)
@@ -89,7 +89,7 @@
 	 * @param resolution the result of this operation
 	 * @param preferredResolution the preferrable resolution as no resolution could be determined
 	 */
-	void determineResolution(unsigned int resolution[], unsigned int preferredResolution[]);
+	void determineResolution(unsigned int resolution[2], unsigned int preferredResolution[2]);
 	
 	/**
 	 * @brief Notifies the Input of the data type (via a SocketConnection)

Modified: trunk/blender/source/blender/compositor/intern/COM_MemoryBuffer.h
===================================================================
--- trunk/blender/source/blender/compositor/intern/COM_MemoryBuffer.h	2012-08-10 12:56:09 UTC (rev 49768)
+++ trunk/blender/source/blender/compositor/intern/COM_MemoryBuffer.h	2012-08-10 13:23:31 UTC (rev 49769)
@@ -26,16 +26,12 @@
 #define _COM_MemoryBuffer_h_
 
 #include "COM_ExecutionGroup.h"
-#include "BLI_rect.h"
 #include "COM_MemoryProxy.h"
 
-#include "MEM_guardedalloc.h"
-
 extern "C" {
-	//#include "BLI_threads.h"
 	#include "BLI_math.h"
+	#include "BLI_rect.h"
 }
-//#include <vector>
 
 /**
  * @brief state of a memory buffer

Modified: trunk/blender/source/blender/compositor/intern/COM_NodeOperation.cpp
===================================================================
--- trunk/blender/source/blender/compositor/intern/COM_NodeOperation.cpp	2012-08-10 12:56:09 UTC (rev 49768)
+++ trunk/blender/source/blender/compositor/intern/COM_NodeOperation.cpp	2012-08-10 13:23:31 UTC (rev 49769)
@@ -38,7 +38,7 @@
 	this->m_btree = NULL;
 }
 
-void NodeOperation::determineResolution(unsigned int resolution[], unsigned int preferredResolution[])
+void NodeOperation::determineResolution(unsigned int resolution[2], unsigned int preferredResolution[2])
 {
 	unsigned int temp[2];
 	unsigned int temp2[2];

Modified: trunk/blender/source/blender/compositor/intern/COM_NodeOperation.h
===================================================================
--- trunk/blender/source/blender/compositor/intern/COM_NodeOperation.h	2012-08-10 12:56:09 UTC (rev 49768)
+++ trunk/blender/source/blender/compositor/intern/COM_NodeOperation.h	2012-08-10 13:23:31 UTC (rev 49769)
@@ -96,7 +96,7 @@
 	 * @param resolution the result of this operation
 	 * @param preferredResolution the preferrable resolution as no resolution could be determined
 	 */
-	virtual void determineResolution(unsigned int resolution[], unsigned int preferredResolution[]);
+	virtual void determineResolution(unsigned int resolution[2], unsigned int preferredResolution[2]);
 
 	/**
 	 * @brief isOutputOperation determines whether this operation is an output of the ExecutionSystem during rendering or editing.
@@ -174,7 +174,7 @@
 	 * @brief set the resolution
 	 * @param resolution the resolution to set
 	 */
-	void setResolution(unsigned int resolution[]) {
+	void setResolution(unsigned int resolution[2]) {
 		if (!isResolutionSet()) {
 			this->m_width = resolution[0];
 			this->m_height = resolution[1];

Modified: trunk/blender/source/blender/compositor/intern/COM_OutputSocket.cpp
===================================================================
--- trunk/blender/source/blender/compositor/intern/COM_OutputSocket.cpp	2012-08-10 12:56:09 UTC (rev 49768)
+++ trunk/blender/source/blender/compositor/intern/COM_OutputSocket.cpp	2012-08-10 13:23:31 UTC (rev 49769)
@@ -33,7 +33,7 @@
 int OutputSocket::isOutputSocket() const { return true; }
 const int OutputSocket::isConnected() const { return this->m_connections.size() != 0; }
 
-void OutputSocket::determineResolution(unsigned int resolution[], unsigned int preferredResolution[])
+void OutputSocket::determineResolution(unsigned int resolution[2], unsigned int preferredResolution[2])
 {
 	NodeBase *node = this->getNode();
 	if (node->isOperation()) {

Modified: trunk/blender/source/blender/compositor/intern/COM_OutputSocket.h
===================================================================
--- trunk/blender/source/blender/compositor/intern/COM_OutputSocket.h	2012-08-10 12:56:09 UTC (rev 49768)
+++ trunk/blender/source/blender/compositor/intern/COM_OutputSocket.h	2012-08-10 13:23:31 UTC (rev 49769)
@@ -59,7 +59,7 @@
 	 * @param resolution the result of this operation
 	 * @param preferredResolution the preferrable resolution as no resolution could be determined
 	 */
-	void determineResolution(unsigned int resolution[], unsigned int preferredResolution[]);
+	void determineResolution(unsigned int resolution[2], unsigned int preferredResolution[2]);
 	
 	/**
 	 * @brief determine the actual data type and channel info.

Modified: trunk/blender/source/blender/compositor/intern/COM_Socket.h
===================================================================
--- trunk/blender/source/blender/compositor/intern/COM_Socket.h	2012-08-10 12:56:09 UTC (rev 49768)
+++ trunk/blender/source/blender/compositor/intern/COM_Socket.h	2012-08-10 13:23:31 UTC (rev 49769)
@@ -73,7 +73,7 @@
 	const virtual int isConnected() const;
 	int isInputSocket() const;
 	int isOutputSocket() const;
-	virtual void determineResolution(int resolution[], unsigned int preferredResolution[]) {}
+	virtual void determineResolution(unsigned int resolution[2], unsigned int preferredResolution[2]) {}
 
 	void setEditorSocket(bNodeSocket *editorSocket) { this->m_editorSocket = editorSocket; }
 	bNodeSocket *getbNodeSocket() const { return this->m_editorSocket; }

Modified: trunk/blender/source/blender/compositor/operations/COM_BokehImageOperation.cpp
===================================================================
--- trunk/blender/source/blender/compositor/operations/COM_BokehImageOperation.cpp	2012-08-10 12:56:09 UTC (rev 49768)
+++ trunk/blender/source/blender/compositor/operations/COM_BokehImageOperation.cpp	2012-08-10 13:23:31 UTC (rev 49769)
@@ -30,10 +30,8 @@
 }
 void BokehImageOperation::initExecution()
 {
-	this->m_centerX = getWidth() / 2;
-	this->m_centerY = getHeight() / 2;
-	this->m_center[0] = this->m_centerX;
-	this->m_center[1] = this->m_centerY;
+	this->m_center[0] = getWidth() / 2;
+	this->m_center[1] = getHeight() / 2;
 	this->m_inverseRounding = 1.0f - this->m_data->rounding;
 	this->m_circularDistance = getWidth() / 2;
 	this->m_flapRad = (float)(M_PI * 2) / this->m_data->flaps;
@@ -47,14 +45,14 @@
 }
 void BokehImageOperation::detemineStartPointOfFlap(float r[2], int flapNumber, float distance)
 {
-	r[0] = sinf(this->m_flapRad * flapNumber + this->m_flapRadAdd) * distance + this->m_centerX;
-	r[1] = cosf(this->m_flapRad * flapNumber + this->m_flapRadAdd) * distance + this->m_centerY;
+	r[0] = sinf(this->m_flapRad * flapNumber + this->m_flapRadAdd) * distance + this->m_center[0];
+	r[1] = cosf(this->m_flapRad * flapNumber + this->m_flapRadAdd) * distance + this->m_center[1];
 }
 float BokehImageOperation::isInsideBokeh(float distance, float x, float y)
 {
 	float insideBokeh = 0.0f;
-	const float deltaX = x - this->m_centerX;
-	const float deltaY = y - this->m_centerY;
+	const float deltaX = x - this->m_center[0];
+	const float deltaY = y - this->m_center[1];
 	float closestPoint[2];
 	float lineP1[2];
 	float lineP2[2];
@@ -118,8 +116,8 @@
 	}
 }
 
-void BokehImageOperation::determineResolution(unsigned int resolution[], unsigned int preferredResolution[])

@@ Diff output truncated at 10240 characters. @@



More information about the Bf-blender-cvs mailing list