22#include "macrologger.h"
80 float smoothing = 1.f,
81 glm::vec2 center = {0.5f, 0.5f},
82 glm::vec4 bbox = {0.f, 1.f, 0.f, 1.f});
118void rot90(Array &array);
142 bool zero_padding =
false);
210 bool periodic =
false,
211 const Array *p_noise_x =
nullptr,
212 const Array *p_noise_y =
nullptr,
213 glm::vec4 bbox = {0.f, 1.f, 0.f, 1.f});
233void warp(Array &array,
const Array *p_dx,
const Array *p_dy);
259 float amount = 0.02f,
261 bool reverse =
false);
290 float amount = 0.02f,
292 bool reverse =
false);
316 float amount = 0.02f,
318 bool reverse =
false);
345 float amount = 0.02f,
347 bool reverse =
false);
394Array
zoom(
const Array &array,
396 bool periodic =
false,
397 glm::vec2 center = {0.5f, 0.5f},
398 const Array *p_noise_x =
nullptr,
399 const Array *p_noise_y =
nullptr,
400 glm::vec4 bbox = {0.f, 1.f, 0.f, 1.f});
451 const Array &advected_field,
455 bool reverse =
false,
456 bool post_filter =
true,
457 float post_filter_sigma = 0.125f,
458 float advection_length = 0.1f,
459 float value_persistence = 0.99f,
461 const Array *p_advection_mask =
nullptr,
462 const Array *p_mask =
nullptr);
465 const Array &advected_field,
468 bool reverse =
false,
469 bool post_filter =
true,
470 float post_filter_sigma = 0.125f,
471 float advection_length = 0.1f,
472 float value_persistence = 0.99f,
474 const Array *p_advection_mask =
nullptr,
475 const Array *p_mask =
nullptr);
479 const Array &advected_field,
482 bool reverse =
false,
483 bool post_filter =
true,
484 float post_filter_sigma = 0.125f,
485 float advection_length = 0.1f,
486 float value_persistence = 0.99f,
488 const Array *p_advection_mask =
nullptr,
489 const Array *p_mask =
nullptr);
522 const Array &advected_field,
523 float advection_length = 0.1f,
524 float value_persistence = 0.9f,
525 const Array *p_mask =
nullptr);
528 const Array &advected_field,
531 float advection_length = 0.1f,
532 float value_persistence = 0.9f,
533 const Array *p_mask =
nullptr);
536void rotate(Array &array,
float angle,
bool zoom_in =
true);
539void warp(Array &array,
const Array *p_dx,
const Array *p_dy);
Declaration of the Array class for 2D floating-point arrays with various mathematical operations and ...
Definition blending.hpp:186
Array advection_particle(const Array &z, const Array &advected_field, int iterations, int nparticles, std::uint32_t seed, bool reverse=false, bool post_filter=true, float post_filter_sigma=0.125f, float advection_length=0.1f, float value_persistence=0.99f, float inertia=0.f, const Array *p_advection_mask=nullptr, const Array *p_mask=nullptr)
Performs particle-based advection on a scalar field.
Definition advection_particle_gpu.cpp:20
Array advection_warp(const Array &z, const Array &advected_field, float advection_length=0.1f, float value_persistence=0.9f, const Array *p_mask=nullptr)
Performs 2D field advection based on the gradient of a heightmap using a warp-based technic (simplifi...
Definition advection_warp_gpu.cpp:52
void warp(Array &array, const Array *p_dx, const Array *p_dy)
See hmap::warp.
Definition warp_gpu.cpp:14
void rotate(Array &array, float angle, bool zoom_in=true)
See hmap::rotate.
Definition transform_gpu.cpp:14
Definition algebra.hpp:23
void warp(Array &array, const Array *p_dx, const Array *p_dy)
Apply a warping effect to the array.
Definition warp.cpp:16
void flip_lr(Array &array)
Flip the array horizontally (left/right).
Definition transform.cpp:20
Array zoom(const Array &array, float zoom_factor, bool periodic=false, glm::vec2 center={0.5f, 0.5f}, const Array *p_noise_x=nullptr, const Array *p_noise_y=nullptr, glm::vec4 bbox={0.f, 1.f, 0.f, 1.f})
Applies a zoom effect to a 2D array with an adjustable center.
Definition transform.cpp:171
void flip_ud(Array &array)
Flip the array vertically (up/down).
Definition transform.cpp:27
void rot180(Array &array)
Rotate the array by 180 degrees.
Definition transform.cpp:61
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:74
Array translate(const Array &array, float dx, float dy, bool periodic=false, const Array *p_noise_x=nullptr, const Array *p_noise_y=nullptr, glm::vec4 bbox={0.f, 1.f, 0.f, 1.f})
Translates a 2D array by a specified amount along the x and y axes.
Definition transform.cpp:128
void rot270(Array &array)
Rotate the array by 270 degrees.
Definition transform.cpp:67
void rotate(Array &array, float angle, bool zoom_in=true, bool zero_padding=false)
Rotate the array by a specified angle.
Definition transform.cpp:79
Array transpose(const Array &array)
Return the transposed array.
Definition transform.cpp:160
float angle(const Point &p1, const Point &p2)
Computes the angle between two points relative to the x-axis.
Definition points.cpp:46
void rot90(Array &array)
Rotate the array by 90 degrees.
Definition transform.cpp:73
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:29
void rotate_displacement(const Array &delta, float angle, Array &dx, Array &dy)
Rotates a scalar displacement field into directional X and Y components.
Definition transform.cpp:121
void radial_displacement_to_xy(const Array &dr, Array &dx, Array &dy, float smoothing=1.f, glm::vec2 center={0.5f, 0.5f}, glm::vec4 bbox={0.f, 1.f, 0.f, 1.f})
Interpret the input array dr as a radial displacement and convert it to a pair of displacements dx an...
Definition transform.cpp:34