From a360900fbb87cec0aa721d527b251a3dcc72c671 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Pablo=20Mart=C3=ADnez?= <58857054+elpekenin@users.noreply.github.com> Date: Mon, 25 Sep 2023 04:31:46 +0200 Subject: [Enhancement] QP Getters (#21171) --- docs/quantum_painter.md | 43 +++++++++++++++++++++++++++++++++++++++++-- 1 file changed, 41 insertions(+), 2 deletions(-) (limited to 'docs') diff --git a/docs/quantum_painter.md b/docs/quantum_painter.md index 5e399183f8..8acf6aeb36 100644 --- a/docs/quantum_painter.md +++ b/docs/quantum_painter.md @@ -857,13 +857,52 @@ void keyboard_post_init_kb(void) { -#### ** Get Geometry ** +#### ** Gettters ** + +These functions allow external code to retrieve the current width, height, rotation, and drawing offsets. + + + +#### ** Width ** + +```c +uint16_t qp_get_width(painter_device_t device); +``` + +#### ** Height ** + +```c +uint16_t qp_get_height(painter_device_t device); +``` + +#### ** Rotation ** + +```c +painter_rotation_t qp_get_rotation(painter_device_t device); +``` + +#### ** Offset X ** + +```c +uint16_t qp_get_offset_x(painter_device_t device); +``` + +#### ** Offset Y ** + +```c +uint16_t qp_get_offset_y(painter_device_t device); +``` + +##### ** Everything ** + +Convenience function to call all the previous ones at once. +Note: You can pass `NULL` for the values you are not interested in. ```c void qp_get_geometry(painter_device_t device, uint16_t *width, uint16_t *height, painter_rotation_t *rotation, uint16_t *offset_x, uint16_t *offset_y); ``` -The `qp_get_geometry` function allows external code to retrieve the current width, height, rotation, and drawing offsets. + #### ** Set Viewport Offsets ** -- cgit v1.2.3