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

Namespaces

namespace  hmap

Functions

int hmap::convert_length_to_pixel (float x, int nx, bool lim_inf=true, bool lim_sup=false, float scale=1.f)
 Converts a length value to a pixel index in a discretized space.
void hmap::expand_points_domain (std::vector< float > &x, std::vector< float > &y, std::vector< float > &value, const BBox2D &bbox=BBox2D{})
 Expand grid by translating and copying the values of the current bounding box to the 8 first neighboring bounding boxes.
void hmap::expand_points_at_domain_boundaries (std::vector< float > &x, std::vector< float > &y, std::vector< float > &value, const BBox2D &bbox=BBox2D{}, float boundary_value=0.f)
 Expand the grid by adding points on the boundaries of the bounding box.
void hmap::expand_points_domain_corners (std::vector< float > &x, std::vector< float > &y, std::vector< float > &value, const BBox2D &bbox=BBox2D{}, float corner_value=0.f)
 Expand the grid by adding four points at the corner of the bounding box.
void hmap::grid_xy_vector (std::vector< float > &x, std::vector< float > &y, glm::ivec2 shape, const UvRect &uv_rect=UvRect::unit(), bool endpoint=false)
 Return x and y coordinates of a regular grid, as two 1D vectors.
void hmap::rescale_grid_from_unit_square_to_bbox (std::vector< float > &x, std::vector< float > &y, const UvRect &uv_rect)
 Rescale 1D grid vectors from unit square [0, 1] to target UV rectangle.
void hmap::rescale_points_to_unit_square (std::vector< float > &x, std::vector< float > &y, const BBox2D &bbox)
 Rescale coordinate (x, y) so that they fit in a unit-square box based on a given initial bounding box.