diff --git a/src/draw/lv_image_decoder.c b/src/draw/lv_image_decoder.c index fb5ee46af..b2a9529b0 100644 --- a/src/draw/lv_image_decoder.c +++ b/src/draw/lv_image_decoder.c @@ -230,6 +230,19 @@ void lv_image_decoder_delete(lv_image_decoder_t * decoder) lv_free(decoder); } +/** + * Get the next image decoder in the linked list of image decoders + * @param decoder pointer to an image decoder + * @return the next image decoder or NULL if no more image decoder exists + */ +lv_image_decoder_t * lv_image_decoder_get_next(lv_image_decoder_t * decoder) +{ + if(decoder == NULL) + return _lv_ll_get_head(img_decoder_ll_p); + else + return _lv_ll_get_next(img_decoder_ll_p, decoder); +} + /** * Set a callback to get information about the image * @param decoder pointer to an image decoder diff --git a/src/draw/lv_image_decoder.h b/src/draw/lv_image_decoder.h index 7b71ba834..303942f24 100644 --- a/src/draw/lv_image_decoder.h +++ b/src/draw/lv_image_decoder.h @@ -202,6 +202,13 @@ lv_image_decoder_t * lv_image_decoder_create(void); */ void lv_image_decoder_delete(lv_image_decoder_t * decoder); +/** + * Get the next image decoder in the linked list of image decoders + * @param decoder pointer to an image decoder or NULL to get the first one + * @return the next image decoder or NULL if no more image decoder exists + */ +lv_image_decoder_t * lv_image_decoder_get_next(lv_image_decoder_t * decoder); + /** * Set a callback to get information about the image * @param decoder pointer to an image decoder