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:
authorMonique Dewanchand <m.dewanchand@atmind.nl>2012-06-01 15:50:32 +0400
committerMonique Dewanchand <m.dewanchand@atmind.nl>2012-06-01 15:50:32 +0400
commit5fbeda7efd62e251dac2af881de9fe042f30a7a7 (patch)
tree573791adbcfc7725a841fc7e213494b80a8eeae2 /source/blender/compositor/operations/COM_GaussianBokehBlurOperation.cpp
parent7941ebf66e15df1ca4b7b5439a5bbc90254479f4 (diff)
Optimize Gaussian blurs
Diffstat (limited to 'source/blender/compositor/operations/COM_GaussianBokehBlurOperation.cpp')
-rw-r--r--source/blender/compositor/operations/COM_GaussianBokehBlurOperation.cpp31
1 files changed, 21 insertions, 10 deletions
diff --git a/source/blender/compositor/operations/COM_GaussianBokehBlurOperation.cpp b/source/blender/compositor/operations/COM_GaussianBokehBlurOperation.cpp
index af10791590b..b5d175729f3 100644
--- a/source/blender/compositor/operations/COM_GaussianBokehBlurOperation.cpp
+++ b/source/blender/compositor/operations/COM_GaussianBokehBlurOperation.cpp
@@ -34,11 +34,20 @@ GaussianBokehBlurOperation::GaussianBokehBlurOperation(): BlurBaseOperation()
void *GaussianBokehBlurOperation::initializeTileData(rcti *rect, MemoryBuffer **memoryBuffers)
{
- updateGauss(memoryBuffers);
+ if (!sizeavailable) {
+ updateGauss(memoryBuffers);
+ }
void *buffer = getInputOperation(0)->initializeTileData(NULL, memoryBuffers);
return buffer;
}
+void GaussianBokehBlurOperation::initExecution()
+{
+ if (this->sizeavailable) {
+ updateGauss(NULL);
+ }
+}
+
void GaussianBokehBlurOperation::updateGauss(MemoryBuffer **memoryBuffers)
{
if (this->gausstab == NULL) {
@@ -51,8 +60,9 @@ void GaussianBokehBlurOperation::updateGauss(MemoryBuffer **memoryBuffers)
int j, i;
const float width = this->getWidth();
const float height = this->getHeight();
- updateSize(memoryBuffers);
-
+ if (!sizeavailable) {
+ updateSize(memoryBuffers);
+ }
radxf = size*(float)this->data->sizex;
if (radxf>width/2.0f)
radxf = width/2.0f;
@@ -163,19 +173,20 @@ bool GaussianBokehBlurOperation::determineDependingAreaOfInterest(rcti *input, R
return true;
}
else {
- if (this->gausstab) {
+ if (this->sizeavailable && this->gausstab != NULL) {
+ newInput.xmin = 0;
+ newInput.ymin = 0;
+ newInput.xmax = this->getWidth();
+ newInput.ymax = this->getHeight();
+ }
+ else {
int addx = radx;
int addy = rady;
newInput.xmax = input->xmax + addx;
newInput.xmin = input->xmin - addx;
newInput.ymax = input->ymax + addy;
newInput.ymin = input->ymin - addy;
- }
- else {
- newInput.xmin = 0;
- newInput.ymin = 0;
- newInput.xmax = this->getWidth();
- newInput.ymax = this->getHeight();
+
}
return BlurBaseOperation::determineDependingAreaOfInterest(&newInput, readOperation, output);
}