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
10#pragma once
11#include <vector>
12
13#include "highmap/algebra.hpp"
14#include "highmap/array.hpp"
15
16namespace hmap
17{
18
33int convert_length_to_pixel(float x,
34 int nx,
35 bool lim_inf = true,
36 bool lim_sup = false,
37 float scale = 1.f);
38
47void grid_xy_vector(std::vector<float> &x,
48 std::vector<float> &y,
49 glm::ivec2 shape,
50 glm::vec4 bbox = {0.f, 1.f, 0.f, 1.f},
51 bool endpoint = false);
52
53} // 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:23
Cloud scale(const Cloud &cloud, glm::vec2 scale, glm::vec2 center={0.5f, 0.5f})
Scales the point coordinates in a cloud relative to a center point.
Definition cloud_functions.cpp:165
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:17
void grid_xy_vector(std::vector< float > &x, std::vector< float > &y, glm::ivec2 shape, glm::vec4 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:111