Skip to main content

BlipFill

Struct BlipFill 

Source
pub struct BlipFill {
    pub relationship_id: Option<String>,
    pub mode: Option<BlipFillMode>,
    pub crop: Option<CropRect>,
}
Expand description

An image fill (<a:blipFill>, CT_BlipFillProperties). Confirmed against dml-picture.xsd’s CT_Picture (nvPicPr/ blipFill/spPr) that this is the same type PowerPoint/Word/Excel all use both for a real picture shape’s own always-present fill and for texturing an ordinary shape with an image (EG_FillProperties’s blipFill choice, alongside noFill/solidFill/..) — one model, Fill::Image, covers both uses.

The embedded-image reference, the stretch/tile choice, and cropping (<a:srcRect>, point 6) are modeled. Not modeled: <a:duotone>/<a:lum>/other <a:blip> image effects, dpi/ rotWithShape attributes, and EG_FillModeProperties’s own fine-grained tiling/stretching sub-rects (<a:tile>’s tx/ty/sx/ sy/flip/algn, <a:stretch>’s <a:fillRect>) — all cosmetic refinements on top of “which image, does it stretch or tile, and is it cropped”.

Resolving the embedded image’s actual bytes is deliberately not this crate’s job: <a:blip r:embed="..">’s value is a bare relationship id (AG_Blob, confirmed in dml-main.xsd) — drawing carries that id as a plain string, the same way it carries every other host-specific reference (none, so far), and leaves resolving it through an actual OPC package/relationship set to whichever host crate ends up consuming this (see word-ooxml::Image’s own r:embed handling for the precedent this will eventually be generalized from).

Fields§

§relationship_id: Option<String>

<a:blip r:embed=".."> — the embedded image’s relationship id. None omits <a:blip> entirely (a blipFill with no image set — unusual, but not schema-invalid, blip being minOccurs="0").

§mode: Option<BlipFillMode>

EG_FillModeProperties<a:stretch/> or <a:tile/>. None omits the choice entirely (Office’s own default is an implicit stretch-to-fill).

§crop: Option<CropRect>

<a:srcRect> (CT_RelativeRect) — crops the source image before it’s stretched/tiled into the shape. None omits the element entirely (no cropping — the whole image is used), the common case.

Implementations§

Source§

impl BlipFill

Source

pub fn new(relationship_id: impl Into<String>) -> BlipFill

Creates an image fill referencing the given relationship id.

Source

pub fn with_mode(self, mode: BlipFillMode) -> BlipFill

Source

pub fn with_crop(self, crop: CropRect) -> BlipFill

Crops the source image before it’s stretched/tiled into the shape.

Trait Implementations§

Source§

impl Clone for BlipFill

Source§

fn clone(&self) -> BlipFill

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for BlipFill

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result<(), Error>

Formats the value using the given formatter. Read more
Source§

impl Default for BlipFill

Source§

fn default() -> BlipFill

Returns the “default value” for a type. Read more
Source§

impl PartialEq for BlipFill

Source§

fn eq(&self, other: &BlipFill) -> bool

Equality operator ==. Read more
1.0.0 (const: unstable) · Source§

fn ne(&self, other: &Rhs) -> bool

Inequality operator !=. Read more
Source§

impl StructuralPartialEq for BlipFill

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.