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

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJeroen Bakker <j.bakker@atmind.nl>2012-06-04 22:07:29 +0400
committerJeroen Bakker <j.bakker@atmind.nl>2012-06-04 22:07:29 +0400
commit5024996eea206252adc098f44c9a3a1d01ae6167 (patch)
tree4a458dc0b79ac35cdf94fe3198d73ff9a5b7f5be /source/blender/compositor/operations/COM_FastGaussianBlurOperation.cpp
parentd46a6dc59c76c4b5f9210aba51f5f6347c7ccd26 (diff)
* modified vieweroperation to not calculate based on the DO_NODE_OUTPUT
flag of the editorbNode.
Diffstat (limited to 'source/blender/compositor/operations/COM_FastGaussianBlurOperation.cpp')
-rw-r--r--source/blender/compositor/operations/COM_FastGaussianBlurOperation.cpp73
1 files changed, 41 insertions, 32 deletions
diff --git a/source/blender/compositor/operations/COM_FastGaussianBlurOperation.cpp b/source/blender/compositor/operations/COM_FastGaussianBlurOperation.cpp
index ad8f3b12387..ad58631f2c1 100644
--- a/source/blender/compositor/operations/COM_FastGaussianBlurOperation.cpp
+++ b/source/blender/compositor/operations/COM_FastGaussianBlurOperation.cpp
@@ -26,13 +26,12 @@
FastGaussianBlurOperation::FastGaussianBlurOperation(): BlurBaseOperation()
{
- this->iirgaus = false;
+ this->iirgaus = NULL;
}
void FastGaussianBlurOperation::executePixel(float *color,int x, int y, MemoryBuffer *inputBuffers[], void *data)
{
MemoryBuffer *newData = (MemoryBuffer*)data;
-
newData->read(color, x, y);
}
@@ -51,10 +50,7 @@ bool FastGaussianBlurOperation::determineDependingAreaOfInterest(rcti *input, Re
}
else {
if (this->iirgaus) {
- newInput.xmax = input->xmax + (sx);
- newInput.xmin = input->xmin - (sx);
- newInput.ymax = input->ymax + (sy);
- newInput.ymin = input->ymin - (sy);
+ return false;
}
else {
newInput.xmin = 0;
@@ -66,38 +62,51 @@ bool FastGaussianBlurOperation::determineDependingAreaOfInterest(rcti *input, Re
}
}
-void *FastGaussianBlurOperation::initializeTileData(rcti *rect, MemoryBuffer **memoryBuffers)
+void FastGaussianBlurOperation::initExecution()
{
- MemoryBuffer *newBuf = (MemoryBuffer*)this->inputProgram->initializeTileData(rect, memoryBuffers);
- MemoryBuffer *copy = newBuf->duplicate();
- updateSize(memoryBuffers);
-
- int c;
- sx = data->sizex * this->size/2.0f;
- sy = data->sizey * this->size/2.0f;
- this->iirgaus = true;
-
- if ((sx == sy) && (sx > 0.f)) {
- for (c=0; c<COM_NUMBER_OF_CHANNELS; ++c)
- IIR_gauss(copy, sx, c, 3);
+ BlurBaseOperation::initExecution();
+ BlurBaseOperation::initMutex();
+}
+
+void FastGaussianBlurOperation::deinitExecution()
+{
+ if (this->iirgaus) {
+ delete this->iirgaus;
+ this->iirgaus = NULL;
}
- else {
- if (sx > 0.f) {
+ BlurBaseOperation::deinitMutex();
+}
+
+void *FastGaussianBlurOperation::initializeTileData(rcti *rect, MemoryBuffer **memoryBuffers)
+{
+ BLI_mutex_lock(this->getMutex());
+ if (!iirgaus) {
+ MemoryBuffer *newBuf = (MemoryBuffer*)this->inputProgram->initializeTileData(rect, memoryBuffers);
+ MemoryBuffer *copy = newBuf->duplicate();
+ updateSize(memoryBuffers);
+
+ int c;
+ sx = data->sizex * this->size/2.0f;
+ sy = data->sizey * this->size/2.0f;
+
+ if ((sx == sy) && (sx > 0.f)) {
for (c=0; c<COM_NUMBER_OF_CHANNELS; ++c)
- IIR_gauss(copy, sx, c, 1);
+ IIR_gauss(copy, sx, c, 3);
}
- if (sy > 0.f) {
- for (c=0; c<COM_NUMBER_OF_CHANNELS; ++c)
- IIR_gauss(copy, sy, c, 2);
+ else {
+ if (sx > 0.f) {
+ for (c=0; c<COM_NUMBER_OF_CHANNELS; ++c)
+ IIR_gauss(copy, sx, c, 1);
+ }
+ if (sy > 0.f) {
+ for (c=0; c<COM_NUMBER_OF_CHANNELS; ++c)
+ IIR_gauss(copy, sy, c, 2);
+ }
}
+ this->iirgaus = copy;
}
- return copy;
-}
-
-void FastGaussianBlurOperation::deinitializeTileData(rcti *rect, MemoryBuffer **memoryBuffers, void *data)
-{
- MemoryBuffer *newData = (MemoryBuffer*)data;
- delete newData;
+ BLI_mutex_unlock(this->getMutex());
+ return iirgaus;
}
void FastGaussianBlurOperation::IIR_gauss(MemoryBuffer *src, float sigma, int chan, int xy)