nngn
Loading...
Searching...
No Matches
nngn::term::FrameBuffer Class Reference

#include <frame_buffer.h>

Collaboration diagram for nngn::term::FrameBuffer:

Classes

struct  ColoredPixel
 

Public Types

using Flag = nngn::Graphics::TerminalFlag
 
using Mode = nngn::Graphics::TerminalMode
 
using texel4 = Texture::texel4
 
using Flag = nngn::Graphics::TerminalFlag
 
using Mode = nngn::Graphics::TerminalMode
 
using texel4 = Texture::texel4
 

Public Member Functions

 FrameBuffer (Flag f, Mode m)
 
uvec2 size (void) const
 Size of the frame buffer in pixels.
 
std::span< char > span (void)
 Pointer to the content.
 
std::span< char > prefix (void)
 
std::span< char > pixels (void)
 
std::span< char > suffix (void)
 
void resize_and_clear (uvec2 s)
 Changes the size and clears the content according to the mode.
 
void write_ascii (std::size_t x, std::size_t y, Texture::texel4 color)
 Write pixel at {x, y} with color, ASCII output.
 
void write_colored (std::size_t x, std::size_t y, Texture::texel4 color)
 Write pixel at {x, y} with color, colored output.
 
void flip (void)
 Inverts the Y coord.
 
std::size_t dedup (void)
 Eliminates redundant information, possibly reducing the size.
 
 FrameBuffer (Flag f, Mode m)
 
uvec2 size (void) const
 Size of the frame buffer in pixels.
 
std::span< char > span (void)
 Pointer to the content.
 
std::span< char > prefix (void)
 
std::span< char > pixels (void)
 
std::span< char > suffix (void)
 
void resize_and_clear (uvec2 s)
 Changes the size and clears the content according to the mode.
 
void write_ascii (std::size_t x, std::size_t y, Texture::texel4 color)
 Write pixel at {x, y} with color, ASCII output.
 
void write_colored (std::size_t x, std::size_t y, Texture::texel4 color)
 Write pixel at {x, y} with color, colored output.
 
void flip (void)
 Inverts the Y coord.
 
std::size_t dedup (void)
 Eliminates redundant information, possibly reducing the size.
 

Private Member Functions

std::size_t pixel_size (void) const
 
std::size_t pixel_size (void) const
 

Static Private Member Functions

static constexpr std::size_t prefix_size_from_flags (Flag f)
 
static constexpr std::size_t prefix_size_from_flags (Flag f)
 

Private Attributes

Flags< Flagflags
 
Mode mode
 
std::vector< char > v = {}
 
std::vector< char > flip_tmp = {}
 
std::size_t prefix_size
 
std::size_t suffix_size
 
uvec2 m_size = {}
 

Member Typedef Documentation

◆ Flag [1/2]

◆ Flag [2/2]

◆ Mode [1/2]

◆ Mode [2/2]

◆ texel4 [1/2]

◆ texel4 [2/2]

Constructor & Destructor Documentation

◆ FrameBuffer() [1/2]

nngn::term::FrameBuffer::FrameBuffer ( Flag  f,
Mode  m 
)
inline
Here is the call graph for this function:

◆ FrameBuffer() [2/2]

nngn::term::FrameBuffer::FrameBuffer ( Flag  f,
Mode  m 
)

Member Function Documentation

◆ dedup() [1/2]

std::size_t nngn::term::FrameBuffer::dedup ( void  )

Eliminates redundant information, possibly reducing the size.

Unique elements and the prefix/suffix will be in span(0, dedup()).

Here is the call graph for this function:
Here is the caller graph for this function:

◆ dedup() [2/2]

std::size_t nngn::term::FrameBuffer::dedup ( void  )

Eliminates redundant information, possibly reducing the size.

Unique elements and the prefix/suffix will be in span(0, dedup()).

◆ flip() [1/2]

void nngn::term::FrameBuffer::flip ( void  )

Inverts the Y coord.

of all pixels, must be called before dedup.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ flip() [2/2]

void nngn::term::FrameBuffer::flip ( void  )

Inverts the Y coord.

of all pixels, must be called before dedup.

◆ pixel_size() [1/2]

std::size_t nngn::term::FrameBuffer::pixel_size ( void  ) const
inlineprivate
Here is the caller graph for this function:

◆ pixel_size() [2/2]

std::size_t nngn::term::FrameBuffer::pixel_size ( void  ) const
private

◆ pixels() [1/2]

std::span< char > nngn::term::FrameBuffer::pixels ( void  )
inline
Here is the call graph for this function:
Here is the caller graph for this function:

◆ pixels() [2/2]

std::span< char > nngn::term::FrameBuffer::pixels ( void  )

◆ prefix() [1/2]

std::span< char > nngn::term::FrameBuffer::prefix ( void  )
inline
Here is the caller graph for this function:

◆ prefix() [2/2]

std::span< char > nngn::term::FrameBuffer::prefix ( void  )

◆ prefix_size_from_flags() [1/2]

constexpr std::size_t nngn::term::FrameBuffer::prefix_size_from_flags ( Flag  f)
inlinestaticconstexprprivate
Here is the call graph for this function:

◆ prefix_size_from_flags() [2/2]

static constexpr std::size_t nngn::term::FrameBuffer::prefix_size_from_flags ( Flag  f)
staticconstexprprivate

◆ resize_and_clear() [1/2]

void nngn::term::FrameBuffer::resize_and_clear ( uvec2  s)

Changes the size and clears the content according to the mode.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ resize_and_clear() [2/2]

void nngn::term::FrameBuffer::resize_and_clear ( uvec2  s)

Changes the size and clears the content according to the mode.

◆ size() [1/2]

uvec2 nngn::term::FrameBuffer::size ( void  ) const
inline

Size of the frame buffer in pixels.

Here is the caller graph for this function:

◆ size() [2/2]

uvec2 nngn::term::FrameBuffer::size ( void  ) const
inline

Size of the frame buffer in pixels.

◆ span() [1/2]

std::span< char > nngn::term::FrameBuffer::span ( void  )
inline

Pointer to the content.

Here is the caller graph for this function:

◆ span() [2/2]

std::span< char > nngn::term::FrameBuffer::span ( void  )
inline

Pointer to the content.

◆ suffix() [1/2]

std::span< char > nngn::term::FrameBuffer::suffix ( void  )
inline
Here is the caller graph for this function:

◆ suffix() [2/2]

std::span< char > nngn::term::FrameBuffer::suffix ( void  )

◆ write_ascii() [1/2]

void nngn::term::FrameBuffer::write_ascii ( std::size_t  x,
std::size_t  y,
Texture::texel4  color 
)
inline

Write pixel at {x, y} with color, ASCII output.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ write_ascii() [2/2]

void nngn::term::FrameBuffer::write_ascii ( std::size_t  x,
std::size_t  y,
Texture::texel4  color 
)

Write pixel at {x, y} with color, ASCII output.

◆ write_colored() [1/2]

void nngn::term::FrameBuffer::write_colored ( std::size_t  x,
std::size_t  y,
Texture::texel4  color 
)
inline

Write pixel at {x, y} with color, colored output.

Here is the caller graph for this function:

◆ write_colored() [2/2]

void nngn::term::FrameBuffer::write_colored ( std::size_t  x,
std::size_t  y,
Texture::texel4  color 
)

Write pixel at {x, y} with color, colored output.

Member Data Documentation

◆ flags

Flags< Flag > nngn::term::FrameBuffer::flags
private

◆ flip_tmp

std::vector< char > nngn::term::FrameBuffer::flip_tmp = {}
private

◆ m_size

uvec2 nngn::term::FrameBuffer::m_size = {}
private

◆ mode

Mode nngn::term::FrameBuffer::mode
private

◆ prefix_size

std::size_t nngn::term::FrameBuffer::prefix_size
private

◆ suffix_size

std::size_t nngn::term::FrameBuffer::suffix_size
private

◆ v

std::vector< char > nngn::term::FrameBuffer::v = {}
private

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