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