Skip to main content

EncodedOrigin

Enum EncodedOrigin 

Source
#[repr(i32)]
pub enum EncodedOrigin { TopLeft = 1, TopRight = 2, BottomRight = 3, BottomLeft = 4, LeftTop = 5, RightTop = 6, RightBottom = 7, LeftBottom = 8, }
Expand description

These values match the orientation www.exif.org/Exif2-2.PDF.

Variants§

§

TopLeft = 1

Default

§

TopRight = 2

Reflected across y-axis

§

BottomRight = 3

Rotated 180

§

BottomLeft = 4

Reflected across x-axis

§

LeftTop = 5

Reflected across x-axis, Rotated 90 CCW

§

RightTop = 6

Rotated 90 CW

§

RightBottom = 7

Reflected across x-axis, Rotated 90 CW

§

LeftBottom = 8

Rotated 90 CCW

Implementations§

Source§

impl EncodedOrigin

Source

pub const LAST: Self = EncodedOrigin::LeftBottom

Source

pub const DEFAULT: Self = EncodedOrigin::TopLeft

Source

pub fn to_matrix(self, size: impl Into<ISize>) -> Matrix

Given an width and height of the source data, returns a matrix that transforms the source rectangle with upper left corner at [0, 0] and origin to a correctly oriented destination rectangle of [0, 0, w, h].

Source

pub fn to_matrix_inverse(self, size: impl Into<ISize>) -> Matrix

Source

pub fn swaps_width_height(self) -> bool

Return true if the encoded origin includes a 90 degree rotation, in which case the width and height of the source data are swapped relative to a correctly oriented destination.

Trait Implementations§

Source§

impl Clone for EncodedOrigin

Source§

fn clone(&self) -> EncodedOrigin

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Copy for EncodedOrigin

Source§

impl Debug for EncodedOrigin

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Default for EncodedOrigin

Source§

fn default() -> EncodedOrigin

Returns the “default value” for a type. Read more
Source§

impl Eq for EncodedOrigin

Source§

impl Hash for EncodedOrigin

Source§

fn hash<__H: Hasher>(&self, state: &mut __H)

Feeds this value into the given Hasher. Read more
1.3.0 · Source§

fn hash_slice<H>(data: &[Self], state: &mut H)
where H: Hasher, Self: Sized,

Feeds a slice of this type into the given Hasher. Read more
Source§

impl PartialEq for EncodedOrigin

Source§

fn eq(&self, other: &EncodedOrigin) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0 (const: unstable) · Source§

fn ne(&self, other: &Rhs) -> bool

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

impl StructuralPartialEq for EncodedOrigin

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<N, T> NativeTransmutableWrapper<N> for T
where T: NativeTransmutable<N>,

Source§

fn wrap(native: N) -> T

Source§

fn unwrap(self) -> N

Source§

fn inner(&self) -> &N

Source§

fn inner_mut(&mut self) -> &mut N

Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

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

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.