Enum image::metadata::Orientation
source · pub enum Orientation {
NoTransforms,
Rotate90,
Rotate180,
Rotate270,
FlipHorizontal,
FlipVertical,
Rotate90FlipH,
Rotate270FlipH,
}
Expand description
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§
source§impl Orientation
impl Orientation
sourcepub fn from_exif(exif_orientation: u8) -> Option<Self>
pub fn from_exif(exif_orientation: u8) -> Option<Self>
Converts from Exif orientation
sourcepub fn to_exif(self) -> u8
pub fn to_exif(self) -> u8
Converts into Exif orientation
Trait Implementations§
source§impl Clone for Orientation
impl Clone for Orientation
source§fn clone(&self) -> Orientation
fn clone(&self) -> Orientation
Returns a copy of the value. Read more
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moresource§impl Debug for Orientation
impl Debug for Orientation
source§impl Hash for Orientation
impl Hash for Orientation
source§impl PartialEq for Orientation
impl PartialEq for Orientation
source§fn eq(&self, other: &Orientation) -> bool
fn eq(&self, other: &Orientation) -> bool
This method tests for
self
and other
values to be equal, and is used
by ==
.impl Copy for Orientation
impl Eq for Orientation
impl StructuralPartialEq for Orientation
Auto Trait Implementations§
impl Freeze for Orientation
impl RefUnwindSafe for Orientation
impl Send for Orientation
impl Sync for Orientation
impl Unpin for Orientation
impl UnwindSafe for Orientation
Blanket Implementations§
source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more