ISF15ACP4 Driver 1.0.0
API reference
Loading...
Searching...
No Matches
Public Member Functions | Private Attributes | List of all members
isf15acp4::Canvas Class Reference

CPU-side RGB565 framebuffer with basic drawing operations. More...

#include <isf15acp4_canvas.hpp>

Collaboration diagram for isf15acp4::Canvas:
[legend]

Public Member Functions

 Canvas (ProductVariant variant=ProductVariant::Isf15acp4) noexcept
 Construct a canvas for the given product geometry.
 
void Clear (Color565 color) noexcept
 Clear the framebuffer to a solid color.
 
void SetPixel (uint8_t x, uint8_t y, Color565 color) noexcept
 Set one pixel if in bounds.
 
Color565 GetPixel (uint8_t x, uint8_t y) const noexcept
 Get one pixel; returns black when out of bounds.
 
void DrawHLine (uint8_t x0, uint8_t x1, uint8_t y, Color565 color) noexcept
 Draw a horizontal line inclusive of both endpoints.
 
void DrawVLine (uint8_t x, uint8_t y0, uint8_t y1, Color565 color) noexcept
 Draw a vertical line inclusive of both endpoints.
 
void DrawRect (const Rect &rect, Color565 color) noexcept
 Draw rectangle outline.
 
void FillRect (const Rect &rect, Color565 color) noexcept
 Fill a solid rectangle.
 
void DrawChar (uint8_t x, uint8_t y, char ch, Color565 color, Color565 bg=colors::Black) noexcept
 Draw a single character using the built-in 5x7 font.
 
void DrawString (uint8_t x, uint8_t y, const char *text, Color565 color, Color565 bg=colors::Black) noexcept
 Draw a null-terminated string.
 
void BlitRgb565 (uint8_t x, uint8_t y, uint8_t src_width, uint8_t src_height, const Color565 *src) noexcept
 Blit a contiguous RGB565 buffer into the canvas.
 
uint8_t Width () const noexcept
 
uint8_t Height () const noexcept
 
std::size_t ByteSize () const noexcept
 
const Color565 * Data () const noexcept
 
Color565 * Data () noexcept
 

Private Attributes

DisplayGeometry geometry_
 
Color565 buffer_ [96 *64]
 

Detailed Description

CPU-side RGB565 framebuffer with basic drawing operations.

The canvas stores pixels in row-major RGB565 order matching the SSD1331 download format for the selected product variant.

Constructor & Destructor Documentation

◆ Canvas()

isf15acp4::Canvas::Canvas ( ProductVariant  variant = ProductVariant::Isf15acp4)
inlineexplicitnoexcept

Construct a canvas for the given product geometry.

Parameters
variantTarget SmartDisplay variant.

Member Function Documentation

◆ BlitRgb565()

void isf15acp4::Canvas::BlitRgb565 ( uint8_t  x,
uint8_t  y,
uint8_t  src_width,
uint8_t  src_height,
const Color565 *  src 
)
inlinenoexcept

Blit a contiguous RGB565 buffer into the canvas.

Parameters
xDestination X.
yDestination Y.
src_widthSource image width in pixels.
src_heightSource image height in pixels.
srcSource RGB565 pixels (row-major).

◆ ByteSize()

std::size_t isf15acp4::Canvas::ByteSize ( ) const
inlinenoexcept

◆ Clear()

void isf15acp4::Canvas::Clear ( Color565  color)
inlinenoexcept

Clear the framebuffer to a solid color.

◆ Data() [1/2]

const Color565 * isf15acp4::Canvas::Data ( ) const
inlinenoexcept

◆ Data() [2/2]

Color565 * isf15acp4::Canvas::Data ( )
inlinenoexcept

◆ DrawChar()

void isf15acp4::Canvas::DrawChar ( uint8_t  x,
uint8_t  y,
char  ch,
Color565  color,
Color565  bg = colors::Black 
)
inlinenoexcept

Draw a single character using the built-in 5x7 font.

◆ DrawHLine()

void isf15acp4::Canvas::DrawHLine ( uint8_t  x0,
uint8_t  x1,
uint8_t  y,
Color565  color 
)
inlinenoexcept

Draw a horizontal line inclusive of both endpoints.

◆ DrawRect()

void isf15acp4::Canvas::DrawRect ( const Rect &  rect,
Color565  color 
)
inlinenoexcept

Draw rectangle outline.

◆ DrawString()

void isf15acp4::Canvas::DrawString ( uint8_t  x,
uint8_t  y,
const char *  text,
Color565  color,
Color565  bg = colors::Black 
)
inlinenoexcept

Draw a null-terminated string.

◆ DrawVLine()

void isf15acp4::Canvas::DrawVLine ( uint8_t  x,
uint8_t  y0,
uint8_t  y1,
Color565  color 
)
inlinenoexcept

Draw a vertical line inclusive of both endpoints.

◆ FillRect()

void isf15acp4::Canvas::FillRect ( const Rect &  rect,
Color565  color 
)
inlinenoexcept

Fill a solid rectangle.

◆ GetPixel()

Color565 isf15acp4::Canvas::GetPixel ( uint8_t  x,
uint8_t  y 
) const
inlinenoexcept

Get one pixel; returns black when out of bounds.

◆ Height()

uint8_t isf15acp4::Canvas::Height ( ) const
inlinenoexcept

◆ SetPixel()

void isf15acp4::Canvas::SetPixel ( uint8_t  x,
uint8_t  y,
Color565  color 
)
inlinenoexcept

Set one pixel if in bounds.

◆ Width()

uint8_t isf15acp4::Canvas::Width ( ) const
inlinenoexcept

Member Data Documentation

◆ buffer_

Color565 isf15acp4::Canvas::buffer_[96 *64]
private

◆ geometry_

DisplayGeometry isf15acp4::Canvas::geometry_
private

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