pub struct CustomCursorImage {
pub rgba: Arc<[u8]>,
pub size: [u16; 2],
pub hotspot: [u16; 2],
}Expand description
A bitmap cursor pushed to the integration via PlatformOutput::cursor_image.
The integration is expected to upload this to the OS as a real cursor
(so the image is not clipped by the egui window — what egui::Painter
drawn cursors suffer from). Backends that don’t support it should fall
back to PlatformOutput::cursor_icon.
rgba is straight (non-premultiplied) RGBA — same encoding as
winit::window::CustomCursor::from_rgba. The buffer length must be
exactly size[0] * size[1] * 4 bytes. size and hotspot use
u16 to match winit’s native types and avoid a lossy cast in the
integration layer.
Arc<[u8]> is used so integrations can dedupe / cache by pointer
identity (Arc::ptr_eq) and avoid re-uploading the same bitmap to
the OS every frame.
Fields§
§rgba: Arc<[u8]>§size: [u16; 2]§hotspot: [u16; 2]Trait Implementations§
Source§impl Clone for CustomCursorImage
impl Clone for CustomCursorImage
Source§fn clone(&self) -> CustomCursorImage
fn clone(&self) -> CustomCursorImage
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 CustomCursorImage
impl Debug for CustomCursorImage
impl Eq for CustomCursorImage
Source§impl PartialEq for CustomCursorImage
impl PartialEq for CustomCursorImage
impl StructuralPartialEq for CustomCursorImage
Auto Trait Implementations§
impl Freeze for CustomCursorImage
impl RefUnwindSafe for CustomCursorImage
impl Send for CustomCursorImage
impl Sync for CustomCursorImage
impl Unpin for CustomCursorImage
impl UnsafeUnpin for CustomCursorImage
impl UnwindSafe for CustomCursorImage
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more