pub struct Image {
pub size: u32,
pub width: u32,
pub height: u32,
pub hotspot: (u32, u32),
pub delay: u32,
pub bgra: Vec<u8>,
}Expand description
One cursor image (a single size — one XCursor frame).
Pixels are premultiplied BGRA, 4 bytes per pixel, row-major — exactly the XCursor on-disk pixel format (little-endian ARGB), which is also what Windows alpha cursors want; macOS swaps to RGBA on install.
Fields§
§size: u32The nominal size this frame serves (the XCursor TOC subtype). Usually
equals width, but themes may pad.
width: u32§height: u32§hotspot: (u32, u32)Hotspot in pixels, from the top-left.
delay: u32Frame delay in ms — 0 for static cursors. Preserved so animated
cursors round-trip through xcursor::write; install shows the
first frame only.
bgra: Vec<u8>Premultiplied BGRA pixels, width * height * 4 bytes.
Trait Implementations§
impl Eq for Image
impl StructuralPartialEq for Image
Auto Trait Implementations§
impl Freeze for Image
impl RefUnwindSafe for Image
impl Send for Image
impl Sync for Image
impl Unpin for Image
impl UnsafeUnpin for Image
impl UnwindSafe for Image
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