Maze Builder Docs 6.0.1
Loading...
Searching...
No Matches
mazes::stringz Class Reference

String helper class. More...

#include <stringz.h>

Static Public Member Functions

static void objectify (const std::unique_ptr< maze > &m, std::vector< std::tuple< int, int, int, int > > &vertices, std::vector< std::vector< std::uint32_t > > &faces, std::string_view sv=std::string_view{}) noexcept
 Compute the 3D geometries of a maze.
 
static void objectify (lab &labyrinth, std::string_view sv=std::string_view{}) noexcept
 Compute the 3D geometries of a maze.
 
static void to_pixels (const std::string &s, std::vector< std::uint8_t > &pixels, int &width, int &height, int stride=4) noexcept
 Converts a string representation of an image to a pixel array.
 
static void to_pixels (const std::unique_ptr< maze > &m, std::vector< std::uint8_t > &pixels, int &width, int &height, int stride=4) noexcept
 Converts a maze to a pixel representation.
 
static std::string stringify (const std::unique_ptr< maze > &m) noexcept
 Convert a maze into a string representation.
 

Detailed Description

String helper class.

This class provides methods to convert mazes into string representations

Member Function Documentation

◆ objectify() [1/2]

static void mazes::stringz::objectify ( const std::unique_ptr< maze > & m,
std::vector< std::tuple< int, int, int, int > > & vertices,
std::vector< std::vector< std::uint32_t > > & faces,
std::string_view sv = std::string_view{} )
staticnoexcept

Compute the 3D geometries of a maze.

Parameters
mthe maze to convert
verticesthe vertices of the maze
facesthe faces of the maze
sthe string representation of the maze

◆ objectify() [2/2]

static void mazes::stringz::objectify ( lab & labyrinth,
std::string_view sv = std::string_view{} )
staticnoexcept

Compute the 3D geometries of a maze.

Parameters
labyrinththe collection of mazes
sv

◆ stringify()

static std::string mazes::stringz::stringify ( const std::unique_ptr< maze > & m)
staticnoexcept

Convert a maze into a string representation.

Parameters
mthe maze to convert
Returns
the string representation

◆ to_pixels() [1/2]

static void mazes::stringz::to_pixels ( const std::string & s,
std::vector< std::uint8_t > & pixels,
int & width,
int & height,
int stride = 4 )
staticnoexcept

Converts a string representation of an image to a pixel array.

Parameters
s
pixelsvector to store the resulting pixel data
widthinteger reference to store the width of the image
heightinteger reference to store the height of the image

◆ to_pixels() [2/2]

static void mazes::stringz::to_pixels ( const std::unique_ptr< maze > & m,
std::vector< std::uint8_t > & pixels,
int & width,
int & height,
int stride = 4 )
staticnoexcept

Converts a maze to a pixel representation.

Parameters
mA unique pointer to the maze object to be converted.
pixelsA vector to store the resulting pixel data.
widthAn integer reference to store the width of the pixel data.
heightAn integer reference to store the height of the pixel data.
strideThe number of bytes per row in the pixel data.

The documentation for this class was generated from the following file: