CDC Badge OS
Firmware for the CDC Badge v1.0 hardware security key
Loading...
Searching...
No Matches
cdc::ui::MonoSurface Class Reference

#include <MonoSurface.h>

Inheritance diagram for cdc::ui::MonoSurface:

Public Member Functions

 MonoSurface (uint16_t w, uint16_t h)
 Allocates a w x h 1-bpp surface in PSRAM, cleared to white.
 ~MonoSurface () override
 MonoSurface (const MonoSurface &)=delete
MonoSurfaceoperator= (const MonoSurface &)=delete
bool ok () const
 True when the buffer allocation succeeded.
void drawPixel (int16_t x, int16_t y, uint16_t color) override
void clear ()
 Clears the surface to white.
const uint8_t * buffer () const
 Packed pixel rows, strideBytes() * height() bytes.
uint16_t strideBytes () const
 Bytes per packed row, (width + 7) / 8.
size_t byteSize () const
 Total packed byte size.

Detailed Description

Definition at line 20 of file MonoSurface.h.

Constructor & Destructor Documentation

◆ MonoSurface() [1/2]

cdc::ui::MonoSurface::MonoSurface ( uint16_t w,
uint16_t h )

Allocates a w x h 1-bpp surface in PSRAM, cleared to white.

Parameters
wWidth in pixels.
hHeight in pixels.

Definition at line 14 of file MonoSurface.cpp.

Referenced by MonoSurface(), and operator=().

◆ ~MonoSurface()

cdc::ui::MonoSurface::~MonoSurface ( )
override

Definition at line 23 of file MonoSurface.cpp.

◆ MonoSurface() [2/2]

cdc::ui::MonoSurface::MonoSurface ( const MonoSurface & )
delete

References MonoSurface().

Member Function Documentation

◆ buffer()

const uint8_t * cdc::ui::MonoSurface::buffer ( ) const
inlinenodiscard

Packed pixel rows, strideBytes() * height() bytes.

Definition at line 42 of file MonoSurface.h.

Referenced by cdc::ui::CanvasView::marquee().

◆ byteSize()

size_t cdc::ui::MonoSurface::byteSize ( ) const
inlinenodiscard

Total packed byte size.

Definition at line 48 of file MonoSurface.h.

Referenced by clear(), and cdc::ui::CanvasView::marquee().

◆ clear()

void cdc::ui::MonoSurface::clear ( )

Clears the surface to white.

Definition at line 35 of file MonoSurface.cpp.

References byteSize().

◆ drawPixel()

void cdc::ui::MonoSurface::drawPixel ( int16_t x,
int16_t y,
uint16_t color )
override

Definition at line 27 of file MonoSurface.cpp.

◆ ok()

bool cdc::ui::MonoSurface::ok ( ) const
inlinenodiscard

True when the buffer allocation succeeded.

Definition at line 34 of file MonoSurface.h.

Referenced by cdc::ui::CanvasView::marquee().

◆ operator=()

MonoSurface & cdc::ui::MonoSurface::operator= ( const MonoSurface & )
delete

References MonoSurface().

◆ strideBytes()

uint16_t cdc::ui::MonoSurface::strideBytes ( ) const
inlinenodiscard

Bytes per packed row, (width + 7) / 8.

Definition at line 45 of file MonoSurface.h.


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