pub struct StatusImage { /* private fields */ }Expand description
A small runtime RGBA image for a status item: charts, meters, or a grid of results.
Rows run top to bottom; samples are tightly packed, non-premultiplied sRGB RGBA8.
scale is pixels per logical point (2 for Retina). This owns its bytes, independent of
any window or decoded-image registry. Currently rendered by AppKit; other backends use
StatusItemSpec::icon as a fallback. See docs/status-item.md.
Implementations§
Source§impl StatusImage
impl StatusImage
Sourcepub fn rgba(
width: u32,
height: u32,
scale: f64,
pixels: impl Into<Arc<[u8]>>,
) -> Option<Self>
pub fn rgba( width: u32, height: u32, scale: f64, pixels: impl Into<Arc<[u8]>>, ) -> Option<Self>
Validate a runtime image. Rejects empty/mismatched pixels, invalid scales, and images exceeding 16 MiB or 4096 logical points on either axis. No platform allocation occurs.
pub fn width(&self) -> u32
pub fn height(&self) -> u32
pub fn scale(&self) -> f64
pub fn pixels(&self) -> &[u8] ⓘ
pub fn size(&self) -> Size
Trait Implementations§
Source§impl Clone for StatusImage
impl Clone for StatusImage
Source§fn clone(&self) -> StatusImage
fn clone(&self) -> StatusImage
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for StatusImage
impl Debug for StatusImage
Source§impl PartialEq for StatusImage
impl PartialEq for StatusImage
impl StructuralPartialEq for StatusImage
Auto Trait Implementations§
impl Freeze for StatusImage
impl RefUnwindSafe for StatusImage
impl Send for StatusImage
impl Sync for StatusImage
impl Unpin for StatusImage
impl UnsafeUnpin for StatusImage
impl UnwindSafe for StatusImage
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