pub struct PictureImage {
pub mimetype: String,
pub width: u32,
pub height: u32,
pub data: Vec<u8>,
pub dpi: u32,
}Expand description
An extracted picture’s raw encoded bytes plus its mimetype and pixel size —
the docling.rs analogue of docling-core’s ImageRef.
Fields§
§mimetype: Stringe.g. image/png, image/jpeg.
width: u32§height: u32§data: Vec<u8>The image file bytes, exactly as embedded (PNG/JPEG/…).
dpi: u32Pixels per inch of the image relative to the page it came from —
docling-core’s ImageRef.dpi, which consumers use to map pixels back
to points. A crop rendered from a PDF page at s px/pt is 72·s
(docling: int(72 * images_scale), #519); an image embedded in an
office file has no render scale and keeps docling’s 72
(Self::DEFAULT_DPI).
Implementations§
Source§impl PictureImage
impl PictureImage
Sourcepub const DEFAULT_DPI: u32 = 72
pub const DEFAULT_DPI: u32 = 72
docling’s ImageRef default when no render scale applies.
Sourcepub fn dpi_for_scale(scale: f32) -> u32
pub fn dpi_for_scale(scale: f32) -> u32
The dpi of an image rendered at scale pixels per PDF point
(72·scale, rounded — int() would floor 143.99… to 143).
Trait Implementations§
Source§impl Clone for PictureImage
impl Clone for PictureImage
Source§impl Debug for PictureImage
impl Debug for PictureImage
Source§impl PartialEq for PictureImage
impl PartialEq for PictureImage
impl StructuralPartialEq for PictureImage
Auto Trait Implementations§
impl Freeze for PictureImage
impl RefUnwindSafe for PictureImage
impl Send for PictureImage
impl Sync for PictureImage
impl Unpin for PictureImage
impl UnsafeUnpin for PictureImage
impl UnwindSafe for PictureImage
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