From 5db7c4f7d445373d92c41a7cc9aa667e223e5507 Mon Sep 17 00:00:00 2001 From: JozanLeClerc Date: Wed, 4 Mar 2020 15:21:10 +0100 Subject: tryna save --- src/ft_save_to_bmp.c | 23 +++++++++++++++++++++-- 1 file changed, 21 insertions(+), 2 deletions(-) (limited to 'src/ft_save_to_bmp.c') diff --git a/src/ft_save_to_bmp.c b/src/ft_save_to_bmp.c index a510d6b..1118384 100644 --- a/src/ft_save_to_bmp.c +++ b/src/ft_save_to_bmp.c @@ -12,8 +12,27 @@ #include #include +#include +#include -void - ft_save_to_bmp(void) +static int8_t + ft_convert_image_to_bmp(void *img, t_cub *cl) { + int32_t filelen; + uint8_t *bmp; + + (void)img; + filelen = 54 + 3 * cl->wlist.x_size * cl->wlist.y_size; + if (!(bmp = (uint8_t*)malloc((filelen - 54) * sizeof(uint8_t)))) + return (-1); + ft_memdel((void**)&bmp) + return (0); +} + +int8_t + ft_save_to_bmp(void *img, t_cub *cl) +{ + if (ft_convert_image_to_bmp(img, cl) < 0) + return (-1); + return (0); } -- cgit v1.2.3