16#include <Adafruit_GFX.h>
34 [[nodiscard]]
bool ok()
const {
return bits_ !=
nullptr; }
36 void drawPixel(int16_t x, int16_t y, uint16_t color)
override;
42 [[nodiscard]]
const uint8_t*
buffer()
const {
return bits_; }
45 [[nodiscard]] uint16_t
strideBytes()
const {
return stride_; }
48 [[nodiscard]]
size_t byteSize()
const {
return static_cast<size_t>(stride_) * HEIGHT; }
51 uint8_t* bits_ =
nullptr;
uint16_t strideBytes() const
Bytes per packed row, (width + 7) / 8.
void clear()
Clears the surface to white.
MonoSurface & operator=(const MonoSurface &)=delete
MonoSurface(uint16_t w, uint16_t h)
Allocates a w x h 1-bpp surface in PSRAM, cleared to white.
const uint8_t * buffer() const
Packed pixel rows, strideBytes() * height() bytes.
size_t byteSize() const
Total packed byte size.
bool ok() const
True when the buffer allocation succeeded.
MonoSurface(const MonoSurface &)=delete
void drawPixel(int16_t x, int16_t y, uint16_t color) override
Centralized key-code constants for cdc_views.