Blender
V5.3
source
blender
compositor
algorithms
COM_algorithm_morphological_blur.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 <cstdint>
8
9
#include "
BLI_math_filter.hh
"
10
#include "
BLI_math_vector_types.hh
"
11
12
#include "
COM_context.hh
"
13
#include "
COM_result.hh
"
14
15
namespace
blender::compositor
{
16
17
/* Possible morphological operations to apply. */
18
enum class
MorphologicalBlurOperation
:
uint8_t
{
19
/* Dilate by taking the maximum from the original input and the blurred input. Which means the
20
* whites bleeds into the blacks while the blacks don't bleed into the whites. */
21
Dilate
,
22
/* Erode by taking the minimum from the original input and the blurred input. Which means the
23
* blacks bleeds into the whites while the whites don't bleed into the blacks. */
24
Erode
,
25
};
26
27
/* Applies a morphological blur on input using the given radius and filter type. This essentially
28
* applies a standard blur operation, but then takes the maximum or minimum from the original input
29
* and blurred input depending on the chosen operation, see the MorphologicalBlurOperation enum for
30
* more information. The output is written to the given output result, which will be allocated
31
* internally and is thus expected not to be previously allocated. */
32
void
morphological_blur(
33
Context
&context,
34
const
Result &input,
35
Result &
output
,
36
const
float2
&radius,
37
const
MorphologicalBlurOperation operation = MorphologicalBlurOperation::Erode,
38
const
math::FilterKernel
filter_type =
math::FilterKernel::Gauss
);
39
40
}
// namespace blender::compositor
BLI_math_filter.hh
BLI_math_vector_types.hh
COM_context.hh
COM_result.hh
output
#define output
blender::gpu::Context
Definition
gpu_context_private.hh:35
blender::compositor
Definition
BKE_node.hh:77
blender::compositor::MorphologicalBlurOperation
MorphologicalBlurOperation
Definition
COM_algorithm_morphological_blur.hh:18
blender::compositor::MorphologicalBlurOperation::Erode
@ Erode
Definition
COM_algorithm_morphological_blur.hh:24
blender::compositor::MorphologicalBlurOperation::Dilate
@ Dilate
Definition
COM_algorithm_morphological_blur.hh:21
blender::math::FilterKernel
FilterKernel
Definition
BLI_math_filter.hh:13
blender::math::FilterKernel::Gauss
@ Gauss
Definition
BLI_math_filter.hh:19
blender::float2
VecBase< float, 2 > float2
Definition
BLI_math_vector_types.hh:798
blender::uint8_t
unsigned char uint8_t
Definition
BKE_text.h:79
Generated on
for Blender by
doxygen
1.18.0