Blender
V4.3
source
blender
compositor
realtime_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::realtime_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
(Context &context,
34
Result &input,
35
Result &output,
36
float2
radius,
37
MorphologicalBlurOperation
operation =
MorphologicalBlurOperation::Erode
,
38
int
filter_type =
R_FILTER_GAUSS
);
39
40
}
// namespace blender::realtime_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:2188
blender::realtime_compositor
Definition
BKE_node.hh:80
blender::realtime_compositor::MorphologicalBlurOperation
MorphologicalBlurOperation
Definition
COM_algorithm_morphological_blur.hh:19
blender::realtime_compositor::MorphologicalBlurOperation::Erode
@ Erode
blender::realtime_compositor::MorphologicalBlurOperation::Dilate
@ Dilate
blender::realtime_compositor::morphological_blur
void morphological_blur(Context &context, Result &input, Result &output, float2 radius, MorphologicalBlurOperation operation=MorphologicalBlurOperation::Erode, int filter_type=R_FILTER_GAUSS)
Definition
morphological_blur.cc:56
uint8_t
unsigned char uint8_t
Definition
stdint.h:78
blender::VecBase< float, 2 >
Generated on Thu Feb 6 2025 07:36:39 for Blender by
doxygen
1.11.0