|
| | FrameBuffer ()=default |
| | Creates an empty framebuffer.
|
| |
| | FrameBuffer (size_t width, size_t height, IFont< RGB_T > &font) |
| | Creates a framebuffer with the specified size and font.
|
| |
| bool | begin () override |
| | Initializes the framebuffer surface.
|
| |
| void | end () override |
| | Closes the framebuffer and releases resources.
|
| |
| void | setTouchDriver (TouchDriver &touch) |
| |
| SpriteInfo< RGB_T, SurfaceT > & | addSprite (size_t x, size_t y, const ISurface< RGB_T > &sprite, RGB_T invisibleColor=RGB_T(0)) |
| | Adds a sprite to the framebuffer and draws it at the given position.
|
| |
| SpriteInfo< RGB_T, SurfaceT > & | addSprite (size_t x, size_t y, size_t maxX, size_t maxY, const ISurface< RGB_T > &sprite, RGB_T invisibleColor=RGB_T(0)) |
| | Adds a sprite with a preallocated max buffer size for transformations.
|
| |
| void | removeSprite (SpriteInfo< RGB_T, SurfaceT > &spriteInfo) |
| | Removes a sprite and restores the pixels behind it.
|
| |
| SpriteInfo< RGB_T, SurfaceT > * | getSprite (size_t x, size_t y) |
| | Returns a pointer to the sprite at the given position, if any.
|
| |
| size_t | getSpriteCount () const |
| | Returns the number of sprites currently managed by the framebuffer.
|
| |
| SpriteInfo< RGB_T, SurfaceT > * | getSprite (int idx) |
| | Returns a pointer to the sprite at the given index, if valid.
|
| |
| SpriteInfo< RGB_T, SurfaceT > * | getSpritePtr (int idx) |
| |
| void | moveSprite (SpriteInfo< RGB_T, SurfaceT > &spriteInfo, size_t newX, size_t newY) |
| | Moves a sprite to a new position and redraws it.
|
| |
| void | scaleSprite (SpriteInfo< RGB_T, SurfaceT > &spriteInfo, float scale) |
| |
| void | rotateSprite (SpriteInfo< RGB_T, SurfaceT > &spriteInfo, float angleDegrees) |
| |
| void | setPixel (size_t x, size_t y, RGB_T color) override |
| | ISurface<RGB_T> interface delegation.
|
| |
| RGB_T | getPixel (size_t x, size_t y) const override |
| | Returns the pixel at the given position.
|
| |
| bool | resize (size_t w, size_t h) override |
| | Resizes the framebuffer surface.
|
| |
| size_t | width () const override |
| | Returns the framebuffer width in pixels.
|
| |
| size_t | height () const override |
| | Returns the framebuffer height in pixels.
|
| |
| void | setFont (IFont< RGB_T > &font) |
| | Sets the font for text rendering.
|
| |
| IFont< RGB_T > & | font () |
| | Returns the currently set font for text rendering.
|
| |
| void | clear (RGB_T color=RGB_T()) |
| | Clears the framebuffer with a single color.
|
| |
| void | scroll (int dx, int dy) override |
| | Scrolls the framebuffer content by the specified offsets.
|
| |
| void | drawLine (size_t x0, size_t y0, size_t x1, size_t y1, RGB_T color) |
| | Draws a line between two points.
|
| |
| void | drawRect (size_t x, size_t y, size_t w, size_t h, RGB_T color) |
| | Draws a rectangle outline.
|
| |
| void | fillRect (size_t x, size_t y, size_t w, size_t h, RGB_T color) |
| | Fills a rectangle.
|
| |
| void | drawCircle (size_t x, size_t y, size_t r, RGB_T color) |
| | Draws a circle outline.
|
| |
| void | fillCircle (size_t x, size_t y, size_t r, RGB_T color) |
| | Fills a circle.
|
| |
| void | drawSprite (size_t x, size_t y, const ISurface< RGB_T > &sprite, RGB_T invisibleColor=RGB_T()) |
| | Draws a sprite.
|
| |
| void | clearSprite (size_t x, size_t y, ISurface< RGB_T > &sprite, RGB_T clearColor=RGB_T()) |
| | Clears a sprite.
|
| |
| void | copySprite (size_t x, size_t y, const ISurface< RGB_T > &sprite) |
| | Copies a sprite.
|
| |
| void | drawText (int16_t x, int16_t y, const char *text, RGB_T foreground, RGB_T background=RGB_T(), bool opaque=false, uint8_t scale=1, uint8_t spacing=1, uint8_t lineSpacing=1) |
| | Draws UTF-8 text.
|
| |
| LinePrinter< RGB_T > & | linePrinter () |
| | Returns the line printer for text rendering.
|
| |
| bool | isInBounds (size_t x, size_t y) const |
| | Checks if the given coordinates are within the surface bounds.
|
| |
| void | setPixelClipped (size_t x, size_t y, RGB_T color) |
| | Sets a pixel with clipping.
|
| |
| void | drawHorizontalLineClipped (int x0, int x1, int y, RGB_T color) |
| | Draws a horizontal line with clipping.
|
| |
| const uint8_t * | data () const override |
| | Returns the raw pixel buffer as bytes.
|
| |
| size_t | size () const override |
| | Returns the size of the buffer in bytes.
|
| |
| bool | setData (uint8_t *data, size_t dataSize) |
| | Sets the framebuffer pixel data directly, replacing the current content.
|
| |
| bool | contains (size_t x, size_t y) override |
| | checks if the given coordinates are within the surface bounds.
|
| |
| void | processTouch () |
| | Processes touch input and dispatches events to sprites if touched.
|
| |
| virtual | ~ISurface ()=default |
| | Destroys the framebuffer interface.
|
| |
| virtual bool | begin ()=0 |
| | Initializes the framebuffer surface.
|
| |
| virtual void | end ()=0 |
| | Closes the framebuffer and releases resources.
|
| |
| virtual bool | resize (size_t newWidth, size_t newHeight)=0 |
| | Resizes the framebuffer surface.
|
| |
| virtual void | setPixel (size_t x, size_t y, RGB_T color)=0 |
| | Sets a pixel at the given position.
|
| |
| virtual RGB_T | getPixel (size_t x, size_t y) const =0 |
| | Returns the pixel at the given position.
|
| |
| virtual void | scroll (int dx, int dy)=0 |
| | Scrolls the framebuffer content by the specified offsets.
|
| |
| virtual void | clear (RGB_T color=RGB_T(0))=0 |
| | Clears the framebuffer with a single color.
|
| |
| virtual void | drawLine (size_t x0, size_t y0, size_t x1, size_t y1, RGB_T color)=0 |
| | Draws a line between two points.
|
| |
| virtual void | drawRect (size_t x, size_t y, size_t w, size_t h, RGB_T color)=0 |
| | Draws a rectangle outline.
|
| |
| virtual void | fillRect (size_t x, size_t y, size_t w, size_t h, RGB_T color)=0 |
| | Fills a rectangle.
|
| |
| virtual void | drawCircle (size_t x, size_t y, size_t r, RGB_T color)=0 |
| | Draws a circle outline.
|
| |
| virtual void | fillCircle (size_t x, size_t y, size_t r, RGB_T color)=0 |
| | Fills a circle.
|
| |
| virtual void | drawRoundRect (size_t x, size_t y, size_t w, size_t h, size_t radius, RGB_T color) |
| |
| virtual void | fillRoundRect (size_t x, size_t y, size_t w, size_t h, size_t radius, RGB_T color) |
| |
| virtual void | drawArc (size_t cx, size_t cy, size_t r, float startDeg, float endDeg, RGB_T color, uint8_t thickness=1) |
| |
| virtual void | drawSprite (size_t x, size_t y, const ISurface< RGB_T > &sprite, RGB_T invisibleColor=RGB_T(0))=0 |
| | Draws a sprite using an optional transparent color.
|
| |
| virtual void | clearSprite (size_t x, size_t y, ISurface< RGB_T > &sprite, RGB_T clearColor=RGB_T(0))=0 |
| | Clears the area covered by a sprite.
|
| |
| virtual void | copySprite (size_t x, size_t y, const ISurface< RGB_T > &sprite)=0 |
| | Copies pixels from the framebuffer into a sprite.
|
| |
| virtual size_t | width () const =0 |
| | Returns the framebuffer width in pixels.
|
| |
| virtual size_t | height () const =0 |
| | Returns the framebuffer height in pixels.
|
| |
| virtual void | drawText (int16_t x, int16_t y, const char *text, RGB_T foreground, RGB_T background=RGB_T(0), bool opaque=false, uint8_t scale=1, uint8_t spacing=1, uint8_t lineSpacing=1)=0 |
| | Draws UTF-8 text using the configured font.
|
| |
| virtual IFont< RGB_T > & | font ()=0 |
| | Returns the currently set font for text rendering.
|
| |
| virtual const uint8_t * | data () const =0 |
| | Provides access to the framebuffer as a byte buffer.
|
| |
| virtual size_t | size () const =0 |
| | Provides the total data size in bytes.
|
| |
| virtual bool | contains (size_t x, size_t y)=0 |
| | Checks if the given coordinates are within the surface bounds.
|
| |
| virtual void | pushClipRect (size_t x, size_t y, size_t w, size_t h) |
| |
| virtual void | popClipRect () |
| |
| virtual bool | isClipVisible (size_t x, size_t y) const |
| |
template<typename RGB_T = RGB565, typename SurfaceT = Surface<RGB_T>>
class tinygpu::FrameBuffer< RGB_T, SurfaceT >
Framebuffer with sprite placement and background restoration support.
The class extends TinyGPU with sprite bookkeeping so sprites can be added, moved, scaled, and removed while preserving the pixels behind them.