Enum kernel::services::emb_display::FrameChunk
source · #[non_exhaustive]pub enum FrameChunk {
Mono(MonoChunk),
}
Expand description
A drawable buffer
The FrameChunk represents a section of allocated memory that can be drawn into. It can be one of multiple “kinds” of buffer, representing different color and transparency depths.
Users may use any kind of buffer they’d like, and displays are expected to convert to a format that they can use, for example down or upsampling color depth, converting color to grayscale, etc.
This FrameChunk is passed to EmbDisplayClient::draw() to be rendered to the display
§Subsizing
This frame chunk is expected to be equal or smaller than the total display itself, and each of the kinds of framechunk will have metadata that contains both the position and the size of the framechunk. Framechunks can be moved but not resized (if resizing is necessary, the current chunk should be dropped and a new one should be allocated).
§Transparency
FrameChunks also have a transparency component, which allows them to be used for blitting or compositing onto the final display image.
For example, a circle with radius of 80 pixels could be drawn in a 100x100 FrameChunk, with the area outside of the circle marked as transparent. This allows the 100x100 square to be “blitted” at the target location without overwriting the existing content or background outside the circle.
This could also be used to keep persistently drawn sprites in memory, layering them onto the target frame.
All FrameChunk kinds have some kind of transparency, though this may range from a single bit transparency (transparent or not), to a more complex alpha channel