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 Vec2<int> shape,
49 Vec4<float> 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 Vec2<int> shape,
57 Vec4<float> 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 Vec2<int> shape,
69 Vec4<float> 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 Vec2<int> shape,
76 Vec4<float> 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:151
Array sdf_2d_polyline_bezier(const Path &path, Vec2< int > shape, Vec4< float > 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, Vec2< int > shape, Vec4< float > 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:28
Array sdf_2d_polyline_bezier(const Path &path, Vec2< int > shape, Vec4< float > 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
Array sdf_2d_polyline(const Path &path, Vec2< int > shape, Vec4< float > 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
Path class for manipulating and analyzing paths in 2D space.