pub struct PhysicalSize {
pub width: Length,
pub height: Length,
pub dpi: f64,
}Expand description
An output size: width, height and, for raster output, the dpi.
Fields§
§width: Length§height: Length§dpi: f64Dots per inch for raster output (default 300); vector output ignores it.
Implementations§
Source§impl PhysicalSize
impl PhysicalSize
pub fn new(width: Length, height: Length) -> Self
pub fn with_dpi(self, dpi: f64) -> Self
Sourcepub fn canvas(&self) -> Result<(u32, u32), String>
pub fn canvas(&self) -> Result<(u32, u32), String>
The layout canvas (whole units): points for a physical size, pixels for a pixel size. Both lengths must be of the same kind.
Sourcepub fn raster_scale(&self) -> f64
pub fn raster_scale(&self) -> f64
Pixels per layout unit for raster output: dpi / 72 for a physical size, 1 for a pixel size.
Trait Implementations§
Source§impl Clone for PhysicalSize
impl Clone for PhysicalSize
impl Copy for PhysicalSize
Source§impl Debug for PhysicalSize
impl Debug for PhysicalSize
Source§impl PartialEq for PhysicalSize
impl PartialEq for PhysicalSize
impl StructuralPartialEq for PhysicalSize
Auto Trait Implementations§
impl Forget for PhysicalSize
impl Freeze for PhysicalSize
impl Move for PhysicalSize
impl RefUnwindSafe for PhysicalSize
impl Send for PhysicalSize
impl Sync for PhysicalSize
impl Unpin for PhysicalSize
impl UnsafeUnpin for PhysicalSize
impl UnwindSafe for PhysicalSize
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§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more