Skip to content

Use in embedded system #13

@X-Ryl669

Description

@X-Ryl669

I'm wondering how hard it would be to use this on embedded system (like a ESP32, in esp-idf or a STM32 dev board).
It already has numerous features that are required for embedded system, like no dynamic malloc, simple code base hence also small binary size. I haven't tested the speed but I'm sure it's not too bad, the code is well written and clearly readable.

However, other libraries usually implements theses features:

  1. Windowed rendering. On embedded CPU, the RAM memory is very limited, it's not possible to store a complete RGBA buffer for the whole output screen in memory (or very slowly with PSRAM on ESP32). So all libraries implement a trick: only store a fraction of the RGBA buffer (for example 1/16th of the buffer, or 10 lines) so it can fit in SRAM, and render 1/fraction times, each time only clipping in what's displayed (for example, the first render will render any path in from y = 0 to y = height/16 - 1, then the second render will be for height/16 to 2*height/16 and so on)
  2. Abstracting the buffer pixel type (I think it's not too hard to template the RGBA type in the code to support 16bits 5.6.5 RGB that many screens supports or 1bit pixels for monochrome screens)
  3. Implementing double buffering and callbacks when some rendering is done. Typically, once a buffer is rendered, it's sent via DMA to the screen and the rendering continues on another buffer, doubling the achievable FPS.
  4. (optional) Implementing a kind of damage tracking. Since many screens are SPI based, and thus have a very limited bus bandwidth, the screen itself stores its pixels' state, there's no point in sending twice the same pixel. It's possible to only update part of the screen (a region of interest). Thus the library can be modified to reset and compute the union of modified bounding box area while drawing so only the modified area is rendered and resent to the screen. Once the whole screen is rendered, the damage area is reset and can be used for the next frame.

Do you think it'd be possible to add these feature set (if they both match your development goals and pick up your interest)?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions