pub struct Intrinsic {
pub width: u32,
pub height: u32,
pub dpi_x: f32,
pub dpi_y: f32,
pub sized: bool,
}Expand description
An image’s own idea of its size: pixels, and the resolution they are meant to be shown at.
A vector image has no pixels. Its width and height are its
size in CSS pixels to the nearest whole one, and the resolution
carries the remainder, so Intrinsic::size is exact.
Fields§
§width: u32Width in pixels.
height: u32Height in pixels.
dpi_x: f32Horizontal resolution in pixels per inch.
dpi_y: f32Vertical resolution in pixels per inch.
sized: boolWhether the file gives a size. False for a vector image that
gives a ratio alone: width and height are then the two
sides of the ratio, and what sizes the image is the box it is
placed in.
Implementations§
Source§impl Intrinsic
impl Intrinsic
Sourcepub fn size(self) -> (f32, f32)
pub fn size(self) -> (f32, f32)
The intrinsic size in points, at the header’s own resolution. For an image with a ratio and no size, the two sides of the ratio.
Sourcepub fn size_within(self, measure: f32) -> (f32, f32)
pub fn size_within(self, measure: f32) -> (f32, f32)
The size the image takes where no sheet gives it one, in a
box measure wide. An image with a ratio and no size fills
the width, as CSS has a replaced element do.
Trait Implementations§
impl Copy for Intrinsic
Source§impl<'de> Deserialize<'de> for Intrinsic
impl<'de> Deserialize<'de> for Intrinsic
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
impl StructuralPartialEq for Intrinsic
Auto Trait Implementations§
impl Freeze for Intrinsic
impl RefUnwindSafe for Intrinsic
impl Send for Intrinsic
impl Sync for Intrinsic
impl Unpin for Intrinsic
impl UnsafeUnpin for Intrinsic
impl UnwindSafe for Intrinsic
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,
impl<T> DeserializeOwned for Twhere
T: for<'de> Deserialize<'de>,
impl<T> ErasedDestructor for Twhere
T: 'static,
§impl<U, T> ToOwnedObj<U> for Twhere
U: FromObjRef<T>,
impl<U, T> ToOwnedObj<U> for Twhere
U: FromObjRef<T>,
§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.