HighMap library (C++)
Loading...
Searching...
No Matches
warp.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
11#pragma once
12
13#include "highmap/array.hpp"
14
15namespace hmap
16{
17
36void warp(Array &array, const Array *p_dx, const Array *p_dy);
37
60void warp_directional(Array &array,
61 float angle,
62 float amount = 0.02f,
63 int ir = 4,
64 bool reverse = false);
65
90
92void warp_directional(Array &array,
93 float angle,
94 const Array *p_mask,
95 float amount = 0.02f,
96 int ir = 4,
97 bool reverse = false);
98
120void warp_downslope(Array &array,
121 float amount = 0.02f,
122 int ir = 4,
123 bool reverse = false);
124
148
150void warp_downslope(Array &array,
151 const Array *p_mask,
152 float amount = 0.02f,
153 int ir = 4,
154 bool reverse = false);
155
156} // namespace hmap
157
158namespace hmap::gpu
159{
160
162void warp(Array &array, const Array *p_dx, const Array *p_dy);
163
164} // namespace hmap::gpu
Declaration of the Array class for 2D floating-point arrays with various mathematical operations and ...
Array class, helper to manipulate 2D float array with "(i, j)" indexing.
Definition array.hpp:31
Definition array_blending.hpp:225
void warp(Array &array, const Array *p_dx, const Array *p_dy)
See hmap::warp.
Definition warp_gpu.cpp:16
Definition opencv.hpp:20
void warp(Array &array, const Array *p_dx, const Array *p_dy)
Apply a warping effect to the array.
Definition warp.cpp:17
void warp_downslope(Array &array, float amount=0.02f, int ir=4, bool reverse=false)
Apply a warping effect following the downward local gradient direction (deflate/inflate effect).
Definition warp.cpp:84
float angle(const Point &p1, const Point &p2)
Computes the angle between two points relative to the x-axis.
Definition points.cpp:65
void warp_directional(Array &array, float angle, float amount=0.02f, int ir=4, bool reverse=false)
Apply a warping effect following the downward local gradient direction (deflate/inflate effect).
Definition warp.cpp:34