pub struct CellImage { /* private fields */ }Expand description
Image payload for embedding in a table cell.
Constructed from raw JPEG or PNG bytes. The image is validated and
converted to a PDF XObject stream at construction time. Cheap to
clone via internal Arc.
Implementations§
Source§impl CellImage
impl CellImage
Sourcepub fn new(data: Vec<u8>) -> Result<Self>
pub fn new(data: Vec<u8>) -> Result<Self>
Create a new image from raw JPEG or PNG bytes.
Validates the image and pre-builds the PDF XObject stream. Returns an error if the bytes are not a valid/supported image.
Sourcepub fn with_max_height(self, pts: f32) -> Self
pub fn with_max_height(self, pts: f32) -> Self
Set maximum rendered height in points.
Sourcepub fn with_overlay(self, overlay: ImageOverlay) -> Self
pub fn with_overlay(self, overlay: ImageOverlay) -> Self
Attach a text overlay to this image.
Sourcepub fn aspect_ratio(&self) -> f32
pub fn aspect_ratio(&self) -> f32
Aspect ratio (width / height).
Trait Implementations§
Auto Trait Implementations§
impl Freeze for CellImage
impl RefUnwindSafe for CellImage
impl Send for CellImage
impl Sync for CellImage
impl Unpin for CellImage
impl UnsafeUnpin for CellImage
impl UnwindSafe for CellImage
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> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
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