HighMap library (C++)
Loading...
Searching...
No Matches
sdf.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
12#pragma once
13
14#include "highmap/array.hpp"
16
17namespace hmap
18{
19
47Array sdf_2d_polyline(const Path &path,
48 glm::ivec2 shape,
49 glm::vec4 bbox = {0.f, 1.f, 0.f, 1.f},
50 const Array *p_noise_x = nullptr,
51 const Array *p_noise_y = nullptr);
52
55Array sdf_2d_polyline_bezier(const Path &path,
56 glm::ivec2 shape,
57 glm::vec4 bbox = {0.f, 1.f, 0.f, 1.f},
58 const Array *p_noise_x = nullptr,
59 const Array *p_noise_y = nullptr);
60
61} // namespace hmap
62
63namespace hmap::gpu
64{
65
67Array sdf_2d_polyline(const Path &path,
68 glm::ivec2 shape,
69 glm::vec4 bbox = {0.f, 1.f, 0.f, 1.f},
70 const Array *p_noise_x = nullptr,
71 const Array *p_noise_y = nullptr);
72
74Array sdf_2d_polyline_bezier(const Path &path,
75 glm::ivec2 shape,
76 glm::vec4 bbox = {0.f, 1.f, 0.f, 1.f},
77 const Array *p_noise_x = nullptr,
78 const Array *p_noise_y = nullptr);
79
80} // namespace hmap::gpu
Declaration of the Array class for 2D floating-point arrays with various mathematical operations and ...
Definition blending.hpp:186
Array sdf_2d_polyline_bezier(const Path &path, glm::ivec2 shape, glm::vec4 bbox={0.f, 1.f, 0.f, 1.f}, const Array *p_noise_x=nullptr, const Array *p_noise_y=nullptr)
See hmap::sdf_2d_polyline_bezier.
Definition sdf_2d_polyline_gpu.cpp:59
Array sdf_2d_polyline(const Path &path, glm::ivec2 shape, glm::vec4 bbox={0.f, 1.f, 0.f, 1.f}, const Array *p_noise_x=nullptr, const Array *p_noise_y=nullptr)
See hmap::sdf_2d_polyline.
Definition sdf_2d_polyline_gpu.cpp:15
Definition algebra.hpp:22
Array sdf_2d_polyline(const Path &path, glm::ivec2 shape, glm::vec4 bbox={0.f, 1.f, 0.f, 1.f}, const Array *p_noise_x=nullptr, const Array *p_noise_y=nullptr)
Computes the signed distance field (SDF) of a 2D polyline.
Definition sdf_2d_polyline.cpp:14
Array sdf_2d_polyline_bezier(const Path &path, glm::ivec2 shape, glm::vec4 bbox={0.f, 1.f, 0.f, 1.f}, const Array *p_noise_x=nullptr, const Array *p_noise_y=nullptr)
See hmap::sdf_2d_polyline, with a Bezier approximation of the path.
Definition sdf_2d_polyline.cpp:65
Path class for manipulating and analyzing paths in 2D space.