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
22namespace hmap
23{
24
53Array blend_exclusion(const Array &array1, const Array &array2);
54
67Array blend_gradients(const Array &array1, const Array &array2, int ir = 4);
68
84Array blend_negate(const Array &array1, const Array &array2);
85
102Array blend_overlay(const Array &array1, const Array &array2);
103
123Array blend_soft(const Array &array1, const Array &array2);
124
144Array mixer(const Array &t,
145 const std::vector<const Array *> &arrays,
146 float gain_factor = 1.f);
147
177Array transfer(const Array &source,
178 const Array &target,
179 int ir,
180 float amplitude,
181 bool target_prefiltering = false);
182
183} // namespace hmap
184
185namespace hmap::gpu
186{
187
189Array blend_gradients(const Array &array1, const Array &array2, int ir = 4);
190
214Array blend_poisson_bf(const Array &array1,
215 const Array &array2,
216 const int iterations = 500,
217 const Array *p_mask = nullptr);
218
220Array transfer(const Array &source,
221 const Array &target,
222 int ir,
223 float amplitude,
224 bool target_prefiltering = false);
225
226} // 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
Definition blending.hpp:186
Array blend_gradients(const Array &array1, const Array &array2, int ir=4)
See hmap::blend_gradients.
Definition blending_gpu.cpp:16
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:30
Array transfer(const Array &source, const Array &target, int ir, float amplitude, bool target_prefiltering=false)
See hmap::transfer.
Definition blending_gpu.cpp:56
Definition algebra.hpp:28
Array blend_negate(const Array &array1, const Array &array2)
Return the 'negate' blending of two arrays.
Definition blending.cpp:38
Array blend_overlay(const Array &array1, const Array &array2)
Return the 'overlay' blending of two arrays.
Definition blending.cpp:53
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:118
Array blend_soft(const Array &array1, const Array &array2)
Return the 'soft' blending of two arrays.
Definition blending.cpp:68
Array blend_exclusion(const Array &array1, const Array &array2)
Return the 'exclusion' blending of two arrays.
Definition blending.cpp:17
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:76
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:24