pub(crate) struct ImageRegistry {
images: HashMap<u32, Arc<Pixmap>>,
next_id: u32,
}Expand description
Registry that maps opaque ImageIds to Pixmap data.
Used by RenderContext to resolve ImageSource::OpaqueId at rasterization time.
Fields§
§images: HashMap<u32, Arc<Pixmap>>§next_id: u32Implementations§
Source§impl ImageRegistry
impl ImageRegistry
fn register(&mut self, pixmap: Arc<Pixmap>) -> ImageId
pub(crate) fn register_atlas_page( &mut self, page_index: u32, pixmap: Arc<Pixmap>, )
pub(crate) fn destroy(&mut self, id: ImageId) -> bool
pub(crate) fn destroy_atlas_page(&mut self, page_index: u32) -> bool
fn resolve(&self, id: ImageId) -> Option<Arc<Pixmap>>
fn clear(&mut self)
Trait Implementations§
Source§impl Debug for ImageRegistry
impl Debug for ImageRegistry
Source§impl Default for ImageRegistry
impl Default for ImageRegistry
Source§fn default() -> ImageRegistry
fn default() -> ImageRegistry
Returns the “default value” for a type. Read more
Auto Trait Implementations§
impl Freeze for ImageRegistry
impl RefUnwindSafe for ImageRegistry
impl Send for ImageRegistry
impl Sync for ImageRegistry
impl Unpin for ImageRegistry
impl UnsafeUnpin for ImageRegistry
impl UnwindSafe for ImageRegistry
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
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