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:
authorCampbell Barton <ideasman42@gmail.com>2012-06-16 17:46:20 +0400
committerCampbell Barton <ideasman42@gmail.com>2012-06-16 17:46:20 +0400
commit265262a5d5e56005d4636dc28f9fce25f4bbed57 (patch)
treefd055de04c8cbcba9fd5bb5a4f200d191547adcb /source/blender/compositor/operations/COM_BlurBaseOperation.cpp
parent2f29f8d18656e9c8796b68671a60812d0cffcb70 (diff)
feather option for dilate/erode node - needed for alpha masks so we can (blur in/out), currently only positive values supported.
Diffstat (limited to 'source/blender/compositor/operations/COM_BlurBaseOperation.cpp')
-rw-r--r--source/blender/compositor/operations/COM_BlurBaseOperation.cpp24
1 files changed, 21 insertions, 3 deletions
diff --git a/source/blender/compositor/operations/COM_BlurBaseOperation.cpp b/source/blender/compositor/operations/COM_BlurBaseOperation.cpp
index bb915fec590..0e7676dfcef 100644
--- a/source/blender/compositor/operations/COM_BlurBaseOperation.cpp
+++ b/source/blender/compositor/operations/COM_BlurBaseOperation.cpp
@@ -27,11 +27,11 @@ extern "C" {
#include "RE_pipeline.h"
}
-BlurBaseOperation::BlurBaseOperation() : NodeOperation()
+BlurBaseOperation::BlurBaseOperation(DataType data_type=COM_DT_COLOR) : NodeOperation()
{
- this->addInputSocket(COM_DT_COLOR);
+ this->addInputSocket(data_type);
this->addInputSocket(COM_DT_VALUE);
- this->addOutputSocket(COM_DT_COLOR);
+ this->addOutputSocket(data_type);
this->setComplex(true);
this->inputProgram = NULL;
this->data = NULL;
@@ -89,6 +89,24 @@ float *BlurBaseOperation::make_gausstab(int rad)
return gausstab;
}
+/* normalized distance from the current (inverted so 1.0 is close and 0.0 is far) */
+float *BlurBaseOperation::make_dist_fac_inverse(int rad)
+{
+ float *dist_fac_invert, val;
+ int i, n;
+
+ n = 2 * rad + 1;
+
+ dist_fac_invert = new float[n];
+
+ for (i = -rad; i <= rad; i++) {
+ val = 1.0f - fabsf(((float)i / (float)rad));
+ dist_fac_invert[i + rad] = val;
+ }
+
+ return dist_fac_invert;
+}
+
void BlurBaseOperation::deinitExecution()
{
this->inputProgram = NULL;