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, Vec4< float > bbox={0.f, 1.f, 0.f, 1.f})
 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, Vec4< float > bbox={0.f, 1.f, 0.f, 1.f}, 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, Vec4< float > bbox={0.f, 1.f, 0.f, 1.f}, 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, Vec2< int > shape, Vec4< float > bbox={0.f, 1.f, 0.f, 1.f}, 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, Vec4< float > bbox)
 
void hmap::rescale_points_to_unit_square (std::vector< float > &x, std::vector< float > &y, Vec4< float > bbox)
 Rescale coordinate (x, y) so that they fit in a unit-square box based on a given initial bounding box.