Blender V4.3
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
10
11#include "DNA_scene_types.h"
12
13#include "COM_context.hh"
14#include "COM_result.hh"
15
17
18/* Possible morphological operations to apply. */
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. */
33void morphological_blur(Context &context,
34 Result &input,
35 Result &output,
36 float2 radius,
38 int filter_type = R_FILTER_GAUSS);
39
40} // namespace blender::realtime_compositor
@ R_FILTER_GAUSS
void morphological_blur(Context &context, Result &input, Result &output, float2 radius, MorphologicalBlurOperation operation=MorphologicalBlurOperation::Erode, int filter_type=R_FILTER_GAUSS)
unsigned char uint8_t
Definition stdint.h:78