diff options
author | Sergey Sharybin <sergey.vfx@gmail.com> | 2015-12-09 17:31:39 +0300 |
---|---|---|
committer | Sergey Sharybin <sergey.vfx@gmail.com> | 2016-01-14 14:13:55 +0300 |
commit | cc55f97da9cca7a27f2313b7405d3aad277029d7 (patch) | |
tree | 0dd6047408ec255772dac4a9b79a6e50edcc1990 /source/blender/compositor/operations/COM_BokehBlurOperation.cpp | |
parent | 73feae6f5dd81a81e0321db80e55c15c3518b7a0 (diff) |
Compositor: Add option to extend image bounds when blurring
It is handy when doing some roto work and it's required to blur some
mask or overaly before alpha-overing it on top of the footage.
Quite straightforward option with the only limitation that variable
size blur is not supported.
Reviewers: campbellbarton
Subscribers: hype, sebastian_k
Differential Revision: https://developer.blender.org/D1663
Diffstat (limited to 'source/blender/compositor/operations/COM_BokehBlurOperation.cpp')
-rw-r--r-- | source/blender/compositor/operations/COM_BokehBlurOperation.cpp | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/source/blender/compositor/operations/COM_BokehBlurOperation.cpp b/source/blender/compositor/operations/COM_BokehBlurOperation.cpp index 189483708b5..5ed36635f81 100644 --- a/source/blender/compositor/operations/COM_BokehBlurOperation.cpp +++ b/source/blender/compositor/operations/COM_BokehBlurOperation.cpp @@ -43,6 +43,8 @@ BokehBlurOperation::BokehBlurOperation() : NodeOperation() this->m_inputProgram = NULL; this->m_inputBokehProgram = NULL; this->m_inputBoundingBoxReader = NULL; + + this->m_extend_bounds = false; } void *BokehBlurOperation::initializeTileData(rcti * /*rect*/) @@ -226,3 +228,15 @@ void BokehBlurOperation::updateSize() this->m_sizeavailable = true; } } + +void BokehBlurOperation::determineResolution(unsigned int resolution[2], + unsigned int preferredResolution[2]) +{ + NodeOperation::determineResolution(resolution, + preferredResolution); + if (this->m_extend_bounds) { + const float max_dim = max(resolution[0], resolution[1]); + resolution[0] += 2 * this->m_size * max_dim / 100.0f; + resolution[1] += 2 * this->m_size * max_dim / 100.0f; + } +} |