From 82126edf887c5d2dc4829cbe7e0e70e91d1494cf Mon Sep 17 00:00:00 2001 From: Avamander Date: Wed, 14 Oct 2020 22:47:56 +0300 Subject: [PATCH] Added lv_img_set_src_arr that does better type checking when drawing images from arrays --- src/displayapp/screens/Music.cpp | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/src/displayapp/screens/Music.cpp b/src/displayapp/screens/Music.cpp index fc87a9e7..82355e21 100644 --- a/src/displayapp/screens/Music.cpp +++ b/src/displayapp/screens/Music.cpp @@ -278,4 +278,15 @@ bool Music::OnTouchEvent(Pinetime::Applications::TouchEvents event) { return true; } } +} + +/** + * Set the pixel array to display by the image + * This just calls lv_img_set_src but adds type safety + * + * @param img pointer to an image object + * @param data the image array + */ +inline void lv_img_set_src_arr(lv_obj_t *img, const lv_img_dsc_t *src_img) { + lv_img_set_src(img, src_img); } \ No newline at end of file