HighMap library (C++)
Loading...
Searching...
No Matches
grids.hpp
Go to the documentation of this file.
1/* Copyright (c) 2023 Otto Link. Distributed under the terms of the GNU General
2 Public License. The full license is in the file LICENSE, distributed with
3 this software. */
4
19#pragma once
20#include <vector>
21
22#include "highmap/algebra.hpp"
23#include "highmap/array.hpp"
24
25namespace hmap
26{
27
42int convert_length_to_pixel(float x,
43 int nx,
44 bool lim_inf = true,
45 bool lim_sup = false,
46 float scale = 1.f);
47
56void grid_xy_vector(std::vector<float> &x,
57 std::vector<float> &y,
58 Vec2<int> shape,
59 Vec4<float> bbox = {0.f, 1.f, 0.f, 1.f},
60 bool endpoint = false);
61
62} // namespace hmap
Header file defining basic vector and matrix manipulation classes.
Declaration of the Array class for 2D floating-point arrays with various mathematical operations and ...
Definition algebra.hpp:28
void 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.
Definition grid.cpp:109
int 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.
Definition grid.cpp:15