HighMap library (C++)
Loading...
Searching...
No Matches
interpolate_terrain.hpp
Go to the documentation of this file.
1/* Copyright (c) 2025 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
12#pragma once
13#include <vector>
14
15#include "highmap/array.hpp"
18
19namespace hmap
20{
21
22class ComputeMode; // forward decl.
23
24// --- Array -> Array (world space via CoordFrame)
25
37void flatten_terrain(Array &h_source1,
38 const Array &h_source2,
39 const CoordFrame &t_source1,
40 const CoordFrame &t_source2,
41 bool bilinear = true);
42
54void flatten_terrain(const std::vector<const Array *> &h_sources,
55 Array &h_target,
56 const std::vector<const CoordFrame *> &t_sources,
57 const CoordFrame &t_target,
58 bool bilinear = true);
59
74void interpolate_terrain(const Array &h_source,
75 Array &h_target,
76 const CoordFrame &t_source,
77 const CoordFrame &t_target,
78 bool bilinear = true,
79 float fill_value = 0.f,
80 Array *p_mask = nullptr);
81
82// --- VirtualArray -> VirtualArray (world space via CoordFrame)
83
96void flatten_terrain(VirtualArray &h_source1,
97 const VirtualArray &h_source2,
98 const CoordFrame &t_source1,
99 const CoordFrame &t_source2,
100 const ComputeMode &cm,
101 bool bilinear = true);
102
115void flatten_terrain(const std::vector<const VirtualArray *> &h_sources,
116 VirtualArray &h_target,
117 const std::vector<const CoordFrame *> &t_sources,
118 const CoordFrame &t_target,
119 const ComputeMode &cm,
120 bool bilinear = true);
121
137void interpolate_terrain(const VirtualArray &h_source,
138 VirtualArray &h_target,
139 const CoordFrame &t_source,
140 const CoordFrame &t_target,
141 const ComputeMode &cm,
142 bool bilinear = true,
143 float fill_value = 0.f,
144 VirtualArray *p_mask = nullptr);
145
146} // namespace hmap
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 coord_frame.hpp:40
Definition opencv.hpp:20
void interpolate_terrain(const Array &h_source, Array &h_target, const CoordFrame &t_source, const CoordFrame &t_target, bool bilinear=true, float fill_value=0.f, Array *p_mask=nullptr)
Project and interpolate a source terrain array onto a target terrain array using their world-space co...
Definition interpolate_array.cpp:351
void flatten_terrain(Array &h_source1, const Array &h_source2, const CoordFrame &t_source1, const CoordFrame &t_source2, bool bilinear=true)
Blend a second terrain array in-place onto a base terrain array using their world-space coordinate fr...
Definition interpolate_array.cpp:406
Definition virtual_array.hpp:54
Definition virtual_array.hpp:65