pub struct Image { /* private fields */ }
Expand description
A raster image element.
image
element in SVG.
Implementations§
source§impl Image
impl Image
sourcepub fn id(&self) -> &str
pub fn id(&self) -> &str
Element’s ID.
Taken from the SVG itself. Isn’t automatically generated. Can be empty.
sourcepub fn is_visible(&self) -> bool
pub fn is_visible(&self) -> bool
Element visibility.
sourcepub fn size(&self) -> Size
pub fn size(&self) -> Size
The actual image size.
This is not width
and height
attributes,
but rather the actual PNG/JPEG/GIF/SVG image size.
sourcepub fn rendering_mode(&self) -> ImageRendering
pub fn rendering_mode(&self) -> ImageRendering
Rendering mode.
image-rendering
in SVG.
sourcepub fn abs_transform(&self) -> Transform
pub fn abs_transform(&self) -> Transform
Element’s absolute transform.
Contains all ancestors transforms including elements’s transform.
Note that this is not the relative transform present in SVG. The SVG one would be set only on groups.
sourcepub fn bounding_box(&self) -> Rect
pub fn bounding_box(&self) -> Rect
Element’s object bounding box.
objectBoundingBox
in SVG terms. Meaning it doesn’t affected by parent transforms.
sourcepub fn abs_bounding_box(&self) -> Rect
pub fn abs_bounding_box(&self) -> Rect
Element’s bounding box in canvas coordinates.
userSpaceOnUse
in SVG terms.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for Image
impl !RefUnwindSafe for Image
impl Send for Image
impl Sync for Image
impl Unpin for Image
impl !UnwindSafe for Image
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§unsafe fn clone_to_uninit(&self, dst: *mut T)
unsafe fn clone_to_uninit(&self, dst: *mut T)
🔬This is a nightly-only experimental API. (
clone_to_uninit
)