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{
48
61Array get_kernel(glm::ivec2 shape, KernelType kernel_type);
62
63// --- KERNELS
64
77Array biweight(glm::ivec2 shape);
78
91Array blackman(glm::ivec2 shape);
92
103Array cone(glm::ivec2 shape);
104
119Array cone_talus(float height, float talus);
120
131Array cone_smooth(glm::ivec2 shape);
132
142Array cubic_pulse(glm::ivec2 shape);
143
151std::vector<float> cubic_pulse_1d(int nk);
152
172Array cubic_pulse_directional(glm::ivec2 shape,
173 float angle,
174 float aspect_ratio,
175 float anisotropy);
176
199Array cubic_pulse_truncated(glm::ivec2 shape, float slant_ratio, float angle);
200
211Array cupola(glm::ivec2 shape, float rc = 0.5f);
212
222Array disk(glm::ivec2 shape);
223
249Array disk_smooth(glm::ivec2 shape, float r_cutoff = 0.9f);
250
272Array gabor(glm::ivec2 shape,
273 float kw,
274 float angle,
275 bool quad_phase_shift = false);
276
303Array gabor_dune(glm::ivec2 shape,
304 float kw,
305 float angle,
306 float xtop,
307 float xbottom);
308
321Array hann(glm::ivec2 shape);
322
335Array lorentzian(glm::ivec2 shape, float footprint_threshold = 0.1f);
336
347Array lorentzian_compact(glm::ivec2 shape);
348
364Array sinc_radial(glm::ivec2 shape, float kw);
365
381Array sinc_separable(glm::ivec2 shape, float kw);
382
392Array smooth_cosine(glm::ivec2 shape);
393
403Array square(glm::ivec2 shape);
404
419Array tricube(glm::ivec2 shape);
420
421} // namespace hmap
Declaration of the Array class for 2D floating-point arrays with various mathematical operations and ...
Definition algebra.hpp:22
std::vector< float > cubic_pulse_1d(int nk)
Generates a 1D cubic pulse kernel.
Definition kernels.cpp:116
Array lorentzian_compact(glm::ivec2 shape)
Generate a modified Lorentzian kernel with compact support.
Definition kernels.cpp:378
Array cubic_pulse_truncated(glm::ivec2 shape, float slant_ratio, float angle)
Generates a truncated cubic pulse kernel.
Definition kernels.cpp:173
Array cubic_pulse(glm::ivec2 shape)
Generates a cubic pulse kernel array.
Definition kernels.cpp:97
Array disk_smooth(glm::ivec2 shape, float r_cutoff=0.9f)
Generates a smooth, disk-shaped kernel footprint with soft edges.
Definition kernels.cpp:241
Array biweight(glm::ivec2 shape)
Generates a biweight kernel array.
Definition kernels.cpp:17
KernelType
Enumeration for different kernel functions used in various algorithms.
Definition kernels.hpp:36
@ CUPOLA
Cupola (reverse) kernel function.
Definition kernels.hpp:46
@ 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 cone_smooth(glm::ivec2 shape)
Generates a cone-shaped kernel with a smooth landing.
Definition kernels.cpp:74
Array sinc_separable(glm::ivec2 shape, float kw)
Generates a separable sinc function array with the specified shape and wave number.
Definition kernels.cpp:410
Array get_kernel(glm::ivec2 shape, KernelType kernel_type)
Generate a kernel of the specified type.
Definition kernels.cpp:474
Array lorentzian(glm::ivec2 shape, float footprint_threshold=0.1f)
Generate a Lorentzian kernel.
Definition kernels.cpp:344
Array hann(glm::ivec2 shape)
Generates a Hann window array with the specified shape.
Definition kernels.cpp:362
float angle(const Point &p1, const Point &p2)
Computes the angle between two points relative to the x-axis.
Definition points.cpp:42
Array gabor_dune(glm::ivec2 shape, float kw, float angle, float xtop, float xbottom)
Generates a modified dune-like Gabor kernel.
Definition kernels.cpp:303
Array disk(glm::ivec2 shape)
Generates a disk-shaped kernel footprint.
Definition kernels.cpp:225
Array cupola(glm::ivec2 shape, float rc=0.5f)
Generate a 2D radial cupola kernel.
Definition kernels.cpp:200
Array blackman(glm::ivec2 shape)
Generates a Blackman window array with the specified shape.
Definition kernels.cpp:35
Array sinc_radial(glm::ivec2 shape, float kw)
Generates a radial sinc function array with the specified shape and wave number.
Definition kernels.cpp:394
Array smooth_cosine(glm::ivec2 shape)
Generate a smooth cosine kernel.
Definition kernels.cpp:431
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:270
Array square(glm::ivec2 shape)
Generate a square-shaped kernel.
Definition kernels.cpp:449
Array cubic_pulse_directional(glm::ivec2 shape, float angle, float aspect_ratio, float anisotropy)
Generates a "directional" cubic pulse kernel.
Definition kernels.cpp:138
Array tricube(glm::ivec2 shape)
Generate a tricube kernel.
Definition kernels.cpp:454
Array cone(glm::ivec2 shape)
Generates a cone-shaped kernel array.
Definition kernels.cpp:56