pub struct ImageHandle {
pub id: u32,
pub resolved_path: String,
pub pixel_width: u32,
pub pixel_height: u32,
pub rgb8: Arc<[u8]>,
}Expand description
Decoded raster image data shared between every page that places
the same source image. Held by Arc so a single PNG referenced
from multiple #image(...) directives shares one buffer end-to-end.
Fields§
§id: u32Stable index assigned by the layout engine. The PDF backend
uses it as the suffix on the /Im<n> resource-dict key and the
XObject’s indirect ref allocation order, so callers don’t have
to hash the path themselves.
resolved_path: StringResolved absolute path from the lowerer. Used as the dedup key
across multiple #image(...) calls with the same source.
pixel_width: u32Decoded pixel width.
pixel_height: u32Decoded pixel height.
rgb8: Arc<[u8]>Flat RGB8 pixel buffer (3 * pixel_width * pixel_height bytes).
Shared via Arc<[u8]> so cloning a handle (e.g. when the same
image is referenced from multiple #image/#figure directives,
or when a future caching layer hands the document back) is cheap.
The eval crate hands ownership over as an Arc<[u8]> already
(see AttrValue::Bytes), so the slice never gets copied here.
Trait Implementations§
Source§impl Clone for ImageHandle
impl Clone for ImageHandle
Source§fn clone(&self) -> ImageHandle
fn clone(&self) -> ImageHandle
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreAuto Trait Implementations§
impl Freeze for ImageHandle
impl RefUnwindSafe for ImageHandle
impl Send for ImageHandle
impl Sync for ImageHandle
impl Unpin for ImageHandle
impl UnsafeUnpin for ImageHandle
impl UnwindSafe for ImageHandle
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§impl<U, T> ToOwnedObj<U> for Twhere
U: FromObjRef<T>,
impl<U, T> ToOwnedObj<U> for Twhere
U: FromObjRef<T>,
§fn to_owned_obj(&self, data: FontData<'_>) -> U
fn to_owned_obj(&self, data: FontData<'_>) -> U
T, using the provided data to resolve any offsets.