Blender V4.3
COM_fog_glow_kernel.hh
Go to the documentation of this file.
1/* SPDX-FileCopyrightText: 2024 Blender Authors
2 *
3 * SPDX-License-Identifier: GPL-2.0-or-later */
4
5#pragma once
6
7#include <complex>
8#include <cstdint>
9#include <memory>
10
11#include "BLI_map.hh"
13
15
17
18/* ------------------------------------------------------------------------------------------------
19 * Fog Glow Kernel Key.
20 */
30
31bool operator==(const FogGlowKernelKey &a, const FogGlowKernelKey &b);
32
33/* -------------------------------------------------------------------------------------------------
34 * Fog Glow Kernel.
35 *
36 * A cached resource that computes and caches a Fog Glow convolution kernel in the frequency domain
37 * using FFTW's real to complex transform. The kernel is computed within a specific kernel size but
38 * zero padded to match a certain spatial size. */
40 private:
41 /* The normalization factor that should be used to normalize the kernel frequencies. See the
42 * implementation for more information. */
43 float normalization_factor_ = 1.0f;
44
45 /* The kernel in the frequency domain. See the implementation for more information. */
46 std::complex<float> *frequencies_ = nullptr;
47
48 public:
49 FogGlowKernel(int kernel_size, int2 spatial_size);
50
52
53 std::complex<float> *frequencies() const;
54
55 float normalization_factor() const;
56};
57
58/* ------------------------------------------------------------------------------------------------
59 * Fog Glow Kernel Container.
60 */
62 private:
64
65 public:
66 void reset() override;
67
68 /* Check if there is an available FogGlowKernel cached resource with the given parameters in the
69 * container, if one exists, return it, otherwise, return a newly created one and add it to the
70 * container. In both cases, tag the cached resource as needed to keep it cached for the next
71 * evaluation. */
72 FogGlowKernel &get(int kernel_size, int2 spatial_size);
73};
74
75} // namespace blender::realtime_compositor
FogGlowKernel & get(int kernel_size, int2 spatial_size)
FogGlowKernelKey(int kernel_size, int2 spatial_size)
std::complex< float > * frequencies() const
FogGlowKernel(int kernel_size, int2 spatial_size)
local_group_size(16, 16) .push_constant(Type b
bool operator==(const BokehKernelKey &a, const BokehKernelKey &b)
unsigned __int64 uint64_t
Definition stdint.h:90