Enum jiao::codec::encoded_origin::EncodedOrigin
source · #[repr(u8)]pub enum EncodedOrigin {
TopLeft = 1,
TopRight = 2,
BottomRight = 3,
BottomLeft = 4,
LeftTop = 5,
RightTop = 6,
RightBottom = 7,
LeftBottom = 8,
}
Expand description
These values match the orientation exif2.
Variants§
TopLeft = 1
Default
TopRight = 2
Reflected across y-axis
BottomRight = 3
Rotated 180
BottomLeft = 4
Reflected across x-axis
LeftTop = 5
Reflected across x-axis, Rotated 90 CCW
RightTop = 6
Rotated 90 CW
RightBottom = 7
Reflected across x-axis, Rotated 90 CW
LeftBottom = 8
Rotated 90 CCW
Implementations§
source§impl EncodedOrigin
impl EncodedOrigin
sourcepub const fn to_matrix(self, w: i32, h: i32) -> Matrix
pub const fn to_matrix(self, w: i32, h: i32) -> Matrix
Given an encoded origin and the width and height of the source data, returns a matrix that transforms the source rectangle with upper left corner at [0, 0] and origin to a correctly oriented destination rectangle of [0, 0, w, h].
sourcepub fn swaps_width_height(self) -> bool
pub fn swaps_width_height(self) -> bool
Return true if the encoded origin includes a 90 degree rotation, in which case the width and height of the source data are swapped relative to a correctly oriented destination.
Trait Implementations§
source§impl Clone for EncodedOrigin
impl Clone for EncodedOrigin
source§fn clone(&self) -> EncodedOrigin
fn clone(&self) -> EncodedOrigin
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 EncodedOrigin
impl Debug for EncodedOrigin
source§impl Default for EncodedOrigin
impl Default for EncodedOrigin
source§fn default() -> EncodedOrigin
fn default() -> EncodedOrigin
Returns the “default value” for a type. Read more
source§impl Ord for EncodedOrigin
impl Ord for EncodedOrigin
source§fn cmp(&self, other: &EncodedOrigin) -> Ordering
fn cmp(&self, other: &EncodedOrigin) -> Ordering
1.21.0 · source§fn max(self, other: Self) -> Selfwhere
Self: Sized,
fn max(self, other: Self) -> Selfwhere
Self: Sized,
Compares and returns the maximum of two values. Read more
source§impl PartialEq for EncodedOrigin
impl PartialEq for EncodedOrigin
source§fn eq(&self, other: &EncodedOrigin) -> bool
fn eq(&self, other: &EncodedOrigin) -> bool
This method tests for
self
and other
values to be equal, and is used
by ==
.source§impl PartialOrd for EncodedOrigin
impl PartialOrd for EncodedOrigin
source§fn partial_cmp(&self, other: &EncodedOrigin) -> Option<Ordering>
fn partial_cmp(&self, other: &EncodedOrigin) -> Option<Ordering>
1.0.0 · source§fn le(&self, other: &Rhs) -> bool
fn le(&self, other: &Rhs) -> bool
This method tests less than or equal to (for
self
and other
) and is used by the <=
operator. Read moreimpl Copy for EncodedOrigin
impl Eq for EncodedOrigin
impl StructuralPartialEq for EncodedOrigin
Auto Trait Implementations§
impl Freeze for EncodedOrigin
impl RefUnwindSafe for EncodedOrigin
impl Send for EncodedOrigin
impl Sync for EncodedOrigin
impl Unpin for EncodedOrigin
impl UnwindSafe for EncodedOrigin
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