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
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§unsafe fn clone_to_uninit(&self, dst: *mut T)
unsafe fn clone_to_uninit(&self, dst: *mut T)
🔬This is a nightly-only experimental API. (
clone_to_uninit
)