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_GaussianXBlurOperation.cpp
parent7941ebf66e15df1ca4b7b5439a5bbc90254479f4 (diff)
Optimize Gaussian blurs
Diffstat (limited to 'source/blender/compositor/operations/COM_GaussianXBlurOperation.cpp')
-rw-r--r--source/blender/compositor/operations/COM_GaussianXBlurOperation.cpp30
1 files changed, 22 insertions, 8 deletions
diff --git a/source/blender/compositor/operations/COM_GaussianXBlurOperation.cpp b/source/blender/compositor/operations/COM_GaussianXBlurOperation.cpp
index 276efd90740..121bbbd45a0 100644
--- a/source/blender/compositor/operations/COM_GaussianXBlurOperation.cpp
+++ b/source/blender/compositor/operations/COM_GaussianXBlurOperation.cpp
@@ -36,11 +36,25 @@ GaussianXBlurOperation::GaussianXBlurOperation(): BlurBaseOperation()
void *GaussianXBlurOperation::initializeTileData(rcti *rect, MemoryBuffer **memoryBuffers)
{
- updateGauss(memoryBuffers);
+ if (!this->sizeavailable) {
+ updateGauss(memoryBuffers);
+ }
void *buffer = getInputOperation(0)->initializeTileData(NULL, memoryBuffers);
return buffer;
}
+void GaussianXBlurOperation::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 GaussianXBlurOperation::updateGauss(MemoryBuffer **memoryBuffers)
{
if (this->gausstab == NULL) {
@@ -118,18 +132,18 @@ bool GaussianXBlurOperation::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 + rad;
newInput.xmin = input->xmin - rad;
newInput.ymax = input->ymax;
newInput.ymin = input->ymin;
}
+ else {
+ newInput.xmax = this->getWidth();
+ newInput.xmin = 0;
+ newInput.ymax = this->getHeight();
+ newInput.ymin = 0;
+ }
return NodeOperation::determineDependingAreaOfInterest(&newInput, readOperation, output);
}
}