[][src]Enum arctk::img::aspect_ratio::AspectRatio

pub enum AspectRatio {
    Square,
    Classic,
    Golden,
    Silver,
    Standard,
    Widescreen,
    IPhoneXS,
    IPhone7,
    Custom(f64f64),
}

Aspect-ratio enumeration.

Variants

Square

Square. 1:1.

Classic

Classic photographic film. 3:2.

Golden

Golden ratio. ((1+sqrt(5))/2):1

Silver

Silver ratio. (1+sqrt(2)):1

Standard

Standard. 16:9

Widescreen

Widescreen. 43:18

IPhoneXS

IPhone XS. (1125 x 2436)

IPhone7

IPhone 7. (750 x 1334)

Custom(f64f64)

Custom. (w x h)

Implementations

impl AspectRatio[src]

#[must_use]pub fn ratio(&self) -> f64[src]

Get the pixel ratios.

#[must_use]pub fn resolution(&self, total_target: u64, mult: (u64, u64)) -> (u64, u64)[src]

Determine a resolution for the target number of pixels. Resulting resolution target will contain at least this many pixels.

#[must_use]pub fn vt_res(&self, hr_res: u64) -> u64[src]

Calculate the vertical resolution for a given horizontal resolution. Rounded up to the nearest pixel.

Trait Implementations

impl Clone for AspectRatio[src]

impl Debug for AspectRatio[src]

impl<'de> Deserialize<'de> for AspectRatio[src]

impl Display for AspectRatio[src]

impl Load for AspectRatio[src]

Auto Trait Implementations

Blanket Implementations

impl<S, D, Swp, Dwp, T> AdaptInto<D, Swp, Dwp, T> for S where
    D: AdaptFrom<S, Swp, Dwp, T>,
    Dwp: WhitePoint,
    Swp: WhitePoint,
    T: Component + Float
[src]

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Background for T[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T, U> ConvertInto<U> for T where
    U: ConvertFrom<T>, 
[src]

impl<T> DeserializeOwned for T where
    T: for<'de> Deserialize<'de>, 
[src]

impl<T> Foreground for T[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> Pointable for T

type Init = T

The type for initializers.

impl<T> Same<T> for T

type Output = T

Should always be Self

impl<SS, SP> SupersetOf<SS> for SP where
    SS: SubsetOf<SP>, 

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

impl<T> ToString for T where
    T: Display + ?Sized
[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.

impl<V, T> VZip<V> for T where
    V: MultiLane<T>,