HighMap library (C++)
Loading...
Searching...
No Matches
interpolate_array.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 "highmap/array.hpp"
14
15namespace hmap
16{
17
26void interpolate_array_bicubic(const Array &source,
27 Array &target,
28 bool endpoint = false,
29 bool pixel_centered = true);
30
42void interpolate_array_bicubic(const Array &source,
43 Array &target,
44 const UvRect &uv_rect_source,
45 const UvRect &uv_rect_target,
46 bool endpoint = false,
47 bool pixel_centered = true);
48
57void interpolate_array_bilinear(const Array &source,
58 Array &target,
59 bool endpoint = false,
60 bool pixel_centered = true);
61
73void interpolate_array_bilinear(const Array &source,
74 Array &target,
75 const UvRect &uv_rect_source,
76 const UvRect &uv_rect_target,
77 bool endpoint = false,
78 bool pixel_centered = true);
79
88void interpolate_array_nearest(const Array &source,
89 Array &target,
90 bool endpoint = false);
91
102void interpolate_array_nearest(const Array &source,
103 Array &target,
104 const UvRect &uv_rect_source,
105 const UvRect &uv_rect_target,
106 bool endpoint = false);
107
119 glm::ivec2 dst_shape,
120 float warp = 0.f,
121 std::uint32_t seed = 0);
122
123} // namespace hmap
124
125namespace hmap::gpu
126{
127
128void interpolate_array_bicubic(const Array &source, Array &target);
129
130void interpolate_array_bicubic(const Array &source,
131 Array &target,
132 const UvRect &uv_rect_source,
133 const UvRect &uv_rect_target);
134
135void interpolate_array_bilinear(const Array &source, Array &target);
136
137void interpolate_array_bilinear(const Array &source,
138 Array &target,
139 const UvRect &uv_rect_source,
140 const UvRect &uv_rect_target);
141
142void interpolate_array_lagrange(const Array &source, Array &target, int order);
143
144void interpolate_array_nearest(const Array &source, Array &target);
145
146void interpolate_array_nearest(const Array &source,
147 Array &target,
148 const UvRect &uv_rect_source,
149 const UvRect &uv_rect_target);
150
151} // 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 interpolate_array_bicubic(const Array &source, Array &target)
Definition interpolate_array_gpu.cpp:45
void interpolate_array_bilinear(const Array &source, Array &target)
Definition interpolate_array_gpu.cpp:102
void interpolate_array_nearest(const Array &source, Array &target)
Definition interpolate_array_gpu.cpp:175
void interpolate_array_lagrange(const Array &source, Array &target, int order)
Definition interpolate_array_gpu.cpp:151
Definition opencv.hpp:20
Array resample_bicubic_warp(const Array &src, glm::ivec2 dst_shape, float warp=0.f, std::uint32_t seed=0)
Resample an array to a target shape using cubic B-spline interpolation with optional domain noise war...
Definition interpolate_array.cpp:258
void warp(Array &array, const Array *p_dx, const Array *p_dy)
Apply a warping effect to the array.
Definition warp.cpp:17
void interpolate_array_bilinear(const Array &source, Array &target, bool endpoint=false, bool pixel_centered=true)
Resample an array to a target array using bilinear interpolation.
Definition interpolate_array.cpp:124
void interpolate_array_bicubic(const Array &source, Array &target, bool endpoint=false, bool pixel_centered=true)
Resample an array to a target array using bicubic interpolation.
Definition interpolate_array.cpp:29
void interpolate_array_nearest(const Array &source, Array &target, bool endpoint=false)
Resample an array to a target array using nearest-neighbor interpolation.
Definition interpolate_array.cpp:209
Axis-aligned rectangle in normalized [0, 1]^2 domain/UV space.
Definition uv_rect.hpp:30