Enum Orientation

enum Orientation

Describes the transformations to be applied to the image. Compatible with Exif orientation.

Orientation is specified in the file's metadata, and is often written by cameras.

You can apply it to an image via DynamicImage::apply_orientation.

Variants

NoTransforms

Do not perform any transformations.

Rotate90

Rotate by 90 degrees clockwise.

Rotate180

Rotate by 180 degrees. Can be performed in-place.

Rotate270

Rotate by 270 degrees clockwise. Equivalent to rotating by 90 degrees counter-clockwise.

FlipHorizontal

Flip horizontally. Can be performed in-place.

FlipVertical

Flip vertically. Can be performed in-place.

Rotate90FlipH

Rotate by 90 degrees clockwise and flip horizontally.

Rotate270FlipH

Rotate by 270 degrees clockwise and flip horizontally.

Implementations

impl Orientation

fn from_exif(exif_orientation: u8) -> Option<Self>

Converts from Exif orientation

fn to_exif(self: Self) -> u8

Converts into Exif orientation

impl Clone for Orientation

fn clone(self: &Self) -> Orientation

impl Copy for Orientation

impl Debug for Orientation

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

impl Eq for Orientation

impl Freeze for Orientation

impl Hash for Orientation

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

impl PartialEq for Orientation

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

impl RefUnwindSafe for Orientation

impl Send for Orientation

impl StructuralPartialEq for Orientation

impl Sync for Orientation

impl Unpin for Orientation

impl UnwindSafe for Orientation

impl<T> Any for Orientation

fn type_id(self: &Self) -> TypeId

impl<T> Borrow for Orientation

fn borrow(self: &Self) -> &T

impl<T> BorrowMut for Orientation

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

impl<T> CloneToUninit for Orientation

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

impl<T> From for Orientation

fn from(t: T) -> T

Returns the argument unchanged.

impl<T> Pointable for Orientation

unsafe fn init(init: <T as Pointable>::Init) -> usize
unsafe fn deref<'a>(ptr: usize) -> &'a T
unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T
unsafe fn drop(ptr: usize)

impl<T> ToOwned for Orientation

fn to_owned(self: &Self) -> T
fn clone_into(self: &Self, target: &mut T)

impl<T, U> Into for Orientation

fn into(self: Self) -> U

Calls U::from(self).

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

impl<T, U> TryFrom for Orientation

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

impl<T, U> TryInto for Orientation

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