1 /**
2  * @file lv_draw_sw_blend_private.h
3  *
4  */
5 
6 #ifndef LV_DRAW_SW_BLEND_PRIVATE_H
7 #define LV_DRAW_SW_BLEND_PRIVATE_H
8 
9 #ifdef __cplusplus
10 extern "C" {
11 #endif
12 
13 /*********************
14  *      INCLUDES
15  *********************/
16 
17 #include "lv_draw_sw_blend.h"
18 
19 #if LV_USE_DRAW_SW
20 
21 /*********************
22  *      DEFINES
23  *********************/
24 
25 /**********************
26  *      TYPEDEFS
27  **********************/
28 
29 /**********************
30  *      TYPEDEFS
31  **********************/
32 
33 struct _lv_draw_sw_blend_dsc_t {
34     const lv_area_t * blend_area;   /**< The area with absolute coordinates to draw on `layer->buf`
35                                      *   will be clipped to `layer->clip_area` */
36     const void * src_buf;           /**< Pointer to an image to blend. If set `fill_color` is ignored */
37     uint32_t src_stride;
38     lv_color_format_t src_color_format;
39     const lv_area_t * src_area;
40     lv_opa_t opa;                   /**< The overall opacity*/
41     lv_color_t color;               /**< Fill color*/
42     const lv_opa_t * mask_buf;      /**< NULL if ignored, or an alpha mask to apply on `blend_area`*/
43     lv_draw_sw_mask_res_t mask_res; /**< The result of the previous mask operation */
44     const lv_area_t * mask_area;    /**< The area of `mask_buf` with absolute coordinates*/
45     int32_t mask_stride;
46     lv_blend_mode_t blend_mode;     /**< E.g. LV_BLEND_MODE_ADDITIVE*/
47 };
48 
49 struct _lv_draw_sw_blend_fill_dsc_t {
50     void * dest_buf;
51     int32_t dest_w;
52     int32_t dest_h;
53     int32_t dest_stride;
54     const lv_opa_t * mask_buf;
55     int32_t mask_stride;
56     lv_color_t color;
57     lv_opa_t opa;
58     lv_area_t relative_area;
59 };
60 
61 struct _lv_draw_sw_blend_image_dsc_t {
62     void * dest_buf;
63     int32_t dest_w;
64     int32_t dest_h;
65     int32_t dest_stride;
66     const lv_opa_t * mask_buf;
67     int32_t mask_stride;
68     const void * src_buf;
69     int32_t src_stride;
70     lv_color_format_t src_color_format;
71     lv_opa_t opa;
72     lv_blend_mode_t blend_mode;
73     lv_area_t relative_area;    /**< The blend area relative to the layer's buffer area. */
74     lv_area_t src_area;             /**< The original src area. */
75 };
76 
77 
78 /**********************
79  * GLOBAL PROTOTYPES
80  **********************/
81 
82 /**********************
83  *      MACROS
84  **********************/
85 
86 #endif /* LV_USE_DRAW_SW */
87 
88 #ifdef __cplusplus
89 } /*extern "C"*/
90 #endif
91 
92 #endif /*LV_DRAW_SW_BLEND_PRIVATE_H*/
93