pub struct ImageBuilder {
pub source: ObjRef,
pub matrix: Affine,
}Expand description
An image placement, ready to PageEdit::push.
The pixels are not supplied here: an image page object names an /XObject,
and the regenerated stream writes /Name Do. Obtain the reference from
PageEdit::image_of (an image the document already holds) or from
EditDoc::embed_jpeg / EditDoc::embed_image (one this
save is adding).
Fields§
§source: ObjRefThe image XObject.
matrix: AffineWhere it lands: the matrix mapping the unit square onto the page.
Affine::new([w, 0.0, 0.0, h, x, y]) places a w by h image with
its lower-left corner at (x, y).
Implementations§
Source§impl ImageBuilder
impl ImageBuilder
Sourcepub fn at(source: ObjRef, rect: Rect) -> Self
pub fn at(source: ObjRef, rect: Rect) -> Self
Place source in the rectangle rect.
The image is stretched onto rect; nothing preserves its aspect
ratio, so a caller that wants it kept sizes rect from
EmbeddedImage::width and EmbeddedImage::height.
Sourcepub fn build(self) -> PageObject
pub fn build(self) -> PageObject
The page object this describes.
The pixels are a one-by-one placeholder: a regenerated stream writes a
Do naming the source, and never looks at them. Rendering the edited
graph before saving would show the placeholder rather than the image,
so render the saved file to see the result.
Trait Implementations§
Source§impl Clone for ImageBuilder
impl Clone for ImageBuilder
Source§impl Debug for ImageBuilder
impl Debug for ImageBuilder
Source§impl PartialEq for ImageBuilder
impl PartialEq for ImageBuilder
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<U, T> ToOwnedObj<U> for Twhere
U: FromObjRef<T>,
impl<U, T> ToOwnedObj<U> for Twhere
U: FromObjRef<T>,
Source§fn to_owned_obj(&self, data: FontData<'_>) -> U
fn to_owned_obj(&self, data: FontData<'_>) -> U
T, using the provided data to resolve any offsets.