pub struct Image { /* private fields */ }Expand description
Represents an image that can be embedded in a PDF
Implementations§
Source§impl Image
impl Image
Sourcepub fn from_jpeg_file<P: AsRef<Path>>(path: P) -> Result<Self>
pub fn from_jpeg_file<P: AsRef<Path>>(path: P) -> Result<Self>
Load a JPEG image from a file
Sourcepub fn from_jpeg_data(data: Vec<u8>) -> Result<Self>
pub fn from_jpeg_data(data: Vec<u8>) -> Result<Self>
Create an image from JPEG data
Sourcepub fn from_png_file<P: AsRef<Path>>(path: P) -> Result<Self>
pub fn from_png_file<P: AsRef<Path>>(path: P) -> Result<Self>
Load a PNG image from a file
Sourcepub fn from_png_data(data: Vec<u8>) -> Result<Self>
pub fn from_png_data(data: Vec<u8>) -> Result<Self>
Create an image from PNG data
Sourcepub fn from_tiff_file<P: AsRef<Path>>(path: P) -> Result<Self>
pub fn from_tiff_file<P: AsRef<Path>>(path: P) -> Result<Self>
Load a TIFF image from a file
Sourcepub fn from_tiff_data(data: Vec<u8>) -> Result<Self>
pub fn from_tiff_data(data: Vec<u8>) -> Result<Self>
Create an image from TIFF data
Sourcepub fn format(&self) -> ImageFormat
pub fn format(&self) -> ImageFormat
Get image format
Sourcepub fn to_pdf_object(&self) -> Object
pub fn to_pdf_object(&self) -> Object
Convert to PDF XObject
Trait Implementations§
Auto Trait Implementations§
impl Freeze for Image
impl RefUnwindSafe for Image
impl Send for Image
impl Sync for Image
impl Unpin for Image
impl UnwindSafe for Image
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