HighMap library (C++)
Loading...
Searching...
No Matches
kernels.hpp
Go to the documentation of this file.
1/* Copyright (c) 2023 Otto Link. Distributed under the terms of the GNU General
2 Public License. The full license is in the file LICENSE, distributed with
3 this software. */
4
17#pragma once
18#include <functional>
19
20#include "highmap/array.hpp"
21
22namespace hmap
23{
47
60Array biweight(Vec2<int> shape);
61
74Array blackman(Vec2<int> shape);
75
86Array cone(Vec2<int> shape);
87
102Array cone_talus(float height, float talus);
103
114Array cone_smooth(Vec2<int> shape);
115
125Array cubic_pulse(Vec2<int> shape);
126
134std::vector<float> cubic_pulse_1d(int nk);
135
155Array cubic_pulse_directional(Vec2<int> shape,
156 float angle,
157 float aspect_ratio,
158 float anisotropy);
159
182Array cubic_pulse_truncated(Vec2<int> shape, float slant_ratio, float angle);
183
193Array disk(Vec2<int> shape);
194
220Array disk_smooth(Vec2<int> shape, float r_cutoff = 0.9f);
221
243Array gabor(Vec2<int> shape,
244 float kw,
245 float angle,
246 bool quad_phase_shift = false);
247
274Array gabor_dune(Vec2<int> shape,
275 float kw,
276 float angle,
277 float xtop,
278 float xbottom);
279
292Array get_kernel(Vec2<int> shape, KernelType kernel_type);
293
306Array hann(Vec2<int> shape);
307
320Array lorentzian(Vec2<int> shape, float footprint_threshold = 0.1f);
321
332Array lorentzian_compact(Vec2<int> shape);
333
349Array sinc_radial(Vec2<int> shape, float kw);
350
366Array sinc_separable(Vec2<int> shape, float kw);
367
377Array smooth_cosine(Vec2<int> shape);
378
388Array square(Vec2<int> shape);
389
404Array tricube(Vec2<int> shape);
405
406} // namespace hmap
Declaration of the Array class for 2D floating-point arrays with various mathematical operations and ...
Definition algebra.hpp:28
Array disk_smooth(Vec2< int > shape, float r_cutoff=0.9f)
Generates a smooth, disk-shaped kernel footprint with soft edges.
Definition kernels.cpp:216
Array sinc_radial(Vec2< int > shape, float kw)
Generates a radial sinc function array with the specified shape and wave number.
Definition kernels.cpp:369
std::vector< float > cubic_pulse_1d(int nk)
Generates a 1D cubic pulse kernel.
Definition kernels.cpp:116
Array smooth_cosine(Vec2< int > shape)
Generate a smooth cosine kernel.
Definition kernels.cpp:406
Array cubic_pulse_truncated(Vec2< int > shape, float slant_ratio, float angle)
Generates a truncated cubic pulse kernel.
Definition kernels.cpp:173
Array lorentzian(Vec2< int > shape, float footprint_threshold=0.1f)
Generate a Lorentzian kernel.
Definition kernels.cpp:319
Array cubic_pulse_directional(Vec2< int > shape, float angle, float aspect_ratio, float anisotropy)
Generates a "directional" cubic pulse kernel.
Definition kernels.cpp:138
Array gabor_dune(Vec2< int > shape, float kw, float angle, float xtop, float xbottom)
Generates a modified dune-like Gabor kernel.
Definition kernels.cpp:278
Array get_kernel(Vec2< int > shape, KernelType kernel_type)
Generate a kernel of the specified type.
Definition kernels.cpp:449
KernelType
Enumeration for different kernel functions used in various algorithms.
Definition kernels.hpp:36
@ SMOOTH_COSINE
Smooth cosine kernel function.
Definition kernels.hpp:43
@ DISK
Disk kernel function.
Definition kernels.hpp:41
@ BIWEIGHT
Biweight kernel function.
Definition kernels.hpp:37
@ SQUARE
Square kernel function.
Definition kernels.hpp:44
@ TRICUBE
Tricube kernel function.
Definition kernels.hpp:45
@ CONE_SMOOTH
Smooth cone kernel function.
Definition kernels.hpp:40
@ CUBIC_PULSE
Cubic pulse kernel function.
Definition kernels.hpp:38
@ LORENTZIAN
Lorentzian (Cauchy) kernel function.
Definition kernels.hpp:42
@ CONE
Cone kernel function.
Definition kernels.hpp:39
Array cone_talus(float height, float talus)
Generates a cone-shaped kernel with specified height and talus.
Definition kernels.cpp:81
Array square(Vec2< int > shape)
Generate a square-shaped kernel.
Definition kernels.cpp:424
Array tricube(Vec2< int > shape)
Generate a tricube kernel.
Definition kernels.cpp:429
Array lorentzian_compact(Vec2< int > shape)
Generate a modified Lorentzian kernel with compact support.
Definition kernels.cpp:353
Array cone(Vec2< int > shape)
Generates a cone-shaped kernel array.
Definition kernels.cpp:56
Array gabor(Vec2< int > shape, float kw, float angle, bool quad_phase_shift=false)
Generates a Gabor kernel of the specified shape.
Definition kernels.cpp:245
float angle(const Point &p1, const Point &p2)
Computes the angle between two points relative to the x-axis.
Definition points.cpp:42
Array hann(Vec2< int > shape)
Generates a Hann window array with the specified shape.
Definition kernels.cpp:337
Array sinc_separable(Vec2< int > shape, float kw)
Generates a separable sinc function array with the specified shape and wave number.
Definition kernels.cpp:385
Array disk(Vec2< int > shape)
Generates a disk-shaped kernel footprint.
Definition kernels.cpp:200
Array cone_smooth(Vec2< int > shape)
Generates a cone-shaped kernel with a smooth landing.
Definition kernels.cpp:74
Array blackman(Vec2< int > shape)
Generates a Blackman window array with the specified shape.
Definition kernels.cpp:35
Array biweight(Vec2< int > shape)
Generates a biweight kernel array.
Definition kernels.cpp:17
Array cubic_pulse(Vec2< int > shape)
Generates a cubic pulse kernel array.
Definition kernels.cpp:97