1 /**
2  * @file lv_draw_pxp_blend.h
3  *
4  */
5 
6 /**
7  * MIT License
8  *
9  * Copyright 2020-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_DRAW_PXP_BLEND_H
31 #define LV_DRAW_PXP_BLEND_H
32 
33 #ifdef __cplusplus
34 extern "C" {
35 #endif
36 
37 /*********************
38  *      INCLUDES
39  *********************/
40 
41 #include "../../../lv_conf_internal.h"
42 
43 #if LV_USE_GPU_NXP_PXP
44 #include "lv_gpu_nxp_pxp.h"
45 #include "../../sw/lv_draw_sw.h"
46 
47 /*********************
48  *      DEFINES
49  *********************/
50 
51 /**********************
52  *      TYPEDEFS
53  **********************/
54 
55 /**********************
56  * GLOBAL PROTOTYPES
57  **********************/
58 
59 /**
60  * Fill area, with optional opacity.
61  *
62  * @param[in/out] dest_buf Destination buffer
63  * @param[in] dest_area Area with relative coordinates of destination buffer
64  * @param[in] dest_stride Stride of destination buffer in pixels
65  * @param[in] color Color
66  * @param[in] opa Opacity
67  */
68 void lv_gpu_nxp_pxp_fill(lv_color_t * dest_buf, const lv_area_t * dest_area, lv_coord_t dest_stride,
69                          lv_color_t color, lv_opa_t opa);
70 
71 /**
72  * BLock Image Transfer - copy rectangular image from src_buf to dst_buf with effects.
73  * By default, image is copied directly, with optional opacity. This function can also
74  * rotate the display output buffer to a specified angle (90x step).
75  *
76  * @param[in/out] dest_buf Destination buffer
77  * @param[in] dest_area Area with relative coordinates of destination buffer
78  * @param[in] dest_stride Stride of destination buffer in pixels
79  * @param[in] src_buf Source buffer
80  * @param[in] src_area Source area with relative coordinates of source buffer
81  * @param[in] src_stride Stride of source buffer in pixels
82  * @param[in] opa Opacity
83  * @param[in] angle Display rotation angle (90x)
84  */
85 void lv_gpu_nxp_pxp_blit(lv_color_t * dest_buf, const lv_area_t * dest_area, lv_coord_t dest_stride,
86                          const lv_color_t * src_buf, const lv_area_t * src_area, lv_coord_t src_stride,
87                          lv_opa_t opa, lv_disp_rot_t angle);
88 
89 /**
90  * BLock Image Transfer - copy rectangular image from src_buf to dst_buf with transformation.
91  *
92  *
93  * @param[in/out] dest_buf Destination buffer
94  * @param[in] dest_area Area with relative coordinates of destination buffer
95  * @param[in] dest_stride Stride of destination buffer in pixels
96  * @param[in] src_buf Source buffer
97  * @param[in] src_area Area with relative coordinates of source buffer
98  * @param[in] src_stride Stride of source buffer in pixels
99  * @param[in] dsc Image descriptor
100  * @param[in] cf Color format
101  */
102 void lv_gpu_nxp_pxp_blit_transform(lv_color_t * dest_buf, lv_area_t * dest_area, lv_coord_t dest_stride,
103                                    const lv_color_t * src_buf, const lv_area_t * src_area, lv_coord_t src_stride,
104                                    const lv_draw_img_dsc_t * dsc, lv_img_cf_t cf);
105 
106 /**
107  * BLock Image Transfer - copy rectangular image from src_buf to dst_buf, no transformation or blending.
108  *
109  *
110  * @param[in/out] dest_buf Destination buffer
111  * @param[in] dest_area Area with relative coordinates of destination buffer
112  * @param[in] dest_stride Stride of destination buffer in pixels
113  * @param[in] src_buf Source buffer
114  * @param[in] src_area Area with relative coordinates of source buffer
115  * @param[in] src_stride Stride of source buffer in pixels
116  */
117 void lv_gpu_nxp_pxp_buffer_copy(lv_color_t * dest_buf, const lv_area_t * dest_area, lv_coord_t dest_stride,
118                                 const lv_color_t * src_buf, const lv_area_t * src_area, lv_coord_t src_stride);
119 
120 /**********************
121  *      MACROS
122  **********************/
123 
124 #endif /*LV_USE_GPU_NXP_PXP*/
125 
126 #ifdef __cplusplus
127 } /*extern "C"*/
128 #endif
129 
130 #endif /*LV_DRAW_PXP_BLEND_H*/
131