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§fn clone(&self) -> ImageBuilder
fn clone(&self) -> ImageBuilder
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more