pub struct MemoryImage {
pub bytes: ImageBytes,
pub scale: f64,
}Expand description
Decodes an image from an immutable buffer. Flutter MemoryImage.
Fields§
§bytes: ImageBytesThe source whose identity is used for cache lookup.
scale: f64Linear pixels per logical point in the decoded image.
Implementations§
Source§impl MemoryImage
impl MemoryImage
Sourcepub fn new(bytes: Arc<[u8]>) -> MemoryImage
pub fn new(bytes: Arc<[u8]>) -> MemoryImage
Creates a provider retaining the shared allocation; clone the Arc to reuse a decode.
Sourcepub fn from_static(bytes: &'static [u8]) -> MemoryImage
pub fn from_static(bytes: &'static [u8]) -> MemoryImage
Creates a provider for static data without copying it to establish a cache key.
Sourcepub fn scale(self, scale: f64) -> MemoryImage
pub fn scale(self, scale: f64) -> MemoryImage
Dart MemoryImage(scale:).
Trait Implementations§
Source§impl Clone for MemoryImage
impl Clone for MemoryImage
Source§fn clone(&self) -> MemoryImage
fn clone(&self) -> MemoryImage
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 MemoryImage
impl Debug for MemoryImage
Source§impl ImageProvider for MemoryImage
impl ImageProvider for MemoryImage
Source§fn key(&self, _configuration: &ImageConfiguration) -> ImageCacheKey
fn key(&self, _configuration: &ImageConfiguration) -> ImageCacheKey
What names this image in the cache. Flutter
obtainKey. Read moreSource§fn load_image(
&self,
app: &mut App,
key: &ImageCacheKey,
) -> Retained<Handle<ImageStreamCompleter>>
fn load_image( &self, app: &mut App, key: &ImageCacheKey, ) -> Retained<Handle<ImageStreamCompleter>>
Starts decoding, answering with the completer that will carry the frame. Flutter
loadImage. Read moreSource§fn resolve(
&self,
app: &mut App,
configuration: &ImageConfiguration,
) -> Retained<Handle<ImageStream>>
fn resolve( &self, app: &mut App, configuration: &ImageConfiguration, ) -> Retained<Handle<ImageStream>>
The stream for this image, sharing whatever the cache already has. Flutter
resolve.Auto Trait Implementations§
impl Forget for MemoryImage
impl Freeze for MemoryImage
impl Move for MemoryImage
impl RefUnwindSafe for MemoryImage
impl Send for MemoryImage
impl Sync for MemoryImage
impl Unpin for MemoryImage
impl UnsafeUnpin for MemoryImagewhere
&'static [u8]: UnsafeUnpin,
*const ArcInner<[u8]> is !null: UnsafeUnpin,
PhantomData<ArcInner<[u8]>>: UnsafeUnpin,
impl UnwindSafe for MemoryImage
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