Skip to content

Commit 08ce02d

Browse files
video: add isRotated() API
1 parent 94316b2 commit 08ce02d

File tree

3 files changed

+21
-1
lines changed

3 files changed

+21
-1
lines changed

libraries/Arduino_H7_Video/docs/api.md

+10-1
Original file line numberDiff line numberDiff line change
@@ -16,12 +16,12 @@ The main class for managing the video controller and the display.
1616
| `public void` [`end`](#public-void-end) | De-initialize the video controller and display. |
1717
| `public int` [`width`](#public-int-width) | Get the width of the display. |
1818
| `public int` [`height`](#public-int-height) | Get the height of the display. |
19+
| `public bool` [`isRotated`](#public-bool-isrotated) | Check if the display is rotated. |
1920
| `public void` [`clear`](#public-void-clear) | Clear the display. |
2021
| `public void` [`beginDraw`](#public-void-begindraw) | Begin drawing operations on the display. |
2122
| `public void` [`endDraw`](#public-void-enddraw) | End drawing operations on the display. |
2223
| `public void` [`set`](#public-void-setint-x-int-y-uint8_t-r-uint8_t-g-uint8_t-b) | Set the color of the pixel at the specified coordinates. |
2324

24-
2525
> *Note: For all drawing functions, refer to the documentation of the [`ArduinoGraphics`](https://reference.arduino.cc/reference/en/libraries/arduinographics/) library.*
2626
2727
## Members
@@ -72,6 +72,15 @@ Get the height of the display.
7272

7373
---
7474

75+
### `public bool` [`isRotated`](#)`()`
76+
77+
Check if the display is rotated.
78+
79+
#### Returns
80+
`bool`: True if the display is rotated, false otherwise.
81+
82+
---
83+
7584
### `public void` [`clear`](#)`()`
7685

7786
Clear the display.

libraries/Arduino_H7_Video/src/Arduino_H7_Video.cpp

+4
Original file line numberDiff line numberDiff line change
@@ -125,6 +125,10 @@ int Arduino_H7_Video::height() {
125125
return _height;
126126
}
127127

128+
bool Arduino_H7_Video::isRotated() {
129+
return _rotated;
130+
}
131+
128132
void Arduino_H7_Video::end() {
129133
#ifdef HAS_ARDUINOGRAPHICS
130134
ArduinoGraphics::end();

libraries/Arduino_H7_Video/src/Arduino_H7_Video.h

+7
Original file line numberDiff line numberDiff line change
@@ -97,6 +97,13 @@ class Arduino_H7_Video
9797
*/
9898
int height();
9999

100+
/**
101+
* @brief Check if the display is rotated.
102+
*
103+
* @return bool True if the display is rotated, false otherwise.
104+
*/
105+
bool isRotated();
106+
100107
#ifdef HAS_ARDUINOGRAPHICS
101108
/**
102109
* @brief Clear the display.

0 commit comments

Comments
 (0)