diff options
author | Campbell Barton <ideasman42@gmail.com> | 2012-08-10 17:23:31 +0400 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2012-08-10 17:23:31 +0400 |
commit | e8772477894a6fd8c09488b488fdcc1af432da1b (patch) | |
tree | 9e26bbf5bb90d8fbf1c1b28d92cca2cc2bbb2802 /source/blender | |
parent | fea0e60227825ea917e59348f1be10bd9caeabb4 (diff) |
use define for bokeh blur size, also define size of determineResolution args.
Diffstat (limited to 'source/blender')
53 files changed, 72 insertions, 77 deletions
diff --git a/source/blender/compositor/COM_defines.h b/source/blender/compositor/COM_defines.h index e11048b23f3..3cc161a5877 100644 --- a/source/blender/compositor/COM_defines.h +++ b/source/blender/compositor/COM_defines.h @@ -107,4 +107,6 @@ typedef enum OrderOfChunks { #define COM_NUMBER_OF_CHANNELS 4 +#define COM_BLUR_BOKEH_PIXELS 512 + #endif diff --git a/source/blender/compositor/intern/COM_ExecutionGroup.cpp b/source/blender/compositor/intern/COM_ExecutionGroup.cpp index 46a0db7af2d..30875afcb3f 100644 --- a/source/blender/compositor/intern/COM_ExecutionGroup.cpp +++ b/source/blender/compositor/intern/COM_ExecutionGroup.cpp @@ -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(); diff --git a/source/blender/compositor/intern/COM_ExecutionGroup.h b/source/blender/compositor/intern/COM_ExecutionGroup.h index a87b40af89d..c7a7d06134e 100644 --- a/source/blender/compositor/intern/COM_ExecutionGroup.h +++ b/source/blender/compositor/intern/COM_ExecutionGroup.h @@ -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 diff --git a/source/blender/compositor/intern/COM_InputSocket.cpp b/source/blender/compositor/intern/COM_InputSocket.cpp index 94cb5ff5396..a9c280e0367 100644 --- a/source/blender/compositor/intern/COM_InputSocket.cpp +++ b/source/blender/compositor/intern/COM_InputSocket.cpp @@ -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); diff --git a/source/blender/compositor/intern/COM_InputSocket.h b/source/blender/compositor/intern/COM_InputSocket.h index 5d0923ff204..259479015aa 100644 --- a/source/blender/compositor/intern/COM_InputSocket.h +++ b/source/blender/compositor/intern/COM_InputSocket.h @@ -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) diff --git a/source/blender/compositor/intern/COM_MemoryBuffer.h b/source/blender/compositor/intern/COM_MemoryBuffer.h index 142f05af250..5d0d9c97450 100644 --- a/source/blender/compositor/intern/COM_MemoryBuffer.h +++ b/source/blender/compositor/intern/COM_MemoryBuffer.h @@ -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 diff --git a/source/blender/compositor/intern/COM_NodeOperation.cpp b/source/blender/compositor/intern/COM_NodeOperation.cpp index 9baab584d9e..bae884d713e 100644 --- a/source/blender/compositor/intern/COM_NodeOperation.cpp +++ b/source/blender/compositor/intern/COM_NodeOperation.cpp @@ -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]; diff --git a/source/blender/compositor/intern/COM_NodeOperation.h b/source/blender/compositor/intern/COM_NodeOperation.h index a9cf281b02f..93a19529d34 100644 --- a/source/blender/compositor/intern/COM_NodeOperation.h +++ b/source/blender/compositor/intern/COM_NodeOperation.h @@ -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]; diff --git a/source/blender/compositor/intern/COM_OutputSocket.cpp b/source/blender/compositor/intern/COM_OutputSocket.cpp index 865ab0472e8..f23a48979da 100644 --- a/source/blender/compositor/intern/COM_OutputSocket.cpp +++ b/source/blender/compositor/intern/COM_OutputSocket.cpp @@ -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()) { diff --git a/source/blender/compositor/intern/COM_OutputSocket.h b/source/blender/compositor/intern/COM_OutputSocket.h index 4810e1ae065..dc5ca27cbda 100644 --- a/source/blender/compositor/intern/COM_OutputSocket.h +++ b/source/blender/compositor/intern/COM_OutputSocket.h @@ -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. diff --git a/source/blender/compositor/intern/COM_Socket.h b/source/blender/compositor/intern/COM_Socket.h index 5607d2f4569..2aebe262594 100644 --- a/source/blender/compositor/intern/COM_Socket.h +++ b/source/blender/compositor/intern/COM_Socket.h @@ -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; } diff --git a/source/blender/compositor/operations/COM_BokehImageOperation.cpp b/source/blender/compositor/operations/COM_BokehImageOperation.cpp index d7de201e9df..979d08390c1 100644 --- a/source/blender/compositor/operations/COM_BokehImageOperation.cpp +++ b/source/blender/compositor/operations/COM_BokehImageOperation.cpp @@ -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; } diff --git a/source/blender/compositor/operations/COM_BokehImageOperation.h b/source/blender/compositor/operations/COM_BokehImageOperation.h index a797d0fca53..5be4e033ea0 100644 --- a/source/blender/compositor/operations/COM_BokehImageOperation.h +++ b/source/blender/compositor/operations/COM_BokehImageOperation.h @@ -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; } diff --git a/source/blender/compositor/operations/COM_CompositorOperation.cpp b/source/blender/compositor/operations/COM_CompositorOperation.cpp index cba8c753d6a..141d071dddc 100644 --- a/source/blender/compositor/operations/COM_CompositorOperation.cpp +++ b/source/blender/compositor/operations/COM_CompositorOperation.cpp @@ -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; diff --git a/source/blender/compositor/operations/COM_CompositorOperation.h b/source/blender/compositor/operations/COM_CompositorOperation.h index 882e50b4922..ae94e974db0 100644 --- a/source/blender/compositor/operations/COM_CompositorOperation.h +++ b/source/blender/compositor/operations/COM_CompositorOperation.h @@ -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 diff --git a/source/blender/compositor/operations/COM_CropOperation.cpp b/source/blender/compositor/operations/COM_CropOperation.cpp index efbc331e7d3..aa10b0f522d 100644 --- a/source/blender/compositor/operations/COM_CropOperation.cpp +++ b/source/blender/compositor/operations/COM_CropOperation.cpp @@ -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(); diff --git a/source/blender/compositor/operations/COM_CropOperation.h b/source/blender/compositor/operations/COM_CropOperation.h index 78644536143..6817635243d 100644 --- a/source/blender/compositor/operations/COM_CropOperation.h +++ b/source/blender/compositor/operations/COM_CropOperation.h @@ -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); }; diff --git a/source/blender/compositor/operations/COM_GlareThresholdOperation.cpp b/source/blender/compositor/operations/COM_GlareThresholdOperation.cpp index 7f32618d2af..bb4e224c720 100644 --- a/source/blender/compositor/operations/COM_GlareThresholdOperation.cpp +++ b/source/blender/compositor/operations/COM_GlareThresholdOperation.cpp @@ -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); diff --git a/source/blender/compositor/operations/COM_GlareThresholdOperation.h b/source/blender/compositor/operations/COM_GlareThresholdOperation.h index faba6c6c47c..8db2fc5c72e 100644 --- a/source/blender/compositor/operations/COM_GlareThresholdOperation.h +++ b/source/blender/compositor/operations/COM_GlareThresholdOperation.h @@ -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 diff --git a/source/blender/compositor/operations/COM_ImageOperation.cpp b/source/blender/compositor/operations/COM_ImageOperation.cpp index 36cc6ca8d6d..c15bb1dc5e6 100644 --- a/source/blender/compositor/operations/COM_ImageOperation.cpp +++ b/source/blender/compositor/operations/COM_ImageOperation.cpp @@ -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(); diff --git a/source/blender/compositor/operations/COM_ImageOperation.h b/source/blender/compositor/operations/COM_ImageOperation.h index ed7b10cd4f5..1398b30cbcf 100644 --- a/source/blender/compositor/operations/COM_ImageOperation.h +++ b/source/blender/compositor/operations/COM_ImageOperation.h @@ -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(); diff --git a/source/blender/compositor/operations/COM_KeyingScreenOperation.cpp b/source/blender/compositor/operations/COM_KeyingScreenOperation.cpp index 050aa3391d5..bf49e7a0e89 100644 --- a/source/blender/compositor/operations/COM_KeyingScreenOperation.cpp +++ b/source/blender/compositor/operations/COM_KeyingScreenOperation.cpp @@ -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; diff --git a/source/blender/compositor/operations/COM_KeyingScreenOperation.h b/source/blender/compositor/operations/COM_KeyingScreenOperation.h index 04e47e6e77f..a766c369532 100644 --- a/source/blender/compositor/operations/COM_KeyingScreenOperation.h +++ b/source/blender/compositor/operations/COM_KeyingScreenOperation.h @@ -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(); diff --git a/source/blender/compositor/operations/COM_MaskOperation.cpp b/source/blender/compositor/operations/COM_MaskOperation.cpp index 1812b7372bb..46d31eeabf7 100644 --- a/source/blender/compositor/operations/COM_MaskOperation.cpp +++ b/source/blender/compositor/operations/COM_MaskOperation.cpp @@ -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); diff --git a/source/blender/compositor/operations/COM_MaskOperation.h b/source/blender/compositor/operations/COM_MaskOperation.h index 6e1735bcf9d..f57ed27f8e3 100644 --- a/source/blender/compositor/operations/COM_MaskOperation.h +++ b/source/blender/compositor/operations/COM_MaskOperation.h @@ -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(); diff --git a/source/blender/compositor/operations/COM_MathBaseOperation.cpp b/source/blender/compositor/operations/COM_MathBaseOperation.cpp index 4644dce572d..89d7bd48d9e 100644 --- a/source/blender/compositor/operations/COM_MathBaseOperation.cpp +++ b/source/blender/compositor/operations/COM_MathBaseOperation.cpp @@ -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); diff --git a/source/blender/compositor/operations/COM_MathBaseOperation.h b/source/blender/compositor/operations/COM_MathBaseOperation.h index 8fc6c762b16..5d28831e18b 100644 --- a/source/blender/compositor/operations/COM_MathBaseOperation.h +++ b/source/blender/compositor/operations/COM_MathBaseOperation.h @@ -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; } }; diff --git a/source/blender/compositor/operations/COM_MixBaseOperation.cpp b/source/blender/compositor/operations/COM_MixBaseOperation.cpp index 9f9c432895e..8a43e4275b1 100644 --- a/source/blender/compositor/operations/COM_MixBaseOperation.cpp +++ b/source/blender/compositor/operations/COM_MixBaseOperation.cpp @@ -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); diff --git a/source/blender/compositor/operations/COM_MixBaseOperation.h b/source/blender/compositor/operations/COM_MixBaseOperation.h index 0a8ed4fa0e1..c3e171c5c22 100644 --- a/source/blender/compositor/operations/COM_MixBaseOperation.h +++ b/source/blender/compositor/operations/COM_MixBaseOperation.h @@ -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; } diff --git a/source/blender/compositor/operations/COM_MovieClipAttributeOperation.cpp b/source/blender/compositor/operations/COM_MovieClipAttributeOperation.cpp index 14d7fa7e649..a4d9a28e895 100644 --- a/source/blender/compositor/operations/COM_MovieClipAttributeOperation.cpp +++ b/source/blender/compositor/operations/COM_MovieClipAttributeOperation.cpp @@ -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]; diff --git a/source/blender/compositor/operations/COM_MovieClipAttributeOperation.h b/source/blender/compositor/operations/COM_MovieClipAttributeOperation.h index 28028ab6fd4..d9b1888ebe9 100644 --- a/source/blender/compositor/operations/COM_MovieClipAttributeOperation.h +++ b/source/blender/compositor/operations/COM_MovieClipAttributeOperation.h @@ -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; } diff --git a/source/blender/compositor/operations/COM_MovieClipOperation.cpp b/source/blender/compositor/operations/COM_MovieClipOperation.cpp index ea267830b86..2c319d9bfd5 100644 --- a/source/blender/compositor/operations/COM_MovieClipOperation.cpp +++ b/source/blender/compositor/operations/COM_MovieClipOperation.cpp @@ -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; diff --git a/source/blender/compositor/operations/COM_MovieClipOperation.h b/source/blender/compositor/operations/COM_MovieClipOperation.h index 6ca10e2fa9d..1b297408bb8 100644 --- a/source/blender/compositor/operations/COM_MovieClipOperation.h +++ b/source/blender/compositor/operations/COM_MovieClipOperation.h @@ -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(); diff --git a/source/blender/compositor/operations/COM_PreviewOperation.cpp b/source/blender/compositor/operations/COM_PreviewOperation.cpp index a400402417b..aff374cdded 100644 --- a/source/blender/compositor/operations/COM_PreviewOperation.cpp +++ b/source/blender/compositor/operations/COM_PreviewOperation.cpp @@ -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]; diff --git a/source/blender/compositor/operations/COM_PreviewOperation.h b/source/blender/compositor/operations/COM_PreviewOperation.h index 7183ea64fff..ffd80ff27af 100644 --- a/source/blender/compositor/operations/COM_PreviewOperation.h +++ b/source/blender/compositor/operations/COM_PreviewOperation.h @@ -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; } diff --git a/source/blender/compositor/operations/COM_ReadBufferOperation.cpp b/source/blender/compositor/operations/COM_ReadBufferOperation.cpp index 2473ad8303e..677d5abafef 100644 --- a/source/blender/compositor/operations/COM_ReadBufferOperation.cpp +++ b/source/blender/compositor/operations/COM_ReadBufferOperation.cpp @@ -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(); diff --git a/source/blender/compositor/operations/COM_ReadBufferOperation.h b/source/blender/compositor/operations/COM_ReadBufferOperation.h index f52b732b076..f5a76070609 100644 --- a/source/blender/compositor/operations/COM_ReadBufferOperation.h +++ b/source/blender/compositor/operations/COM_ReadBufferOperation.h @@ -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); diff --git a/source/blender/compositor/operations/COM_RenderLayersBaseProg.cpp b/source/blender/compositor/operations/COM_RenderLayersBaseProg.cpp index a036e8e7231..6b2e1f919d1 100644 --- a/source/blender/compositor/operations/COM_RenderLayersBaseProg.cpp +++ b/source/blender/compositor/operations/COM_RenderLayersBaseProg.cpp @@ -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; diff --git a/source/blender/compositor/operations/COM_RenderLayersBaseProg.h b/source/blender/compositor/operations/COM_RenderLayersBaseProg.h index ead1eb183b3..bef8a8d4407 100644 --- a/source/blender/compositor/operations/COM_RenderLayersBaseProg.h +++ b/source/blender/compositor/operations/COM_RenderLayersBaseProg.h @@ -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. diff --git a/source/blender/compositor/operations/COM_ScaleOperation.cpp b/source/blender/compositor/operations/COM_ScaleOperation.cpp index 23c13518b1d..9fab427b36e 100644 --- a/source/blender/compositor/operations/COM_ScaleOperation.cpp +++ b/source/blender/compositor/operations/COM_ScaleOperation.cpp @@ -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; diff --git a/source/blender/compositor/operations/COM_ScaleOperation.h b/source/blender/compositor/operations/COM_ScaleOperation.h index 075fb6e7064..ab63966c3fc 100644 --- a/source/blender/compositor/operations/COM_ScaleOperation.h +++ b/source/blender/compositor/operations/COM_ScaleOperation.h @@ -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(); diff --git a/source/blender/compositor/operations/COM_SetColorOperation.cpp b/source/blender/compositor/operations/COM_SetColorOperation.cpp index 0665073840c..4b6b7cf50c5 100644 --- a/source/blender/compositor/operations/COM_SetColorOperation.cpp +++ b/source/blender/compositor/operations/COM_SetColorOperation.cpp @@ -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]; diff --git a/source/blender/compositor/operations/COM_SetColorOperation.h b/source/blender/compositor/operations/COM_SetColorOperation.h index 72708800f1e..b82cdffe475 100644 --- a/source/blender/compositor/operations/COM_SetColorOperation.h +++ b/source/blender/compositor/operations/COM_SetColorOperation.h @@ -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; } }; diff --git a/source/blender/compositor/operations/COM_SetValueOperation.cpp b/source/blender/compositor/operations/COM_SetValueOperation.cpp index d88257226f5..4a6bb3b4e53 100644 --- a/source/blender/compositor/operations/COM_SetValueOperation.cpp +++ b/source/blender/compositor/operations/COM_SetValueOperation.cpp @@ -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]; diff --git a/source/blender/compositor/operations/COM_SetValueOperation.h b/source/blender/compositor/operations/COM_SetValueOperation.h index a2c3e8eaa0b..55d190c40f0 100644 --- a/source/blender/compositor/operations/COM_SetValueOperation.h +++ b/source/blender/compositor/operations/COM_SetValueOperation.h @@ -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; } }; diff --git a/source/blender/compositor/operations/COM_SetVectorOperation.cpp b/source/blender/compositor/operations/COM_SetVectorOperation.cpp index 651add0453f..c368c19bf4c 100644 --- a/source/blender/compositor/operations/COM_SetVectorOperation.cpp +++ b/source/blender/compositor/operations/COM_SetVectorOperation.cpp @@ -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]; diff --git a/source/blender/compositor/operations/COM_SetVectorOperation.h b/source/blender/compositor/operations/COM_SetVectorOperation.h index 0868213a109..36174e4e408 100644 --- a/source/blender/compositor/operations/COM_SetVectorOperation.h +++ b/source/blender/compositor/operations/COM_SetVectorOperation.h @@ -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]) { diff --git a/source/blender/compositor/operations/COM_TextureOperation.cpp b/source/blender/compositor/operations/COM_TextureOperation.cpp index 5a32bcb76ac..caf0bba741f 100644 --- a/source/blender/compositor/operations/COM_TextureOperation.cpp +++ b/source/blender/compositor/operations/COM_TextureOperation.cpp @@ -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; diff --git a/source/blender/compositor/operations/COM_TextureOperation.h b/source/blender/compositor/operations/COM_TextureOperation.h index 3631f8d24ff..ef46b5307be 100644 --- a/source/blender/compositor/operations/COM_TextureOperation.h +++ b/source/blender/compositor/operations/COM_TextureOperation.h @@ -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 diff --git a/source/blender/compositor/operations/COM_TrackPositionOperation.cpp b/source/blender/compositor/operations/COM_TrackPositionOperation.cpp index 869ec71614a..3092d4622e5 100644 --- a/source/blender/compositor/operations/COM_TrackPositionOperation.cpp +++ b/source/blender/compositor/operations/COM_TrackPositionOperation.cpp @@ -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]; diff --git a/source/blender/compositor/operations/COM_TrackPositionOperation.h b/source/blender/compositor/operations/COM_TrackPositionOperation.h index fe4f703d26c..eec12ff8241 100644 --- a/source/blender/compositor/operations/COM_TrackPositionOperation.h +++ b/source/blender/compositor/operations/COM_TrackPositionOperation.h @@ -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(); diff --git a/source/blender/compositor/operations/COM_VariableSizeBokehBlurOperation.cpp b/source/blender/compositor/operations/COM_VariableSizeBokehBlurOperation.cpp index f7712f675f2..a3245507994 100644 --- a/source/blender/compositor/operations/COM_VariableSizeBokehBlurOperation.cpp +++ b/source/blender/compositor/operations/COM_VariableSizeBokehBlurOperation.cpp @@ -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; diff --git a/source/blender/compositor/operations/COM_VariableSizeBokehBlurOperation.h b/source/blender/compositor/operations/COM_VariableSizeBokehBlurOperation.h index f53d54f8c2c..d2b2668848a 100644 --- a/source/blender/compositor/operations/COM_VariableSizeBokehBlurOperation.h +++ b/source/blender/compositor/operations/COM_VariableSizeBokehBlurOperation.h @@ -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; } }; |