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{
24
49
62Array get_kernel(glm::ivec2 shape, KernelType kernel_type);
63
64// --- KERNELS
65
78Array biweight(glm::ivec2 shape);
79
92Array blackman(glm::ivec2 shape);
93
104Array cone(glm::ivec2 shape);
105
120Array cone_talus(float height, float talus);
121
132Array cone_smooth(glm::ivec2 shape);
133
143Array cubic_pulse(glm::ivec2 shape);
144
152std::vector<float> cubic_pulse_1d(int nk);
153
173Array cubic_pulse_directional(glm::ivec2 shape,
174 float angle,
175 float aspect_ratio,
176 float anisotropy);
177
200Array cubic_pulse_truncated(glm::ivec2 shape, float slant_ratio, float angle);
201
212Array cupola(glm::ivec2 shape, float rc = 0.5f);
213
223Array disk(glm::ivec2 shape);
224
250Array disk_smooth(glm::ivec2 shape, float r_cutoff = 0.9f);
251
273Array gabor(glm::ivec2 shape,
274 float kw,
275 float angle,
276 bool quad_phase_shift = false);
277
304Array gabor_dune(glm::ivec2 shape,
305 float kw,
306 float angle,
307 float xtop,
308 float xbottom);
309
322Array hann(glm::ivec2 shape);
323
336Array lorentzian(glm::ivec2 shape, float footprint_threshold = 0.1f);
337
348Array lorentzian_compact(glm::ivec2 shape);
349
365Array sinc_radial(glm::ivec2 shape, float kw);
366
382Array sinc_separable(glm::ivec2 shape, float kw);
383
393Array smooth_cosine(glm::ivec2 shape);
394
404Array square(glm::ivec2 shape);
405
420Array tricube(glm::ivec2 shape);
421
422} // namespace hmap
Declaration of the Array class for 2D floating-point arrays with various mathematical operations and ...
Definition opencv.hpp:20
std::vector< float > cubic_pulse_1d(int nk)
Generates a 1D cubic pulse kernel.
Definition kernels.cpp:128
Array lorentzian_compact(glm::ivec2 shape)
Generate a modified Lorentzian kernel with compact support.
Definition kernels.cpp:408
Array cubic_pulse_truncated(glm::ivec2 shape, float slant_ratio, float angle)
Generates a truncated cubic pulse kernel.
Definition kernels.cpp:189
Array cubic_pulse(glm::ivec2 shape)
Generates a cubic pulse kernel array.
Definition kernels.cpp:107
Array disk_smooth(glm::ivec2 shape, float r_cutoff=0.9f)
Generates a smooth, disk-shaped kernel footprint with soft edges.
Definition kernels.cpp:263
Array biweight(glm::ivec2 shape)
Generates a biweight kernel array.
Definition kernels.cpp:19
KernelType
Enumeration for different kernel functions used in various algorithms.
Definition kernels.hpp:37
@ CUPOLA
Cupola (reverse) kernel function.
Definition kernels.hpp:47
@ SMOOTH_COSINE
Smooth cosine kernel function.
Definition kernels.hpp:44
@ DISK
Disk kernel function.
Definition kernels.hpp:42
@ BIWEIGHT
Biweight kernel function.
Definition kernels.hpp:38
@ SQUARE
Square kernel function.
Definition kernels.hpp:45
@ TRICUBE
Tricube kernel function.
Definition kernels.hpp:46
@ CONE_SMOOTH
Smooth cone kernel function.
Definition kernels.hpp:41
@ CUBIC_PULSE
Cubic pulse kernel function.
Definition kernels.hpp:39
@ LORENTZIAN
Lorentzian (Cauchy) kernel function.
Definition kernels.hpp:43
@ CONE
Cone kernel function.
Definition kernels.hpp:40
Array cone_talus(float height, float talus)
Generates a cone-shaped kernel with specified height and talus.
Definition kernels.cpp:91
Array cone_smooth(glm::ivec2 shape)
Generates a cone-shaped kernel with a smooth landing.
Definition kernels.cpp:82
Array sinc_separable(glm::ivec2 shape, float kw)
Generates a separable sinc function array with the specified shape and wave number.
Definition kernels.cpp:444
Array get_kernel(glm::ivec2 shape, KernelType kernel_type)
Generate a kernel of the specified type.
Definition kernels.cpp:515
Array lorentzian(glm::ivec2 shape, float footprint_threshold=0.1f)
Generate a Lorentzian kernel.
Definition kernels.cpp:372
Array hann(glm::ivec2 shape)
Generates a Hann window array with the specified shape.
Definition kernels.cpp:392
float angle(const Point &p1, const Point &p2)
Computes the angle between two points relative to the x-axis.
Definition points.cpp:65
Array gabor_dune(glm::ivec2 shape, float kw, float angle, float xtop, float xbottom)
Generates a modified dune-like Gabor kernel.
Definition kernels.cpp:329
Array disk(glm::ivec2 shape)
Generates a disk-shaped kernel footprint.
Definition kernels.cpp:245
Array cupola(glm::ivec2 shape, float rc=0.5f)
Generate a 2D radial cupola kernel.
Definition kernels.cpp:218
Array blackman(glm::ivec2 shape)
Generates a Blackman window array with the specified shape.
Definition kernels.cpp:39
Array sinc_radial(glm::ivec2 shape, float kw)
Generates a radial sinc function array with the specified shape and wave number.
Definition kernels.cpp:426
Array smooth_cosine(glm::ivec2 shape)
Generate a smooth cosine kernel.
Definition kernels.cpp:467
Array gabor(glm::ivec2 shape, float kw, float angle, bool quad_phase_shift=false)
Generates a Gabor kernel of the specified shape.
Definition kernels.cpp:294
Array square(glm::ivec2 shape)
Generate a square-shaped kernel.
Definition kernels.cpp:487
Array cubic_pulse_directional(glm::ivec2 shape, float angle, float aspect_ratio, float anisotropy)
Generates a "directional" cubic pulse kernel.
Definition kernels.cpp:152
Array tricube(glm::ivec2 shape)
Generate a tricube kernel.
Definition kernels.cpp:493
Array cone(glm::ivec2 shape)
Generates a cone-shaped kernel array.
Definition kernels.cpp:62