pub enum Orientation {
Normal,
HorizontalFlip,
Rotate180,
VerticalFlip,
Transpose,
Rotate90,
Transverse,
Rotate270,
Unknown,
}
Expand description
Possible orientations of an image
Values are taken from the IFD tag Orientation (0x0112) in most cases but they can be obtained from other metadata in the file.
Variants§
Implementations§
Source§impl Orientation
impl Orientation
Sourcepub fn from_u16(orientation: u16) -> Orientation
pub fn from_u16(orientation: u16) -> Orientation
Convert a u16 from the IFD tag Orientation (0x0112) into its corresponding enum value
Sourcepub fn to_flips(&self) -> (bool, bool, bool)
pub fn to_flips(&self) -> (bool, bool, bool)
Convert orientation to an image flip operation tuple. The first field is if x and y coordinates should be swapped (transposed). The second and third field is horizontal and vertical flipping respectively. For a correct result, flipping must be done before transposing.
Sourcepub fn from_flips(flips: (bool, bool, bool)) -> Self
pub fn from_flips(flips: (bool, bool, bool)) -> Self
Does the opposite of to_flips()
Trait Implementations§
Source§impl Clone for Orientation
impl Clone for Orientation
Source§fn clone(&self) -> Orientation
fn clone(&self) -> Orientation
Returns a duplicate 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§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self
into a Left
variant of Either<Self, Self>
if into_left
is true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self
into a Left
variant of Either<Self, Self>
if into_left(&self)
returns true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read more