HighMap library (C++)
Loading...
Searching...
No Matches
convolve.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
19#pragma once
20
21#include "highmap/array.hpp"
22
23namespace hmap
24{
25
45Array convolve1d_i(const Array &array, const std::vector<float> &kernel);
46
66Array convolve1d_j(const Array &array, const std::vector<float> &kernel);
67
82Array convolve2d(const Array &array, const Array &kernel);
83
99Array convolve2d_truncated(const Array &array, const Array &kernel);
100
122Array convolve2d_svd(const Array &z, const Array &kernel, int rank = 3);
123
149Array convolve2d_svd_rotated_kernel(const Array &z,
150 const Array &kernel,
151 int rank = 3,
152 int n_rotations = 6,
153 std::uint32_t seed = 1);
154
155} // namespace hmap
156
157namespace hmap::gpu
158{
159
189Array sparse_max_convolution(const Array &array,
190 const Array &kernel,
191 bool scale_kernel_with_value = true,
192 float k_smoothmax = 0.f);
193
194Array sparse_max_convolution(const Array &array_values,
195 const Array &array_sizes,
196 const Array &kernel,
197 float k_smoothmax = 0.f);
198
199} // namespace hmap::gpu
Declaration of the Array class for 2D floating-point arrays with various mathematical operations and ...
Definition blending.hpp:225
Array sparse_max_convolution(const Array &array, const Array &kernel, bool scale_kernel_with_value=true, float k_smoothmax=0.f)
Apply a sparse max-convolution.
Definition sparse_max_convolution.cpp:14
Definition algebra.hpp:23
Array convolve2d_svd(const Array &z, const Array &kernel, int rank=3)
Return the approximate convolution product of the array with a Singular Value Decomposition (SVD) of ...
Definition convolve2d_svd.cpp:23
Array convolve1d_j(const Array &array, const std::vector< float > &kernel)
Return the convolution product of the array with a 1D kernel along the 'j' direction.
Definition convolve.cpp:39
Array convolve2d_truncated(const Array &array, const Array &kernel)
Return the convolution product of the array with a given 2D kernel, with a truncated output size.
Definition convolve.cpp:78
Array convolve2d_svd_rotated_kernel(const Array &z, const Array &kernel, int rank=3, int n_rotations=6, std::uint32_t seed=1)
Return the approximate convolution product of the array with a Singular Value Decomposition (SVD) of ...
Definition convolve2d_svd.cpp:84
Array convolve1d_i(const Array &array, const std::vector< float > &kernel)
Return the convolution product of the array with a 1D kernel along the 'i' direction.
Definition convolve.cpp:18
Array convolve2d(const Array &array, const Array &kernel)
Return the convolution product of the array with a given 2D kernel.
Definition convolve.cpp:62