Struct PixelDensity
struct PixelDensity { ... }
Represents the pixel density of an image
For example, a 300 DPI image is represented by:
use *;
let hdpi = dpi;
assert_eq!
Fields
density: (u16, u16)A couple of values for (Xdensity, Ydensity)
unit: PixelDensityUnitThe unit in which the density is measured
Implementations
impl PixelDensity
fn dpi(density: u16) -> SelfCreates the most common pixel density type: the horizontal and the vertical density are equal, and measured in pixels per inch.
impl Clone for PixelDensity
fn clone(self: &Self) -> PixelDensity
impl Copy for PixelDensity
impl Debug for PixelDensity
fn fmt(self: &Self, f: &mut Formatter<'_>) -> Result
impl Default for PixelDensity
fn default() -> SelfReturns a pixel density with a pixel aspect ratio of 1
impl Eq for PixelDensity
impl Freeze for PixelDensity
impl PartialEq for PixelDensity
fn eq(self: &Self, other: &PixelDensity) -> bool
impl RefUnwindSafe for PixelDensity
impl Send for PixelDensity
impl StructuralPartialEq for PixelDensity
impl Sync for PixelDensity
impl Unpin for PixelDensity
impl UnsafeUnpin for PixelDensity
impl UnwindSafe for PixelDensity
impl<R, P> ReadPrimitive for PixelDensity
impl<T> Any for PixelDensity
fn type_id(self: &Self) -> TypeId
impl<T> Borrow for PixelDensity
fn borrow(self: &Self) -> &T
impl<T> BorrowMut for PixelDensity
fn borrow_mut(self: &mut Self) -> &mut T
impl<T> CloneToUninit for PixelDensity
unsafe fn clone_to_uninit(self: &Self, dest: *mut u8)
impl<T> From for PixelDensity
fn from(t: T) -> TReturns the argument unchanged.
impl<T> Pointable for PixelDensity
unsafe fn init(init: <T as Pointable>::Init) -> usizeunsafe fn deref<'a>(ptr: usize) -> &'a Tunsafe fn deref_mut<'a>(ptr: usize) -> &'a mut Tunsafe fn drop(ptr: usize)
impl<T> ToOwned for PixelDensity
fn to_owned(self: &Self) -> Tfn clone_into(self: &Self, target: &mut T)
impl<T, U> Into for PixelDensity
fn into(self: Self) -> UCalls
U::from(self).That is, this conversion is whatever the implementation of
[From]<T> for Uchooses to do.
impl<T, U> TryFrom for PixelDensity
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
impl<T, U> TryInto for PixelDensity
fn try_into(self: Self) -> Result<U, <U as TryFrom<T>>::Error>