HighMap library (C++)
Loading...
Searching...
No Matches
blending.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#include "highmap/array.hpp"
21#include "highmap/texture.hpp"
22
23namespace hmap
24{
25
54Array blend_exclusion(const Array &array1, const Array &array2);
55
68Array blend_gradients(const Array &array1, const Array &array2, int ir = 4);
69
85Array blend_negate(const Array &array1, const Array &array2);
86
103Array blend_overlay(const Array &array1, const Array &array2);
104
124Array blend_soft(const Array &array1, const Array &array2);
125
149Array blend_power_law(const std::vector<const Array *> &arrays,
150 float alpha = 0.f);
151
160Array blend_power_law(const Array &array1,
161 const Array &array2,
162 float alpha = 0.f);
163
183Array mixer(const Array &t,
184 const std::vector<const Array *> &arrays,
185 float gain_factor = 1.f);
186
216Array transfer(const Array &source,
217 const Array &target,
218 int ir,
219 float amplitude,
220 bool target_prefiltering = false);
221
222} // namespace hmap
223
224namespace hmap::gpu
225{
226
228Array blend_gradients(const Array &array1, const Array &array2, int ir = 4);
229
253Array blend_poisson_bf(const Array &array1,
254 const Array &array2,
255 const int iterations = 500,
256 const Array *p_mask = nullptr);
257
274Texture blend_poisson_bf(const Texture &texture1,
275 const Texture &texture2,
276 const int iterations = 500,
277 const Array *p_mask = nullptr);
278
280Array transfer(const Array &source,
281 const Array &target,
282 int ir,
283 float amplitude,
284 bool target_prefiltering = false);
285
286} // 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:32
A class to represent a multi-channel texture using planar hmap::Array storage.
Definition texture.hpp:37
Definition blending.hpp:225
Array blend_gradients(const Array &array1, const Array &array2, int ir=4)
See hmap::blend_gradients.
Definition blending_gpu.cpp:22
Array blend_poisson_bf(const Array &array1, const Array &array2, const int iterations=500, const Array *p_mask=nullptr)
Blends two arrays using Poisson blending with a brute-force solver.
Definition blending_gpu.cpp:39
Array transfer(const Array &source, const Array &target, int ir, float amplitude, bool target_prefiltering=false)
See hmap::transfer.
Definition blending_gpu.cpp:121
Definition algebra.hpp:23
Array blend_negate(const Array &array1, const Array &array2)
Return the 'negate' blending of two arrays.
Definition blending.cpp:47
Array blend_overlay(const Array &array1, const Array &array2)
Return the 'overlay' blending of two arrays.
Definition blending.cpp:65
Array transfer(const Array &source, const Array &target, int ir, float amplitude, bool target_prefiltering=false)
Transfers spatial details from a source array onto a target array.
Definition blending.cpp:185
Array blend_power_law(const std::vector< const Array * > &arrays, float alpha=0.f)
Return the power law blending of a set of arrays.
Definition blending.cpp:94
Array blend_soft(const Array &array1, const Array &array2)
Return the 'soft' blending of two arrays.
Definition blending.cpp:83
Array blend_exclusion(const Array &array1, const Array &array2)
Return the 'exclusion' blending of two arrays.
Definition blending.cpp:20
Array mixer(const Array &t, const std::vector< const Array * > &arrays, float gain_factor=1.f)
Return the mixing of a set of arrays based on a parameter t.
Definition blending.cpp:133
Array blend_gradients(const Array &array1, const Array &array2, int ir=4)
Return the blending of two arrays based on their gradients.
Definition blending.cpp:30
Header file for the Texture class.