Struct titanium::desktop::gui::libdruid::piet::image_crate::codecs::jpeg::PixelDensity
pub struct PixelDensity {
pub density: (u16, u16),
pub unit: PixelDensityUnit,
}
Expand description
Represents the pixel density of an image
For example, a 300 DPI image is represented by:
use image::codecs::jpeg::*;
let hdpi = PixelDensity::dpi(300);
assert_eq!(hdpi, PixelDensity {density: (300,300), unit: PixelDensityUnit::Inches})
Fields§
§density: (u16, u16)
A couple of values for (Xdensity, Ydensity)
unit: PixelDensityUnit
The unit in which the density is measured
Implementations§
§impl PixelDensity
impl PixelDensity
pub fn dpi(density: u16) -> PixelDensity
pub fn dpi(density: u16) -> PixelDensity
Creates the most common pixel density type: the horizontal and the vertical density are equal, and measured in pixels per inch.
Trait Implementations§
§impl Clone for PixelDensity
impl Clone for PixelDensity
§fn clone(&self) -> PixelDensity
fn clone(&self) -> PixelDensity
Returns a copy of the value. Read more
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read more§impl Debug for PixelDensity
impl Debug for PixelDensity
§impl Default for PixelDensity
impl Default for PixelDensity
§fn default() -> PixelDensity
fn default() -> PixelDensity
Returns a pixel density with a pixel aspect ratio of 1
§impl PartialEq<PixelDensity> for PixelDensity
impl PartialEq<PixelDensity> for PixelDensity
§fn eq(&self, other: &PixelDensity) -> bool
fn eq(&self, other: &PixelDensity) -> bool
This method tests for
self
and other
values to be equal, and is used
by ==
.impl Copy for PixelDensity
impl Eq for PixelDensity
impl StructuralEq for PixelDensity
impl StructuralPartialEq for PixelDensity
Auto Trait Implementations§
impl RefUnwindSafe for PixelDensity
impl Send for PixelDensity
impl Sync for PixelDensity
impl Unpin for PixelDensity
impl UnwindSafe for PixelDensity
Blanket Implementations§
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
§impl<T> IsDefault for Twhere
T: Default + PartialEq<T> + Copy,
impl<T> IsDefault for Twhere T: Default + PartialEq<T> + Copy,
§fn is_default(&self) -> bool
fn is_default(&self) -> bool
Checks that type has a default value.
§impl<T> Pointable for T
impl<T> Pointable for T
§impl<T> RoundFrom<T> for T
impl<T> RoundFrom<T> for T
§fn round_from(x: T) -> T
fn round_from(x: T) -> T
Performs the conversion.
§impl<T, U> RoundInto<U> for Twhere
U: RoundFrom<T>,
impl<T, U> RoundInto<U> for Twhere U: RoundFrom<T>,
§fn round_into(self) -> U
fn round_into(self) -> U
Performs the conversion.