Blender
V5.0
source
blender
compositor
algorithms
COM_algorithm_van_vliet_gaussian_blur.hh
Go to the documentation of this file.
1
/* SPDX-FileCopyrightText: 2024 Blender Authors
2
*
3
* SPDX-License-Identifier: GPL-2.0-or-later */
4
5
#pragma once
6
7
#include "
BLI_math_vector_types.hh
"
8
9
#include "
COM_context.hh
"
10
#include "
COM_result.hh
"
11
12
namespace
blender::compositor
{
13
14
/* Blur the input using a fourth order IIR filter approximating a Gaussian filter of the given
15
* sigma computed using Van Vliet's design method. This is based on the following paper:
16
*
17
* Van Vliet, Lucas J., Ian T. Young, and Piet W. Verbeek. "Recursive Gaussian derivative
18
* filters." Proceedings. Fourteenth International Conference on Pattern Recognition (Cat. No.
19
* 98EX170). Vol. 1. IEEE, 1998.
20
*
21
* However, we internally split the fourth order IIR filter into two second order sections in order
22
* to improve its numerical stability and improve parallelism. See the implementation for more
23
* information.
24
*
25
* This differs from the standard symmetric separable blur algorithm in that it is faster for high
26
* sigma values, the downside is that it consumes more memory and is only an approximation that
27
* might suffer from fringing and artifacts, though those are typically unnoticeable. This filter
28
* is not accurate for sigma values less than 32, in those cases, use the Deriche filter instead.
29
* Further, for sigma values less than 3, use direct convolution instead, since it is faster and
30
* more accurate. Neumann boundary is assumed.
31
*
32
* The output is written to the given output result, which will be allocated internally and is thus
33
* expected not to be previously allocated. */
34
void
van_vliet_gaussian_blur
(
Context
&context,
35
const
Result
&
input
,
36
Result
&
output
,
37
const
float2
&sigma);
38
39
}
// namespace blender::compositor
BLI_math_vector_types.hh
COM_context.hh
COM_result.hh
blender::compositor::Context
Definition
COM_context.hh:44
blender::compositor::Result
Definition
COM_result.hh:100
input
#define input
Definition
gpu_shader_compat_cxx.hh:170
output
#define output
Definition
gpu_shader_compat_cxx.hh:171
blender::compositor
Definition
BKE_node.hh:77
blender::compositor::van_vliet_gaussian_blur
void van_vliet_gaussian_blur(Context &context, const Result &input, Result &output, const float2 &sigma)
Definition
van_vliet_gaussian_blur.cc:379
blender::float2
VecBase< float, 2 > float2
Definition
BLI_math_vector_types.hh:618
Generated on
for Blender by
doxygen
1.16.1