|
roo_display
API Documentation for roo_display
|
Represents the orientation of a display device. More...
#include <orientation.h>
Public Types | |
| enum class | HorizontalDirection { kLeftToRight = 0 , kRightToLeft = 1 } |
| Horizontal direction of the display. More... | |
| enum class | VerticalDirection { kTopToBottom = 0 , kBottomToTop = 1 } |
| Vertical direction of the display. More... | |
Public Member Functions | |
| constexpr | Orientation () |
| Orientation | swapXY () const |
| Swap the mapping between x/y and horizontal/vertical directions. | |
| bool | isXYswapped () const |
| Return whether x maps to the vertical direction. | |
| HorizontalDirection | getHorizontalDirection () const |
| Return the horizontal direction. | |
| bool | isLeftToRight () const |
| Return whether horizontal direction is left-to-right. | |
| bool | isRightToLeft () const |
| Return whether horizontal direction is right-to-left. | |
| Orientation | flipHorizontally () const |
| Flip the horizontal direction. | |
| VerticalDirection | getVerticalDirection () const |
| Return the vertical direction. | |
| bool | isTopToBottom () const |
| Return whether vertical direction is top-to-bottom. | |
| bool | isBottomToTop () const |
| Return whether vertical direction is bottom-to-top. | |
| Orientation | flipVertically () const |
| Flip the vertical direction. | |
| bool | isMirrored () const |
| Return whether text would appear mirrored in this orientation. | |
| Orientation | rotateRight () const |
| Rotate 90 degrees clockwise. | |
| Orientation | rotateLeft () const |
| Rotate 90 degrees counter-clockwise. | |
| Orientation | rotateUpsideDown () const |
| Rotate 180 degrees. | |
| Orientation | rotateClockwise (int turns) const |
Rotate clockwise by turns * 90 degrees. | |
| Orientation | rotateCounterClockwise (int turns) const |
Rotate counter-clockwise by turns * 90 degrees. | |
| int | getRotationCount () const |
| Return how many right rotations reach this orientation from default. | |
| Orientation | flipX () const |
| Flip along the x axis (horizontal or vertical depending on swap). | |
| Orientation | flipY () const |
| Flip along the y axis (vertical or horizontal depending on swap). | |
| const char * | asString () const |
| Return a common name for this orientation. | |
Static Public Member Functions | |
| static constexpr Orientation | Default () |
| Return the default orientation (RightDown). | |
| static constexpr Orientation | RightDown () |
| Return a specific orientation value. | |
| static constexpr Orientation | DownRight () |
| Return orientation where x increases downward and y increases to the right. | |
| static constexpr Orientation | LeftDown () |
| Return orientation where x increases to the left and y increases downward. | |
| static constexpr Orientation | DownLeft () |
| Return orientation where x increases downward and y increases to the left. | |
| static constexpr Orientation | RightUp () |
| Return orientation where x increases to the right and y increases upward. | |
| static constexpr Orientation | UpRight () |
| Return orientation where x increases upward and y increases to the right. | |
| static constexpr Orientation | LeftUp () |
| Return orientation where x increases to the left and y increases upward. | |
| static constexpr Orientation | UpLeft () |
| Return orientation where x increases upward and y increases to the left. | |
| static Orientation | RotatedByCount (int count) |
Return the default orientation rotated by count * 90 degrees. | |
Friends | |
| bool | operator== (Orientation a, Orientation b) |
| bool | operator!= (Orientation a, Orientation b) |
Represents the orientation of a display device.
A display has a natural physical placement defining absolute up/down/left/ right. Orientation maps logical (x, y) coordinates to those directions. Examples:
Internally, orientation is stored as a byte and can be passed by value. There are 8 possible values, which can be viewed as:
Helper methods are provided for common transformations.
Definition at line 25 of file orientation.h.
Horizontal direction of the display.
| Enumerator | |
|---|---|
| kLeftToRight | |
| kRightToLeft | |
Definition at line 28 of file orientation.h.
Vertical direction of the display.
| Enumerator | |
|---|---|
| kTopToBottom | |
| kBottomToTop | |
Definition at line 31 of file orientation.h.
|
inlineconstexpr |
Definition at line 51 of file orientation.h.
Referenced by DownLeft(), DownRight(), flipHorizontally(), flipVertically(), LeftDown(), LeftUp(), RightDown(), RightUp(), rotateRight(), rotateUpsideDown(), swapXY(), UpLeft(), and UpRight().
Return a common name for this orientation.
Definition at line 184 of file orientation.h.
|
inlinestaticconstexpr |
Return the default orientation (RightDown).
Definition at line 54 of file orientation.h.
References RightDown().
Referenced by roo_display::OffscreenDevice< ColorMode, pixel_order, byte_order, pixels_per_byte, storage_type >::drawDirectRect(), roo_display::OffscreenDevice< ColorMode, pixel_order, byte_order, pixels_per_byte, storage_type >::drawDirectRectAsync(), roo_display::DisplayDevice::orientationUpdated(), roo_display::internal::Orienter::orientPixels(), roo_display::internal::Orienter::orientRect(), roo_display::internal::Orienter::orientRects(), and RotatedByCount().
|
inlinestaticconstexpr |
Return orientation where x increases downward and y increases to the left.
Definition at line 69 of file orientation.h.
References Orientation().
|
inlinestaticconstexpr |
Return orientation where x increases downward and y increases to the right.
Definition at line 65 of file orientation.h.
References Orientation().
|
inline |
Flip the horizontal direction.
Definition at line 108 of file orientation.h.
References Orientation().
|
inline |
Flip the vertical direction.
Definition at line 122 of file orientation.h.
References Orientation().
|
inline |
Flip along the x axis (horizontal or vertical depending on swap).
Definition at line 174 of file orientation.h.
References flipHorizontally(), flipVertically(), and isXYswapped().
|
inline |
Flip along the y axis (vertical or horizontal depending on swap).
Definition at line 179 of file orientation.h.
References flipHorizontally(), flipVertically(), and isXYswapped().
|
inline |
Return the horizontal direction.
Definition at line 93 of file orientation.h.
References kLeftToRight, and kRightToLeft.
Referenced by isLeftToRight(), and isRightToLeft().
|
inline |
Return how many right rotations reach this orientation from default.
Definition at line 168 of file orientation.h.
|
inline |
Return the vertical direction.
Definition at line 111 of file orientation.h.
References kBottomToTop, and kTopToBottom.
Referenced by isBottomToTop(), and isTopToBottom().
|
inline |
Return whether vertical direction is bottom-to-top.
Definition at line 119 of file orientation.h.
References getVerticalDirection(), and kBottomToTop.
Referenced by roo_display::TouchCalibration::Calibrate(), roo_display::TouchDisplay::getTouch(), roo_display::internal::Orienter::orientPixels(), roo_display::internal::Orienter::orientRect(), and roo_display::internal::Orienter::orientRects().
|
inline |
Return whether horizontal direction is left-to-right.
Definition at line 98 of file orientation.h.
References getHorizontalDirection(), and kLeftToRight.
Referenced by roo_display::internal::AddressWindow::setAddress(), roo_display::ssd1327::Ssd1327Target< Transport >::setOrientation(), and roo_display::st77xx::St77xxTarget< Transport, Initializer, display_width, display_height, lpad, tpad, rpad, bpad, inverted, bgr, hflipped >::setOrientation().
|
inline |
Return whether text would appear mirrored in this orientation.
Definition at line 125 of file orientation.h.
|
inline |
Return whether horizontal direction is right-to-left.
Definition at line 103 of file orientation.h.
References getHorizontalDirection(), and kRightToLeft.
Referenced by roo_display::TouchCalibration::Calibrate(), roo_display::TouchDisplay::getTouch(), roo_display::internal::Orienter::orientPixels(), roo_display::internal::Orienter::orientRect(), roo_display::internal::Orienter::orientRects(), roo_display::ili9341::Ili9341Target< Transport >::setOrientation(), roo_display::ili9486::Ili9486Target< Transport >::setOrientation(), and roo_display::ili9488::Ili9488Target< Transport >::setOrientation().
|
inline |
Return whether vertical direction is top-to-bottom.
Definition at line 116 of file orientation.h.
References getVerticalDirection(), and kTopToBottom.
Referenced by roo_display::internal::AddressWindow::setAddress(), roo_display::ili9341::Ili9341Target< Transport >::setOrientation(), roo_display::ili9486::Ili9486Target< Transport >::setOrientation(), roo_display::ili9488::Ili9488Target< Transport >::setOrientation(), roo_display::ssd1327::Ssd1327Target< Transport >::setOrientation(), and roo_display::st77xx::St77xxTarget< Transport, Initializer, display_width, display_height, lpad, tpad, rpad, bpad, inverted, bgr, hflipped >::setOrientation().
|
inline |
Return whether x maps to the vertical direction.
Definition at line 90 of file orientation.h.
Referenced by roo_display::TouchCalibration::Calibrate(), roo_display::DisplayDevice::effective_height(), roo_display::DisplayDevice::effective_width(), flipX(), flipY(), roo_display::TouchDisplay::getTouch(), roo_display::internal::Orienter::orientPixels(), roo_display::internal::Orienter::orientRect(), roo_display::internal::Orienter::orientRects(), roo_display::internal::AddressWindow::setAddress(), roo_display::ili9341::Ili9341Target< Transport >::setOrientation(), roo_display::ili9486::Ili9486Target< Transport >::setOrientation(), roo_display::ili9488::Ili9488Target< Transport >::setOrientation(), roo_display::ssd1327::Ssd1327Target< Transport >::setOrientation(), and roo_display::st77xx::St77xxTarget< Transport, Initializer, display_width, display_height, lpad, tpad, rpad, bpad, inverted, bgr, hflipped >::setOrientation().
|
inlinestaticconstexpr |
Return orientation where x increases to the left and y increases downward.
Definition at line 67 of file orientation.h.
References Orientation().
Referenced by roo_display::products::noname::ili9341_red::Kmrtm32032Spi< pinLcdCs, pinTouchCs, pinLcdDc, pinLcdReset >::touch_calibration().
|
inlinestaticconstexpr |
Return orientation where x increases to the left and y increases upward.
Definition at line 75 of file orientation.h.
References Orientation().
|
inlinestaticconstexpr |
Return a specific orientation value.
Each static factory describes how logical x/y axes map to physical directions, using the naming convention {x-direction}{y-direction}. For example, RightDown means x increases to the right and y increases downward.
Definition at line 62 of file orientation.h.
References Orientation().
Referenced by Default(), and roo_display::products::noname::st7796s_black::Msp4031< pinLcdCs, pinLcdDc, pinLcdReset >::touch_calibration().
|
inlinestaticconstexpr |
Return orientation where x increases to the right and y increases upward.
Definition at line 71 of file orientation.h.
References Orientation().
Referenced by roo_display::products::noname::ili9341_red::Tjctm24024Spi< pinLcdCs, pinTouchCs, pinLcdDc, pinLcdReset >::touch_calibration().
|
inline |
Rotate clockwise by turns * 90 degrees.
Definition at line 146 of file orientation.h.
References rotateLeft(), rotateRight(), and rotateUpsideDown().
Referenced by rotateCounterClockwise().
|
inline |
Rotate counter-clockwise by turns * 90 degrees.
Definition at line 163 of file orientation.h.
References rotateClockwise().
|
inlinestatic |
Return the default orientation rotated by count * 90 degrees.
| count | Number of 90-degree clockwise steps (negative allowed). |
Definition at line 82 of file orientation.h.
References Default().
|
inline |
Rotate 90 degrees counter-clockwise.
Definition at line 137 of file orientation.h.
References rotateRight(), and rotateUpsideDown().
Referenced by rotateClockwise().
|
inline |
Rotate 90 degrees clockwise.
Definition at line 131 of file orientation.h.
References Orientation().
Referenced by rotateClockwise(), and rotateLeft().
|
inline |
Rotate 180 degrees.
Definition at line 140 of file orientation.h.
References Orientation().
Referenced by rotateClockwise(), and rotateLeft().
|
inline |
Swap the mapping between x/y and horizontal/vertical directions.
Definition at line 87 of file orientation.h.
References Orientation().
|
inlinestaticconstexpr |
Return orientation where x increases upward and y increases to the left.
Definition at line 77 of file orientation.h.
References Orientation().
|
inlinestaticconstexpr |
Return orientation where x increases upward and y increases to the right.
Definition at line 73 of file orientation.h.
References Orientation().
|
friend |
Definition at line 204 of file orientation.h.
|
friend |
Definition at line 200 of file orientation.h.
|
staticconstexpr |
Definition at line 49 of file orientation.h.
|
staticconstexpr |
Definition at line 39 of file orientation.h.
Referenced by getVerticalDirection(), and isBottomToTop().
|
staticconstexpr |
Definition at line 33 of file orientation.h.
Referenced by getHorizontalDirection(), and isLeftToRight().
|
staticconstexpr |
Definition at line 35 of file orientation.h.
Referenced by getHorizontalDirection(), and isRightToLeft().
|
staticconstexpr |
Definition at line 37 of file orientation.h.
Referenced by getVerticalDirection(), and isTopToBottom().
|
staticconstexpr |
Definition at line 43 of file orientation.h.
|
staticconstexpr |
Definition at line 45 of file orientation.h.
|
staticconstexpr |
Definition at line 47 of file orientation.h.