1 /**
2  * @file lv_vglite_buf.h
3  *
4  */
5 
6 /**
7  * MIT License
8  *
9  * Copyright 2023 NXP
10  *
11  * Permission is hereby granted, free of charge, to any person obtaining a copy
12  * of this software and associated documentation files (the "Software"), to deal
13  * in the Software without restriction, including without limitation the rights to
14  * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
15  * the Software, and to permit persons to whom the Software is furnished to do so,
16  * subject to the following conditions:
17  *
18  * The above copyright notice and this permission notice (including the next paragraph)
19  * shall be included in all copies or substantial portions of the Software.
20  *
21  * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,
22  * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A
23  * PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
24  * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF
25  * CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE
26  * OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
27  *
28  */
29 
30 #ifndef LV_VGLITE_BUF_H
31 #define LV_VGLITE_BUF_H
32 
33 #ifdef __cplusplus
34 extern "C" {
35 #endif
36 
37 /*********************
38  *      INCLUDES
39  *********************/
40 #include "../../../lv_conf_internal.h"
41 
42 #if LV_USE_GPU_NXP_VG_LITE
43 #include "vg_lite.h"
44 #include "../../sw/lv_draw_sw.h"
45 
46 /*********************
47  *      DEFINES
48  *********************/
49 
50 /**********************
51  *      TYPEDEFS
52  **********************/
53 
54 /**********************
55  * GLOBAL PROTOTYPES
56  **********************/
57 /**
58  * Init vglite destination buffer. It will be done once per frame.
59  *
60  * @param[in] buf Destination buffer address (does not require alignment for VG_LITE_LINEAR mode)
61  * @param[in] area Destination buffer area (for width and height)
62  * @param[in] stride Stride of destination buffer
63  */
64 void lv_gpu_nxp_vglite_init_buf(const lv_color_t * buf, const lv_area_t * area, lv_coord_t stride);
65 
66 /**
67  * Get vglite destination buffer pointer.
68  *
69  * @retval The vglite destination buffer
70  */
71 vg_lite_buffer_t * lv_vglite_get_dest_buf(void);
72 
73 /**
74  * Get vglite source buffer pointer.
75  *
76  * @retval The vglite source buffer
77  */
78 vg_lite_buffer_t * lv_vglite_get_src_buf(void);
79 
80 /**
81  * Set vglite destination buffer address only.
82  *
83  * @param[in] buf Destination buffer address (does not require alignment for VG_LITE_LINEAR mode)
84  */
85 void lv_vglite_set_dest_buf_ptr(const lv_color_t * buf);
86 
87 /**
88  * Set vglite source buffer address only.
89  *
90  * @param[in] buf Source buffer address
91  */
92 void lv_vglite_set_src_buf_ptr(const lv_color_t * buf);
93 
94 /**
95  * Set vglite source buffer. It will be done only if buffer addreess is different.
96  *
97  * @param[in] buf Source buffer address
98  * @param[in] area Source buffer area (for width and height)
99  * @param[in] stride Stride of source buffer
100  */
101 void lv_vglite_set_src_buf(const lv_color_t * buf, const lv_area_t * area, lv_coord_t stride);
102 
103 /**
104  * Set vglite buffer.
105  *
106  * @param[in] vgbuf Address of the VGLite buffer object
107  * @param[in] buf Address of the memory for the VGLite buffer
108  * @param[in] area buffer area (for width and height)
109  * @param[in] stride buffer stride
110  */
111 void lv_vglite_set_buf(vg_lite_buffer_t * vgbuf, const lv_color_t * buf,
112                        const lv_area_t * area, lv_coord_t stride);
113 
114 /**********************
115  *      MACROS
116  **********************/
117 
118 #endif /*LV_USE_GPU_NXP_VG_LITE*/
119 
120 #ifdef __cplusplus
121 } /*extern "C"*/
122 #endif
123 
124 #endif /*LV_VGLITE_BUF_H*/
125