const MAX_DIMENSION
pub const MAX_DIMENSION = 32768Purpose
Logical coordinates and RGB565 colors are independent of the controller, bus, and wire byte order. Backends receive clipped, synchronous operations.
#embedded/displayStandard library package `#embedded/display`.
const MAX_DIMENSIONpub const MAX_DIMENSION = 32768Logical coordinates and RGB565 colors are independent of the controller, bus, and wire byte order. Backends receive clipped, synchronous operations.
struct Surface#Tpub struct Surface#T {
pub backend T
}Typed backend ownership avoids globals, erased context pointers and an escaping borrow of driver state. Only board/driver code uses backend.
backend Tcreatepub fn create#T(width int, height int, backend T, fill fn($&T, &geometry.Rect, int) bool, write fn($&T, &geometry.Span, &[]int) bool) Surface#TCreate a new file, directory, or resource.
width intheight intbackend Tfill fn($&T, &geometry.Rect, int) boolwrite fn($&T, &geometry.Span, &[]int) boolSurface#T — a value of this type
(&Surface#T) widthpub fn (surface &Surface#T) width() intExecute width on &Surface#T.
surface &Surface#TSurface#T instance used by this call (borrow).int — a value of this type
(&Surface#T) heightpub fn (surface &Surface#T) height() intExecute height on &Surface#T.
surface &Surface#TSurface#T instance used by this call (borrow).int — a value of this type
(&Surface#T) validpub fn (surface &Surface#T) valid() boolOperation on &Surface#T: whether the value is valid.
surface &Surface#TSurface#T instance used by this call (borrow).bool — true or false
($&Surface#T) fill_rectpub fn (surface $&Surface#T) fill_rect(x int, y int, width int, height int, color int) boolOperation on $&Surface#T: fill rectangle.
surface $&Surface#TSurface#T instance used by this call (exclusive borrow).x inty intwidth intheight intcolor intbool — true or false
($&Surface#T) clearpub fn (surface $&Surface#T) clear(color int) boolClear all buffered or stored entries and internal state.
surface $&Surface#TSurface#T instance used by this call (exclusive borrow).color intbool — true or false
($&Surface#T) write_rgb565pub fn (surface $&Surface#T) write_rgb565(x int, y int, pixels &[]int, count int) boolOne horizontal row of count logical RGB565 values (one integer per pixel). Buffers may be reused immediately after this call; a backend must not retain their borrow. Clipping adjusts the source offset without copying pixels.
surface $&Surface#TSurface#T instance used by this call (exclusive borrow).x inty intpixels &[]intcount intbool — true or false