90 float smoothing = 1.f,
91 glm::vec2 center = {0.5f, 0.5f},
153 bool zero_padding =
false);
196 bool flatten_center =
false,
197 float flatten_radius = 0.05f);
237 bool periodic =
false,
238 const Array *p_noise_x =
nullptr,
239 const Array *p_noise_y =
nullptr,
302 bool periodic =
false,
303 glm::vec2 center = {0.5f, 0.5f},
304 const Array *p_noise_x =
nullptr,
305 const Array *p_noise_y =
nullptr,
314void rotate(Array &array,
float angle,
bool zoom_in =
true);
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 rotate(Array &array, float angle, bool zoom_in=true)
See hmap::rotate.
Definition transform_gpu.cpp:16
void rot270(Texture &texture)
Rotate the texture by 270 degrees counterclockwise.
Definition texture_transform.cpp:56
Array symmetrize(const Array &array, SymmetryType symmetry_type=SymmetryType::SYMMETRY_LEFT_TO_RIGHT, bool flatten_center=false, float flatten_radius=0.05f)
Enforces geometric symmetry on an array.
Definition transform.cpp:190
void flip_ud(Texture &texture)
Flip the texture vertically (up/down).
Definition texture_transform.cpp:25
void rot90(Texture &texture)
Rotate the texture by 90 degrees counterclockwise.
Definition texture_transform.cpp:35
SymmetryType
Describes the symmetry operation to apply to an array.
Definition transform.hpp:27
@ SYMMETRY_TOP_TO_BOTTOM
Mirror top half onto bottom half.
Definition transform.hpp:30
@ SYMMETRY_LEFT_TO_RIGHT
Mirror left half onto right half.
Definition transform.hpp:28
@ SYMMETRY_RIGHT_TO_LEFT
Mirror right half onto left half.
Definition transform.hpp:29
@ SYMMETRY_Y
Symmetric average across horizontal axis.
Definition transform.hpp:33
@ SYMMETRY_ROT180
180-degree rotational symmetry around center.
Definition transform.hpp:35
@ SYMMETRY_X
Symmetric average across vertical axis.
Definition transform.hpp:32
@ SYMMETRY_BOTTOM_TO_TOP
Mirror bottom half onto top half.
Definition transform.hpp:31
@ SYMMETRY_XY
4-quadrant symmetric average across both X and Y.
Definition transform.hpp:34
void rotate(Array &array, float angle, bool zoom_in=true, bool zero_padding=false)
Rotate the array by a specified angle.
Definition transform.cpp:94
void rot180(Texture &texture)
Rotate the texture by 180 degrees.
Definition texture_transform.cpp:46
Array translate(const Array &array, float dx, float dy, bool periodic=false, const Array *p_noise_x=nullptr, const Array *p_noise_y=nullptr, const UvRect &uv_rect=UvRect::unit())
Translates a 2D array by a specified amount along the x and y axes.
Definition transform.cpp:299
void scale_uv(Texture &texture, glm::vec2 uv_scale)
Scale the texture in UV space with wrapping boundary.
Definition texture_transform.cpp:67
Texture transpose(const Texture &texture)
Return the transposed texture.
Definition texture_transform.cpp:77
float angle(const Point &p1, const Point &p2)
Computes the angle between two points relative to the x-axis.
Definition points.cpp:65
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:138
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, const UvRect &uv_rect=UvRect::unit())
Applies a zoom effect to a 2D array with an adjustable center.
Definition transform.cpp:350
void flip_lr(Texture &texture)
Flip the texture horizontally (left/right).
Definition texture_transform.cpp:15
void radial_displacement_to_xy(const Array &dr, Array &dx, Array &dy, float smoothing=1.f, glm::vec2 center={0.5f, 0.5f}, const UvRect &uv_rect=UvRect::unit())
Interpret the input array dr as a radial displacement and convert it to a pair of displacements dx an...
Definition transform.cpp:41
Axis-aligned rectangle in normalized [0, 1]^2 domain/UV space.
Definition uv_rect.hpp:30
static constexpr UvRect unit()
Definition uv_rect.hpp:46