Struct bevy_retrograde::core::image::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::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
pub fn clone(&self) -> PixelDensity
pub fn clone(&self) -> PixelDensity
Returns a copy of the value. Read more
Performs copy-assignment from source
. Read more
impl Debug for PixelDensity
impl Debug for PixelDensity
impl Default for PixelDensity
impl Default for PixelDensity
pub fn default() -> PixelDensity
pub fn default() -> PixelDensity
Returns a pixel density with a pixel aspect ratio of 1
impl PartialEq<PixelDensity> for PixelDensity
impl PartialEq<PixelDensity> for PixelDensity
pub fn eq(&self, other: &PixelDensity) -> bool
pub fn eq(&self, other: &PixelDensity) -> bool
This method tests for self
and other
values to be equal, and is used
by ==
. Read more
pub fn ne(&self, other: &PixelDensity) -> bool
pub fn ne(&self, other: &PixelDensity) -> bool
This method tests for !=
.
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
Mutably borrows from an owned value. Read more
impl<T> Downcast for T where
T: Any,
impl<T> Downcast for T where
T: Any,
Convert Box<dyn Trait>
(where Trait: Downcast
) to Box<dyn Any>
. Box<dyn Any>
can
then be further downcast
into Box<ConcreteType>
where ConcreteType
implements Trait
. Read more
pub fn into_any_rc(self: Rc<T>) -> Rc<dyn Any + 'static>
pub fn into_any_rc(self: Rc<T>) -> Rc<dyn Any + 'static>
Convert Rc<Trait>
(where Trait: Downcast
) to Rc<Any>
. Rc<Any>
can then be
further downcast
into Rc<ConcreteType>
where ConcreteType
implements Trait
. Read more
Convert &Trait
(where Trait: Downcast
) to &Any
. This is needed since Rust cannot
generate &Any
’s vtable from &Trait
’s. Read more
pub fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
pub fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
Convert &mut Trait
(where Trait: Downcast
) to &Any
. This is needed since Rust cannot
generate &mut Any
’s vtable from &mut Trait
’s. Read more
Compare self to key
and return true
if they are equal.
impl<T> FromWorld for T where
T: Default,
impl<T> FromWorld for T where
T: Default,
pub fn from_world(_world: &mut World) -> T
pub fn from_world(_world: &mut World) -> T
Creates Self
using data from the given [World]
Instruments this type with the provided Span
, returning an
Instrumented
wrapper. Read more
pub fn clone_type_data(&self) -> Box<dyn TypeData + 'static, Global>
pub fn vzip(self) -> V