1 /**
2  * @file lv_draw_sdl_utils.h
3  *
4  */
5 #ifndef LV_DRAW_SDL_UTILS_H
6 #define LV_DRAW_SDL_UTILS_H
7 
8 #ifdef __cplusplus
9 extern "C" {
10 #endif
11 
12 /*********************
13  *      INCLUDES
14  *********************/
15 
16 #include "../../lv_conf_internal.h"
17 #if LV_USE_GPU_SDL
18 
19 #include "lv_draw_sdl.h"
20 #include "../../misc/lv_color.h"
21 #include "../../misc/lv_area.h"
22 
23 #include LV_GPU_SDL_INCLUDE_PATH
24 
25 /*********************
26  *      DEFINES
27  *********************/
28 
29 /**********************
30  *      TYPEDEFS
31  **********************/
32 
33 /**********************
34  * GLOBAL PROTOTYPES
35  **********************/
36 
37 void _lv_draw_sdl_utils_init();
38 
39 void _lv_draw_sdl_utils_deinit();
40 
41 void lv_area_to_sdl_rect(const lv_area_t * in, SDL_Rect * out);
42 
43 void lv_color_to_sdl_color(const lv_color_t * in, SDL_Color * out);
44 
45 void lv_area_zoom_to_sdl_rect(const lv_area_t * in, SDL_Rect * out, uint16_t zoom, const lv_point_t * pivot);
46 
47 SDL_Palette * lv_sdl_alloc_palette_for_bpp(const uint8_t * mapping, uint8_t bpp);
48 
49 SDL_Surface * lv_sdl_create_opa_surface(lv_opa_t * opa, lv_coord_t width, lv_coord_t height, lv_coord_t stride);
50 
51 SDL_Texture * lv_sdl_create_opa_texture(SDL_Renderer * renderer, lv_opa_t * pixels, lv_coord_t width,
52                                         lv_coord_t height, lv_coord_t stride);
53 
54 void lv_sdl_to_8bpp(uint8_t * dest, const uint8_t * src, int width, int height, int stride, uint8_t bpp);
55 
56 /**********************
57  *      MACROS
58  **********************/
59 
60 #endif /*LV_USE_GPU_SDL*/
61 #ifdef __cplusplus
62 } /*extern "C"*/
63 #endif
64 
65 #endif /*LV_DRAW_SDL_UTILS_H*/
66