Enum skia_safe::codec::EncodedOrigin
source · #[repr(i32)]pub enum EncodedOrigin {
TopLeft,
TopRight,
BottomRight,
BottomLeft,
LeftTop,
RightTop,
RightBottom,
LeftBottom,
}
Expand description
These values match the orientation www.exif.org/Exif2-2.PDF.
Variants§
TopLeft
Default
TopRight
Reflected across y-axis
BottomRight
Rotated 180
BottomLeft
Reflected across x-axis
LeftTop
Reflected across x-axis, Rotated 90 CCW
RightTop
Rotated 90 CW
RightBottom
Reflected across x-axis, Rotated 90 CW
LeftBottom
Rotated 90 CCW
Implementations§
source§impl EncodedOrigin
impl EncodedOrigin
pub const LAST: Self = EncodedOrigin::LeftBottom
pub const DEFAULT: Self = EncodedOrigin::TopLeft
sourcepub fn to_matrix(self, size: impl Into<ISize>) -> Matrix
pub fn to_matrix(self, size: impl Into<ISize>) -> Matrix
Given an 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 Hash for EncodedOrigin
impl Hash for EncodedOrigin
source§impl PartialEq<EncodedOrigin> for EncodedOrigin
impl PartialEq<EncodedOrigin> 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 ==
.impl Copy for EncodedOrigin
impl Eq for EncodedOrigin
impl StructuralEq for EncodedOrigin
impl StructuralPartialEq for EncodedOrigin
Auto Trait Implementations§
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