class RotateFlip
Defined at line 37 of file ../../src/ui/scenic/lib/types/rotate_flip.h
Covers the rotate/flip permutations supported by
`fuchsia.hardware.display.types/CoordinateTransformation`.
Enum names read in application order: rotation first, then the named
reflection ("rotate-then-flip"). Reflections flip the image across the
specified axis: e.g. `kReflectX` mirrors across a horizontal line,
swapping top and bottom rows.
Rotations do not commute with reflections, so each reflection-carrying
value also has a flip-then-rotate reading that names the OTHER axis
(e.g. `kRotateCcw90ReflectY` is equivalently REFLECT_X followed by
ROTATE_CCW_90); `From(Orientation, ImageFlip)` converts from that
flip-first form.
TODO(https://fxbug.dev/356385730): Flatland2 introduces `FlipThenRotate`, which adopts Android
conventions. These differ from current display coordinator conventions:
- Android uses flip-then-rotate, display coordinator uses rotate-then-flip
- Android uses clockwise, display coordinator uses counter-clockwise
Eventually both display coordinator and Scenic impl are expected to adopt the Android convention.
Public Methods
void RotateFlip ()
Defined at line 168 of file ../../src/ui/scenic/lib/types/rotate_flip.h
void RotateFlip (const RotateFlip & )
Defined at line 170 of file ../../src/ui/scenic/lib/types/rotate_flip.h
void RotateFlip (RotateFlip && )
Defined at line 171 of file ../../src/ui/scenic/lib/types/rotate_flip.h
RotateFlip & operator= (const RotateFlip & )
Defined at line 172 of file ../../src/ui/scenic/lib/types/rotate_flip.h
RotateFlip & operator= (RotateFlip && )
Defined at line 173 of file ../../src/ui/scenic/lib/types/rotate_flip.h
void ~RotateFlip ()
Defined at line 174 of file ../../src/ui/scenic/lib/types/rotate_flip.h
Enum enum_value ()
Used for hashing/printing/etc; not useful for general users.
Defined at line 189 of file ../../src/ui/scenic/lib/types/rotate_flip.h
RotateFlip From (const fuchsia_ui_composition::Orientation & rotation, const fuchsia_ui_composition::ImageFlip & flip)
Returns the transform that applies `flip` first, followed by
`rotation`: Flatland's convention, where the flip happens in image
space before any rotation. The equivalent rotate-then-flip enum value
often names a different reflection axis than `flip`; see the per-case
comments in the implementation.
Defined at line 198 of file ../../src/ui/scenic/lib/types/rotate_flip.h
RotateFlip From (const fuchsia_hardware_display_types::wire::CoordinateTransformation & coordinate_transform)
`RotateFlip` directly mirrors the hardware display type
`fuchsia.hardware.display.types/CoordinateTransformation`: same numeric
values, converted by cast.
Defined at line 261 of file ../../src/ui/scenic/lib/types/rotate_flip.h
RotateFlip From (const fuchsia_ui_composition::FlipThenRotate & flip_then_rotate)
static
Defined at line 268 of file ../../src/ui/scenic/lib/types/rotate_flip.h
RotateFlip kIdentity ()
Static "constructors".
Defined at line 306 of file ../../src/ui/scenic/lib/types/rotate_flip.h
RotateFlip kReflectX ()
static
Defined at line 309 of file ../../src/ui/scenic/lib/types/rotate_flip.h
RotateFlip kReflectY ()
static
Defined at line 312 of file ../../src/ui/scenic/lib/types/rotate_flip.h
RotateFlip kRotateCcw180 ()
static
Defined at line 315 of file ../../src/ui/scenic/lib/types/rotate_flip.h
RotateFlip kRotateCcw90 ()
static
Defined at line 318 of file ../../src/ui/scenic/lib/types/rotate_flip.h
RotateFlip kRotateCcw90ReflectX ()
static
Defined at line 321 of file ../../src/ui/scenic/lib/types/rotate_flip.h
RotateFlip kRotateCcw90ReflectY ()
static
Defined at line 326 of file ../../src/ui/scenic/lib/types/rotate_flip.h
RotateFlip kRotateCcw270 ()
static
Defined at line 331 of file ../../src/ui/scenic/lib/types/rotate_flip.h
void RotateFlip (RotateFlip::Enum val)
Defined at line 195 of file ../../src/ui/scenic/lib/types/rotate_flip.h
RotateFlip RotatedBy (Enum rotation)
Returns the RotateFlip equivalent to applying this transform first, then
`rotation`. `rotation` must be a pure rotation (kIdentity or one of the
kRotateCcw* values); reflections are rejected via CHECK.
Defined at line 339 of file ../../src/ui/scenic/lib/types/rotate_flip.h
RotateFlip RotatedBy (RotateFlip rotation)
Defined at line 388 of file ../../src/ui/scenic/lib/types/rotate_flip.h
fuchsia_hardware_display_types::wire::CoordinateTransformation ToDisplayCoordinateTransformation ()
Defined at line 392 of file ../../src/ui/scenic/lib/types/rotate_flip.h
Enumerations
enum class Enum : uint8_t
| Name | Value | Comments |
|---|---|---|
| kIdentity | 0 |
Image pixels are passed through without any change. |
| kReflectX | 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
This transformation is also called an "X flip".
Example: |
| kReflectY | 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
This transformation is also called an "Y flip".
Example: |
| kRotateCcw180 | 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`
Example: |
| kRotateCcw90 | 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
This enum member's numeric value has a single bit set to 1. Any
Example: |
| kRotateCcw90ReflectX | 5 |
Image pixels are transformed using `ROTATE_CCW_90`, followed by `REFLECT_X`.
The image produced by this transformation has different dimensions from
Example: |
| kRotateCcw90ReflectY | 6 |
Image pixels are transformed using `ROTATE_CCW_90`, followed by `REFLECT_Y`.
The image produced by this transformation has different dimensions from
Example: |
| kRotateCcw270 | 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
This is equivalent to applying the `ROTATE_CCW_90` transform, followed
Example: |
Defined at line 39 of file ../../src/ui/scenic/lib/types/rotate_flip.h
Friends
bool RotateFlip (const RotateFlip & lhs, const RotateFlip & rhs)
bool RotateFlip (const RotateFlip & lhsconst RotateFlip & rhs)