Blender V5.0
COM_symmetric_blur_weights.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#include <memory>
9
10#include "BLI_map.hh"
12
14#include "COM_result.hh"
15
16namespace blender::compositor {
17
18class Context;
19
20/* ------------------------------------------------------------------------------------------------
21 * Symmetric Blur Weights Key.
22 */
24 public:
25 int type;
27
29
30 uint64_t hash() const;
31};
32
34
35/* -------------------------------------------------------------------------------------------------
36 * Symmetric Blur Weights.
37 *
38 * A cached resource that computes and caches a result containing the weights of the filter of the
39 * given type and radius. The filter is assumed to be symmetric, because the filter functions are
40 * evaluated on the normalized distance to the center. Consequently, only the upper right quadrant
41 * are computed and the user takes that into consideration. */
43 public:
45
46 SymmetricBlurWeights(Context &context, int type, float2 radius);
47
49};
50
51/* ------------------------------------------------------------------------------------------------
52 * Symmetric Blur Weights Container.
53 */
55 private:
57
58 public:
59 void reset() override;
60
61 /* Check if there is an available SymmetricBlurWeights cached resource with the given parameters
62 * in the container, if one exists, return it, otherwise, return a newly created one and add it
63 * to the container. In both cases, tag the cached resource as needed to keep it cached for the
64 * next evaluation. */
65 Result &get(Context &context, int type, float2 radius);
66};
67
68} // namespace blender::compositor
unsigned long long int uint64_t
Result & get(Context &context, int type, float2 radius)
SymmetricBlurWeights(Context &context, int type, float2 radius)
bool operator==(const BokehKernelKey &a, const BokehKernelKey &b)
VecBase< float, 2 > float2