Blender
V5.3
source
blender
compositor
algorithms
COM_algorithm_symmetric_separable_blur_variable_size.hh
Go to the documentation of this file.
1
/* SPDX-FileCopyrightText: 2023 Blender Authors
2
*
3
* SPDX-License-Identifier: GPL-2.0-or-later */
4
5
#pragma once
6
7
#include "
BLI_math_filter.hh
"
8
9
#include "
COM_context.hh
"
10
#include "
COM_result.hh
"
11
12
namespace
blender::compositor
{
13
14
/* Blur the input using a horizontal and a vertical separable blur passes given the filter type
15
* using SymmetricSeparableBlurWeights, where the number of weights is equal to weights_resolution.
16
* Since the radius can be variable, the number of weights can be less than or more than the number
17
* of pixels actually getting accumulated during blurring, so the weights are interpolated in the
18
* shader as needed, the resolution is typically set to the maximum possible radius if known. The
19
* radius of the blur can be variable and is defined using the given radius float image. The output
20
* is written to the given output result, which will be allocated internally and is thus expected
21
* not to be previously allocated.
22
*
23
* Technically, variable size blur can't be computed separably, however, assuming a sufficiently
24
* smooth radius field, the results can be visually pleasing, so this can be used a more performant
25
* variable size blur if the quality is satisfactory. */
26
void
symmetric_separable_blur_variable_size
(
27
Context
&context,
28
const
Result
&input,
29
const
Result
&radius,
30
Result
&
output
,
31
const
int
weights_resolution = 128,
32
const
math::FilterKernel
filter_type =
math::FilterKernel::Gauss
);
33
34
}
// namespace blender::compositor
BLI_math_filter.hh
COM_context.hh
COM_result.hh
output
#define output
blender::compositor::Context
Definition
COM_context.hh:53
blender::compositor::Result
Definition
COM_result.hh:125
blender::compositor
Definition
BKE_node.hh:77
blender::compositor::symmetric_separable_blur_variable_size
void symmetric_separable_blur_variable_size(Context &context, const Result &input, const Result &radius, Result &output, const int weights_resolution=128, const math::FilterKernel filter_type=math::FilterKernel::Gauss)
Definition
symmetric_separable_blur_variable_size.cc:235
blender::math::FilterKernel
FilterKernel
Definition
BLI_math_filter.hh:13
blender::math::FilterKernel::Gauss
@ Gauss
Definition
BLI_math_filter.hh:19
Generated on
for Blender by
doxygen
1.18.0