pub struct PDImageXObject {
pub width: u32,
pub height: u32,
pub image_id: ObjectId,
}Expand description
High-level Image XObject (/Subtype /Image).
Fields§
§width: u32§height: u32§image_id: ObjectIdImplementations§
Source§impl PDImageXObject
impl PDImageXObject
Sourcepub fn create_from_jpeg(
cos_doc: &mut COSDocument,
jpeg_bytes: &[u8],
) -> PdfResult<Self>
pub fn create_from_jpeg( cos_doc: &mut COSDocument, jpeg_bytes: &[u8], ) -> PdfResult<Self>
Creates an Image XObject from JPEG bytes using native DCTDecode passthrough.
Sourcepub fn create_from_image_bytes(
cos_doc: &mut COSDocument,
img_bytes: &[u8],
) -> PdfResult<Self>
pub fn create_from_image_bytes( cos_doc: &mut COSDocument, img_bytes: &[u8], ) -> PdfResult<Self>
Creates an Image XObject from PNG or raw image bytes with transparency / alpha mask support.
Sourcepub fn register_with_page(&self, page: &mut PDPage) -> String
pub fn register_with_page(&self, page: &mut PDPage) -> String
Registers this image with a page and returns its resource name (e.g. “Im1”).
Trait Implementations§
Source§impl Clone for PDImageXObject
impl Clone for PDImageXObject
Source§fn clone(&self) -> PDImageXObject
fn clone(&self) -> PDImageXObject
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 moreAuto Trait Implementations§
impl Freeze for PDImageXObject
impl RefUnwindSafe for PDImageXObject
impl Send for PDImageXObject
impl Sync for PDImageXObject
impl Unpin for PDImageXObject
impl UnsafeUnpin for PDImageXObject
impl UnwindSafe for PDImageXObject
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