Blender V5.0
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
16namespace blender::compositor {
17
18/* Possible morphological operations to apply. */
19enum 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. */
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. */
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. */
34 Context &context,
35 const Result &input,
36 Result &output,
37 const float2 &radius,
39 const int filter_type = R_FILTER_GAUSS);
40
41} // namespace blender::compositor
@ R_FILTER_GAUSS
#define input
#define output
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)
VecBase< float, 2 > float2