#[repr(u8)]pub enum CoordinateTransformation {
Identity = 0,
ReflectX = 1,
ReflectY = 2,
RotateCcw180 = 3,
RotateCcw90 = 4,
RotateCcw90ReflectX = 5,
RotateCcw90ReflectY = 6,
RotateCcw270 = 7,
}
Expand description
Transformations that can be applied by display hardware to input images.
The coordinate system transformations listed here can be implemented in hardware by display engines, because they have straightforward implementations for raster images.
Support for input image transformations (every member except for IDENTITY
)
varies across display engines. This is because each transformation requires
non-trivial hardware modifications that have area (cost) and power
implications.
Variants§
Identity = 0
Image pixels are passed through without any change.
This is the only value guaranteed to be supported by all display engine drivers.
ReflectX = 1
Image pixels are reflected across a line meeting the image’s center, parallel to the X axis.
This enum member’s numeric value has a single bit set to 1. Any transformation whose value has this bit set involves an X reflection.
This transformation is also called an “X flip”.
Example: |a b c d| |i j k l| |e f g h| -> |e f g h| |i j k l| |a b c d|
ReflectY = 2
Image pixels are reflected across a line meeting the image’s center, parallel to the Y axis.
This enum member’s numeric value has a single bit set to 1. Any transformation whose value has this bit set involves an Y reflection.
This transformation is also called an “Y flip”.
Example: |a b c d| |d c b a| |e f g h| -> |h g f e| |i j k l| |l k j i|
RotateCcw180 = 3
Image pixels are rotated around the image’s center counter-clockwise by 180 degrees.
This is equivalent to applying the REFLECT_X
and REFLECT_Y
transforms. REFLECT_X
and REFLECT_Y
are commutative, so their
ordering doesn’t matter.
Example: |a b c d| |l k j i| |e f g h| -> |h g f e| |i j k l| |d c b a|
RotateCcw90 = 4
Image pixels are rotated around the image’s center counter-clockwise by 90 degrees.
The image produced by this transformation has different dimensions from the input image.
This enum member’s numeric value has a single bit set to 1. Any transformation whose value has this bit set involves a 90-degree counter-clockwise rotation.
Example: |a b c d| |d h l| |e f g h| -> |c g k| |i j k l| |b f j| |a e i|
RotateCcw90ReflectX = 5
Image pixels are transformed using ROTATE_CCW_90
, followed by REFLECT_X
.
The image produced by this transformation has different dimensions from the input image.
Example: |a b c d| |a e i| |e f g h| -> |b f k| |i j k l| |c g k| |d h l|
RotateCcw90ReflectY = 6
Image pixels are transformed using ROTATE_CCW_90
, followed by REFLECT_Y
.
The image produced by this transformation has different dimensions from the input image.
Example: |a b c d| |l h d| |e f g h| -> |k g c| |i j k l| |j f b| |i e a|
RotateCcw270 = 7
Image pixels are rotated around the image’s center counter-clockwise by 270 degrees.
The image produced by this transformation has different dimensions from the input image.
This is equivalent to applying the ROTATE_CCW_90
transform, followed
by REFLECT_X
and REFLECT_Y
. REFLECT_X
and REFLECT_Y
are
commutative, so their ordering doesn’t matter.
Example: |a b c d| |i e a| |e f g h| -> |j f b| |i j k l| |k g c| |l h d|
Implementations§
source§impl CoordinateTransformation
impl CoordinateTransformation
pub fn from_primitive(prim: u8) -> Option<Self>
pub const fn into_primitive(self) -> u8
pub fn is_unknown(&self) -> bool
is_unknown
Trait Implementations§
source§impl Clone for CoordinateTransformation
impl Clone for CoordinateTransformation
source§fn clone(&self) -> CoordinateTransformation
fn clone(&self) -> CoordinateTransformation
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read moresource§impl Debug for CoordinateTransformation
impl Debug for CoordinateTransformation
source§impl Decode<CoordinateTransformation> for CoordinateTransformation
impl Decode<CoordinateTransformation> for CoordinateTransformation
source§impl Encode<CoordinateTransformation> for CoordinateTransformation
impl Encode<CoordinateTransformation> for CoordinateTransformation
source§impl Hash for CoordinateTransformation
impl Hash for CoordinateTransformation
source§impl Ord for CoordinateTransformation
impl Ord for CoordinateTransformation
source§fn cmp(&self, other: &CoordinateTransformation) -> Ordering
fn cmp(&self, other: &CoordinateTransformation) -> Ordering
1.21.0 · source§fn max(self, other: Self) -> Selfwhere
Self: Sized,
fn max(self, other: Self) -> Selfwhere
Self: Sized,
source§impl PartialEq for CoordinateTransformation
impl PartialEq for CoordinateTransformation
source§fn eq(&self, other: &CoordinateTransformation) -> bool
fn eq(&self, other: &CoordinateTransformation) -> bool
self
and other
values to be equal, and is used
by ==
.source§impl PartialOrd for CoordinateTransformation
impl PartialOrd for CoordinateTransformation
source§fn partial_cmp(&self, other: &CoordinateTransformation) -> Option<Ordering>
fn partial_cmp(&self, other: &CoordinateTransformation) -> Option<Ordering>
1.0.0 · source§fn le(&self, other: &Rhs) -> bool
fn le(&self, other: &Rhs) -> bool
self
and other
) and is used by the <=
operator. Read moresource§impl TypeMarker for CoordinateTransformation
impl TypeMarker for CoordinateTransformation
§type Owned = CoordinateTransformation
type Owned = CoordinateTransformation
source§fn inline_align(_context: Context) -> usize
fn inline_align(_context: Context) -> usize
source§fn inline_size(_context: Context) -> usize
fn inline_size(_context: Context) -> usize
inline_align
.source§fn encode_is_copy() -> bool
fn encode_is_copy() -> bool
Self::Owned
matches the FIDL wire
format and encoding requires no validation. When true, we can optimize
encoding arrays and vectors of Self::Owned
to a single memcpy. Read moresource§fn decode_is_copy() -> bool
fn decode_is_copy() -> bool
Self::Owned
matches the FIDL wire
format and decoding requires no validation. When true, we can optimize
decoding arrays and vectors of Self::Owned
to a single memcpy.source§impl ValueTypeMarker for CoordinateTransformation
impl ValueTypeMarker for CoordinateTransformation
§type Borrowed<'a> = CoordinateTransformation
type Borrowed<'a> = CoordinateTransformation
Encode<Self>
type cheaply obtainable from &Self::Owned
. There are three cases: Read moreimpl Copy for CoordinateTransformation
impl Eq for CoordinateTransformation
impl StructuralPartialEq for CoordinateTransformation
Auto Trait Implementations§
impl Freeze for CoordinateTransformation
impl RefUnwindSafe for CoordinateTransformation
impl Send for CoordinateTransformation
impl Sync for CoordinateTransformation
impl Unpin for CoordinateTransformation
impl UnwindSafe for CoordinateTransformation
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
source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
source§default unsafe fn clone_to_uninit(&self, dst: *mut T)
default unsafe fn clone_to_uninit(&self, dst: *mut T)
clone_to_uninit
)source§impl<T> CloneToUninit for Twhere
T: Copy,
impl<T> CloneToUninit for Twhere
T: Copy,
source§unsafe fn clone_to_uninit(&self, dst: *mut T)
unsafe fn clone_to_uninit(&self, dst: *mut T)
clone_to_uninit
)