pub struct ColorFormat(pub lv_color_format_t);Expand description
LVGL color format selector (matches LV_COLOR_FORMAT_*).
Tuple Fields§
§0: lv_color_format_tImplementations§
Source§impl ColorFormat
impl ColorFormat
pub const I1: Self
pub const A8: Self
pub const RGB565: Self
pub const RGB888: Self
pub const ARGB8888: Self
pub const XRGB8888: Self
Sourcepub const fn bpp(self) -> Option<usize>
pub const fn bpp(self) -> Option<usize>
Bytes per pixel for this format.
Returns None for unknown formats — the inner field is public,
so callers can construct arbitrary lv_color_format_t values
that aren’t one of the named constants. Match None if you
receive a ColorFormat from raw FFI; otherwise use one of the
associated constants (I1, A8, RGB565, RGB888, ARGB8888,
XRGB8888) and unwrap() is safe.
I1 returns Some(0) — the format is sub-byte per pixel and
callers must size the canvas buffer externally (one bit per pixel,
rounded up to a whole byte per row).
Trait Implementations§
Source§impl Clone for ColorFormat
impl Clone for ColorFormat
Source§fn clone(&self) -> ColorFormat
fn clone(&self) -> ColorFormat
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreimpl Copy for ColorFormat
Auto Trait Implementations§
impl Freeze for ColorFormat
impl RefUnwindSafe for ColorFormat
impl Send for ColorFormat
impl Sync for ColorFormat
impl Unpin for ColorFormat
impl UnsafeUnpin for ColorFormat
impl UnwindSafe for ColorFormat
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more