hal_gfx_raster.h
Go to the documentation of this file.
1 /**
2 ****************************************************************************************
3 *
4 * @file hal_gfx_raster.h
5 * @author BLE Driver Team
6 * @brief Header file containing functions prototypes of Graphics library.
7 *
8 ****************************************************************************************
9 * @attention
10 #####Copyright (c) 2019 GOODIX
11 All rights reserved.
12
13 Redistribution and use in source and binary forms, with or without
14 modification, are permitted provided that the following conditions are met:
15 * Redistributions of source code must retain the above copyright
16 notice, this list of conditions and the following disclaimer.
17 * Redistributions in binary form must reproduce the above copyright
18 notice, this list of conditions and the following disclaimer in the
19 documentation and/or other materials provided with the distribution.
20 * Neither the name of GOODIX nor the names of its contributors may be used
21 to endorse or promote products derived from this software without
22 specific prior written permission.
23
24 THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
25 AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
26 IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
27 ARE DISCLAIMED. IN NO EVENT SHALL COPYRIGHT HOLDERS AND CONTRIBUTORS BE
28 LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
29 CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
30 SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
31 INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
32 CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
33 ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
34 POSSIBILITY OF SUCH DAMAGE.
35 ****************************************************************************************
36 */
37
38 /** @addtogroup GRAPHICS_SDK Graphics
39 * @{
40 */
41
42 /** @addtogroup HAL_GFX HAL GFX
43 * @{
44 */
45
46 /** @defgroup HAL_GFX_RASTER GFX RASTER
47 * @brief GPU raster interfaces.
48 * @{
49 */
50
51 #ifndef HAL_GFX_RASTER_H__
52 #define HAL_GFX_RASTER_H__
53
54 #ifdef __cplusplus
55 extern "C" {
56 #endif
57 /**
58 * @defgroup HAL_GFX_RASTER_FUNCTION Functions
59 * @{
60 */
61 /**
62 *****************************************************************************************
63 * @brief Setting the raster color
64 *
65 * @param[in] rgba8888: Color value
66 *****************************************************************************************
67 */
68 void hal_gfx_set_raster_color(uint32_t rgba8888);
69
70 /**
71 *****************************************************************************************
72 * @brief Raster a pixel
73 *
74 * @param[in] x: x coordinate of the pixel
75 * @param[in] y: x coordinate of the pixel
76 *****************************************************************************************
77 */
78 void hal_gfx_raster_pixel(int x, int y);
79
80 /**
81 *****************************************************************************************
82 * @brief Raster a line
83 *
84 * @param[in] x0: x coordinate at the beginning of the line
85 * @param[in] y0: y coordinate at the beginning of the line
86 * @param[in] x1: x coordinate at the end of the line
87 * @param[in] y1: y coordinate at the end of the line
88 *****************************************************************************************
89 */
90 void hal_gfx_raster_line(int x0, int y0, int x1, int y1);
91
92 /**
93 *****************************************************************************************
94 * @brief Raster a triangle with fixed point(16.16)
95 *
96 * @param[in] x0fx: x coordinate at the first vertex of the triangle
97 * @param[in] y0fx: y coordinate at the first vertex of the triangle
98 * @param[in] x1fx: x coordinate at the second vertex of the triangle
99 * @param[in] y1fx: y coordinate at the second vertex of the triangle
100 * @param[in] x2fx: x coordinate at the third vertex of the triangle
101 * @param[in] y2fx: y coordinate at the third vertex of the triangle
102 *****************************************************************************************
103 */
104 void hal_gfx_raster_triangle_fx(int x0fx, int y0fx, int x1fx, int y1fx, int x2fx, int y2fx);
105
106 /**
107 *****************************************************************************************
108 * @brief Raster a rectangle
109 *
110 * @param[in] x: x coordinate of the upper left vertex of the rectangle
111 * @param[in] y: y coordinate of the upper left vertex of the rectangle
112 * @param[in] w: width of the rectangle
113 * @param[in] h: height of the rectangle
114 *****************************************************************************************
115 */
116 void hal_gfx_raster_rect(int x, int y, int w, int h);
117
118 /**
119 *****************************************************************************************
120 * @brief Raster a rectangle with rounded edges
121 *
122 * @param[in] x0: x coordinate of the upper left vertex of the rectangle
123 * @param[in] y0: y coordinate of the upper left vertex of the rectangle
124 * @param[in] w: width of the rectangle
125 * @param[in] h: height of the rectangle
126 * @param[in] r: corner radius
127 *****************************************************************************************
128 */
129 void hal_gfx_raster_rounded_rect(int x0, int y0, int w, int h, int r);
130
131 /**
132 *****************************************************************************************
133 * @brief Raster a quad with fixed point(16.16)
134 *
135 * @param[in] x0fx: x coordinate at the first vertex of the quadrilateral
136 * @param[in] y0fx: y coordinate at the first vertex of the quadrilateral
137 * @param[in] x1fx: x coordinate at the second vertex of the quadrilateral
138 * @param[in] y1fx: y coordinate at the second vertex of the quadrilateral
139 * @param[in] x2fx: x coordinate at the third vertex of the quadrilateral
140 * @param[in] y2fx: y coordinate at the third vertex of the quadrilateral
141 * @param[in] x3fx: x coordinate at the fourth vertex of the quadrilateral
142 * @param[in] y3fx: y coordinate at the fourth vertex of the quadrilateral
143 *****************************************************************************************
144 */
145 void hal_gfx_raster_quad_fx(int x0fx, int y0fx, int x1fx, int y1fx, int x2fx, int y2fx, int x3fx, int y3fx);
146
147 /**
148 *****************************************************************************************
149 * @brief Raster a triangle
150 *
151 * @param[in] x0: x coordinate at the first vertex of the triangle
152 * @param[in] y0: y coordinate at the first vertex of the triangle
153 * @param[in] x1: x coordinate at the second vertex of the triangle
154 * @param[in] y1: y coordinate at the second vertex of the triangle
155 * @param[in] x2: x coordinate at the third vertex of the triangle
156 * @param[in] y2: y coordinate at the third vertex of the triangle
157 *****************************************************************************************
158 */
159 void hal_gfx_raster_triangle (int x0, int y0, int x1, int y1, int x2, int y2);
160
161 /**
162 *****************************************************************************************
163 * @brief Raster a quad
164 *
165 * @param[in] x0: x coordinate at the first vertex of the quadrilateral
166 * @param[in] y0: y coordinate at the first vertex of the quadrilateral
167 * @param[in] x1: x coordinate at the second vertex of the quadrilateral
168 * @param[in] y1: y coordinate at the second vertex of the quadrilateral
169 * @param[in] x2: x coordinate at the third vertex of the quadrilateral
170 * @param[in] y2: y coordinate at the third vertex of the quadrilateral
171 * @param[in] x3: x coordinate at the fourth vertex of the quadrilateral
172 * @param[in] y3: y coordinate at the fourth vertex of the quadrilateral
173 *****************************************************************************************
174 */
175 void hal_gfx_raster_quad (int x0,int y0,int x1,int y1,int x2,int y2,int x3,int y3);
176
177 /**
178 *****************************************************************************************
179 * @brief Raster a circle with Anti-Aliasing (if available)
180 *
181 * @param[in] x: x coordinate of the circle's center
182 * @param[in] y: y coordinate of the circle's center
183 * @param[in] r: circle's radius
184 *****************************************************************************************
185 */
186 void hal_gfx_raster_circle_aa(float x, float y, float r);
187
188 /**
189 *****************************************************************************************
190 * @brief Raster a circle with Anti-Aliasing (if available) and specified width
191 *
192 * @param[in] x: x coordinate of the circle's center
193 * @param[in] y: y coordinate of the circle's center
194 * @param[in] r: circle's radius
195 * @param[in] w: pencil width
196 *****************************************************************************************
197 */
198 void hal_gfx_raster_stroked_circle_aa(float x, float y, float r, float w);
199
200 /**
201 *****************************************************************************************
202 * @brief Raster a rectangle with fixed point(16.16)
203 *
204 * @param[in] x: x coordinate of the upper left vertex of the rectangle
205 * @param[in] y: y coordinate of the upper left vertex of the rectangle
206 * @param[in] w: width of the rectangle
207 * @param[in] h: height of the rectangle
208 *****************************************************************************************
209 */
210 void hal_gfx_raster_rect_fx(int x, int y, int w, int h);
211
212 /**
213 *****************************************************************************************
214 * @brief Raster a rectangle. (float coordinates)
215 *
216 * @param[in] x: x coordinate of the upper left vertex of the rectangle
217 * @param[in] y: y coordinate of the upper left vertex of the rectangle
218 * @param[in] w: width of the rectangle
219 * @param[in] h: height of the rectangle
220 *****************************************************************************************
221 */
222 void hal_gfx_raster_rect_f(float x, float y, float w, float h);
223
224 /**
225 *****************************************************************************************
226 * @brief Raster a triangle. (float coordinates)
227 *
228 * @param[in] x0: x coordinate at the first vertex of the triangle
229 * @param[in] y0: y coordinate at the first vertex of the triangle
230 * @param[in] x1: x coordinate at the second vertex of the triangle
231 * @param[in] y1: y coordinate at the second vertex of the triangle
232 * @param[in] x2: x coordinate at the third vertex of the triangle
233 * @param[in] y2: y coordinate at the third vertex of the triangle
234 *****************************************************************************************
235 */
236 void hal_gfx_raster_triangle_f(float x0, float y0, float x1, float y1, float x2, float y2);
237
238 /**
239 *****************************************************************************************
240 * @brief Raster the first vertex of the triangle strip. (float coordinates)
241 *
242 * @param[in] x0: x coordinate at the first vertex of the triangle
243 * @param[in] y0: y coordinate at the first vertex of the triangle
244 *****************************************************************************************
245 */
246 void hal_gfx_raster_triangle_p0_f(float x0, float y0);
247
248 /**
249 *****************************************************************************************
250 * @brief Raster the second vertex of the triangle strip. (float coordinates)
251 *
252 * @param[in] x1: x coordinate at the second vertex of the triangle
253 * @param[in] y1: y coordinate at the second vertex of the triangle
254 *****************************************************************************************
255 */
256 void hal_gfx_raster_triangle_p1_f(float x1, float y1);
257
258 /**
259 *****************************************************************************************
260 * @brief Raster the third vertex of the triangle strip. (float coordinates)
261 *
262 * @param[in] x2: x coordinate at the third vertex of the triangle
263 * @param[in] y2: y coordinate at the third vertex of the triangle
264 *****************************************************************************************
265 */
266 void hal_gfx_raster_triangle_p2_f(float x2, float y2);
267
268 /**
269 *****************************************************************************************
270 * @brief Raster a quad. (float coordinates)
271 *
272 * @param[in] x0: x coordinate at the first vertex of the quadrilateral
273 * @param[in] y0: y coordinate at the first vertex of the quadrilateral
274 * @param[in] x1: x coordinate at the second vertex of the quadrilateral
275 * @param[in] y1: y coordinate at the second vertex of the quadrilateral
276 * @param[in] x2: x coordinate at the third vertex of the quadrilateral
277 * @param[in] y2: y coordinate at the third vertex of the quadrilateral
278 * @param[in] x3: x coordinate at the fourth vertex of the quadrilateral
279 * @param[in] y3: y coordinate at the fourth vertex of the quadrilateral
280 *****************************************************************************************
281 */
282 void hal_gfx_raster_quad_f(float x0, float y0, float x1, float y1, float x2, float y2, float x3, float y3);
283 /** @} */
284 #ifdef __cplusplus
285 }
286 #endif
287
288 #endif
289 /** @} */
290 /** @} */
291 /** @} */
292
hal_gfx_raster_stroked_circle_aa
void hal_gfx_raster_stroked_circle_aa(float x, float y, float r, float w)
Raster a circle with Anti-Aliasing (if available) and specified width.
hal_gfx_raster_triangle_p0_f
void hal_gfx_raster_triangle_p0_f(float x0, float y0)
Raster the first vertex of the triangle strip.
hal_gfx_raster_quad
void hal_gfx_raster_quad(int x0, int y0, int x1, int y1, int x2, int y2, int x3, int y3)
Raster a quad.
hal_gfx_raster_rect
void hal_gfx_raster_rect(int x, int y, int w, int h)
Raster a rectangle.
hal_gfx_raster_triangle_p1_f
void hal_gfx_raster_triangle_p1_f(float x1, float y1)
Raster the second vertex of the triangle strip.
hal_gfx_raster_line
void hal_gfx_raster_line(int x0, int y0, int x1, int y1)
Raster a line.
hal_gfx_raster_rounded_rect
void hal_gfx_raster_rounded_rect(int x0, int y0, int w, int h, int r)
Raster a rectangle with rounded edges.
hal_gfx_raster_quad_f
void hal_gfx_raster_quad_f(float x0, float y0, float x1, float y1, float x2, float y2, float x3, float y3)
Raster a quad.
hal_gfx_raster_triangle_fx
void hal_gfx_raster_triangle_fx(int x0fx, int y0fx, int x1fx, int y1fx, int x2fx, int y2fx)
Raster a triangle with fixed point(16.16)
hal_gfx_raster_pixel
void hal_gfx_raster_pixel(int x, int y)
Raster a pixel.
hal_gfx_raster_rect_f
void hal_gfx_raster_rect_f(float x, float y, float w, float h)
Raster a rectangle.
hal_gfx_set_raster_color
void hal_gfx_set_raster_color(uint32_t rgba8888)
Setting the raster color.
hal_gfx_raster_triangle_p2_f
void hal_gfx_raster_triangle_p2_f(float x2, float y2)
Raster the third vertex of the triangle strip.
hal_gfx_raster_rect_fx
void hal_gfx_raster_rect_fx(int x, int y, int w, int h)
Raster a rectangle with fixed point(16.16)
hal_gfx_raster_quad_fx
void hal_gfx_raster_quad_fx(int x0fx, int y0fx, int x1fx, int y1fx, int x2fx, int y2fx, int x3fx, int y3fx)
Raster a quad with fixed point(16.16)
hal_gfx_raster_circle_aa
void hal_gfx_raster_circle_aa(float x, float y, float r)
Raster a circle with Anti-Aliasing (if available)
hal_gfx_raster_triangle_f
void hal_gfx_raster_triangle_f(float x0, float y0, float x1, float y1, float x2, float y2)
Raster a triangle.
hal_gfx_raster_triangle
void hal_gfx_raster_triangle(int x0, int y0, int x1, int y1, int x2, int y2)
Raster a triangle.