lib/imlib: Remove old framebuffer macros.

Signed-off-by: iabdalkader <i.abdalkader@gmail.com>
This commit is contained in:
iabdalkader 2025-09-02 13:41:30 +02:00
parent bc39969581
commit 4c2c59d0e5
3 changed files with 5 additions and 11 deletions

View File

@ -35,12 +35,6 @@
#define FRAMEBUFFER_ALIGNMENT OMV_CACHE_LINE_SIZE
#endif
// TODO these should just be removed.
#define framebuffer_get_width(fb) (fb->w)
#define framebuffer_get_height(fb) (fb->h)
#define framebuffer_get_depth(fb) (fb->bpp)
#define framebuffer_get_buffer_size(fb) (fb->buf_size)
// If FB_FLAG_CHECK_LAST is set and this is the last buffer in
// the free queue the release logic depends on the buffer mode:
//

View File

@ -132,9 +132,9 @@ static mp_obj_t py_gif_open(size_t n_args, const mp_obj_t *pos_args, mp_map_t *k
framebuffer_t *fb = framebuffer_get(0);
py_gif_obj_t *gif = mp_obj_malloc_with_finaliser(py_gif_obj_t, &py_gif_type);
gif->width = (args[ARG_width].u_int == -1) ? framebuffer_get_width(fb) : args[ARG_width].u_int;
gif->height = (args[ARG_height].u_int == -1) ? framebuffer_get_height(fb) : args[ARG_height].u_int;
gif->color = (args[ARG_color].u_int == -1) ? (framebuffer_get_depth(fb) >= 2) : args[ARG_color].u_bool;
gif->width = (args[ARG_width].u_int == -1) ? fb->w : args[ARG_width].u_int;
gif->height = (args[ARG_height].u_int == -1) ? fb->h : args[ARG_height].u_int;
gif->color = (args[ARG_color].u_int == -1) ? (fb->bpp >= 2) : args[ARG_color].u_bool;
gif->loop = args[ARG_loop].u_bool;
file_open(&gif->fp, path, false, FA_WRITE | FA_CREATE_ALWAYS);

View File

@ -196,8 +196,8 @@ static mp_obj_t py_mjpeg_open(size_t n_args, const mp_obj_t *pos_args, mp_map_t
mjpeg->us_old = 0;
mjpeg->us_avg = 0;
mjpeg->closed = 0;
mjpeg->width = (args[ARG_width].u_int == -1) ? framebuffer_get_width(fb) : args[ARG_width].u_int;
mjpeg->height = (args[ARG_height].u_int == -1) ? framebuffer_get_height(fb) : args[ARG_height].u_int;
mjpeg->width = (args[ARG_width].u_int == -1) ? fb->w : args[ARG_width].u_int;
mjpeg->height = (args[ARG_height].u_int == -1) ? fb->h : args[ARG_height].u_int;
file_open(&mjpeg->fp, path, false, FA_WRITE | FA_CREATE_ALWAYS);
mjpeg_open(&mjpeg->fp, mjpeg->width, mjpeg->height);