43 CellPath(
const std::vector<glm::ivec2> &indices);
49 CellPath(std::vector<glm::ivec2> &&indices)
noexcept;
58 std::vector<glm::ivec2>::iterator
begin() noexcept;
63 std::vector<glm::ivec2>::const_iterator
begin() const noexcept;
68 std::vector<glm::ivec2>::iterator
end() noexcept;
73 std::vector<glm::ivec2>::const_iterator
end() const noexcept;
83 const glm::ivec2 &
front() const;
93 const glm::ivec2 &
back() const;
99 glm::ivec2 &operator[](
size_t index);
105 const glm::ivec2 &operator[](
size_t index) const;
110 void clear() noexcept;
116 bool empty() const noexcept;
128 size_t size() const noexcept;
140 const std::vector<glm::ivec2> &
get_indices() const;
143 std::vector<glm::ivec2> indices;
186 const glm::ivec2 &shape,
190 float persistence = 0.5
f,
191 float lacunarity = 2.
f);
bool empty() const noexcept
Check whether the cell path is empty.
Definition cell_path.cpp:47
size_t size() const noexcept
Get the number of cells in the path.
Definition cell_path.cpp:97
std::vector< glm::ivec2 >::iterator end() noexcept
Return an iterator to the end.
Definition cell_path.cpp:52
void push_back(const glm::ivec2 &idx)
Add a cell index to the end of the path.
Definition cell_path.cpp:92
glm::ivec2 & front()
Access the first element.
Definition cell_path.cpp:62
CellPath()=default
Construct a new CellPath object.
glm::ivec2 & back()
Access the last element.
Definition cell_path.cpp:22
std::vector< glm::ivec2 >::iterator begin() noexcept
Return an iterator to the beginning.
Definition cell_path.cpp:32
void clear() noexcept
Clear all cell indices.
Definition cell_path.cpp:42
std::vector< glm::ivec2 > & get_indices()
Get the cell indices.
Definition cell_path.cpp:72
void enforce_path_adjacency(CellPath &path)
Ensures that an integer path is grid-adjacent and gap-free.
Definition add_noise.cpp:121
void add_line_bresenham(CellPath &out, glm::ivec2 a, glm::ivec2 b)
Rasterizes a segment between two integer points using Bresenham's algorithm.
Definition add_noise.cpp:21
bool is_path_adjacent(const CellPath &path)
Checks if a grid path has no gaps (8-connectivity).
Definition add_noise.cpp:154
NoiseType
Enumeration of various noise types used for procedural generation.
Definition functions.hpp:67
@ PERLIN
Perlin.
Definition functions.hpp:69
void add_noise(CellPath &path, std::uint32_t seed, float kw, float amp, const glm::ivec2 &shape, NoiseType noise_type=NoiseType::PERLIN, int octaves=8, float weight=0.7f, float persistence=0.5f, float lacunarity=2.f)
Applies transverse noise displacement along an integer path.
Definition add_noise.cpp:56