pub struct Bitmap(/* private fields */);Expand description
A decoded image the toolkit holds, released when the last handle drops.
Cheap to clone (an Rc), so several nodes and the canvas can draw the same decode. !Send
like everything else that talks to the toolkit.
Implementations§
Source§impl Bitmap
impl Bitmap
Sourcepub fn id(&self) -> BitmapId
pub fn id(&self) -> BitmapId
The id the toolkit knows this image by, which day_spec::ImageSource::Decoded carries.
Sourcepub fn info(&self) -> BitmapInfo
pub fn info(&self) -> BitmapInfo
Pixel size, scale, format and alpha, read once at decode (docs/images.md).
Sourcepub fn properties(&self) -> Option<ImageProperties>
pub fn properties(&self) -> Option<ImageProperties>
The metadata beyond the pixels: EXIF orientation, DPI, capture time. None where this
backend ships no metadata reader; probe Cap::ImageProperties before offering an
affordance that needs it.
Sourcepub fn encode(&self, spec: EncodeSpec) -> EncodeFuture ⓘ
pub fn encode(&self, spec: EncodeSpec) -> EncodeFuture ⓘ
Encode back to bytes, in spec’s format. Await it inside day::task.
Sourcepub fn encode_async(
&self,
spec: EncodeSpec,
on_done: impl FnOnce(Result<Vec<u8>, ImageError>) + 'static,
)
pub fn encode_async( &self, spec: EncodeSpec, on_done: impl FnOnce(Result<Vec<u8>, ImageError>) + 'static, )
Bitmap::encode’s callback half, for a call site that is not already async.
Trait Implementations§
Auto Trait Implementations§
impl !Send for Bitmap
impl !Sync for Bitmap
impl Freeze for Bitmap
impl RefUnwindSafe for Bitmap
impl Unpin for Bitmap
impl UnsafeUnpin for Bitmap
impl UnwindSafe for Bitmap
Blanket Implementations§
§impl<T> AnyEq for T
impl<T> AnyEq for T
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> ErasedDestructor for Twhere
T: 'static,
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