mirror of
https://github.com/slint-ui/slint.git
synced 2025-08-30 23:27:22 +00:00
Expose swrenderer screen rotation to C++ and esp-idf
This commit is contained in:
parent
b0bc14d8a4
commit
414a9e85e7
4 changed files with 60 additions and 7 deletions
|
@ -605,6 +605,28 @@ public:
|
|||
inner, reinterpret_cast<uint16_t *>(buffer.data()), buffer.size(), pixel_stride);
|
||||
return PhysicalRegion { r };
|
||||
}
|
||||
|
||||
/// This enum describes the rotation that is applied to the buffer when rendering.
|
||||
/// To be used in set_window_rotation()
|
||||
enum class WindowRotation {
|
||||
/// No rotation
|
||||
NoRotation = 0,
|
||||
/// Rotate 90° to the left
|
||||
Rotate90 = 90,
|
||||
/// 180° rotation (upside-down)
|
||||
Rotate180 = 180,
|
||||
/// Rotate 90° to the right
|
||||
Rotate270 = 270,
|
||||
};
|
||||
|
||||
/// Set how the window need to be rotated in the buffer.
|
||||
///
|
||||
/// This is typically used to implement screen rotation in software
|
||||
void set_window_rotation(WindowRotation rotation)
|
||||
{
|
||||
cbindgen_private::slint_software_renderer_set_window_rotation(inner,
|
||||
static_cast<int>(rotation));
|
||||
}
|
||||
};
|
||||
#endif
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue