1 /*
2  * Copyright (c) 2018 Jan Van Winkel <jan.van_winkel@dxplore.eu>
3  * Copyright (c) 2023 Nordic Semiconductor
4  *
5  * SPDX-License-Identifier: Apache-2.0
6  *
7  * "Bottom" of the SDL display driver.
8  * When built with the native_simulator this will be built in the runner context,
9  * that is, with the host C library, and with the host include paths.
10  */
11 #ifndef DRIVERS_DISPLAY_DISPLAY_SDL_BOTTOM_H
12 #define DRIVERS_DISPLAY_DISPLAY_SDL_BOTTOM_H
13 
14 #include <stdbool.h>
15 #include <stdint.h>
16 
17 #ifdef __cplusplus
18 extern "C" {
19 #endif
20 
21 /* Note: None of these functions are public interfaces. But internal to the SDL display driver */
22 
23 int sdl_display_init_bottom(uint16_t height, uint16_t width, uint16_t zoom_pct,
24 			    bool use_accelerator, void **window, const void *window_user_data,
25 			    const char *title, void **renderer, void **mutex, void **texture,
26 			    void **read_texture, void **background_texture,
27 			    uint32_t transparency_grid_color1, uint32_t transparency_grid_color2,
28 			    uint16_t transparency_grid_cell_size);
29 void sdl_display_write_bottom(const uint16_t height, const uint16_t width, const uint16_t x,
30 			      const uint16_t y, void *renderer, void *mutex, void *texture,
31 			      void *background_texture, uint8_t *buf, bool display_on,
32 			      bool frame_incomplete, uint32_t color_tint);
33 int sdl_display_read_bottom(const uint16_t height, const uint16_t width, const uint16_t x,
34 			    const uint16_t y, void *renderer, void *buf, uint16_t pitch,
35 			    void *mutex, void *texture, void *read_texture);
36 void sdl_display_blanking_off_bottom(void *renderer, void *texture, void *background_texture,
37 				     uint32_t color_tint);
38 void sdl_display_blanking_on_bottom(void *renderer);
39 void sdl_display_cleanup_bottom(void **window, void **renderer, void **mutex, void **texture,
40 				void **read_texture, void **background_texture);
41 
42 #ifdef __cplusplus
43 }
44 #endif
45 
46 #endif /* DRIVERS_DISPLAY_DISPLAY_SDL_BOTTOM_H */
47