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_GaussianYBlurOperation.cpp
parent7941ebf66e15df1ca4b7b5439a5bbc90254479f4 (diff)
Optimize Gaussian blurs
Diffstat (limited to 'source/blender/compositor/operations/COM_GaussianYBlurOperation.cpp')
-rw-r--r--source/blender/compositor/operations/COM_GaussianYBlurOperation.cpp30
1 files changed, 22 insertions, 8 deletions
diff --git a/source/blender/compositor/operations/COM_GaussianYBlurOperation.cpp b/source/blender/compositor/operations/COM_GaussianYBlurOperation.cpp
index faef152dc31..1760a281785 100644
--- a/source/blender/compositor/operations/COM_GaussianYBlurOperation.cpp
+++ b/source/blender/compositor/operations/COM_GaussianYBlurOperation.cpp
@@ -35,11 +35,25 @@ GaussianYBlurOperation::GaussianYBlurOperation(): BlurBaseOperation()
void *GaussianYBlurOperation::initializeTileData(rcti *rect, MemoryBuffer **memoryBuffers)
{
- updateGauss(memoryBuffers);
+ if (!this->sizeavailable) {
+ updateGauss(memoryBuffers);
+ }
void *buffer = getInputOperation(0)->initializeTileData(NULL, memoryBuffers);
return buffer;
}
+void GaussianYBlurOperation::initExecution()
+{
+ if (this->sizeavailable) {
+ float rad = size*this->data->sizex;
+ if (rad<1)
+ rad = 1;
+
+ this->rad = rad;
+ this->gausstab = BlurBaseOperation::make_gausstab(rad);
+ }
+}
+
void GaussianYBlurOperation::updateGauss(MemoryBuffer **memoryBuffers)
{
if (this->gausstab == NULL) {
@@ -115,18 +129,18 @@ bool GaussianYBlurOperation::determineDependingAreaOfInterest(rcti *input, ReadB
return true;
}
else {
- if (this->gausstab == NULL) {
- newInput.xmax = this->getWidth();
- newInput.xmin = 0;
- newInput.ymax = this->getHeight();
- newInput.ymin = 0;
- }
- else {
+ if (this->sizeavailable && this->gausstab != NULL) {
newInput.xmax = input->xmax;
newInput.xmin = input->xmin;
newInput.ymax = input->ymax + rad;
newInput.ymin = input->ymin - rad;
}
+ else {
+ newInput.xmax = this->getWidth();
+ newInput.xmin = 0;
+ newInput.ymax = this->getHeight();
+ newInput.ymin = 0;
+ }
return NodeOperation::determineDependingAreaOfInterest(&newInput, readOperation, output);
}
}