use define for bokeh blur size, also define size of determineResolution args.
authorCampbell Barton <ideasman42@gmail.com>
Fri, 10 Aug 2012 13:23:31 +0000 (13:23 +0000)
committerCampbell Barton <ideasman42@gmail.com>
Fri, 10 Aug 2012 13:23:31 +0000 (13:23 +0000)
53 files changed:
source/blender/compositor/COM_defines.h
source/blender/compositor/intern/COM_ExecutionGroup.cpp
source/blender/compositor/intern/COM_ExecutionGroup.h
source/blender/compositor/intern/COM_InputSocket.cpp
source/blender/compositor/intern/COM_InputSocket.h
source/blender/compositor/intern/COM_MemoryBuffer.h
source/blender/compositor/intern/COM_NodeOperation.cpp
source/blender/compositor/intern/COM_NodeOperation.h
source/blender/compositor/intern/COM_OutputSocket.cpp
source/blender/compositor/intern/COM_OutputSocket.h
source/blender/compositor/intern/COM_Socket.h
source/blender/compositor/operations/COM_BokehImageOperation.cpp
source/blender/compositor/operations/COM_BokehImageOperation.h
source/blender/compositor/operations/COM_CompositorOperation.cpp
source/blender/compositor/operations/COM_CompositorOperation.h
source/blender/compositor/operations/COM_CropOperation.cpp
source/blender/compositor/operations/COM_CropOperation.h
source/blender/compositor/operations/COM_GlareThresholdOperation.cpp
source/blender/compositor/operations/COM_GlareThresholdOperation.h
source/blender/compositor/operations/COM_ImageOperation.cpp
source/blender/compositor/operations/COM_ImageOperation.h
source/blender/compositor/operations/COM_KeyingScreenOperation.cpp
source/blender/compositor/operations/COM_KeyingScreenOperation.h
source/blender/compositor/operations/COM_MaskOperation.cpp
source/blender/compositor/operations/COM_MaskOperation.h
source/blender/compositor/operations/COM_MathBaseOperation.cpp
source/blender/compositor/operations/COM_MathBaseOperation.h
source/blender/compositor/operations/COM_MixBaseOperation.cpp
source/blender/compositor/operations/COM_MixBaseOperation.h
source/blender/compositor/operations/COM_MovieClipAttributeOperation.cpp
source/blender/compositor/operations/COM_MovieClipAttributeOperation.h
source/blender/compositor/operations/COM_MovieClipOperation.cpp
source/blender/compositor/operations/COM_MovieClipOperation.h
source/blender/compositor/operations/COM_PreviewOperation.cpp
source/blender/compositor/operations/COM_PreviewOperation.h
source/blender/compositor/operations/COM_ReadBufferOperation.cpp
source/blender/compositor/operations/COM_ReadBufferOperation.h
source/blender/compositor/operations/COM_RenderLayersBaseProg.cpp
source/blender/compositor/operations/COM_RenderLayersBaseProg.h
source/blender/compositor/operations/COM_ScaleOperation.cpp
source/blender/compositor/operations/COM_ScaleOperation.h
source/blender/compositor/operations/COM_SetColorOperation.cpp
source/blender/compositor/operations/COM_SetColorOperation.h
source/blender/compositor/operations/COM_SetValueOperation.cpp
source/blender/compositor/operations/COM_SetValueOperation.h
source/blender/compositor/operations/COM_SetVectorOperation.cpp
source/blender/compositor/operations/COM_SetVectorOperation.h
source/blender/compositor/operations/COM_TextureOperation.cpp
source/blender/compositor/operations/COM_TextureOperation.h
source/blender/compositor/operations/COM_TrackPositionOperation.cpp
source/blender/compositor/operations/COM_TrackPositionOperation.h
source/blender/compositor/operations/COM_VariableSizeBokehBlurOperation.cpp
source/blender/compositor/operations/COM_VariableSizeBokehBlurOperation.h

index e11048b23f34abe79d03d290fe0c0f2582272b2b..3cc161a5877983aebc445d3fe71c88d014cf0777 100644 (file)
@@ -107,4 +107,6 @@ typedef enum OrderOfChunks {
 
 #define COM_NUMBER_OF_CHANNELS 4
 
+#define COM_BLUR_BOKEH_PIXELS 512
+
 #endif
index 46a0db7af2d7aa938823492942b7a5a3f4a8e173..30875afcb3fd306227ea76b5e3e676f2b5edecbb 100644 (file)
@@ -186,7 +186,7 @@ void ExecutionGroup::deinitExecution()
        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();
index a87b40af89ddd1e84d43a7e6de4b4212f8830a17..c7a7d06134eb95125f836c2cb03b829abd2871ca 100644 (file)
@@ -270,13 +270,13 @@ public:
         * @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
index 94cb5ff539643eb301183649480394af8f2149d0..a9c280e03675713969efcfad5ca6da85271f0792 100644 (file)
@@ -54,7 +54,7 @@ SocketConnection *InputSocket::getConnection()
        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);
index 5d0923ff204d8ed034e7e80ba82d9e782883d1a7..259479015aa65cee4e2513e81898cd2811a8b9ab 100644 (file)
@@ -89,7 +89,7 @@ public:
         * @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)
index 142f05af250da9f626ca88a6752c007580a10624..5d0d9c97450368432fecc512a3edd351bc4f9387 100644 (file)
@@ -26,16 +26,12 @@ class MemoryBuffer;
 #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
index 9baab584d9e4353fddb3eef03d74385311f4d0dc..bae884d713ed0a6eedcb0c0aa531263b27a381b2 100644 (file)
@@ -38,7 +38,7 @@ NodeOperation::NodeOperation() : NodeBase()
        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];
index a9cf281b02f88166bc0d8703f9cd74480870d387..93a19529d3457a6f26528d4fff7fce2ed5623fe3 100644 (file)
@@ -96,7 +96,7 @@ public:
         * @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 @@ public:
         * @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];
index 865ab0472e8e795eb88981add3200f1f7d6d72c3..f23a48979daa3d0b9795e6eaf80d14ed50c32973 100644 (file)
@@ -33,7 +33,7 @@ OutputSocket::OutputSocket(DataType datatype) : Socket(datatype)
 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()) {
index 4810e1ae065b690a99a959c55ccb6b7e7aaf0b5f..dc5ca27cbdaa4de8a25462e349f33f770cda051d 100644 (file)
@@ -59,7 +59,7 @@ public:
         * @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.
index 5607d2f456996cfd080bed29f1a0444c3287fe03..2aebe2625943123169f62058d8396b51031a12cf 100644 (file)
@@ -73,7 +73,7 @@ public:
        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; }
index d7de201e9df5be6f3ca6979f0f08335e8de4c4b7..979d08390c13dc9f19db347bd795b31d59c39648 100644 (file)
@@ -30,10 +30,8 @@ BokehImageOperation::BokehImageOperation() : NodeOperation()
 }
 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::initExecution()
 }
 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::deinitExecution()
        }
 }
 
-void BokehImageOperation::determineResolution(unsigned int resolution[], unsigned int preferredResolution[])
+void BokehImageOperation::determineResolution(unsigned int resolution[2], unsigned int preferredResolution[2])
 {
-       resolution[0] = 512;
-       resolution[1] = 512;
+       resolution[0] = COM_BLUR_BOKEH_PIXELS;
+       resolution[1] = COM_BLUR_BOKEH_PIXELS;
 }
index a797d0fca53a24df6714b8a7afd722b9df7d392c..5be4e033ea0a20056fba169b344c828af416cc06 100644 (file)
@@ -30,8 +30,6 @@ private:
        NodeBokehImage *m_data;
 
        float m_center[2];
-       float m_centerX;
-       float m_centerY;
        float m_inverseRounding;
        float m_circularDistance;
        float m_flapRad;
@@ -59,7 +57,7 @@ public:
         */
        void deinitExecution();
        
-       void determineResolution(unsigned int resolution[], unsigned int preferredResolution[]);
+       void determineResolution(unsigned int resolution[2], unsigned int preferredResolution[2]);
 
        void setData(NodeBokehImage *data) { this->m_data = data; }
        void deleteDataOnFinish() { this->m_deleteData = true; }
index cba8c753d6af8640f4e47e67203d1c66eb4c1c64..141d071dddc817ab6b1d8a92a587d3fcd38c2040 100644 (file)
@@ -158,7 +158,7 @@ void CompositorOperation::executeRegion(rcti *rect, unsigned int tileNumber)
        }
 }
 
-void CompositorOperation::determineResolution(unsigned int resolution[], unsigned int preferredResolution[])
+void CompositorOperation::determineResolution(unsigned int resolution[2], unsigned int preferredResolution[2])
 {
        int width = this->m_rd->xsch * this->m_rd->size / 100;
        int height = this->m_rd->ysch * this->m_rd->size / 100;
index 882e50b49227c375560d1dcdedc15ab527748382..ae94e974db038a0a1f964fe82878c17ada68fe63 100644 (file)
@@ -71,6 +71,6 @@ public:
        void initExecution();
        void deinitExecution();
        const CompositorPriority getRenderPriority() const { return COM_PRIORITY_MEDIUM; }
-       void determineResolution(unsigned int resolution[], unsigned int preferredResolution[]);
+       void determineResolution(unsigned int resolution[2], unsigned int preferredResolution[2]);
 };
 #endif
index efbc331e7d370d5941ab4bf5df62cf088744de7e..aa10b0f522dcb63eee789159c7acc3105f7f1d02 100644 (file)
@@ -100,7 +100,7 @@ bool CropImageOperation::determineDependingAreaOfInterest(rcti *input, ReadBuffe
        return NodeOperation::determineDependingAreaOfInterest(&newInput, readOperation, output);
 }
 
-void CropImageOperation::determineResolution(unsigned int resolution[], unsigned int preferedResolution[])
+void CropImageOperation::determineResolution(unsigned int resolution[2], unsigned int preferedResolution[2])
 {
        NodeOperation::determineResolution(resolution, preferedResolution);
        updateArea();
index 78644536143aaf77fec0a0803992b54643bfcc21..6817635243dec567a223b9ab5e76b90d937008b0 100644 (file)
@@ -56,7 +56,7 @@ private:
 public:
        CropImageOperation();
        bool determineDependingAreaOfInterest(rcti *input, ReadBufferOperation *readOperation, rcti *output);
-       void determineResolution(unsigned int resolution[], unsigned int preferedResolution[]);
+       void determineResolution(unsigned int resolution[2], unsigned int preferedResolution[2]);
        void executePixel(float *color, float x, float y, PixelSampler sampler);
 
 };
index 7f32618d2afe83c36f1fe1c2697f1d62b94ab4cf..bb4e224c720f7cac9858502ea25dc33c4f752293 100644 (file)
@@ -30,7 +30,7 @@ GlareThresholdOperation::GlareThresholdOperation() : NodeOperation()
        this->m_inputProgram = NULL;
 }
 
-void GlareThresholdOperation::determineResolution(unsigned int resolution[], unsigned int preferredResolution[])
+void GlareThresholdOperation::determineResolution(unsigned int resolution[2], unsigned int preferredResolution[2])
 {
        NodeOperation::determineResolution(resolution, preferredResolution);
        resolution[0] = resolution[0] / (1 << this->m_settings->quality);
index faba6c6c47c86d3946d00feca2a415e7315ba1af..8db2fc5c72e1475d89e3b98327f07a98c1648200 100644 (file)
@@ -58,6 +58,6 @@ public:
                this->m_settings = settings;
        }
        
-       void determineResolution(unsigned int resolution[], unsigned int preferredResolution[]);
+       void determineResolution(unsigned int resolution[2], unsigned int preferredResolution[2]);
 };
 #endif
index 36cc6ca8d6d286a5b3ba6733bdf8b8250ff57989..c15bb1dc5e61b26fe5d2a6ad31c1dc7bb8e0d7ab 100644 (file)
@@ -94,7 +94,7 @@ void BaseImageOperation::deinitExecution()
        this->m_imageBuffer = NULL;
 }
 
-void BaseImageOperation::determineResolution(unsigned int resolution[], unsigned int preferredResolution[])
+void BaseImageOperation::determineResolution(unsigned int resolution[2], unsigned int preferredResolution[2])
 {
        ImBuf *stackbuf = getImBuf();
 
index ed7b10cd4f54805ed3b827a243943892e38aeea2..1398b30cbcf5b3763dd7a4889fe9ab0b61acb249 100644 (file)
@@ -53,7 +53,7 @@ protected:
        /**
         * Determine the output resolution. The resolution is retrieved from the Renderer
         */
-       void determineResolution(unsigned int resolution[], unsigned int preferredResolution[]);
+       void determineResolution(unsigned int resolution[2], unsigned int preferredResolution[2]);
        
        virtual ImBuf *getImBuf();
 
index 050aa3391d59a268d2197d3ac704f5cbf731cba4..bf49e7a0e8926263b76e1029959f3c44c3d31a29 100644 (file)
@@ -280,7 +280,7 @@ void KeyingScreenOperation::deinitializeTileData(rcti *rect, void *data)
        MEM_freeN(tile_data);
 }
 
-void KeyingScreenOperation::determineResolution(unsigned int resolution[], unsigned int preferredResolution[])
+void KeyingScreenOperation::determineResolution(unsigned int resolution[2], unsigned int preferredResolution[2])
 {
        resolution[0] = 0;
        resolution[1] = 0;
index 04e47e6e77fd24e1181f8bb99d3ef44b05ae6a6e..a766c369532c03d03bd9d02f8ad4744d8eb5e073 100644 (file)
@@ -62,7 +62,7 @@ protected:
        /**
         * Determine the output resolution. The resolution is retrieved from the Renderer
         */
-       void determineResolution(unsigned int resolution[], unsigned int preferredResolution[]);
+       void determineResolution(unsigned int resolution[2], unsigned int preferredResolution[2]);
 
        TriangulationData *buildVoronoiTriangulation();
 
index 1812b7372bba1dd0b098c75b3e815a3d115ac72b..46d31eeabf72333ab2007e4c076fc267ff3df588 100644 (file)
@@ -109,7 +109,7 @@ void MaskOperation::deinitExecution()
        }
 }
 
-void MaskOperation::determineResolution(unsigned int resolution[], unsigned int preferredResolution[])
+void MaskOperation::determineResolution(unsigned int resolution[2], unsigned int preferredResolution[2])
 {
        if (this->m_maskWidth == 0 || this->m_maskHeight == 0) {
                NodeOperation::determineResolution(resolution, preferredResolution);
index 6e1735bcf9d093c4f025f3a74c38cbb6da8d4a89..f57ed27f8e3a022296fa819dd852f2679dae5a35 100644 (file)
@@ -56,7 +56,7 @@ protected:
        /**
         * Determine the output resolution. The resolution is retrieved from the Renderer
         */
-       void determineResolution(unsigned int resolution[], unsigned int preferredResolution[]);
+       void determineResolution(unsigned int resolution[2], unsigned int preferredResolution[2]);
 
 public:
        MaskOperation();
index 4644dce572db24980cf4b3094e28ead89805eb26..89d7bd48d9e4123f173dc9cab9b69ea575f9646d 100644 (file)
@@ -48,10 +48,10 @@ void MathBaseOperation::deinitExecution()
        this->m_inputValue2Operation = NULL;
 }
 
-void MathBaseOperation::determineResolution(unsigned int resolution[], unsigned int preferredResolution[])
+void MathBaseOperation::determineResolution(unsigned int resolution[2], unsigned int preferredResolution[2])
 {
        InputSocket *socket;
-       unsigned int tempPreferredResolution[] = {0, 0};
+       unsigned int tempPreferredResolution[2] = {0, 0};
        unsigned int tempResolution[2];
 
        socket = this->getInputSocket(0);
index 8fc6c762b16a8b75c21786f7bdeaa33eb53729bf..5d28831e18bd787dd455d88feb1d160eb75b9d22 100644 (file)
@@ -65,7 +65,7 @@ public:
        /**
         * Determine resolution
         */
-       void determineResolution(unsigned int resolution[], unsigned int preferredResolution[]);
+       void determineResolution(unsigned int resolution[2], unsigned int preferredResolution[2]);
 
        void setUseClamp(bool value) { this->m_useClamp = value; }
 };
index 9f9c432895e0a936a073f1a6f940d69e716a1e35..8a43e4275b1866d1a56d0b457e2e6eb3709c9abb 100644 (file)
@@ -70,10 +70,10 @@ void MixBaseOperation::deinitExecution()
        this->m_inputColor2Operation = NULL;
 }
 
-void MixBaseOperation::determineResolution(unsigned int resolution[], unsigned int preferredResolution[])
+void MixBaseOperation::determineResolution(unsigned int resolution[2], unsigned int preferredResolution[2])
 {
        InputSocket *socket;
-       unsigned int tempPreferredResolution[] = {0, 0};
+       unsigned int tempPreferredResolution[2] = {0, 0};
        unsigned int tempResolution[2];
        
        socket = this->getInputSocket(1);
index 0a8ed4fa0e1839e5069f85a5a426dec77c9e6ad6..c3e171c5c224052b6a0221adf8cdfe31e2f71ac2 100644 (file)
@@ -71,7 +71,7 @@ public:
         */
        void deinitExecution();
        
-       void determineResolution(unsigned int resolution[], unsigned int preferredResolution[]);
+       void determineResolution(unsigned int resolution[2], unsigned int preferredResolution[2]);
        
        void setUseValueAlphaMultiply(const bool value) { this->m_valueAlphaMultiply = value; }
        bool useValueAlphaMultiply() { return this->m_valueAlphaMultiply; }
index 14d7fa7e64950f1bd6cbc33db55731d985961910..a4d9a28e895fe6a4dc568e6f1dbb4beac1126876 100644 (file)
@@ -64,7 +64,7 @@ void MovieClipAttributeOperation::executePixel(float *outputValue, float x, floa
        outputValue[0] = this->m_value;
 }
 
-void MovieClipAttributeOperation::determineResolution(unsigned int resolution[], unsigned int preferredResolution[])
+void MovieClipAttributeOperation::determineResolution(unsigned int resolution[2], unsigned int preferredResolution[2])
 {
        resolution[0] = preferredResolution[0];
        resolution[1] = preferredResolution[1];
index 28028ab6fd4985074540f62c3da340abc5865efb..d9b1888ebe9de61b7fb7396102161a7ba7752416 100644 (file)
@@ -52,7 +52,7 @@ public:
         * the inner loop of this program
         */
        void executePixel(float *color, float x, float y, PixelSampler sampler);
-       void determineResolution(unsigned int resolution[], unsigned int preferredResolution[]);
+       void determineResolution(unsigned int resolution[2], unsigned int preferredResolution[2]);
 
        void setMovieClip(MovieClip *clip) { this->m_clip = clip; }
        void setFramenumber(int framenumber) { this->m_framenumber = framenumber; }
index ea267830b8608ae2de08a3580c7627438d920534..2c319d9bfd5965711a8c13f26e07dc6e3352ef0f 100644 (file)
@@ -76,7 +76,7 @@ void MovieClipOperation::deinitExecution()
        }
 }
 
-void MovieClipOperation::determineResolution(unsigned int resolution[], unsigned int preferredResolution[])
+void MovieClipOperation::determineResolution(unsigned int resolution[2], unsigned int preferredResolution[2])
 {
        resolution[0] = 0;
        resolution[1] = 0;
index 6ca10e2fa9d99e0bd824af66c53372232dc49afd..1b297408bb87772d8870633d4d3d398e97bbaffa 100644 (file)
@@ -47,7 +47,7 @@ protected:
        /**
         * Determine the output resolution. The resolution is retrieved from the Renderer
         */
-       void determineResolution(unsigned int resolution[], unsigned int preferredResolution[]);
+       void determineResolution(unsigned int resolution[2], unsigned int preferredResolution[2]);
 
 public:
        MovieClipOperation();
index a400402417b3435d79b882fcaaff9c77ae28eaf6..aff374cdded54c19a998ef7fe3b7fbd7f6a31d9d 100644 (file)
@@ -110,7 +110,7 @@ bool PreviewOperation::determineDependingAreaOfInterest(rcti *input, ReadBufferO
 
        return NodeOperation::determineDependingAreaOfInterest(&newInput, readOperation, output);
 }
-void PreviewOperation::determineResolution(unsigned int resolution[], unsigned int preferredResolution[])
+void PreviewOperation::determineResolution(unsigned int resolution[2], unsigned int preferredResolution[2])
 {
        NodeOperation::determineResolution(resolution, preferredResolution);
        int width = resolution[0];
index 7183ea64ffff9b35e5390a8564c8120e71731039..ffd80ff27af0d8ae651739acbc4b6da00c70dc8b 100644 (file)
@@ -45,7 +45,7 @@ public:
        const CompositorPriority getRenderPriority() const;
        
        void executeRegion(rcti *rect, unsigned int tileNumber);
-       void determineResolution(unsigned int resolution[], unsigned int preferredResolution[]);
+       void determineResolution(unsigned int resolution[2], unsigned int preferredResolution[2]);
        void setbNode(bNode *node) { this->m_node = node; }
        bool determineDependingAreaOfInterest(rcti *input, ReadBufferOperation *readOperation, rcti *output);
        bool isPreviewOperation() { return true; }
index 2473ad8303eb3736d3b61fce05522ab727421c02..677d5abafef1710f5ec93c6fb6c5743f2c185fbc 100644 (file)
@@ -36,7 +36,7 @@ void *ReadBufferOperation::initializeTileData(rcti *rect)
        return m_buffer;
 }
 
-void ReadBufferOperation::determineResolution(unsigned int resolution[], unsigned int preferredResolution[])
+void ReadBufferOperation::determineResolution(unsigned int resolution[2], unsigned int preferredResolution[2])
 {
        if (this->m_memoryProxy != NULL) {
                WriteBufferOperation *operation = this->m_memoryProxy->getWriteBufferOperation();
index f52b732b07638d403a50bfa971c276a88efd4fea..f5a760706096adcfeda8ad9d4c4452a85ecbbf41 100644 (file)
@@ -36,7 +36,7 @@ public:
        int isBufferOperation() { return true; }
        void setMemoryProxy(MemoryProxy *memoryProxy) { this->m_memoryProxy = memoryProxy; }
        MemoryProxy *getMemoryProxy() { return this->m_memoryProxy; }
-       void determineResolution(unsigned int resolution[], unsigned int preferredResolution[]);
+       void determineResolution(unsigned int resolution[2], unsigned int preferredResolution[2]);
        
        void *initializeTileData(rcti *rect);
        void executePixel(float *color, float x, float y, PixelSampler sampler);
index a036e8e7231419e08710f6d8430cceb47ff5b58d..6b2e1f919d1a6bd99eb449f1e1549b296022e318 100644 (file)
@@ -100,7 +100,7 @@ void RenderLayersBaseProg::deinitExecution()
        this->m_inputBuffer = NULL;
 }
 
-void RenderLayersBaseProg::determineResolution(unsigned int resolution[], unsigned int preferredResolution[])
+void RenderLayersBaseProg::determineResolution(unsigned int resolution[2], unsigned int preferredResolution[2])
 {
        Scene *sce = this->getScene();
        Render *re = (sce) ? RE_GetRender(sce->id.name) : NULL;
index ead1eb183b396d477d60f62305ec0bb0339a37f9..bef8a8d4407e3bc28cf5a4bb228e761cee3bc234 100644 (file)
@@ -73,7 +73,7 @@ protected:
        /**
         * Determine the output resolution. The resolution is retrieved from the Renderer
         */
-       void determineResolution(unsigned int resolution[], unsigned int preferredResolution[]);
+       void determineResolution(unsigned int resolution[2], unsigned int preferredResolution[2]);
        
        /**
         * retrieve the reference to the float buffer of the renderer.
index 23c13518b1d90e56cafe4749ee264ff7890e0cdd..9fab427b36e38b60703ce3718ad0526af3027c98 100644 (file)
@@ -276,7 +276,7 @@ bool ScaleFixedSizeOperation::determineDependingAreaOfInterest(rcti *input, Read
        return NodeOperation::determineDependingAreaOfInterest(&newInput, readOperation, output);
 }
 
-void ScaleFixedSizeOperation::determineResolution(unsigned int resolution[], unsigned int preferredResolution[])
+void ScaleFixedSizeOperation::determineResolution(unsigned int resolution[2], unsigned int preferredResolution[2])
 {
        unsigned int nr[2];
        nr[0] = this->m_newWidth;
index 075fb6e7064d88b160d767e7fb5650ef478943e2..ab63966c3fc88d352b46c1ce30911dd78c78e7d1 100644 (file)
@@ -75,7 +75,7 @@ class ScaleFixedSizeOperation : public NodeOperation {
 public:
        ScaleFixedSizeOperation();
        bool determineDependingAreaOfInterest(rcti *input, ReadBufferOperation *readOperation, rcti *output);
-       void determineResolution(unsigned int resolution[], unsigned int preferredResolution[]);
+       void determineResolution(unsigned int resolution[2], unsigned int preferredResolution[2]);
        void executePixel(float *color, float x, float y, PixelSampler sampler);
 
        void initExecution();
index 0665073840c7a1df84f35326b3ff679666965305..4b6b7cf50c58b19d8e8720c6eee3dd2ac401d323 100644 (file)
@@ -35,7 +35,7 @@ void SetColorOperation::executePixel(float *outputValue, float x, float y, Pixel
        outputValue[3] = this->m_channel4;
 }
 
-void SetColorOperation::determineResolution(unsigned int resolution[], unsigned int preferredResolution[])
+void SetColorOperation::determineResolution(unsigned int resolution[2], unsigned int preferredResolution[2])
 {
        resolution[0] = preferredResolution[0];
        resolution[1] = preferredResolution[1];
index 72708800f1e3c0a50dbcb77742761ee625e7844c..b82cdffe4753c79553f43da34f58e6aa37b61261 100644 (file)
@@ -63,7 +63,7 @@ public:
         */
        void executePixel(float *color, float x, float y, PixelSampler sampler);
 
-       void determineResolution(unsigned int resolution[], unsigned int preferredResolution[]);
+       void determineResolution(unsigned int resolution[2], unsigned int preferredResolution[2]);
        const bool isSetOperation() const { return true; }
 
 };
index d88257226f59244395c22f61bf074662424ad8c7..4a6bb3b4e53b4f22d572af05fcbafa780206c961 100644 (file)
@@ -32,7 +32,7 @@ void SetValueOperation::executePixel(float *outputValue, float x, float y, Pixel
        outputValue[0] = this->m_value;
 }
 
-void SetValueOperation::determineResolution(unsigned int resolution[], unsigned int preferredResolution[])
+void SetValueOperation::determineResolution(unsigned int resolution[2], unsigned int preferredResolution[2])
 {
        resolution[0] = preferredResolution[0];
        resolution[1] = preferredResolution[1];
index a2c3e8eaa0be5316ebb1f30d9f08af95c94b7411..55d190c40f050b33db9e4f849fab3fe49483db20 100644 (file)
@@ -47,7 +47,7 @@ public:
         * the inner loop of this program
         */
        void executePixel(float *color, float x, float y, PixelSampler sampler);
-       void determineResolution(unsigned int resolution[], unsigned int preferredResolution[]);
+       void determineResolution(unsigned int resolution[2], unsigned int preferredResolution[2]);
        
        const bool isSetOperation() const { return true; }
 };
index 651add0453f57976dbfaa0188c139935ca5c048e..c368c19bf4c752db956928e5954a2d6241fa5fba 100644 (file)
@@ -36,7 +36,7 @@ void SetVectorOperation::executePixel(float *outputValue, float x, float y, Pixe
        outputValue[3] = this->m_w;
 }
 
-void SetVectorOperation::determineResolution(unsigned int resolution[], unsigned int preferredResolution[])
+void SetVectorOperation::determineResolution(unsigned int resolution[2], unsigned int preferredResolution[2])
 {
        resolution[0] = preferredResolution[0];
        resolution[1] = preferredResolution[1];
index 0868213a109f7255e0f4326a9e666bb8a1245bcc..36174e4e408567d9b57d455b4ab9e74b826753a4 100644 (file)
@@ -56,7 +56,7 @@ public:
         */
        void executePixel(float *color, float x, float y, PixelSampler sampler);
 
-       void determineResolution(unsigned int resolution[], unsigned int preferredResolution[]);
+       void determineResolution(unsigned int resolution[2], unsigned int preferredResolution[2]);
        const bool isSetOperation() const { return true; }
 
        void setVector(float vector[3]) {
index 5a32bcb76ac139ccf9fd32d360170ae9de86b5a2..caf0bba741ff17561c07fec1178642ffdf26d51d 100644 (file)
@@ -53,7 +53,7 @@ void TextureBaseOperation::deinitExecution()
        this->m_inputOffset = NULL;
 }
 
-void TextureBaseOperation::determineResolution(unsigned int resolution[], unsigned int preferredResolution[])
+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;
index 3631f8d24ff73765f2372a3a6568d856d9132dde..ef46b5307be5b3737ab980009585596dfeb7aca0 100644 (file)
@@ -51,7 +51,7 @@ protected:
        /**
         * Determine the output resolution. The resolution is retrieved from the Renderer
         */
-       void determineResolution(unsigned int resolution[], unsigned int preferredResolution[]);
+       void determineResolution(unsigned int resolution[2], unsigned int preferredResolution[2]);
        
        /**
         * Constructor
index 869ec71614af4b018f6b7f36be7e612388d5da12..3092d4622e5bdc821327707ba2488fd2c97fdfb3 100644 (file)
@@ -111,7 +111,7 @@ void TrackPositionOperation::executePixel(float *outputValue, float x, float y,
                outputValue[0] *= this->m_height;
 }
 
-void TrackPositionOperation::determineResolution(unsigned int resolution[], unsigned int preferredResolution[])
+void TrackPositionOperation::determineResolution(unsigned int resolution[2], unsigned int preferredResolution[2])
 {
        resolution[0] = preferredResolution[0];
        resolution[1] = preferredResolution[1];
index fe4f703d26c395b9556cdc2179997878543510ec..eec12ff8241f4414c090002a4099e86c1d60b524 100644 (file)
@@ -60,7 +60,7 @@ protected:
        /**
          * Determine the output resolution. The resolution is retrieved from the Renderer
          */
-       void determineResolution(unsigned int resolution[], unsigned int preferredResolution[]);
+       void determineResolution(unsigned int resolution[2], unsigned int preferredResolution[2]);
 
 public:
        TrackPositionOperation();
index f7712f675f255e0bce07771472febea2c6cffba9..a3245507994662b32f3f31fbc1ea7458c932ca5f 100644 (file)
@@ -139,8 +139,9 @@ void VariableSizeBokehBlurOperation::executePixel(float *color, int x, int y, vo
                                                if (size > this->m_threshold) {
                                                        float dx = nx - x;
                                                        if (size > fabsf(dx) && size > fabsf(dy)) {
-                                                               float uv[2] = {256.0f + (dx / size) * 255.0f,
-                                                                              256.0f + (dy / size) * 255.0f};
+                                                               float uv[2] = {
+                                                                   (float)(COM_BLUR_BOKEH_PIXELS / 2) + (dx / size) * (float)((COM_BLUR_BOKEH_PIXELS / 2) - 1),
+                                                                   (float)(COM_BLUR_BOKEH_PIXELS / 2) + (dy / size) * (float)((COM_BLUR_BOKEH_PIXELS / 2) - 1)};
                                                                inputBokehBuffer->readNoCheck(bokeh, uv[0], uv[1]);
                                                                madd_v4_v4v4(color_accum, bokeh, &inputProgramFloatBuffer[offsetNxNy]);
                                                                add_v4_v4(multiplier_accum, bokeh);
@@ -216,9 +217,9 @@ bool VariableSizeBokehBlurOperation::determineDependingAreaOfInterest(rcti *inpu
        newInput.xmin = input->xmin - this->m_maxBlur + 2;
        newInput.ymax = input->ymax + this->m_maxBlur - 2;
        newInput.ymin = input->ymin - this->m_maxBlur - 2;
-       bokehInput.xmax = 512;
+       bokehInput.xmax = COM_BLUR_BOKEH_PIXELS;
        bokehInput.xmin = 0;
-       bokehInput.ymax = 512;
+       bokehInput.ymax = COM_BLUR_BOKEH_PIXELS;
        bokehInput.ymin = 0;
        
 
@@ -336,7 +337,7 @@ void InverseSearchRadiusOperation::deinitExecution()
        this->m_inputRadius = NULL;
 }
 
-void InverseSearchRadiusOperation::determineResolution(unsigned int resolution[], unsigned int preferredResolution[])
+void InverseSearchRadiusOperation::determineResolution(unsigned int resolution[2], unsigned int preferredResolution[2])
 {
        NodeOperation::determineResolution(resolution, preferredResolution);
        resolution[0] = resolution[0] / DIVIDER;
index f53d54f8c2c42929014af843ce274ed631eed8d4..d2b2668848ae1443227baaddaa6053a21eb0b385 100644 (file)
@@ -82,7 +82,7 @@ public:
        /**
         * the inner loop of this program
         */
-       void executePixel(float *color, int x, int y, MemoryBuffer * inputBuffers[], void *data);
+       void executePixel(float *color, int x, int y, MemoryBuffer *inputBuffers[], void *data);
        
        /**
         * Initialize the execution
@@ -97,7 +97,7 @@ public:
        void deinitExecution();
        
        bool determineDependingAreaOfInterest(rcti *input, ReadBufferOperation *readOperation, rcti *output);
-       void determineResolution(unsigned int resolution[], unsigned int preferredResolution[]);
+       void determineResolution(unsigned int resolution[2], unsigned int preferredResolution[2]);
        
        void setMaxBlur(int maxRadius) { this->m_maxBlur = maxRadius; }
 };