Enum imagepipe::Orientation [−][src]
pub enum Orientation { Normal, HorizontalFlip, Rotate180, VerticalFlip, Transpose, Rotate90, Transverse, Rotate270, Unknown, }
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
Normal
HorizontalFlip
Rotate180
VerticalFlip
Transpose
Rotate90
Transverse
Rotate270
Unknown
Methods
impl Orientation
[src]
impl Orientation
pub fn from_u16(orientation: u16) -> Orientation
[src]
pub fn from_u16(orientation: u16) -> Orientation
Convert a u16 from the IFD tag Orientation (0x0112) into its corresponding enum value
pub fn to_flips(&self) -> (bool, bool, bool)
[src]
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.
Trait Implementations
impl Serialize for Orientation
[src]
impl Serialize for Orientation
fn serialize<__S>(
&self,
__serializer: __S
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error> where
__S: Serializer,
[src]
fn serialize<__S>(
&self,
__serializer: __S
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error> where
__S: Serializer,
Serialize this value into the given Serde serializer. Read more
impl<'de> Deserialize<'de> for Orientation
[src]
impl<'de> Deserialize<'de> for Orientation
fn deserialize<__D>(
__deserializer: __D
) -> Result<Orientation, <__D as Deserializer<'de>>::Error> where
__D: Deserializer<'de>,
[src]
fn deserialize<__D>(
__deserializer: __D
) -> Result<Orientation, <__D as Deserializer<'de>>::Error> where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
impl Hash for Orientation
[src]
impl Hash for Orientation
fn hash<__H>(&self, state: &mut __H) where
__H: Hasher,
[src]
fn hash<__H>(&self, state: &mut __H) where
__H: Hasher,
Feeds this value into the given [Hasher
]. Read more
fn hash_slice<H>(data: &[Self], state: &mut H) where
H: Hasher,
1.3.0[src]
fn hash_slice<H>(data: &[Self], state: &mut H) where
H: Hasher,
Feeds a slice of this type into the given [Hasher
]. Read more
impl Clone for Orientation
[src]
impl Clone for Orientation
fn clone(&self) -> Orientation
[src]
fn clone(&self) -> Orientation
Returns a copy of the value. Read more
fn clone_from(&mut self, source: &Self)
1.0.0[src]
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from source
. Read more
impl Debug for Orientation
[src]
impl Debug for Orientation
fn fmt(&self, f: &mut Formatter) -> Result<(), Error>
[src]
fn fmt(&self, f: &mut Formatter) -> Result<(), Error>
Formats the value using the given formatter. Read more
impl Copy for Orientation
[src]
impl Copy for Orientation
impl Eq for Orientation
[src]
impl Eq for Orientation
impl PartialEq<Orientation> for Orientation
[src]
impl PartialEq<Orientation> for Orientation
Auto Trait Implementations
impl Send for Orientation
impl Send for Orientation
impl Sync for Orientation
impl Sync for Orientation