1 /**
2  * MIT License
3  *
4  * -----------------------------------------------------------------------------
5  * Copyright (c) 2008-24 Think Silicon Single Member PC
6  * -----------------------------------------------------------------------------
7  *
8  * Permission is hereby granted, free of charge, to any person obtaining a copy
9  * of this software and associated documentation files (the "Software"), to deal
10  * in the Software without restriction, including without limitation the rights to
11  * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
12  * the Software, and to permit persons to whom the Software is furnished to do so,
13  * subject to the following conditions:
14  *
15  * The above copyright notice and this permission notice (including the next paragraph)
16  * shall be included in all copies or substantial portions of the Software.
17  *
18  * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,
19  * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A
20  * PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
21  * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF
22  * CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE
23  * OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
24  *
25  */
26 
27 /**
28  * @file lv_nema_gfx_path.h
29  *
30  */
31 
32 #ifndef LV_NEMA_GFX_PATH_H
33 #define LV_NEMA_GFX_PATH_H
34 
35 #ifdef __cplusplus
36 extern "C" {
37 #endif
38 
39 /*********************
40  *      INCLUDES
41  *********************/
42 
43 #include "lv_draw_nema_gfx.h"
44 
45 #if LV_USE_NEMA_GFX
46 #if LV_USE_NEMA_VG
47 
48 /**********************
49  *      TYPEDEFS
50  **********************/
51 
52 typedef struct {
53     NEMA_VG_PATH_HANDLE path;
54     NEMA_VG_PAINT_HANDLE paint;
55     float * data;
56     uint8_t * seg;
57     uint32_t data_size;
58     uint32_t seg_size;
59 } lv_nema_gfx_path_t;
60 
61 /**********************
62  * GLOBAL PROTOTYPES
63  **********************/
64 
65 lv_nema_gfx_path_t * lv_nema_gfx_path_create(void);
66 
67 void lv_nema_gfx_path_alloc(lv_nema_gfx_path_t * nema_gfx_path);
68 
69 void lv_nema_gfx_path_destroy(lv_nema_gfx_path_t * nema_gfx_path);
70 
71 void lv_nema_gfx_path_move_to(lv_nema_gfx_path_t * nema_gfx_path,
72                               float x, float y);
73 
74 void lv_nema_gfx_path_line_to(lv_nema_gfx_path_t * nema_gfx_path,
75                               float x, float y);
76 
77 void lv_nema_gfx_path_quad_to(lv_nema_gfx_path_t * nema_gfx_path,
78                               float cx, float cy,
79                               float x, float y);
80 
81 void lv_nema_gfx_path_cubic_to(lv_nema_gfx_path_t * nema_gfx_path,
82                                float cx1, float cy1,
83                                float cx2, float cy2,
84                                float x, float y);
85 
86 void lv_nema_gfx_path_end(lv_nema_gfx_path_t * nema_gfx_path);
87 
88 
89 
90 #endif  /*LV_USE_NEMA_VG*/
91 #endif  /*LV_USE_NEMA_GFX*/
92 
93 #ifdef __cplusplus
94 } /*extern "C"*/
95 #endif
96 
97 #endif /*LV_NEMA_GFX_PATH_H*/
98