HighMap library (C++)
Loading...
Searching...
No Matches
transform.cpp File Reference

Namespaces

namespace  hmap
 

Functions

void hmap::flip_lr (Array &array)
 Flip the array horizontally (left/right).
 
void hmap::flip_ud (Array &array)
 Flip the array vertically (up/down).
 
void hmap::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 and dy in cartesian coordinates.
 
void hmap::rot180 (Array &array)
 Rotate the array by 180 degrees.
 
void hmap::rot270 (Array &array)
 Rotate the array by 270 degrees.
 
void hmap::rot90 (Array &array)
 Rotate the array by 90 degrees.
 
void hmap::rotate (Array &array, float angle, bool zoom_in=true, bool zero_padding=false)
 Rotate the array by a specified angle.
 
void hmap::rotate_displacement (const Array &delta, float angle, Array &dx, Array &dy)
 Rotates a scalar displacement field into directional X and Y components.
 
Array hmap::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.
 
Array hmap::transpose (const Array &array)
 Return the transposed array.
 
Array hmap::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.