pub struct ImageBuilder { /* private fields */ }Expand description
Thin builder for an embedded Image block.
Implementations§
Source§impl ImageBuilder
impl ImageBuilder
Sourcepub fn new(bytes: Vec<u8>, mime: impl Into<String>) -> Self
pub fn new(bytes: Vec<u8>, mime: impl Into<String>) -> Self
Start an embedded image with caller-supplied bytes and MIME type.
Sourcepub fn from_image(image: Image) -> Self
pub fn from_image(image: Image) -> Self
Continue building from an existing image.
Sourcepub fn size_px(self, width_px: u32, height_px: u32) -> Self
pub fn size_px(self, width_px: u32, height_px: u32) -> Self
Set the image dimensions in pixels.
Sourcepub fn rotate_degrees(self, degrees: i32) -> Self
pub fn rotate_degrees(self, degrees: i32) -> Self
Rotate the image clockwise by whole degrees.
Sourcepub fn floating_offset_emu(self, x_emu: i64, y_emu: i64) -> Self
pub fn floating_offset_emu(self, x_emu: i64, y_emu: i64) -> Self
Emit this image as a page-relative floating anchor at the given EMU offset.
Trait Implementations§
Source§impl Clone for ImageBuilder
impl Clone for ImageBuilder
Source§fn clone(&self) -> ImageBuilder
fn clone(&self) -> ImageBuilder
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 moreSource§impl Debug for ImageBuilder
impl Debug for ImageBuilder
Source§impl Default for ImageBuilder
impl Default for ImageBuilder
Source§fn default() -> ImageBuilder
fn default() -> ImageBuilder
Returns the “default value” for a type. Read more
Source§impl From<ImageBuilder> for Image
impl From<ImageBuilder> for Image
Source§fn from(builder: ImageBuilder) -> Self
fn from(builder: ImageBuilder) -> Self
Converts to this type from the input type.
Source§impl PartialEq for ImageBuilder
impl PartialEq for ImageBuilder
Source§fn eq(&self, other: &ImageBuilder) -> bool
fn eq(&self, other: &ImageBuilder) -> bool
Tests for
self and other values to be equal, and is used by ==.impl StructuralPartialEq for ImageBuilder
Auto Trait Implementations§
impl Freeze for ImageBuilder
impl RefUnwindSafe for ImageBuilder
impl Send for ImageBuilder
impl Sync for ImageBuilder
impl Unpin for ImageBuilder
impl UnsafeUnpin for ImageBuilder
impl UnwindSafe for ImageBuilder
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