microui  14.1.1
microui
ui_drawing.c
1 /*
2  * C
3  *
4  * Copyright 2023-2024 MicroEJ Corp. All rights reserved.
5  * Use of this source code is governed by a BSD-style license that can be found with this software.
6  */
7 
8 /*
9  * @file
10  * @brief Redirection of all MicroUI and Drawing libraries drawing functions. This file
11  * is required (must be compiled in the C project) but should not be modified (except when
12  * the VEE port uses more than 3 destination formats, see below).
13  *
14  * According to the available number of destination formats, this file redirects all drawings
15  * to the Graphics Engine software algorithms or uses some tables to target the right drawer
16  * according to the destination format.
17  *
18  * When only one destination format is available and no hardware acceleration (GPU) is
19  * available, the C compiler must just include this file. The default weak implementations
20  * call the Graphics Engine sofware algorithms.
21  *
22  * When only one destination format is available and a hardware acceleration (GPU) is
23  * available, a custom implementation over the GPU must override a set of these default
24  * weak implementations (function UI_DRAWING_xxx()). This allows to override only a set
25  * of functions which are GPU compatible.
26  *
27  * When several destination formats are available, this file uses some tables to target
28  * the right drawer. Each drawer (that targets a specific destination format) has to
29  * specify the table index and has to override a maximum of drawing functions. When a
30  * function is not overridden for a given destination format, the default weak implementation
31  * is used. This implementation uses the stub implementation.
32  *
33  * The BSP has to set the define "UI_GC_SUPPORTED_FORMATS". When not set or smaller than
34  * "2", this file considers only one destination format is available: the same format as
35  * the buffer of the display.
36  *
37  * When this define is "2" or "3", this file uses the tables indirections. The format "0" is
38  * reserved for the display buffer format (and for the GraphicsContext that uses the same
39  * format). The formats "1" and "2" are specific to the VEE Port.
40  *
41  * This file does not manages more than 3 destination formats ("0" == display buffer format
42  * and custom formats "1" and "2"). However the file can be easily modified to target more
43  * than 3 destination formats. See format "2" support and apply same patterns to add the
44  * format "3".
45  *
46  * @author MicroEJ Developer Team
47  * @version 14.1.1
48  * @see ui_drawing.h
49  */
50 
51 // -----------------------------------------------------------------------------
52 // Includes
53 // -----------------------------------------------------------------------------
54 
55 #include <assert.h>
56 
57 #include <LLUI_DISPLAY.h>
58 
59 #include "ui_drawing.h"
60 #include "ui_drawing_stub.h"
61 #include "ui_drawing_soft.h"
62 #include "dw_drawing_soft.h"
63 #include "ui_image_drawing.h"
64 #include "ui_font_drawing.h"
65 #include "ui_configuration.h"
66 #include "bsp_util.h"
67 
68 // --------------------------------------------------------------------------------
69 // Defines
70 // --------------------------------------------------------------------------------
71 
72 #if !defined(UI_GC_SUPPORTED_FORMATS) || (UI_GC_SUPPORTED_FORMATS <= 1)
73 
74 /*
75  * The functions UI_DRAWING_DEFAULT_xxx() are directly called by LLUI_DISPLAY_impl.c, LLUI_PAINTER_impl.c and
76  * LLDW_PAINTER_impl.c. Other files can override each weak
77  * function independently to use a GPU.
78  */
79 
80 #define UI_DRAWING_DEFAULT_writePixel UI_DRAWING_writePixel
81 #define UI_DRAWING_DEFAULT_drawLine UI_DRAWING_drawLine
82 #define UI_DRAWING_DEFAULT_drawHorizontalLine UI_DRAWING_drawHorizontalLine
83 #define UI_DRAWING_DEFAULT_drawVerticalLine UI_DRAWING_drawVerticalLine
84 #define UI_DRAWING_DEFAULT_drawRectangle UI_DRAWING_drawRectangle
85 #define UI_DRAWING_DEFAULT_fillRectangle UI_DRAWING_fillRectangle
86 #define UI_DRAWING_DEFAULT_drawRoundedRectangle UI_DRAWING_drawRoundedRectangle
87 #define UI_DRAWING_DEFAULT_fillRoundedRectangle UI_DRAWING_fillRoundedRectangle
88 #define UI_DRAWING_DEFAULT_drawCircleArc UI_DRAWING_drawCircleArc
89 #define UI_DRAWING_DEFAULT_drawEllipseArc UI_DRAWING_drawEllipseArc
90 #define UI_DRAWING_DEFAULT_fillCircleArc UI_DRAWING_fillCircleArc
91 #define UI_DRAWING_DEFAULT_fillEllipseArc UI_DRAWING_fillEllipseArc
92 #define UI_DRAWING_DEFAULT_drawEllipse UI_DRAWING_drawEllipse
93 #define UI_DRAWING_DEFAULT_fillEllipse UI_DRAWING_fillEllipse
94 #define UI_DRAWING_DEFAULT_drawCircle UI_DRAWING_drawCircle
95 #define UI_DRAWING_DEFAULT_fillCircle UI_DRAWING_fillCircle
96 #define UI_DRAWING_DEFAULT_drawString UI_DRAWING_drawString
97 #define UI_DRAWING_DEFAULT_drawRenderableString UI_DRAWING_drawRenderableString
98 #define UI_DRAWING_DEFAULT_drawImage UI_DRAWING_drawImage
99 #define UI_DRAWING_DEFAULT_copyImage UI_DRAWING_copyImage
100 #define UI_DRAWING_DEFAULT_drawRegion UI_DRAWING_drawRegion
101 
102 #define UI_DRAWING_DEFAULT_drawThickFadedPoint UI_DRAWING_drawThickFadedPoint
103 #define UI_DRAWING_DEFAULT_drawThickFadedLine UI_DRAWING_drawThickFadedLine
104 #define UI_DRAWING_DEFAULT_drawThickFadedCircle UI_DRAWING_drawThickFadedCircle
105 #define UI_DRAWING_DEFAULT_drawThickFadedCircleArc UI_DRAWING_drawThickFadedCircleArc
106 #define UI_DRAWING_DEFAULT_drawThickFadedEllipse UI_DRAWING_drawThickFadedEllipse
107 #define UI_DRAWING_DEFAULT_drawThickLine UI_DRAWING_drawThickLine
108 #define UI_DRAWING_DEFAULT_drawThickCircle UI_DRAWING_drawThickCircle
109 #define UI_DRAWING_DEFAULT_drawThickEllipse UI_DRAWING_drawThickEllipse
110 #define UI_DRAWING_DEFAULT_drawThickCircleArc UI_DRAWING_drawThickCircleArc
111 #define UI_DRAWING_DEFAULT_drawFlippedImage UI_DRAWING_drawFlippedImage
112 #define UI_DRAWING_DEFAULT_drawRotatedImageNearestNeighbor UI_DRAWING_drawRotatedImageNearestNeighbor
113 #define UI_DRAWING_DEFAULT_drawRotatedImageBilinear UI_DRAWING_drawRotatedImageBilinear
114 #define UI_DRAWING_DEFAULT_drawScaledImageNearestNeighbor UI_DRAWING_drawScaledImageNearestNeighbor
115 #define UI_DRAWING_DEFAULT_drawScaledImageBilinear UI_DRAWING_drawScaledImageBilinear
116 #define UI_DRAWING_DEFAULT_drawScaledStringBilinear UI_DRAWING_drawScaledStringBilinear
117 #define UI_DRAWING_DEFAULT_drawScaledRenderableStringBilinear UI_DRAWING_drawScaledRenderableStringBilinear
118 #define UI_DRAWING_DEFAULT_drawCharWithRotationBilinear UI_DRAWING_drawCharWithRotationBilinear
119 #define UI_DRAWING_DEFAULT_drawCharWithRotationNearestNeighbor UI_DRAWING_drawCharWithRotationNearestNeighbor
120 
121 #else // !defined(UI_GC_SUPPORTED_FORMATS) || (UI_GC_SUPPORTED_FORMATS <= 1)
122 
123 /*
124  * The functions UI_DRAWING_DEFAULT_xxx() are indirectly called through some tables.
125  * The functions have got the identifier "0" as suffix. Another file can override
126  * each weak function independently to use a GPU.
127  */
128 
129 #define UI_DRAWING_DEFAULT_writePixel UI_DRAWING_writePixel_0
130 #define UI_DRAWING_DEFAULT_drawLine UI_DRAWING_drawLine_0
131 #define UI_DRAWING_DEFAULT_drawHorizontalLine UI_DRAWING_drawHorizontalLine_0
132 #define UI_DRAWING_DEFAULT_drawVerticalLine UI_DRAWING_drawVerticalLine_0
133 #define UI_DRAWING_DEFAULT_drawRectangle UI_DRAWING_drawRectangle_0
134 #define UI_DRAWING_DEFAULT_fillRectangle UI_DRAWING_fillRectangle_0
135 #define UI_DRAWING_DEFAULT_drawRoundedRectangle UI_DRAWING_drawRoundedRectangle_0
136 #define UI_DRAWING_DEFAULT_fillRoundedRectangle UI_DRAWING_fillRoundedRectangle_0
137 #define UI_DRAWING_DEFAULT_drawCircleArc UI_DRAWING_drawCircleArc_0
138 #define UI_DRAWING_DEFAULT_drawEllipseArc UI_DRAWING_drawEllipseArc_0
139 #define UI_DRAWING_DEFAULT_fillCircleArc UI_DRAWING_fillCircleArc_0
140 #define UI_DRAWING_DEFAULT_fillEllipseArc UI_DRAWING_fillEllipseArc_0
141 #define UI_DRAWING_DEFAULT_drawEllipse UI_DRAWING_drawEllipse_0
142 #define UI_DRAWING_DEFAULT_fillEllipse UI_DRAWING_fillEllipse_0
143 #define UI_DRAWING_DEFAULT_drawCircle UI_DRAWING_drawCircle_0
144 #define UI_DRAWING_DEFAULT_fillCircle UI_DRAWING_fillCircle_0
145 #define UI_DRAWING_DEFAULT_drawString UI_DRAWING_drawString_0
146 #define UI_DRAWING_DEFAULT_drawRenderableString UI_DRAWING_drawRenderableString_0
147 #define UI_DRAWING_DEFAULT_drawImage UI_DRAWING_drawImage_0
148 #define UI_DRAWING_DEFAULT_copyImage UI_DRAWING_copyImage_0
149 #define UI_DRAWING_DEFAULT_drawRegion UI_DRAWING_drawRegion_0
150 
151 #define UI_DRAWING_DEFAULT_drawThickFadedPoint UI_DRAWING_drawThickFadedPoint_0
152 #define UI_DRAWING_DEFAULT_drawThickFadedLine UI_DRAWING_drawThickFadedLine_0
153 #define UI_DRAWING_DEFAULT_drawThickFadedCircle UI_DRAWING_drawThickFadedCircle_0
154 #define UI_DRAWING_DEFAULT_drawThickFadedCircleArc UI_DRAWING_drawThickFadedCircleArc_0
155 #define UI_DRAWING_DEFAULT_drawThickFadedEllipse UI_DRAWING_drawThickFadedEllipse_0
156 #define UI_DRAWING_DEFAULT_drawThickLine UI_DRAWING_drawThickLine_0
157 #define UI_DRAWING_DEFAULT_drawThickCircle UI_DRAWING_drawThickCircle_0
158 #define UI_DRAWING_DEFAULT_drawThickEllipse UI_DRAWING_drawThickEllipse_0
159 #define UI_DRAWING_DEFAULT_drawThickCircleArc UI_DRAWING_drawThickCircleArc_0
160 #define UI_DRAWING_DEFAULT_drawFlippedImage UI_DRAWING_drawFlippedImage_0
161 #define UI_DRAWING_DEFAULT_drawRotatedImageNearestNeighbor UI_DRAWING_drawRotatedImageNearestNeighbor_0
162 #define UI_DRAWING_DEFAULT_drawRotatedImageBilinear UI_DRAWING_drawRotatedImageBilinear_0
163 #define UI_DRAWING_DEFAULT_drawScaledImageNearestNeighbor UI_DRAWING_drawScaledImageNearestNeighbor_0
164 #define UI_DRAWING_DEFAULT_drawScaledImageBilinear UI_DRAWING_drawScaledImageBilinear_0
165 #define UI_DRAWING_DEFAULT_drawScaledStringBilinear UI_DRAWING_drawScaledStringBilinear_0
166 #define UI_DRAWING_DEFAULT_drawScaledRenderableStringBilinear UI_DRAWING_drawScaledRenderableStringBilinear_0
167 #define UI_DRAWING_DEFAULT_drawCharWithRotationBilinear UI_DRAWING_drawCharWithRotationBilinear_0
168 #define UI_DRAWING_DEFAULT_drawCharWithRotationNearestNeighbor UI_DRAWING_drawCharWithRotationNearestNeighbor_0
169 
170 #endif // !defined(UI_GC_SUPPORTED_FORMATS) || (UI_GC_SUPPORTED_FORMATS <= 1)
171 
172 // --------------------------------------------------------------------------------
173 // Extern functions
174 // --------------------------------------------------------------------------------
175 
176 #if defined(UI_GC_SUPPORTED_FORMATS) && (UI_GC_SUPPORTED_FORMATS > 1)
177 
178 /*
179  * @brief Set of drawing functions according to the index of the destination format in
180  * the drawing tables ("0", "1" or "2").
181  *
182  * These functions must be declared in other H files.
183  */
184 
185 #if (UI_GC_SUPPORTED_FORMATS > 3)
186 #error "Increase the number of following functions and update the next tables"
187 #endif
188 
189 extern DRAWING_Status UI_DRAWING_writePixel_0(MICROUI_GraphicsContext *gc, jint x, jint y);
190 extern DRAWING_Status UI_DRAWING_drawLine_0(MICROUI_GraphicsContext *gc, jint startX, jint startY, jint endX,
191  jint endY);
192 extern DRAWING_Status UI_DRAWING_drawHorizontalLine_0(MICROUI_GraphicsContext *gc, jint x1, jint x2, jint y);
193 extern DRAWING_Status UI_DRAWING_drawVerticalLine_0(MICROUI_GraphicsContext *gc, jint x, jint y1, jint y2);
194 extern DRAWING_Status UI_DRAWING_drawRectangle_0(MICROUI_GraphicsContext *gc, jint x1, jint y1, jint x2, jint y2);
195 extern DRAWING_Status UI_DRAWING_fillRectangle_0(MICROUI_GraphicsContext *gc, jint x1, jint y1, jint x2, jint y2);
196 extern DRAWING_Status UI_DRAWING_drawRoundedRectangle_0(MICROUI_GraphicsContext *gc, jint x, jint y, jint width,
197  jint height, jint cornerEllipseWidth, jint cornerEllipseHeight);
198 extern DRAWING_Status UI_DRAWING_fillRoundedRectangle_0(MICROUI_GraphicsContext *gc, jint x, jint y, jint width,
199  jint height, jint cornerEllipseWidth, jint cornerEllipseHeight);
200 extern DRAWING_Status UI_DRAWING_drawCircleArc_0(MICROUI_GraphicsContext *gc, jint x, jint y, jint diameter,
201  jfloat startAngle, jfloat arcAngle);
202 extern DRAWING_Status UI_DRAWING_drawEllipseArc_0(MICROUI_GraphicsContext *gc, jint x, jint y, jint width, jint height,
203  jfloat startAngle, jfloat arcAngle);
204 extern DRAWING_Status UI_DRAWING_fillCircleArc_0(MICROUI_GraphicsContext *gc, jint x, jint y, jint diameter,
205  jfloat startAngle, jfloat arcAngle);
206 extern DRAWING_Status UI_DRAWING_fillEllipseArc_0(MICROUI_GraphicsContext *gc, jint x, jint y, jint width, jint height,
207  jfloat startAngle, jfloat arcAngle);
208 extern DRAWING_Status UI_DRAWING_drawEllipse_0(MICROUI_GraphicsContext *gc, jint x, jint y, jint width, jint height);
209 extern DRAWING_Status UI_DRAWING_fillEllipse_0(MICROUI_GraphicsContext *gc, jint x, jint y, jint width, jint height);
210 extern DRAWING_Status UI_DRAWING_drawCircle_0(MICROUI_GraphicsContext *gc, jint x, jint y, jint diameter);
211 extern DRAWING_Status UI_DRAWING_fillCircle_0(MICROUI_GraphicsContext *gc, jint x, jint y, jint diameter);
212 extern DRAWING_Status UI_DRAWING_drawString_0(MICROUI_GraphicsContext *gc, jchar *chars, jint length,
213  MICROUI_Font *font, jint x, jint y);
214 extern DRAWING_Status UI_DRAWING_drawRenderableString_0(MICROUI_GraphicsContext *gc, jchar *chars, jint length,
215  MICROUI_Font *font, jint width,
216  MICROUI_RenderableString *renderableString, jint x, jint y);
217 extern DRAWING_Status UI_DRAWING_drawImage_0(MICROUI_GraphicsContext *gc, MICROUI_Image *img, jint regionX,
218  jint regionY, jint width, jint height, jint x, jint y, jint alpha);
219 extern DRAWING_Status UI_DRAWING_copyImage_0(MICROUI_GraphicsContext *gc, MICROUI_Image *img, jint regionX,
220  jint regionY, jint width, jint height, jint x, jint y);
221 extern DRAWING_Status UI_DRAWING_drawRegion_0(MICROUI_GraphicsContext *gc, jint regionX, jint regionY, jint width,
222  jint height, jint x, jint y, jint alpha);
223 extern DRAWING_Status UI_DRAWING_drawThickFadedPoint_0(MICROUI_GraphicsContext *gc, jint x, jint y, jint thickness,
224  jint fade);
225 extern DRAWING_Status UI_DRAWING_drawThickFadedLine_0(MICROUI_GraphicsContext *gc, jint startX, jint startY, jint endX,
226  jint endY, jint thickness, jint fade, DRAWING_Cap startCap,
227  DRAWING_Cap endCap);
228 extern DRAWING_Status UI_DRAWING_drawThickFadedCircle_0(MICROUI_GraphicsContext *gc, jint x, jint y, jint diameter,
229  jint thickness, jint fade);
230 extern DRAWING_Status UI_DRAWING_drawThickFadedCircleArc_0(MICROUI_GraphicsContext *gc, jint x, jint y, jint diameter,
231  jfloat startAngle, jfloat arcAngle, jint thickness,
232  jint fade, DRAWING_Cap start, DRAWING_Cap end);
233 extern DRAWING_Status UI_DRAWING_drawThickFadedEllipse_0(MICROUI_GraphicsContext *gc, jint x, jint y, jint width,
234  jint height, jint thickness, jint fade);
235 extern DRAWING_Status UI_DRAWING_drawThickLine_0(MICROUI_GraphicsContext *gc, jint startX, jint startY, jint endX,
236  jint endY, jint thickness);
237 extern DRAWING_Status UI_DRAWING_drawThickCircle_0(MICROUI_GraphicsContext *gc, jint x, jint y, jint diameter,
238  jint thickness);
239 extern DRAWING_Status UI_DRAWING_drawThickEllipse_0(MICROUI_GraphicsContext *gc, jint x, jint y, jint width,
240  jint height, jint thickness);
241 extern DRAWING_Status UI_DRAWING_drawThickCircleArc_0(MICROUI_GraphicsContext *gc, jint x, jint y, jint diameter,
242  jfloat startAngle, jfloat arcAngle, jint thickness);
243 extern DRAWING_Status UI_DRAWING_drawFlippedImage_0(MICROUI_GraphicsContext *gc, MICROUI_Image *img, jint regionX,
244  jint regionY, jint width, jint height, jint x, jint y,
245  DRAWING_Flip transformation, jint alpha);
246 extern DRAWING_Status UI_DRAWING_drawRotatedImageNearestNeighbor_0(MICROUI_GraphicsContext *gc, MICROUI_Image *img,
247  jint x, jint y, jint rotationX, jint rotationY,
248  jfloat angle, jint alpha);
249 extern DRAWING_Status UI_DRAWING_drawRotatedImageBilinear_0(MICROUI_GraphicsContext *gc, MICROUI_Image *img, jint x,
250  jint y, jint rotationX, jint rotationY, jfloat angle,
251  jint alpha);
252 extern DRAWING_Status UI_DRAWING_drawScaledImageNearestNeighbor_0(MICROUI_GraphicsContext *gc, MICROUI_Image *img,
253  jint x, jint y, jfloat factorX, jfloat factorY,
254  jint alpha);
255 extern DRAWING_Status UI_DRAWING_drawScaledImageBilinear_0(MICROUI_GraphicsContext *gc, MICROUI_Image *img, jint x,
256  jint y, jfloat factorX, jfloat factorY, jint alpha);
257 extern DRAWING_Status UI_DRAWING_drawScaledStringBilinear_0(MICROUI_GraphicsContext *gc, jchar *chars, jint length,
258  MICROUI_Font *font, jint x, jint y, jfloat xRatio,
259  jfloat yRatio);
260 extern DRAWING_Status UI_DRAWING_drawScaledRenderableStringBilinear_0(MICROUI_GraphicsContext *gc, jchar *chars,
261  jint length, MICROUI_Font *font, jint width,
262  MICROUI_RenderableString *renderableString,
263  jint x, jint y, jfloat xRatio, jfloat yRatio);
264 extern DRAWING_Status UI_DRAWING_drawCharWithRotationBilinear_0(MICROUI_GraphicsContext *gc, jchar c,
265  MICROUI_Font *font, jint x, jint y, jint xRotation,
266  jint yRotation, jfloat angle, jint alpha);
267 extern DRAWING_Status UI_DRAWING_drawCharWithRotationNearestNeighbor_0(MICROUI_GraphicsContext *gc, jchar c,
268  MICROUI_Font *font, jint x, jint y,
269  jint xRotation, jint yRotation, jfloat angle,
270  jint alpha);
271 
272 extern uint32_t UI_DRAWING_getNewImageStrideInBytes_1(jbyte image_format, uint32_t width, uint32_t height,
273  uint32_t default_stride);
274 extern void UI_DRAWING_adjustNewImageCharacteristics_1(jbyte image_format, uint32_t width, uint32_t height,
275  uint32_t *data_size, uint32_t *data_alignment);
276 extern void UI_DRAWING_initializeNewImage_1(MICROUI_Image *image);
277 extern void UI_DRAWING_freeImageResources_1(MICROUI_Image *image);
278 extern DRAWING_Status UI_DRAWING_writePixel_1(MICROUI_GraphicsContext *gc, jint x, jint y);
279 extern DRAWING_Status UI_DRAWING_drawLine_1(MICROUI_GraphicsContext *gc, jint startX, jint startY, jint endX,
280  jint endY);
281 extern DRAWING_Status UI_DRAWING_drawHorizontalLine_1(MICROUI_GraphicsContext *gc, jint x1, jint x2, jint y);
282 extern DRAWING_Status UI_DRAWING_drawVerticalLine_1(MICROUI_GraphicsContext *gc, jint x, jint y1, jint y2);
283 extern DRAWING_Status UI_DRAWING_drawRectangle_1(MICROUI_GraphicsContext *gc, jint x1, jint y1, jint x2, jint y2);
284 extern DRAWING_Status UI_DRAWING_fillRectangle_1(MICROUI_GraphicsContext *gc, jint x1, jint y1, jint x2, jint y2);
285 extern DRAWING_Status UI_DRAWING_drawRoundedRectangle_1(MICROUI_GraphicsContext *gc, jint x, jint y, jint width,
286  jint height, jint cornerEllipseWidth, jint cornerEllipseHeight);
287 extern DRAWING_Status UI_DRAWING_fillRoundedRectangle_1(MICROUI_GraphicsContext *gc, jint x, jint y, jint width,
288  jint height, jint cornerEllipseWidth, jint cornerEllipseHeight);
289 extern DRAWING_Status UI_DRAWING_drawCircleArc_1(MICROUI_GraphicsContext *gc, jint x, jint y, jint diameter,
290  jfloat startAngle, jfloat arcAngle);
291 extern DRAWING_Status UI_DRAWING_drawEllipseArc_1(MICROUI_GraphicsContext *gc, jint x, jint y, jint width, jint height,
292  jfloat startAngle, jfloat arcAngle);
293 extern DRAWING_Status UI_DRAWING_fillCircleArc_1(MICROUI_GraphicsContext *gc, jint x, jint y, jint diameter,
294  jfloat startAngle, jfloat arcAngle);
295 extern DRAWING_Status UI_DRAWING_fillEllipseArc_1(MICROUI_GraphicsContext *gc, jint x, jint y, jint width, jint height,
296  jfloat startAngle, jfloat arcAngle);
297 extern DRAWING_Status UI_DRAWING_drawEllipse_1(MICROUI_GraphicsContext *gc, jint x, jint y, jint width, jint height);
298 extern DRAWING_Status UI_DRAWING_fillEllipse_1(MICROUI_GraphicsContext *gc, jint x, jint y, jint width, jint height);
299 extern DRAWING_Status UI_DRAWING_drawCircle_1(MICROUI_GraphicsContext *gc, jint x, jint y, jint diameter);
300 extern DRAWING_Status UI_DRAWING_fillCircle_1(MICROUI_GraphicsContext *gc, jint x, jint y, jint diameter);
301 extern DRAWING_Status UI_DRAWING_drawString_1(MICROUI_GraphicsContext *gc, jchar *chars, jint length,
302  MICROUI_Font *font, jint x, jint y);
303 extern DRAWING_Status UI_DRAWING_drawRenderableString_1(MICROUI_GraphicsContext *gc, jchar *chars, jint length,
304  MICROUI_Font *font, jint width,
305  MICROUI_RenderableString *renderableString, jint x, jint y);
306 extern DRAWING_Status UI_DRAWING_drawImage_1(MICROUI_GraphicsContext *gc, MICROUI_Image *img, jint regionX,
307  jint regionY, jint width, jint height, jint x, jint y, jint alpha);
308 extern DRAWING_Status UI_DRAWING_copyImage_1(MICROUI_GraphicsContext *gc, MICROUI_Image *img, jint regionX,
309  jint regionY, jint width, jint height, jint x, jint y);
310 extern DRAWING_Status UI_DRAWING_drawRegion_1(MICROUI_GraphicsContext *gc, jint regionX, jint regionY, jint width,
311  jint height, jint x, jint y, jint alpha);
312 extern DRAWING_Status UI_DRAWING_drawThickFadedPoint_1(MICROUI_GraphicsContext *gc, jint x, jint y, jint thickness,
313  jint fade);
314 extern DRAWING_Status UI_DRAWING_drawThickFadedLine_1(MICROUI_GraphicsContext *gc, jint startX, jint startY, jint endX,
315  jint endY, jint thickness, jint fade, DRAWING_Cap startCap,
316  DRAWING_Cap endCap);
317 extern DRAWING_Status UI_DRAWING_drawThickFadedCircle_1(MICROUI_GraphicsContext *gc, jint x, jint y, jint diameter,
318  jint thickness, jint fade);
319 extern DRAWING_Status UI_DRAWING_drawThickFadedCircleArc_1(MICROUI_GraphicsContext *gc, jint x, jint y, jint diameter,
320  jfloat startAngle, jfloat arcAngle, jint thickness,
321  jint fade, DRAWING_Cap start, DRAWING_Cap end);
322 extern DRAWING_Status UI_DRAWING_drawThickFadedEllipse_1(MICROUI_GraphicsContext *gc, jint x, jint y, jint width,
323  jint height, jint thickness, jint fade);
324 extern DRAWING_Status UI_DRAWING_drawThickLine_1(MICROUI_GraphicsContext *gc, jint startX, jint startY, jint endX,
325  jint endY, jint thickness);
326 extern DRAWING_Status UI_DRAWING_drawThickCircle_1(MICROUI_GraphicsContext *gc, jint x, jint y, jint diameter,
327  jint thickness);
328 extern DRAWING_Status UI_DRAWING_drawThickEllipse_1(MICROUI_GraphicsContext *gc, jint x, jint y, jint width,
329  jint height, jint thickness);
330 extern DRAWING_Status UI_DRAWING_drawThickCircleArc_1(MICROUI_GraphicsContext *gc, jint x, jint y, jint diameter,
331  jfloat startAngle, jfloat arcAngle, jint thickness);
332 extern DRAWING_Status UI_DRAWING_drawFlippedImage_1(MICROUI_GraphicsContext *gc, MICROUI_Image *img, jint regionX,
333  jint regionY, jint width, jint height, jint x, jint y,
334  DRAWING_Flip transformation, jint alpha);
335 extern DRAWING_Status UI_DRAWING_drawRotatedImageNearestNeighbor_1(MICROUI_GraphicsContext *gc, MICROUI_Image *img,
336  jint x, jint y, jint rotationX, jint rotationY,
337  jfloat angle, jint alpha);
338 extern DRAWING_Status UI_DRAWING_drawRotatedImageBilinear_1(MICROUI_GraphicsContext *gc, MICROUI_Image *img, jint x,
339  jint y, jint rotationX, jint rotationY, jfloat angle,
340  jint alpha);
341 extern DRAWING_Status UI_DRAWING_drawScaledImageNearestNeighbor_1(MICROUI_GraphicsContext *gc, MICROUI_Image *img,
342  jint x, jint y, jfloat factorX, jfloat factorY,
343  jint alpha);
344 extern DRAWING_Status UI_DRAWING_drawScaledImageBilinear_1(MICROUI_GraphicsContext *gc, MICROUI_Image *img, jint x,
345  jint y, jfloat factorX, jfloat factorY, jint alpha);
346 extern DRAWING_Status UI_DRAWING_drawScaledStringBilinear_1(MICROUI_GraphicsContext *gc, jchar *chars, jint length,
347  MICROUI_Font *font, jint x, jint y, jfloat xRatio,
348  jfloat yRatio);
349 extern DRAWING_Status UI_DRAWING_drawScaledRenderableStringBilinear_1(MICROUI_GraphicsContext *gc, jchar *chars,
350  jint length, MICROUI_Font *font, jint width,
351  MICROUI_RenderableString *renderableString,
352  jint x, jint y, jfloat xRatio, jfloat yRatio);
353 extern DRAWING_Status UI_DRAWING_drawCharWithRotationBilinear_1(MICROUI_GraphicsContext *gc, jchar c,
354  MICROUI_Font *font, jint x, jint y, jint xRotation,
355  jint yRotation, jfloat angle, jint alpha);
356 extern DRAWING_Status UI_DRAWING_drawCharWithRotationNearestNeighbor_1(MICROUI_GraphicsContext *gc, jchar c,
357  MICROUI_Font *font, jint x, jint y,
358  jint xRotation, jint yRotation, jfloat angle,
359  jint alpha);
360 
361 #if (UI_GC_SUPPORTED_FORMATS > 2)
362 extern uint32_t UI_DRAWING_getNewImageStrideInBytes_2(jbyte image_format, uint32_t width, uint32_t height,
363  uint32_t default_stride);
364 extern void UI_DRAWING_adjustNewImageCharacteristics_2(jbyte image_format, uint32_t width, uint32_t height,
365  uint32_t *data_size, uint32_t *data_alignment);
366 extern void UI_DRAWING_initializeNewImage_2(MICROUI_Image *image);
367 extern void UI_DRAWING_freeImageResources_2(MICROUI_Image *image);
368 extern DRAWING_Status UI_DRAWING_writePixel_2(MICROUI_GraphicsContext *gc, jint x, jint y);
369 extern DRAWING_Status UI_DRAWING_drawLine_2(MICROUI_GraphicsContext *gc, jint startX, jint startY, jint endX,
370  jint endY);
371 extern DRAWING_Status UI_DRAWING_drawHorizontalLine_2(MICROUI_GraphicsContext *gc, jint x1, jint x2, jint y);
372 extern DRAWING_Status UI_DRAWING_drawVerticalLine_2(MICROUI_GraphicsContext *gc, jint x, jint y1, jint y2);
373 extern DRAWING_Status UI_DRAWING_drawRectangle_2(MICROUI_GraphicsContext *gc, jint x1, jint y1, jint x2, jint y2);
374 extern DRAWING_Status UI_DRAWING_fillRectangle_2(MICROUI_GraphicsContext *gc, jint x1, jint y1, jint x2, jint y2);
375 extern DRAWING_Status UI_DRAWING_drawRoundedRectangle_2(MICROUI_GraphicsContext *gc, jint x, jint y, jint width,
376  jint height, jint cornerEllipseWidth, jint cornerEllipseHeight);
377 extern DRAWING_Status UI_DRAWING_fillRoundedRectangle_2(MICROUI_GraphicsContext *gc, jint x, jint y, jint width,
378  jint height, jint cornerEllipseWidth, jint cornerEllipseHeight);
379 extern DRAWING_Status UI_DRAWING_drawCircleArc_2(MICROUI_GraphicsContext *gc, jint x, jint y, jint diameter,
380  jfloat startAngle, jfloat arcAngle);
381 extern DRAWING_Status UI_DRAWING_drawEllipseArc_2(MICROUI_GraphicsContext *gc, jint x, jint y, jint width, jint height,
382  jfloat startAngle, jfloat arcAngle);
383 extern DRAWING_Status UI_DRAWING_fillCircleArc_2(MICROUI_GraphicsContext *gc, jint x, jint y, jint diameter,
384  jfloat startAngle, jfloat arcAngle);
385 extern DRAWING_Status UI_DRAWING_fillEllipseArc_2(MICROUI_GraphicsContext *gc, jint x, jint y, jint width, jint height,
386  jfloat startAngle, jfloat arcAngle);
387 extern DRAWING_Status UI_DRAWING_drawEllipse_2(MICROUI_GraphicsContext *gc, jint x, jint y, jint width, jint height);
388 extern DRAWING_Status UI_DRAWING_fillEllipse_2(MICROUI_GraphicsContext *gc, jint x, jint y, jint width, jint height);
389 extern DRAWING_Status UI_DRAWING_drawCircle_2(MICROUI_GraphicsContext *gc, jint x, jint y, jint diameter);
390 extern DRAWING_Status UI_DRAWING_fillCircle_2(MICROUI_GraphicsContext *gc, jint x, jint y, jint diameter);
391 extern DRAWING_Status UI_DRAWING_drawString_2(MICROUI_GraphicsContext *gc, jchar *chars, jint length,
392  MICROUI_Font *font, jint x, jint y);
393 extern DRAWING_Status UI_DRAWING_drawRenderableString_2(MICROUI_GraphicsContext *gc, jchar *chars, jint length,
394  MICROUI_Font *font, jint width,
395  MICROUI_RenderableString *renderableString, jint x, jint y);
396 extern DRAWING_Status UI_DRAWING_drawImage_2(MICROUI_GraphicsContext *gc, MICROUI_Image *img, jint regionX,
397  jint regionY, jint width, jint height, jint x, jint y, jint alpha);
398 extern DRAWING_Status UI_DRAWING_copyImage_2(MICROUI_GraphicsContext *gc, MICROUI_Image *img, jint regionX,
399  jint regionY, jint width, jint height, jint x, jint y);
400 extern DRAWING_Status UI_DRAWING_drawRegion_2(MICROUI_GraphicsContext *gc, jint regionX, jint regionY, jint width,
401  jint height, jint x, jint y, jint alpha);
402 extern DRAWING_Status UI_DRAWING_drawThickFadedPoint_2(MICROUI_GraphicsContext *gc, jint x, jint y, jint thickness,
403  jint fade);
404 extern DRAWING_Status UI_DRAWING_drawThickFadedLine_2(MICROUI_GraphicsContext *gc, jint startX, jint startY, jint endX,
405  jint endY, jint thickness, jint fade, DRAWING_Cap startCap,
406  DRAWING_Cap endCap);
407 extern DRAWING_Status UI_DRAWING_drawThickFadedCircle_2(MICROUI_GraphicsContext *gc, jint x, jint y, jint diameter,
408  jint thickness, jint fade);
409 extern DRAWING_Status UI_DRAWING_drawThickFadedCircleArc_2(MICROUI_GraphicsContext *gc, jint x, jint y, jint diameter,
410  jfloat startAngle, jfloat arcAngle, jint thickness,
411  jint fade, DRAWING_Cap start, DRAWING_Cap end);
412 extern DRAWING_Status UI_DRAWING_drawThickFadedEllipse_2(MICROUI_GraphicsContext *gc, jint x, jint y, jint width,
413  jint height, jint thickness, jint fade);
414 extern DRAWING_Status UI_DRAWING_drawThickLine_2(MICROUI_GraphicsContext *gc, jint startX, jint startY, jint endX,
415  jint endY, jint thickness);
416 extern DRAWING_Status UI_DRAWING_drawThickCircle_2(MICROUI_GraphicsContext *gc, jint x, jint y, jint diameter,
417  jint thickness);
418 extern DRAWING_Status UI_DRAWING_drawThickEllipse_2(MICROUI_GraphicsContext *gc, jint x, jint y, jint width,
419  jint height, jint thickness);
420 extern DRAWING_Status UI_DRAWING_drawThickCircleArc_2(MICROUI_GraphicsContext *gc, jint x, jint y, jint diameter,
421  jfloat startAngle, jfloat arcAngle, jint thickness);
422 extern DRAWING_Status UI_DRAWING_drawFlippedImage_2(MICROUI_GraphicsContext *gc, MICROUI_Image *img, jint regionX,
423  jint regionY, jint width, jint height, jint x, jint y,
424  DRAWING_Flip transformation, jint alpha);
425 extern DRAWING_Status UI_DRAWING_drawRotatedImageNearestNeighbor_2(MICROUI_GraphicsContext *gc, MICROUI_Image *img,
426  jint x, jint y, jint rotationX, jint rotationY,
427  jfloat angle, jint alpha);
428 extern DRAWING_Status UI_DRAWING_drawRotatedImageBilinear_2(MICROUI_GraphicsContext *gc, MICROUI_Image *img, jint x,
429  jint y, jint rotationX, jint rotationY, jfloat angle,
430  jint alpha);
431 extern DRAWING_Status UI_DRAWING_drawScaledImageNearestNeighbor_2(MICROUI_GraphicsContext *gc, MICROUI_Image *img,
432  jint x, jint y, jfloat factorX, jfloat factorY,
433  jint alpha);
434 extern DRAWING_Status UI_DRAWING_drawScaledImageBilinear_2(MICROUI_GraphicsContext *gc, MICROUI_Image *img, jint x,
435  jint y, jfloat factorX, jfloat factorY, jint alpha);
436 extern DRAWING_Status UI_DRAWING_drawScaledStringBilinear_2(MICROUI_GraphicsContext *gc, jchar *chars, jint length,
437  MICROUI_Font *font, jint x, jint y, jfloat xRatio,
438  jfloat yRatio);
439 extern DRAWING_Status UI_DRAWING_drawScaledRenderableStringBilinear_2(MICROUI_GraphicsContext *gc, jchar *chars,
440  jint length, MICROUI_Font *font, jint width,
441  MICROUI_RenderableString *renderableString,
442  jint x, jint y, jfloat xRatio, jfloat yRatio);
443 extern DRAWING_Status UI_DRAWING_drawCharWithRotationBilinear_2(MICROUI_GraphicsContext *gc, jchar c,
444  MICROUI_Font *font, jint x, jint y, jint xRotation,
445  jint yRotation, jfloat angle, jint alpha);
446 extern DRAWING_Status UI_DRAWING_drawCharWithRotationNearestNeighbor_2(MICROUI_GraphicsContext *gc, jchar c,
447  MICROUI_Font *font, jint x, jint y,
448  jint xRotation, jint yRotation, jfloat angle,
449  jint alpha);
450 
451 #endif // (UI_GC_SUPPORTED_FORMATS > 2)
452 
453 #endif // defined(UI_GC_SUPPORTED_FORMATS) && (UI_GC_SUPPORTED_FORMATS > 1)
454 
455 // --------------------------------------------------------------------------------
456 // Typedef of drawing functions
457 // --------------------------------------------------------------------------------
458 
459 #if defined(UI_GC_SUPPORTED_FORMATS) && (UI_GC_SUPPORTED_FORMATS > 1)
460 
461 /*
462  * @brief Typedef used by next tables. See the function comments in ui_drawing.h
463  */
464 
465 typedef uint32_t (*UI_DRAWING_getNewImageStrideInBytes_t)(jbyte image_format, uint32_t width, uint32_t height,
466  uint32_t default_stride);
467 typedef void (*UI_DRAWING_adjustNewImageCharacteristics_t)(jbyte image_format, uint32_t width, uint32_t height,
468  uint32_t *data_size, uint32_t *data_alignment);
469 typedef void (*UI_DRAWING_initializeNewImage_t)(MICROUI_Image *image);
470 typedef void (*UI_DRAWING_freeImageResources_t)(MICROUI_Image *image);
471 typedef DRAWING_Status (*UI_DRAWING_writePixel_t)(MICROUI_GraphicsContext *gc, jint x, jint y);
472 typedef DRAWING_Status (*UI_DRAWING_drawLine_t)(MICROUI_GraphicsContext *gc, jint startX, jint startY, jint endX,
473  jint endY);
474 typedef DRAWING_Status (*UI_DRAWING_drawHorizontalLine_t)(MICROUI_GraphicsContext *gc, jint x1, jint x2, jint y);
475 typedef DRAWING_Status (*UI_DRAWING_drawVerticalLine_t)(MICROUI_GraphicsContext *gc, jint x, jint y1, jint y2);
476 typedef DRAWING_Status (*UI_DRAWING_drawRectangle_t)(MICROUI_GraphicsContext *gc, jint x1, jint y1, jint x2, jint y2);
477 typedef DRAWING_Status (*UI_DRAWING_fillRectangle_t)(MICROUI_GraphicsContext *gc, jint x1, jint y1, jint x2, jint y2);
478 typedef DRAWING_Status (*UI_DRAWING_drawRoundedRectangle_t)(MICROUI_GraphicsContext *gc, jint x, jint y, jint width,
479  jint height, jint cornerEllipseWidth,
480  jint cornerEllipseHeight);
481 typedef DRAWING_Status (*UI_DRAWING_fillRoundedRectangle_t)(MICROUI_GraphicsContext *gc, jint x, jint y, jint width,
482  jint height, jint cornerEllipseWidth,
483  jint cornerEllipseHeight);
484 typedef DRAWING_Status (*UI_DRAWING_drawCircleArc_t)(MICROUI_GraphicsContext *gc, jint x, jint y, jint diameter,
485  jfloat startAngle, jfloat arcAngle);
486 typedef DRAWING_Status (*UI_DRAWING_drawEllipseArc_t)(MICROUI_GraphicsContext *gc, jint x, jint y, jint width,
487  jint height, jfloat startAngle, jfloat arcAngle);
488 typedef DRAWING_Status (*UI_DRAWING_fillCircleArc_t)(MICROUI_GraphicsContext *gc, jint x, jint y, jint diameter,
489  jfloat startAngle, jfloat arcAngle);
490 typedef DRAWING_Status (*UI_DRAWING_fillEllipseArc_t)(MICROUI_GraphicsContext *gc, jint x, jint y, jint width,
491  jint height, jfloat startAngle, jfloat arcAngle);
492 typedef DRAWING_Status (*UI_DRAWING_drawEllipse_t)(MICROUI_GraphicsContext *gc, jint x, jint y, jint width,
493  jint height);
494 typedef DRAWING_Status (*UI_DRAWING_fillEllipse_t)(MICROUI_GraphicsContext *gc, jint x, jint y, jint width,
495  jint height);
496 typedef DRAWING_Status (*UI_DRAWING_drawCircle_t)(MICROUI_GraphicsContext *gc, jint x, jint y, jint diameter);
497 typedef DRAWING_Status (*UI_DRAWING_fillCircle_t)(MICROUI_GraphicsContext *gc, jint x, jint y, jint diameter);
498 typedef DRAWING_Status (*UI_DRAWING_drawImage_t)(MICROUI_GraphicsContext *gc, MICROUI_Image *img, jint regionX,
499  jint regionY, jint width, jint height, jint x, jint y, jint alpha);
500 typedef DRAWING_Status (*UI_DRAWING_copyImage_t)(MICROUI_GraphicsContext *gc, MICROUI_Image *img, jint regionX,
501  jint regionY, jint width, jint height, jint x, jint y);
502 typedef DRAWING_Status (*UI_DRAWING_drawRegion_t)(MICROUI_GraphicsContext *gc, jint regionX, jint regionY, jint width,
503  jint height, jint x, jint y, jint alpha);
504 typedef DRAWING_Status (*UI_DRAWING_drawString_t)(MICROUI_GraphicsContext *gc, jchar *chars, jint length,
505  MICROUI_Font *font, jint x, jint y);
506 typedef DRAWING_Status (*UI_DRAWING_drawRenderableString_t)(MICROUI_GraphicsContext *gc, jchar *chars, jint length,
507  MICROUI_Font *font, jint width,
508  MICROUI_RenderableString *renderableString, jint x, jint y);
509 typedef DRAWING_Status (*UI_DRAWING_drawThickFadedPoint_t)(MICROUI_GraphicsContext *gc, jint x, jint y, jint thickness,
510  jint fade);
511 typedef DRAWING_Status (*UI_DRAWING_drawThickFadedLine_t)(MICROUI_GraphicsContext *gc, jint startX, jint startY,
512  jint endX, jint endY, jint thickness, jint fade,
513  DRAWING_Cap startCap, DRAWING_Cap endCap);
514 typedef DRAWING_Status (*UI_DRAWING_drawThickFadedCircle_t)(MICROUI_GraphicsContext *gc, jint x, jint y, jint diameter,
515  jint thickness, jint fade);
516 typedef DRAWING_Status (*UI_DRAWING_drawThickFadedCircleArc_t)(MICROUI_GraphicsContext *gc, jint x, jint y,
517  jint diameter, jfloat startAngle, jfloat arcAngle,
518  jint thickness, jint fade, DRAWING_Cap start,
519  DRAWING_Cap end);
520 typedef DRAWING_Status (*UI_DRAWING_drawThickFadedEllipse_t)(MICROUI_GraphicsContext *gc, jint x, jint y, jint width,
521  jint height, jint thickness, jint fade);
522 typedef DRAWING_Status (*UI_DRAWING_drawThickLine_t)(MICROUI_GraphicsContext *gc, jint startX, jint startY, jint endX,
523  jint endY, jint thickness);
524 typedef DRAWING_Status (*UI_DRAWING_drawThickCircle_t)(MICROUI_GraphicsContext *gc, jint x, jint y, jint diameter,
525  jint thickness);
526 typedef DRAWING_Status (*UI_DRAWING_drawThickEllipse_t)(MICROUI_GraphicsContext *gc, jint x, jint y, jint width,
527  jint height, jint thickness);
528 typedef DRAWING_Status (*UI_DRAWING_drawThickCircleArc_t)(MICROUI_GraphicsContext *gc, jint x, jint y, jint diameter,
529  jfloat startAngle, jfloat arcAngle, jint thickness);
530 typedef DRAWING_Status (*UI_DRAWING_drawFlippedImage_t)(MICROUI_GraphicsContext *gc, MICROUI_Image *img, jint regionX,
531  jint regionY, jint width, jint height, jint x, jint y,
532  DRAWING_Flip transformation, jint alpha);
533 typedef DRAWING_Status (*UI_DRAWING_drawRotatedImageNearestNeighbor_t)(MICROUI_GraphicsContext *gc, MICROUI_Image *img,
534  jint x, jint y, jint rotationX, jint rotationY,
535  jfloat angle, jint alpha);
536 typedef DRAWING_Status (*UI_DRAWING_drawRotatedImageBilinear_t)(MICROUI_GraphicsContext *gc, MICROUI_Image *img, jint x,
537  jint y, jint rotationX, jint rotationY, jfloat angle,
538  jint alpha);
539 typedef DRAWING_Status (*UI_DRAWING_drawScaledImageNearestNeighbor_t)(MICROUI_GraphicsContext *gc, MICROUI_Image *img,
540  jint x, jint y, jfloat factorX, jfloat factorY,
541  jint alpha);
542 typedef DRAWING_Status (*UI_DRAWING_drawScaledImageBilinear_t)(MICROUI_GraphicsContext *gc, MICROUI_Image *img, jint x,
543  jint y, jfloat factorX, jfloat factorY, jint alpha);
544 typedef DRAWING_Status (*UI_DRAWING_drawScaledStringBilinear_t)(MICROUI_GraphicsContext *gc, jchar *chars, jint length,
545  MICROUI_Font *font, jint x, jint y, jfloat xRatio,
546  jfloat yRatio);
547 typedef DRAWING_Status (*UI_DRAWING_drawScaledRenderableStringBilinear_t)(MICROUI_GraphicsContext *gc, jchar *chars,
548  jint length, MICROUI_Font *font, jint width,
549  MICROUI_RenderableString *renderableString,
550  jint x, jint y, jfloat xRatio, jfloat yRatio);
551 typedef DRAWING_Status (*UI_DRAWING_drawCharWithRotationBilinear_t)(MICROUI_GraphicsContext *gc, jchar c,
552  MICROUI_Font *font, jint x, jint y, jint xRotation,
553  jint yRotation, jfloat angle, jint alpha);
554 typedef DRAWING_Status (*UI_DRAWING_drawCharWithRotationNearestNeighbor_t)(MICROUI_GraphicsContext *gc, jchar c,
555  MICROUI_Font *font, jint x, jint y,
556  jint xRotation, jint yRotation, jfloat angle,
557  jint alpha);
558 
559 #endif // #if defined(UI_GC_SUPPORTED_FORMATS) && (UI_GC_SUPPORTED_FORMATS > 1)
560 
561 // --------------------------------------------------------------------------------
562 // Tables according to the destination format.
563 // --------------------------------------------------------------------------------
564 
565 #if defined(UI_GC_SUPPORTED_FORMATS) && (UI_GC_SUPPORTED_FORMATS > 1)
566 
567 static const UI_DRAWING_getNewImageStrideInBytes_t UI_DRAWER_getNewImageStrideInBytes[] = {
568  &UI_DRAWING_getNewImageStrideInBytes,
569  &UI_DRAWING_getNewImageStrideInBytes_1,
570 #if (UI_GC_SUPPORTED_FORMATS > 2)
571  &UI_DRAWING_getNewImageStrideInBytes_2,
572 #endif
573 };
574 
575 static const UI_DRAWING_adjustNewImageCharacteristics_t UI_DRAWER_adjustNewImageCharacteristics[] = {
576  &UI_DRAWING_adjustNewImageCharacteristics,
577  &UI_DRAWING_adjustNewImageCharacteristics_1,
578 #if (UI_GC_SUPPORTED_FORMATS > 2)
579  &UI_DRAWING_adjustNewImageCharacteristics_2,
580 #endif
581 };
582 
583 static const UI_DRAWING_initializeNewImage_t UI_DRAWER_initializeNewImage[] = {
584  &UI_DRAWING_initializeNewImage,
585  &UI_DRAWING_initializeNewImage_1,
586 #if (UI_GC_SUPPORTED_FORMATS > 2)
587  &UI_DRAWING_initializeNewImage_2,
588 #endif
589 };
590 
591 static const UI_DRAWING_freeImageResources_t UI_DRAWER_freeImageResources[] = {
592  &UI_DRAWING_freeImageResources,
593  &UI_DRAWING_freeImageResources_1,
594 #if (UI_GC_SUPPORTED_FORMATS > 2)
595  &UI_DRAWING_freeImageResources_2,
596 #endif
597 };
598 
599 static const UI_DRAWING_writePixel_t UI_DRAWER_writePixel[] = {
600  &UI_DRAWING_writePixel_0,
601  &UI_DRAWING_writePixel_1,
602 #if (UI_GC_SUPPORTED_FORMATS > 2)
603  &UI_DRAWING_writePixel_2,
604 #endif
605 };
606 
607 static const UI_DRAWING_drawLine_t UI_DRAWER_drawLine[] = {
608  &UI_DRAWING_drawLine_0,
609  &UI_DRAWING_drawLine_1,
610 #if (UI_GC_SUPPORTED_FORMATS > 2)
611  &UI_DRAWING_drawLine_2,
612 #endif
613 };
614 
615 static const UI_DRAWING_drawHorizontalLine_t UI_DRAWER_drawHorizontalLine[] = {
616  &UI_DRAWING_drawHorizontalLine_0,
617  &UI_DRAWING_drawHorizontalLine_1,
618 #if (UI_GC_SUPPORTED_FORMATS > 2)
619  &UI_DRAWING_drawHorizontalLine_2,
620 #endif
621 };
622 
623 static const UI_DRAWING_drawVerticalLine_t UI_DRAWER_drawVerticalLine[] = {
624  &UI_DRAWING_drawVerticalLine_0,
625  &UI_DRAWING_drawVerticalLine_1,
626 #if (UI_GC_SUPPORTED_FORMATS > 2)
627  &UI_DRAWING_drawVerticalLine_2,
628 #endif
629 };
630 
631 static const UI_DRAWING_drawRectangle_t UI_DRAWER_drawRectangle[] = {
632  &UI_DRAWING_drawRectangle_0,
633  &UI_DRAWING_drawRectangle_1,
634 #if (UI_GC_SUPPORTED_FORMATS > 2)
635  &UI_DRAWING_drawRectangle_2,
636 #endif
637 };
638 
639 static const UI_DRAWING_fillRectangle_t UI_DRAWER_fillRectangle[] = {
640  &UI_DRAWING_fillRectangle_0,
641  &UI_DRAWING_fillRectangle_1,
642 #if (UI_GC_SUPPORTED_FORMATS > 2)
643  &UI_DRAWING_fillRectangle_2,
644 #endif
645 };
646 
647 static const UI_DRAWING_drawRoundedRectangle_t UI_DRAWER_drawRoundedRectangle[] = {
648  &UI_DRAWING_drawRoundedRectangle_0,
649  &UI_DRAWING_drawRoundedRectangle_1,
650 #if (UI_GC_SUPPORTED_FORMATS > 2)
651  &UI_DRAWING_drawRoundedRectangle_2,
652 #endif
653 };
654 
655 static const UI_DRAWING_fillRoundedRectangle_t UI_DRAWER_fillRoundedRectangle[] = {
656  &UI_DRAWING_fillRoundedRectangle_0,
657  &UI_DRAWING_fillRoundedRectangle_1,
658 #if (UI_GC_SUPPORTED_FORMATS > 2)
659  &UI_DRAWING_fillRoundedRectangle_2,
660 #endif
661 };
662 
663 static const UI_DRAWING_drawCircleArc_t UI_DRAWER_drawCircleArc[] = {
664  &UI_DRAWING_drawCircleArc_0,
665  &UI_DRAWING_drawCircleArc_1,
666 #if (UI_GC_SUPPORTED_FORMATS > 2)
667  &UI_DRAWING_drawCircleArc_2,
668 #endif
669 };
670 
671 static const UI_DRAWING_drawEllipseArc_t UI_DRAWER_drawEllipseArc[] = {
672  &UI_DRAWING_drawEllipseArc_0,
673  &UI_DRAWING_drawEllipseArc_1,
674 #if (UI_GC_SUPPORTED_FORMATS > 2)
675  &UI_DRAWING_drawEllipseArc_2,
676 #endif
677 };
678 
679 static const UI_DRAWING_fillCircleArc_t UI_DRAWER_fillCircleArc[] = {
680  &UI_DRAWING_fillCircleArc_0,
681  &UI_DRAWING_fillCircleArc_1,
682 #if (UI_GC_SUPPORTED_FORMATS > 2)
683  &UI_DRAWING_fillCircleArc_2,
684 #endif
685 };
686 
687 static const UI_DRAWING_fillEllipseArc_t UI_DRAWER_fillEllipseArc[] = {
688  &UI_DRAWING_fillEllipseArc_0,
689  &UI_DRAWING_fillEllipseArc_1,
690 #if (UI_GC_SUPPORTED_FORMATS > 2)
691  &UI_DRAWING_fillEllipseArc_2,
692 #endif
693 };
694 
695 static const UI_DRAWING_drawEllipse_t UI_DRAWER_drawEllipse[] = {
696  &UI_DRAWING_drawEllipse_0,
697  &UI_DRAWING_drawEllipse_1,
698 #if (UI_GC_SUPPORTED_FORMATS > 2)
699  &UI_DRAWING_drawEllipse_2,
700 #endif
701 };
702 
703 static const UI_DRAWING_fillEllipse_t UI_DRAWER_fillEllipse[] = {
704  &UI_DRAWING_fillEllipse_0,
705  &UI_DRAWING_fillEllipse_1,
706 #if (UI_GC_SUPPORTED_FORMATS > 2)
707  &UI_DRAWING_fillEllipse_2,
708 #endif
709 };
710 
711 static const UI_DRAWING_drawCircle_t UI_DRAWER_drawCircle[] = {
712  &UI_DRAWING_drawCircle_0,
713  &UI_DRAWING_drawCircle_1,
714 #if (UI_GC_SUPPORTED_FORMATS > 2)
715  &UI_DRAWING_drawCircle_2,
716 #endif
717 };
718 
719 static const UI_DRAWING_fillCircle_t UI_DRAWER_fillCircle[] = {
720  &UI_DRAWING_fillCircle_0,
721  &UI_DRAWING_fillCircle_1,
722 #if (UI_GC_SUPPORTED_FORMATS > 2)
723  &UI_DRAWING_fillCircle_2,
724 #endif
725 };
726 
727 static const UI_DRAWING_drawImage_t UI_DRAWER_drawImage[] = {
728  &UI_DRAWING_drawImage_0,
729  &UI_DRAWING_drawImage_1,
730 #if (UI_GC_SUPPORTED_FORMATS > 2)
731  &UI_DRAWING_drawImage_2,
732 #endif
733 };
734 
735 static const UI_DRAWING_copyImage_t UI_DRAWER_copyImage[] = {
736  &UI_DRAWING_copyImage_0,
737  &UI_DRAWING_copyImage_1,
738 #if (UI_GC_SUPPORTED_FORMATS > 2)
739  &UI_DRAWING_copyImage_2,
740 #endif
741 };
742 
743 static const UI_DRAWING_drawRegion_t UI_DRAWER_drawRegion[] = {
744  &UI_DRAWING_drawRegion_0,
745  &UI_DRAWING_drawRegion_1,
746 #if (UI_GC_SUPPORTED_FORMATS > 2)
747  &UI_DRAWING_drawRegion_2,
748 #endif
749 };
750 
751 static const UI_DRAWING_drawString_t UI_DRAWER_drawString[] = {
752  UI_DRAWING_drawString_0,
753  UI_DRAWING_drawString_1,
754 #if (UI_GC_SUPPORTED_FORMATS > 2)
755  UI_DRAWING_drawString_2,
756 #endif
757 };
758 
759 static const UI_DRAWING_drawRenderableString_t UI_DRAWER_drawRenderableString[] = {
760  UI_DRAWING_drawRenderableString_0,
761  UI_DRAWING_drawRenderableString_1,
762 #if (UI_GC_SUPPORTED_FORMATS > 2)
763  UI_DRAWING_drawRenderableString_2,
764 #endif
765 };
766 
767 static const UI_DRAWING_drawThickFadedPoint_t UI_DRAWER_drawThickFadedPoint[] = {
768  &UI_DRAWING_drawThickFadedPoint_0,
769  &UI_DRAWING_drawThickFadedPoint_1,
770 #if (UI_GC_SUPPORTED_FORMATS > 2)
771  &UI_DRAWING_drawThickFadedPoint_2,
772 #endif
773 };
774 
775 static const UI_DRAWING_drawThickFadedLine_t UI_DRAWER_drawThickFadedLine[] = {
776  &UI_DRAWING_drawThickFadedLine_0,
777  &UI_DRAWING_drawThickFadedLine_1,
778 #if (UI_GC_SUPPORTED_FORMATS > 2)
779  &UI_DRAWING_drawThickFadedLine_2,
780 #endif
781 };
782 
783 static const UI_DRAWING_drawThickFadedCircle_t UI_DRAWER_drawThickFadedCircle[] = {
784  &UI_DRAWING_drawThickFadedCircle_0,
785  &UI_DRAWING_drawThickFadedCircle_1,
786 #if (UI_GC_SUPPORTED_FORMATS > 2)
787  &UI_DRAWING_drawThickFadedCircle_2,
788 #endif
789 };
790 
791 static const UI_DRAWING_drawThickFadedCircleArc_t UI_DRAWER_drawThickFadedCircleArc[] = {
792  &UI_DRAWING_drawThickFadedCircleArc_0,
793  &UI_DRAWING_drawThickFadedCircleArc_1,
794 #if (UI_GC_SUPPORTED_FORMATS > 2)
795  &UI_DRAWING_drawThickFadedCircleArc_2,
796 #endif
797 };
798 
799 static const UI_DRAWING_drawThickFadedEllipse_t UI_DRAWER_drawThickFadedEllipse[] = {
800  &UI_DRAWING_drawThickFadedEllipse_0,
801  &UI_DRAWING_drawThickFadedEllipse_1,
802 #if (UI_GC_SUPPORTED_FORMATS > 2)
803  &UI_DRAWING_drawThickFadedEllipse_2,
804 #endif
805 };
806 
807 static const UI_DRAWING_drawThickLine_t UI_DRAWER_drawThickLine[] = {
808  &UI_DRAWING_drawThickLine_0,
809  &UI_DRAWING_drawThickLine_1,
810 #if (UI_GC_SUPPORTED_FORMATS > 2)
811  &UI_DRAWING_drawThickLine_2,
812 #endif
813 };
814 
815 static const UI_DRAWING_drawThickCircle_t UI_DRAWER_drawThickCircle[] = {
816  &UI_DRAWING_drawThickCircle_0,
817  &UI_DRAWING_drawThickCircle_1,
818 #if (UI_GC_SUPPORTED_FORMATS > 2)
819  &UI_DRAWING_drawThickCircle_2,
820 #endif
821 };
822 
823 static const UI_DRAWING_drawThickEllipse_t UI_DRAWER_drawThickEllipse[] = {
824  &UI_DRAWING_drawThickEllipse_0,
825  &UI_DRAWING_drawThickEllipse_1,
826 #if (UI_GC_SUPPORTED_FORMATS > 2)
827  &UI_DRAWING_drawThickEllipse_2,
828 #endif
829 };
830 
831 static const UI_DRAWING_drawThickCircleArc_t UI_DRAWER_drawThickCircleArc[] = {
832  &UI_DRAWING_drawThickCircleArc_0,
833  &UI_DRAWING_drawThickCircleArc_1,
834 #if (UI_GC_SUPPORTED_FORMATS > 2)
835  &UI_DRAWING_drawThickCircleArc_2,
836 #endif
837 };
838 
839 static const UI_DRAWING_drawFlippedImage_t UI_DRAWER_drawFlippedImage[] = {
840  &UI_DRAWING_drawFlippedImage_0,
841  &UI_DRAWING_drawFlippedImage_1,
842 #if (UI_GC_SUPPORTED_FORMATS > 2)
843  &UI_DRAWING_drawFlippedImage_2,
844 #endif
845 };
846 
847 static const UI_DRAWING_drawRotatedImageNearestNeighbor_t UI_DRAWER_drawRotatedImageNearestNeighbor[] = {
848  &UI_DRAWING_drawRotatedImageNearestNeighbor_0,
849  &UI_DRAWING_drawRotatedImageNearestNeighbor_1,
850 #if (UI_GC_SUPPORTED_FORMATS > 2)
851  &UI_DRAWING_drawRotatedImageNearestNeighbor_2,
852 #endif
853 };
854 
855 static const UI_DRAWING_drawRotatedImageBilinear_t UI_DRAWER_drawRotatedImageBilinear[] = {
856  &UI_DRAWING_drawRotatedImageBilinear_0,
857  &UI_DRAWING_drawRotatedImageBilinear_1,
858 #if (UI_GC_SUPPORTED_FORMATS > 2)
859  &UI_DRAWING_drawRotatedImageBilinear_2,
860 #endif
861 };
862 
863 static const UI_DRAWING_drawScaledImageNearestNeighbor_t UI_DRAWER_drawScaledImageNearestNeighbor[] = {
864  &UI_DRAWING_drawScaledImageNearestNeighbor_0,
865  &UI_DRAWING_drawScaledImageNearestNeighbor_1,
866 #if (UI_GC_SUPPORTED_FORMATS > 2)
867  &UI_DRAWING_drawScaledImageNearestNeighbor_2,
868 #endif
869 };
870 
871 static const UI_DRAWING_drawScaledImageBilinear_t UI_DRAWER_drawScaledImageBilinear[] = {
872  &UI_DRAWING_drawScaledImageBilinear_0,
873  &UI_DRAWING_drawScaledImageBilinear_1,
874 #if (UI_GC_SUPPORTED_FORMATS > 2)
875  &UI_DRAWING_drawScaledImageBilinear_2,
876 #endif
877 };
878 
879 static const UI_DRAWING_drawScaledStringBilinear_t UI_DRAWER_drawScaledStringBilinear[] = {
880  UI_DRAWING_drawScaledStringBilinear_0,
881  UI_DRAWING_drawScaledStringBilinear_1,
882 #if (UI_GC_SUPPORTED_FORMATS > 2)
883  UI_DRAWING_drawScaledStringBilinear_2,
884 #endif
885 };
886 
887 static const UI_DRAWING_drawScaledRenderableStringBilinear_t UI_DRAWER_drawScaledRenderableStringBilinear[] = {
888  UI_DRAWING_drawScaledRenderableStringBilinear_0,
889  UI_DRAWING_drawScaledRenderableStringBilinear_1,
890 #if (UI_GC_SUPPORTED_FORMATS > 2)
891  UI_DRAWING_drawScaledRenderableStringBilinear_2,
892 #endif
893 };
894 
895 static const UI_DRAWING_drawCharWithRotationBilinear_t UI_DRAWER_drawCharWithRotationBilinear[] = {
896  UI_DRAWING_drawCharWithRotationBilinear_0,
897  UI_DRAWING_drawCharWithRotationBilinear_1,
898 #if (UI_GC_SUPPORTED_FORMATS > 2)
899  UI_DRAWING_drawCharWithRotationBilinear_2,
900 #endif
901 };
902 
903 static const UI_DRAWING_drawCharWithRotationNearestNeighbor_t UI_DRAWER_drawCharWithRotationNearestNeighbor[] = {
904  UI_DRAWING_drawCharWithRotationNearestNeighbor_0,
905  UI_DRAWING_drawCharWithRotationNearestNeighbor_1,
906 #if (UI_GC_SUPPORTED_FORMATS > 2)
907  UI_DRAWING_drawCharWithRotationNearestNeighbor_2,
908 #endif
909 };
910 
911 #endif // defined(UI_GC_SUPPORTED_FORMATS) && (UI_GC_SUPPORTED_FORMATS > 1)
912 
913 // --------------------------------------------------------------------------------
914 // LLUI_DISPLAY_impl.h functions that depend on image format
915 // (the functions are redirected to ui_drawing.h)
916 // --------------------------------------------------------------------------------
917 
918 #if !defined(UI_GC_SUPPORTED_FORMATS) || (UI_GC_SUPPORTED_FORMATS <= 1)
919 
920 /*
921  * The VEE port supports only one destination format: the display buffer format. The
922  * application mutable images have the same format as the display buffer.
923  */
924 
925 // See the header file for the function documentation
926 int32_t LLUI_DISPLAY_IMPL_getDrawerIdentifier(jbyte image_format) {
927  return LLUI_DISPLAY_isDisplayFormat(image_format) ? 0 /* no error */ : -1 /* means invalid */;
928 }
929 
930 // See the header file for the function documentation
931 uint32_t LLUI_DISPLAY_IMPL_getNewImageStrideInBytes(jbyte image_format, uint32_t width, uint32_t height,
932  uint32_t default_stride) {
933  // just make an indirection (useful for multi destination formats)
934  return UI_DRAWING_getNewImageStrideInBytes(image_format, width, height, default_stride);
935 }
936 
937 // See the header file for the function documentation
938 void LLUI_DISPLAY_IMPL_adjustNewImageCharacteristics(jbyte image_format, uint32_t width, uint32_t height,
939  uint32_t *data_size, uint32_t *data_alignment) {
940  // just make an indirection (useful for multi destination formats)
941  UI_DRAWING_adjustNewImageCharacteristics(image_format, width, height, data_size, data_alignment);
942 }
943 
944 // See the header file for the function documentation
945 void LLUI_DISPLAY_IMPL_initializeNewImage(MICROUI_Image *image) {
946  // just make an indirection (useful for multi destination formats)
947  UI_DRAWING_initializeNewImage(image);
948 }
949 
950 // See the header file for the function documentation
951 void LLUI_DISPLAY_IMPL_freeImageResources(MICROUI_Image *image) {
952  // just make an indirection (useful for multi destination formats)
953  UI_DRAWING_freeImageResources(image);
954 }
955 
956 #else // #if !defined(UI_GC_SUPPORTED_FORMATS) || (UI_GC_SUPPORTED_FORMATS <= 1)
957 
958 /*
959  * The VEE port supports several destination formats. All drawing functions use a
960  * dedicated table to redirect to the right implementation. The VEE Port must implement
961  * the functions UI_DRAWING_is_drawer_X() to identify the right drawer according to
962  * the destination format.
963  *
964  * The "DEFAULT" functions (see below) are used as element "0" of the tables (this is the
965  * display buffer format).
966  */
967 
968 int32_t LLUI_DISPLAY_IMPL_getDrawerIdentifier(jbyte image_format) {
969  int32_t index;
970 
971  if (LLUI_DISPLAY_isDisplayFormat(image_format)) {
972  index = 0;
973  } else if (UI_DRAWING_is_drawer_1(image_format)) {
974  index = 1;
975 #if (UI_GC_SUPPORTED_FORMATS > 2)
976  } else if (UI_DRAWING_is_drawer_2(image_format)) {
977  index = 2;
978 #endif
979  } else {
980  // unknown format
981  index = -1;
982  }
983 
984  return index;
985 }
986 
987 /*
988  * @brief See the header file for the function documentation
989  *
990  * Implementation details: The new image to create is an immutable image or a mutable image.
991  *
992  * - If it is a mutable image, that means a drawer is able to draw into it (see
993  * LLUI_DISPLAY_IMPL_getDrawerIdentifier()). In this case, this function redirects the
994  * implementation to the drawer (that should be able to adjust image characteristics if
995  * required).
996  *
997  * - If it is an immutable image (PNG decoder, automatic image format convert, etc.), that
998  * means (most of the time) no drawer can manage this image format. In such case, this function
999  * redirects the implementation to the default implementation (the indirection table
1000  * UI_DRAWER_getNewImageStrideInBytes points to the default function at index 0).
1001  *
1002  * - In the case a drawer is available for this new immutable image, this function redirects
1003  * to the drawer.
1004  */
1005 uint32_t LLUI_DISPLAY_IMPL_getNewImageStrideInBytes(jbyte image_format, uint32_t width, uint32_t height,
1006  uint32_t default_stride) {
1007  int32_t drawer = LLUI_DISPLAY_IMPL_getDrawerIdentifier(image_format);
1008  drawer = (drawer >= 0) ? drawer : 0;
1009  return (*UI_DRAWER_getNewImageStrideInBytes[drawer])(image_format, width, height, default_stride);
1010 }
1011 
1012 // See the header file foar the function documentation and implementation of
1013 // LLUI_DISPLAY_IMPL_getNewImageStrideInBytes
1014 void LLUI_DISPLAY_IMPL_adjustNewImageCharacteristics(jbyte image_format, uint32_t width, uint32_t height,
1015  uint32_t *data_size, uint32_t *data_alignment) {
1016  int32_t drawer = LLUI_DISPLAY_IMPL_getDrawerIdentifier(image_format);
1017  drawer = (drawer >= 0) ? drawer : 0;
1018  (*UI_DRAWER_adjustNewImageCharacteristics[drawer])(image_format, width, height, data_size, data_alignment);
1019 }
1020 
1021 // See the header file for the function documentation and implementation of
1022 // LLUI_DISPLAY_IMPL_getNewImageStrideInBytes
1023 void LLUI_DISPLAY_IMPL_initializeNewImage(MICROUI_Image *image) {
1024  int32_t drawer = LLUI_DISPLAY_IMPL_getDrawerIdentifier(image->format);
1025  drawer = (drawer >= 0) ? drawer : 0;
1026  (*UI_DRAWER_initializeNewImage[drawer])(image);
1027 }
1028 
1029 // See the header file for the function documentation and implementation of
1030 // LLUI_DISPLAY_IMPL_getNewImageStrideInBytes
1031 void LLUI_DISPLAY_IMPL_freeImageResources(MICROUI_Image *image) {
1032  int32_t drawer = LLUI_DISPLAY_IMPL_getDrawerIdentifier(image->format);
1033  drawer = (drawer >= 0) ? drawer : 0;
1034  (*UI_DRAWER_freeImageResources[drawer])(image);
1035 }
1036 
1037 #endif // #if !defined(UI_GC_SUPPORTED_FORMATS) || (UI_GC_SUPPORTED_FORMATS <= 1)
1038 
1039 // --------------------------------------------------------------------------------
1040 // ui_drawing.h functions
1041 // (the function names don't differ regardless of the available number of destination formats)
1042 // --------------------------------------------------------------------------------
1043 
1044 // See the header file for the function documentation
1045 BSP_DECLARE_WEAK_FCNT uint32_t UI_DRAWING_getNewImageStrideInBytes(jbyte image_format, uint32_t width, uint32_t height,
1046  uint32_t default_stride) {
1047  (void)image_format;
1048  (void)width;
1049  (void)height;
1050  // no specific stride by default
1051  return default_stride;
1052 }
1053 
1054 // See the header file for the function documentation
1055 BSP_DECLARE_WEAK_FCNT void UI_DRAWING_adjustNewImageCharacteristics(jbyte image_format, uint32_t width, uint32_t height,
1056  uint32_t *data_size, uint32_t *data_alignment) {
1057  (void)image_format;
1058  (void)width;
1059  (void)height;
1060  (void)data_size;
1061  (void)data_alignment;
1062  // nothing to adjust by default
1063 }
1064 
1065 // See the header file for the function documentation
1066 BSP_DECLARE_WEAK_FCNT void UI_DRAWING_initializeNewImage(MICROUI_Image *image) {
1067  (void)image;
1068  // nothing to initialize by default
1069 }
1070 
1071 // See the header file for the function documentation
1072 BSP_DECLARE_WEAK_FCNT void UI_DRAWING_freeImageResources(MICROUI_Image *image) {
1073  (void)image;
1074  // nothing to initialize by default
1075 }
1076 
1077 // See the header file for the function documentation
1078 BSP_DECLARE_WEAK_FCNT jint UI_DRAWING_stringWidth(jchar *chars, jint length, MICROUI_Font *font) {
1079 #if !defined(UI_FEATURE_FONT_CUSTOM_FORMATS)
1080  assert(!LLUI_DISPLAY_isCustomFormat(font->format));
1081  return UI_DRAWING_SOFT_stringWidth(chars, length, font);
1082 #else
1083  return UI_FONT_DRAWING_stringWidth(chars, length, font);
1084 #endif
1085 }
1086 
1087 // See the header file for the function documentation
1088 BSP_DECLARE_WEAK_FCNT jint UI_DRAWING_initializeRenderableStringSNIContext(jchar *chars, jint length,
1089  MICROUI_Font *font,
1090  MICROUI_RenderableString *renderableString) {
1091 #if !defined(UI_FEATURE_FONT_CUSTOM_FORMATS)
1092  assert(!LLUI_DISPLAY_isCustomFormat(font->format));
1093  return UI_DRAWING_SOFT_initializeRenderableStringSNIContext(chars, length, font, renderableString);
1094 #else
1095  return UI_FONT_DRAWING_initializeRenderableStringSNIContext(chars, length, font, renderableString);
1096 #endif
1097 }
1098 
1099 // --------------------------------------------------------------------------------
1100 // ui_drawing.h functions
1101 // (the function names differ according to the available number of destination formats)
1102 // --------------------------------------------------------------------------------
1103 
1104 // See the header file for the function documentation
1105 BSP_DECLARE_WEAK_FCNT DRAWING_Status UI_DRAWING_DEFAULT_writePixel(MICROUI_GraphicsContext *gc, jint x, jint y) {
1106  return UI_DRAWING_SOFT_writePixel(gc, x, y);
1107 }
1108 
1109 // See the header file for the function documentation
1110 BSP_DECLARE_WEAK_FCNT DRAWING_Status UI_DRAWING_DEFAULT_drawLine(MICROUI_GraphicsContext *gc, jint startX, jint startY,
1111  jint endX, jint endY) {
1112  return UI_DRAWING_SOFT_drawLine(gc, startX, startY, endX, endY);
1113 }
1114 
1115 // See the header file for the function documentation
1116 BSP_DECLARE_WEAK_FCNT DRAWING_Status UI_DRAWING_DEFAULT_drawHorizontalLine(MICROUI_GraphicsContext *gc, jint x1,
1117  jint x2, jint y) {
1118  return UI_DRAWING_SOFT_drawHorizontalLine(gc, x1, x2, y);
1119 }
1120 
1121 // See the header file for the function documentation
1122 BSP_DECLARE_WEAK_FCNT DRAWING_Status UI_DRAWING_DEFAULT_drawVerticalLine(MICROUI_GraphicsContext *gc, jint x, jint y1,
1123  jint y2) {
1124  return UI_DRAWING_SOFT_drawVerticalLine(gc, x, y1, y2);
1125 }
1126 
1127 // See the header file for the function documentation
1128 BSP_DECLARE_WEAK_FCNT DRAWING_Status UI_DRAWING_DEFAULT_drawRectangle(MICROUI_GraphicsContext *gc, jint x1, jint y1,
1129  jint x2, jint y2) {
1130  return UI_DRAWING_SOFT_drawRectangle(gc, x1, y1, x2, y2);
1131 }
1132 
1133 // See the header file for the function documentation
1134 BSP_DECLARE_WEAK_FCNT DRAWING_Status UI_DRAWING_DEFAULT_fillRectangle(MICROUI_GraphicsContext *gc, jint x1, jint y1,
1135  jint x2, jint y2) {
1136  return UI_DRAWING_SOFT_fillRectangle(gc, x1, y1, x2, y2);
1137 }
1138 
1139 // See the header file for the function documentation
1140 BSP_DECLARE_WEAK_FCNT DRAWING_Status UI_DRAWING_DEFAULT_drawRoundedRectangle(MICROUI_GraphicsContext *gc, jint x,
1141  jint y, jint width, jint height,
1142  jint cornerEllipseWidth,
1143  jint cornerEllipseHeight) {
1144  return UI_DRAWING_SOFT_drawRoundedRectangle(gc, x, y, width, height, cornerEllipseWidth, cornerEllipseHeight);
1145 }
1146 
1147 // See the header file for the function documentation
1148 BSP_DECLARE_WEAK_FCNT DRAWING_Status UI_DRAWING_DEFAULT_fillRoundedRectangle(MICROUI_GraphicsContext *gc, jint x,
1149  jint y, jint width, jint height,
1150  jint cornerEllipseWidth,
1151  jint cornerEllipseHeight) {
1152  return UI_DRAWING_SOFT_fillRoundedRectangle(gc, x, y, width, height, cornerEllipseWidth, cornerEllipseHeight);
1153 }
1154 
1155 // See the header file for the function documentation
1156 BSP_DECLARE_WEAK_FCNT DRAWING_Status UI_DRAWING_DEFAULT_drawCircleArc(MICROUI_GraphicsContext *gc, jint x, jint y,
1157  jint diameter, jfloat startAngle,
1158  jfloat arcAngle) {
1159  return UI_DRAWING_SOFT_drawCircleArc(gc, x, y, diameter, startAngle, arcAngle);
1160 }
1161 
1162 // See the header file for the function documentation
1163 BSP_DECLARE_WEAK_FCNT DRAWING_Status UI_DRAWING_DEFAULT_drawEllipseArc(MICROUI_GraphicsContext *gc, jint x, jint y,
1164  jint width, jint height, jfloat startAngle,
1165  jfloat arcAngle) {
1166  return UI_DRAWING_SOFT_drawEllipseArc(gc, x, y, width, height, startAngle, arcAngle);
1167 }
1168 
1169 // See the header file for the function documentation
1170 BSP_DECLARE_WEAK_FCNT DRAWING_Status UI_DRAWING_DEFAULT_fillCircleArc(MICROUI_GraphicsContext *gc, jint x, jint y,
1171  jint diameter, jfloat startAngle,
1172  jfloat arcAngle) {
1173  return UI_DRAWING_SOFT_fillCircleArc(gc, x, y, diameter, startAngle, arcAngle);
1174 }
1175 
1176 // See the header file for the function documentation
1177 BSP_DECLARE_WEAK_FCNT DRAWING_Status UI_DRAWING_DEFAULT_fillEllipseArc(MICROUI_GraphicsContext *gc, jint x, jint y,
1178  jint width, jint height, jfloat startAngle,
1179  jfloat arcAngle) {
1180  return UI_DRAWING_SOFT_fillEllipseArc(gc, x, y, width, height, startAngle, arcAngle);
1181 }
1182 
1183 // See the header file for the function documentation
1184 BSP_DECLARE_WEAK_FCNT DRAWING_Status UI_DRAWING_DEFAULT_drawEllipse(MICROUI_GraphicsContext *gc, jint x, jint y,
1185  jint width, jint height) {
1186  return UI_DRAWING_SOFT_drawEllipse(gc, x, y, width, height);
1187 }
1188 
1189 // See the header file for the function documentation
1190 BSP_DECLARE_WEAK_FCNT DRAWING_Status UI_DRAWING_DEFAULT_fillEllipse(MICROUI_GraphicsContext *gc, jint x, jint y,
1191  jint width, jint height) {
1192  return UI_DRAWING_SOFT_fillEllipse(gc, x, y, width, height);
1193 }
1194 
1195 // See the header file for the function documentation
1196 BSP_DECLARE_WEAK_FCNT DRAWING_Status UI_DRAWING_DEFAULT_drawCircle(MICROUI_GraphicsContext *gc, jint x, jint y,
1197  jint diameter) {
1198  return UI_DRAWING_SOFT_drawCircle(gc, x, y, diameter);
1199 }
1200 
1201 // See the header file for the function documentation
1202 BSP_DECLARE_WEAK_FCNT DRAWING_Status UI_DRAWING_DEFAULT_fillCircle(MICROUI_GraphicsContext *gc, jint x, jint y,
1203  jint diameter) {
1204  return UI_DRAWING_SOFT_fillCircle(gc, x, y, diameter);
1205 }
1206 
1207 // See the header file for the function documentation
1208 BSP_DECLARE_WEAK_FCNT DRAWING_Status UI_DRAWING_DEFAULT_drawImage(MICROUI_GraphicsContext *gc, MICROUI_Image *img,
1209  jint regionX, jint regionY, jint width, jint height,
1210  jint x, jint y, jint alpha) {
1211 #if !defined(UI_FEATURE_IMAGE_CUSTOM_FORMATS)
1212  return UI_DRAWING_SOFT_drawImage(gc, img, regionX, regionY, width, height, x, y, alpha);
1213 #else
1214  return UI_IMAGE_DRAWING_draw(gc, img, regionX, regionY, width, height, x, y, alpha);
1215 #endif
1216 }
1217 
1218 // See the header file for the function documentation
1219 BSP_DECLARE_WEAK_FCNT DRAWING_Status UI_DRAWING_DEFAULT_copyImage(MICROUI_GraphicsContext *gc, MICROUI_Image *img,
1220  jint regionX, jint regionY, jint width, jint height,
1221  jint x, jint y) {
1222 #if !defined(UI_FEATURE_IMAGE_CUSTOM_FORMATS)
1223  return UI_DRAWING_SOFT_copyImage(gc, img, regionX, regionY, width, height, x, y);
1224 #else
1225  return UI_IMAGE_DRAWING_copy(gc, img, regionX, regionY, width, height, x, y);
1226 #endif
1227 }
1228 
1229 // See the header file for the function documentation
1230 BSP_DECLARE_WEAK_FCNT DRAWING_Status UI_DRAWING_DEFAULT_drawRegion(MICROUI_GraphicsContext *gc, jint regionX,
1231  jint regionY, jint width, jint height, jint x,
1232  jint y, jint alpha) {
1233 #if !defined(UI_FEATURE_IMAGE_CUSTOM_FORMATS)
1234  return UI_DRAWING_SOFT_drawRegion(gc, regionX, regionY, width, height, x, y, alpha);
1235 #else
1236  return UI_IMAGE_DRAWING_drawRegion(gc, regionX, regionY, width, height, x, y, alpha);
1237 #endif
1238 }
1239 
1240 // See the header file for the function documentation
1241 BSP_DECLARE_WEAK_FCNT DRAWING_Status UI_DRAWING_DEFAULT_drawString(MICROUI_GraphicsContext *gc, jchar *chars,
1242  jint length, MICROUI_Font *font, jint x, jint y) {
1243 #if !defined(UI_FEATURE_FONT_CUSTOM_FORMATS)
1244  assert(!LLUI_DISPLAY_isCustomFormat(font->format));
1245  return UI_DRAWING_SOFT_drawString(gc, chars, length, font, x, y);
1246 #else
1247  return UI_FONT_DRAWING_drawString(gc, chars, length, font, x, y);
1248 #endif
1249 }
1250 
1251 // See the header file for the function documentation
1252 BSP_DECLARE_WEAK_FCNT DRAWING_Status UI_DRAWING_DEFAULT_drawRenderableString(MICROUI_GraphicsContext *gc, jchar *chars,
1253  jint length, MICROUI_Font *font,
1254  jint width,
1255  MICROUI_RenderableString *renderableString,
1256  jint x, jint y) {
1257 #if !defined(UI_FEATURE_FONT_CUSTOM_FORMATS)
1258  assert(!LLUI_DISPLAY_isCustomFormat(font->format));
1259  return UI_DRAWING_SOFT_drawRenderableString(gc, chars, length, font, width, renderableString, x, y);
1260 #else
1261  return UI_FONT_DRAWING_drawRenderableString(gc, chars, length, font, width, renderableString, x, y);
1262 #endif
1263 }
1264 
1265 // See the header file for the function documentation
1266 BSP_DECLARE_WEAK_FCNT DRAWING_Status UI_DRAWING_DEFAULT_drawThickFadedPoint(MICROUI_GraphicsContext *gc, jint x, jint y,
1267  jint thickness, jint fade) {
1268  return DW_DRAWING_SOFT_drawThickFadedPoint(gc, x, y, thickness, fade);
1269 }
1270 
1271 // See the header file for the function documentation
1272 BSP_DECLARE_WEAK_FCNT DRAWING_Status UI_DRAWING_DEFAULT_drawThickFadedLine(MICROUI_GraphicsContext *gc, jint startX,
1273  jint startY, jint endX, jint endY,
1274  jint thickness, jint fade,
1275  DRAWING_Cap startCap, DRAWING_Cap endCap) {
1276  return DW_DRAWING_SOFT_drawThickFadedLine(gc, startX, startY, endX, endY, thickness, fade, startCap, endCap);
1277 }
1278 
1279 // See the header file for the function documentation
1280 BSP_DECLARE_WEAK_FCNT DRAWING_Status UI_DRAWING_DEFAULT_drawThickFadedCircle(MICROUI_GraphicsContext *gc, jint x,
1281  jint y, jint diameter, jint thickness,
1282  jint fade) {
1283  return DW_DRAWING_SOFT_drawThickFadedCircle(gc, x, y, diameter, thickness, fade);
1284 }
1285 
1286 // See the header file for the function documentation
1287 BSP_DECLARE_WEAK_FCNT DRAWING_Status UI_DRAWING_DEFAULT_drawThickFadedCircleArc(MICROUI_GraphicsContext *gc, jint x,
1288  jint y, jint diameter,
1289  jfloat startAngle, jfloat arcAngle,
1290  jint thickness, jint fade,
1291  DRAWING_Cap start, DRAWING_Cap end) {
1292  return DW_DRAWING_SOFT_drawThickFadedCircleArc(gc, x, y, diameter, startAngle, arcAngle, thickness, fade, start,
1293  end);
1294 }
1295 
1296 // See the header file for the function documentation
1297 BSP_DECLARE_WEAK_FCNT DRAWING_Status UI_DRAWING_DEFAULT_drawThickFadedEllipse(MICROUI_GraphicsContext *gc, jint x,
1298  jint y, jint width, jint height,
1299  jint thickness, jint fade) {
1300  return DW_DRAWING_SOFT_drawThickFadedEllipse(gc, x, y, width, height, thickness, fade);
1301 }
1302 
1303 // See the header file for the function documentation
1304 BSP_DECLARE_WEAK_FCNT DRAWING_Status UI_DRAWING_DEFAULT_drawThickLine(MICROUI_GraphicsContext *gc, jint startX,
1305  jint startY, jint endX, jint endY,
1306  jint thickness) {
1307  return DW_DRAWING_SOFT_drawThickLine(gc, startX, startY, endX, endY, thickness);
1308 }
1309 
1310 // See the header file for the function documentation
1311 BSP_DECLARE_WEAK_FCNT DRAWING_Status UI_DRAWING_DEFAULT_drawThickCircle(MICROUI_GraphicsContext *gc, jint x, jint y,
1312  jint diameter, jint thickness) {
1313  return DW_DRAWING_SOFT_drawThickCircle(gc, x, y, diameter, thickness);
1314 }
1315 
1316 // See the header file for the function documentation
1317 BSP_DECLARE_WEAK_FCNT DRAWING_Status UI_DRAWING_DEFAULT_drawThickEllipse(MICROUI_GraphicsContext *gc, jint x, jint y,
1318  jint width, jint height, jint thickness) {
1319  return DW_DRAWING_SOFT_drawThickEllipse(gc, x, y, width, height, thickness);
1320 }
1321 
1322 // See the header file for the function documentation
1323 BSP_DECLARE_WEAK_FCNT DRAWING_Status UI_DRAWING_DEFAULT_drawThickCircleArc(MICROUI_GraphicsContext *gc, jint x, jint y,
1324  jint diameter, jfloat startAngle,
1325  jfloat arcAngle, jint thickness) {
1326  return DW_DRAWING_SOFT_drawThickCircleArc(gc, x, y, diameter, startAngle, arcAngle, thickness);
1327 }
1328 
1329 // See the header file for the function documentation
1330 BSP_DECLARE_WEAK_FCNT DRAWING_Status UI_DRAWING_DEFAULT_drawFlippedImage(MICROUI_GraphicsContext *gc,
1331  MICROUI_Image *img, jint regionX, jint regionY,
1332  jint width, jint height, jint x, jint y,
1333  DRAWING_Flip transformation, jint alpha) {
1334 #if !defined(UI_FEATURE_IMAGE_CUSTOM_FORMATS)
1335  return DW_DRAWING_SOFT_drawFlippedImage(gc, img, regionX, regionY, width, height, x, y, transformation, alpha);
1336 #else
1337  return UI_IMAGE_DRAWING_drawFlipped(gc, img, regionX, regionY, width, height, x, y, transformation, alpha);
1338 #endif
1339 }
1340 
1341 // See the header file for the function documentation
1342 BSP_DECLARE_WEAK_FCNT DRAWING_Status UI_DRAWING_DEFAULT_drawRotatedImageNearestNeighbor(MICROUI_GraphicsContext *gc,
1343  MICROUI_Image *img, jint x,
1344  jint y, jint rotationX,
1345  jint rotationY, jfloat angle,
1346  jint alpha) {
1347 #if !defined(UI_FEATURE_IMAGE_CUSTOM_FORMATS)
1348  return DW_DRAWING_SOFT_drawRotatedImageNearestNeighbor(gc, img, x, y, rotationX, rotationY, angle, alpha);
1349 #else
1350  return UI_IMAGE_DRAWING_drawRotatedNearestNeighbor(gc, img, x, y, rotationX, rotationY, angle, alpha);
1351 #endif
1352 }
1353 
1354 // See the header file for the function documentation
1355 BSP_DECLARE_WEAK_FCNT DRAWING_Status UI_DRAWING_DEFAULT_drawRotatedImageBilinear(MICROUI_GraphicsContext *gc,
1356  MICROUI_Image *img, jint x, jint y,
1357  jint rotationX, jint rotationY,
1358  jfloat angle, jint alpha) {
1359 #if !defined(UI_FEATURE_IMAGE_CUSTOM_FORMATS)
1360  return DW_DRAWING_SOFT_drawRotatedImageBilinear(gc, img, x, y, rotationX, rotationY, angle, alpha);
1361 #else
1362  return UI_IMAGE_DRAWING_drawRotatedBilinear(gc, img, x, y, rotationX, rotationY, angle, alpha);
1363 #endif
1364 }
1365 
1366 // See the header file for the function documentation
1367 BSP_DECLARE_WEAK_FCNT DRAWING_Status UI_DRAWING_DEFAULT_drawScaledImageNearestNeighbor(MICROUI_GraphicsContext *gc,
1368  MICROUI_Image *img, jint x,
1369  jint y, jfloat factorX,
1370  jfloat factorY, jint alpha) {
1371 #if !defined(UI_FEATURE_IMAGE_CUSTOM_FORMATS)
1372  return DW_DRAWING_SOFT_drawScaledImageNearestNeighbor(gc, img, x, y, factorX, factorY, alpha);
1373 #else
1374  return UI_IMAGE_DRAWING_drawScaledNearestNeighbor(gc, img, x, y, factorX, factorY, alpha);
1375 #endif
1376 }
1377 
1378 // See the header file for the function documentation
1379 BSP_DECLARE_WEAK_FCNT DRAWING_Status UI_DRAWING_DEFAULT_drawScaledImageBilinear(MICROUI_GraphicsContext *gc,
1380  MICROUI_Image *img, jint x, jint y,
1381  jfloat factorX, jfloat factorY,
1382  jint alpha) {
1383 #if !defined(UI_FEATURE_IMAGE_CUSTOM_FORMATS)
1384  return DW_DRAWING_SOFT_drawScaledImageBilinear(gc, img, x, y, factorX, factorY, alpha);
1385 #else
1386  return UI_IMAGE_DRAWING_drawScaledBilinear(gc, img, x, y, factorX, factorY, alpha);
1387 #endif
1388 }
1389 
1390 BSP_DECLARE_WEAK_FCNT DRAWING_Status UI_DRAWING_DEFAULT_drawScaledStringBilinear(MICROUI_GraphicsContext *gc,
1391  jchar *chars, jint length,
1392  MICROUI_Font *font, jint x, jint y,
1393  jfloat xRatio, jfloat yRatio) {
1394 #if !defined(UI_FEATURE_FONT_CUSTOM_FORMATS)
1395  assert(!LLUI_DISPLAY_isCustomFormat(font->format));
1396  return DW_DRAWING_SOFT_drawScaledStringBilinear(gc, chars, length, font, x, y, xRatio, yRatio);
1397 #else
1398  return UI_FONT_DRAWING_drawScaledStringBilinear(gc, chars, length, font, x, y, xRatio, yRatio);
1399 #endif
1400 }
1401 
1402 BSP_DECLARE_WEAK_FCNT DRAWING_Status UI_DRAWING_DEFAULT_drawScaledRenderableStringBilinear(MICROUI_GraphicsContext *gc,
1403  jchar *chars, jint length,
1404  MICROUI_Font *font,
1405  jint width,
1406  MICROUI_RenderableString *
1407  renderableString, jint x,
1408  jint y, jfloat xRatio,
1409  jfloat yRatio) {
1410 #if !defined(UI_FEATURE_FONT_CUSTOM_FORMATS)
1411  assert(!LLUI_DISPLAY_isCustomFormat(font->format));
1412  return DW_DRAWING_SOFT_drawScaledRenderableStringBilinear(gc, chars, length, font, width, renderableString, x, y,
1413  xRatio, yRatio);
1414 #else
1415  return UI_FONT_DRAWING_drawScaledRenderableStringBilinear(gc, chars, length, font, width, renderableString, x, y,
1416  xRatio, yRatio);
1417 #endif
1418 }
1419 
1420 BSP_DECLARE_WEAK_FCNT DRAWING_Status UI_DRAWING_DEFAULT_drawCharWithRotationBilinear(MICROUI_GraphicsContext *gc,
1421  jchar c, MICROUI_Font *font,
1422  jint x, int y, jint xRotation,
1423  jint yRotation, jfloat angle,
1424  jint alpha) {
1425 #if !defined(UI_FEATURE_FONT_CUSTOM_FORMATS)
1426  assert(!LLUI_DISPLAY_isCustomFormat(font->format));
1427  return DW_DRAWING_SOFT_drawCharWithRotationBilinear(gc, c, font, x, y, xRotation, yRotation, angle, alpha);
1428 #else
1429  return UI_FONT_DRAWING_drawCharWithRotationBilinear(gc, c, font, x, y, xRotation, yRotation, angle, alpha);
1430 #endif
1431 }
1432 
1433 BSP_DECLARE_WEAK_FCNT DRAWING_Status UI_DRAWING_DEFAULT_drawCharWithRotationNearestNeighbor(MICROUI_GraphicsContext *gc,
1434  jchar c, MICROUI_Font *font,
1435  jint x, jint y,
1436  jint xRotation,
1437  jint yRotation,
1438  jfloat angle, jint alpha) {
1439 #if !defined(UI_FEATURE_FONT_CUSTOM_FORMATS)
1440  assert(!LLUI_DISPLAY_isCustomFormat(font->format));
1441  return DW_DRAWING_SOFT_drawCharWithRotationNearestNeighbor(gc, c, font, x, y, xRotation, yRotation, angle, alpha);
1442 #else
1443  return UI_FONT_DRAWING_drawCharWithRotationNearestNeighbor(gc, c, font, x, y, xRotation, yRotation, angle, alpha);
1444 #endif
1445 }
1446 
1447 #if defined(UI_GC_SUPPORTED_FORMATS) && (UI_GC_SUPPORTED_FORMATS > 1)
1448 
1449 /*
1450  * The VEE port supports several destination formats. All drawing functions use a
1451  * dedicated table to redirect to the right implementation. The VEE Port must implement
1452  * the functions UI_DRAWING_is_drawer_X() to identify the right drawer according to
1453  * the destination format.
1454  *
1455  * The "DEFAULT" functions (see above) are used as element "0" of the tables (== display
1456  * buffer format).
1457  */
1458 
1459 // See the header file for the function documentation
1460 DRAWING_Status UI_DRAWING_writePixel(MICROUI_GraphicsContext *gc, jint x, jint y) {
1461  return (*UI_DRAWER_writePixel[gc->drawer])(gc, x, y);
1462 }
1463 
1464 // See the header file for the function documentation
1465 DRAWING_Status UI_DRAWING_drawLine(MICROUI_GraphicsContext *gc, jint startX, jint startY, jint endX, jint endY) {
1466  return (*UI_DRAWER_drawLine[gc->drawer])(gc, startX, startY, endX, endY);
1467 }
1468 
1469 // See the header file for the function documentation
1470 DRAWING_Status UI_DRAWING_drawHorizontalLine(MICROUI_GraphicsContext *gc, jint x1, jint x2, jint y) {
1471  return (*UI_DRAWER_drawHorizontalLine[gc->drawer])(gc, x1, x2, y);
1472 }
1473 
1474 // See the header file for the function documentation
1475 DRAWING_Status UI_DRAWING_drawVerticalLine(MICROUI_GraphicsContext *gc, jint x, jint y1, jint y2) {
1476  return (*UI_DRAWER_drawVerticalLine[gc->drawer])(gc, x, y1, y2);
1477 }
1478 
1479 // See the header file for the function documentation
1480 DRAWING_Status UI_DRAWING_drawRectangle(MICROUI_GraphicsContext *gc, jint x1, jint y1, jint x2, jint y2) {
1481  return (*UI_DRAWER_drawRectangle[gc->drawer])(gc, x1, y1, x2, y2);
1482 }
1483 
1484 // See the header file for the function documentation
1485 DRAWING_Status UI_DRAWING_fillRectangle(MICROUI_GraphicsContext *gc, jint x1, jint y1, jint x2, jint y2) {
1486  return (*UI_DRAWER_fillRectangle[gc->drawer])(gc, x1, y1, x2, y2);
1487 }
1488 
1489 // See the header file for the function documentation
1490 DRAWING_Status UI_DRAWING_drawRoundedRectangle(MICROUI_GraphicsContext *gc, jint x, jint y, jint width, jint height,
1491  jint cornerEllipseWidth, jint cornerEllipseHeight) {
1492  return (*UI_DRAWER_drawRoundedRectangle[gc->drawer])(gc, x, y, width, height, cornerEllipseWidth,
1493  cornerEllipseHeight);
1494 }
1495 
1496 // See the header file for the function documentation
1497 DRAWING_Status UI_DRAWING_fillRoundedRectangle(MICROUI_GraphicsContext *gc, jint x, jint y, jint width, jint height,
1498  jint cornerEllipseWidth, jint cornerEllipseHeight) {
1499  return (*UI_DRAWER_fillRoundedRectangle[gc->drawer])(gc, x, y, width, height, cornerEllipseWidth,
1500  cornerEllipseHeight);
1501 }
1502 
1503 // See the header file for the function documentation
1504 DRAWING_Status UI_DRAWING_drawCircleArc(MICROUI_GraphicsContext *gc, jint x, jint y, jint diameter, jfloat startAngle,
1505  jfloat arcAngle) {
1506  return (*UI_DRAWER_drawCircleArc[gc->drawer])(gc, x, y, diameter, startAngle, arcAngle);
1507 }
1508 
1509 // See the header file for the function documentation
1510 DRAWING_Status UI_DRAWING_drawEllipseArc(MICROUI_GraphicsContext *gc, jint x, jint y, jint width, jint height,
1511  jfloat startAngle, jfloat arcAngle) {
1512  return (*UI_DRAWER_drawEllipseArc[gc->drawer])(gc, x, y, width, height, startAngle, arcAngle);
1513 }
1514 
1515 // See the header file for the function documentation
1516 DRAWING_Status UI_DRAWING_fillCircleArc(MICROUI_GraphicsContext *gc, jint x, jint y, jint diameter, jfloat startAngle,
1517  jfloat arcAngle) {
1518  return (*UI_DRAWER_fillCircleArc[gc->drawer])(gc, x, y, diameter, startAngle, arcAngle);
1519 }
1520 
1521 // See the header file for the function documentation
1522 DRAWING_Status UI_DRAWING_fillEllipseArc(MICROUI_GraphicsContext *gc, jint x, jint y, jint width, jint height,
1523  jfloat startAngle, jfloat arcAngle) {
1524  return (*UI_DRAWER_fillEllipseArc[gc->drawer])(gc, x, y, width, height, startAngle, arcAngle);
1525 }
1526 
1527 // See the header file for the function documentation
1528 DRAWING_Status UI_DRAWING_drawEllipse(MICROUI_GraphicsContext *gc, jint x, jint y, jint width, jint height) {
1529  return (*UI_DRAWER_drawEllipse[gc->drawer])(gc, x, y, width, height);
1530 }
1531 
1532 // See the header file for the function documentation
1533 DRAWING_Status UI_DRAWING_fillEllipse(MICROUI_GraphicsContext *gc, jint x, jint y, jint width, jint height) {
1534  return (*UI_DRAWER_fillEllipse[gc->drawer])(gc, x, y, width, height);
1535 }
1536 
1537 // See the header file for the function documentation
1538 DRAWING_Status UI_DRAWING_drawCircle(MICROUI_GraphicsContext *gc, jint x, jint y, jint diameter) {
1539  return (*UI_DRAWER_drawCircle[gc->drawer])(gc, x, y, diameter);
1540 }
1541 
1542 // See the header file for the function documentation
1543 DRAWING_Status UI_DRAWING_fillCircle(MICROUI_GraphicsContext *gc, jint x, jint y, jint diameter) {
1544  return (*UI_DRAWER_fillCircle[gc->drawer])(gc, x, y, diameter);
1545 }
1546 
1547 // See the header file for the function documentation
1548 DRAWING_Status UI_DRAWING_drawString(MICROUI_GraphicsContext *gc, jchar *chars, jint length, MICROUI_Font *font, jint x,
1549  jint y) {
1550  return (*UI_DRAWER_drawString[gc->drawer])(gc, chars, length, font, x, y);
1551 }
1552 
1553 // See the header file for the function documentation
1554 DRAWING_Status UI_DRAWING_drawRenderableString(MICROUI_GraphicsContext *gc, jchar *chars, jint length,
1555  MICROUI_Font *font, jint width,
1556  MICROUI_RenderableString *renderableString, jint x, jint y) {
1557  return (*UI_DRAWER_drawRenderableString[gc->drawer])(gc, chars, length, font, width, renderableString, x, y);
1558 }
1559 
1560 // See the header file for the function documentation
1561 DRAWING_Status UI_DRAWING_drawImage(MICROUI_GraphicsContext *gc, MICROUI_Image *img, jint regionX, jint regionY,
1562  jint width, jint height, jint x, jint y, jint alpha) {
1563  return (*UI_DRAWER_drawImage[gc->drawer])(gc, img, regionX, regionY, width, height, x, y, alpha);
1564 }
1565 
1566 // See the header file for the function documentation
1567 DRAWING_Status UI_DRAWING_copyImage(MICROUI_GraphicsContext *gc, MICROUI_Image *img, jint regionX, jint regionY,
1568  jint width, jint height, jint x, jint y) {
1569  return (*UI_DRAWER_copyImage[gc->drawer])(gc, img, regionX, regionY, width, height, x, y);
1570 }
1571 
1572 // See the header file for the function documentation
1573 DRAWING_Status UI_DRAWING_drawRegion(MICROUI_GraphicsContext *gc, jint regionX, jint regionY, jint width, jint height,
1574  jint x, jint y, jint alpha) {
1575  return (*UI_DRAWER_drawRegion[gc->drawer])(gc, regionX, regionY, width, height, x, y, alpha);
1576 }
1577 
1578 // See the header file for the function documentation
1579 DRAWING_Status UI_DRAWING_drawThickFadedPoint(MICROUI_GraphicsContext *gc, jint x, jint y, jint thickness, jint fade) {
1580  return (*UI_DRAWER_drawThickFadedPoint[gc->drawer])(gc, x, y, thickness, fade);
1581 }
1582 
1583 // See the header file for the function documentation
1584 DRAWING_Status UI_DRAWING_drawThickFadedLine(MICROUI_GraphicsContext *gc, jint startX, jint startY, jint endX,
1585  jint endY, jint thickness, jint fade, DRAWING_Cap startCap,
1586  DRAWING_Cap endCap) {
1587  return (*UI_DRAWER_drawThickFadedLine[gc->drawer])(gc, startX, startY, endX, endY, thickness, fade, startCap,
1588  endCap);
1589 }
1590 
1591 // See the header file for the function documentation
1592 DRAWING_Status UI_DRAWING_drawThickFadedCircle(MICROUI_GraphicsContext *gc, jint x, jint y, jint diameter,
1593  jint thickness, jint fade) {
1594  return (*UI_DRAWER_drawThickFadedCircle[gc->drawer])(gc, x, y, diameter, thickness, fade);
1595 }
1596 
1597 // See the header file for the function documentation
1598 DRAWING_Status UI_DRAWING_drawThickFadedCircleArc(MICROUI_GraphicsContext *gc, jint x, jint y, jint diameter,
1599  jfloat startAngle, jfloat arcAngle, jint thickness, jint fade,
1600  DRAWING_Cap start, DRAWING_Cap end) {
1601  return (*UI_DRAWER_drawThickFadedCircleArc[gc->drawer])(gc, x, y, diameter, startAngle, arcAngle, thickness, fade,
1602  start, end);
1603 }
1604 
1605 // See the header file for the function documentation
1606 DRAWING_Status UI_DRAWING_drawThickFadedEllipse(MICROUI_GraphicsContext *gc, jint x, jint y, jint width, jint height,
1607  jint thickness, jint fade) {
1608  return (*UI_DRAWER_drawThickFadedEllipse[gc->drawer])(gc, x, y, width, height, thickness, fade);
1609 }
1610 
1611 // See the header file for the function documentation
1612 DRAWING_Status UI_DRAWING_drawThickLine(MICROUI_GraphicsContext *gc, jint startX, jint startY, jint endX, jint endY,
1613  jint thickness) {
1614  return (*UI_DRAWER_drawThickLine[gc->drawer])(gc, startX, startY, endX, endY, thickness);
1615 }
1616 
1617 // See the header file for the function documentation
1618 DRAWING_Status UI_DRAWING_drawThickCircle(MICROUI_GraphicsContext *gc, jint x, jint y, jint diameter, jint thickness) {
1619  return (*UI_DRAWER_drawThickCircle[gc->drawer])(gc, x, y, diameter, thickness);
1620 }
1621 
1622 // See the header file for the function documentation
1623 DRAWING_Status UI_DRAWING_drawThickEllipse(MICROUI_GraphicsContext *gc, jint x, jint y, jint width, jint height,
1624  jint thickness) {
1625  return (*UI_DRAWER_drawThickEllipse[gc->drawer])(gc, x, y, width, height, thickness);
1626 }
1627 
1628 // See the header file for the function documentation
1629 DRAWING_Status UI_DRAWING_drawThickCircleArc(MICROUI_GraphicsContext *gc, jint x, jint y, jint diameter,
1630  jfloat startAngle, jfloat arcAngle, jint thickness) {
1631  return (*UI_DRAWER_drawThickCircleArc[gc->drawer])(gc, x, y, diameter, startAngle, arcAngle, thickness);
1632 }
1633 
1634 // See the header file for the function documentation
1635 DRAWING_Status UI_DRAWING_drawFlippedImage(MICROUI_GraphicsContext *gc, MICROUI_Image *img, jint regionX, jint regionY,
1636  jint width, jint height, jint x, jint y, DRAWING_Flip transformation,
1637  jint alpha) {
1638  return (*UI_DRAWER_drawFlippedImage[gc->drawer])(gc, img, regionX, regionY, width, height, x, y, transformation,
1639  alpha);
1640 }
1641 
1642 // See the header file for the function documentation
1643 DRAWING_Status UI_DRAWING_drawRotatedImageNearestNeighbor(MICROUI_GraphicsContext *gc, MICROUI_Image *img, jint x,
1644  jint y, jint rotationX, jint rotationY, jfloat angle,
1645  jint alpha) {
1646  return (*UI_DRAWER_drawRotatedImageNearestNeighbor[gc->drawer])(gc, img, x, y, rotationX, rotationY, angle, alpha);
1647 }
1648 
1649 // See the header file for the function documentation
1650 DRAWING_Status UI_DRAWING_drawRotatedImageBilinear(MICROUI_GraphicsContext *gc, MICROUI_Image *img, jint x, jint y,
1651  jint rotationX, jint rotationY, jfloat angle, jint alpha) {
1652  return (*UI_DRAWER_drawRotatedImageBilinear[gc->drawer])(gc, img, x, y, rotationX, rotationY, angle, alpha);
1653 }
1654 
1655 // See the header file for the function documentation
1656 DRAWING_Status UI_DRAWING_drawScaledImageNearestNeighbor(MICROUI_GraphicsContext *gc, MICROUI_Image *img, jint x,
1657  jint y, jfloat factorX, jfloat factorY, jint alpha) {
1658  return (*UI_DRAWER_drawScaledImageNearestNeighbor[gc->drawer])(gc, img, x, y, factorX, factorY, alpha);
1659 }
1660 
1661 // See the header file for the function documentation
1662 DRAWING_Status UI_DRAWING_drawScaledImageBilinear(MICROUI_GraphicsContext *gc, MICROUI_Image *img, jint x, jint y,
1663  jfloat factorX, jfloat factorY, jint alpha) {
1664  return (*UI_DRAWER_drawScaledImageBilinear[gc->drawer])(gc, img, x, y, factorX, factorY, alpha);
1665 }
1666 
1667 // See the header file for the function documentation
1668 DRAWING_Status UI_DRAWING_drawScaledStringBilinear(MICROUI_GraphicsContext *gc, jchar *chars, jint length,
1669  MICROUI_Font *font, jint x, jint y, jfloat xRatio, jfloat yRatio) {
1670  return (*UI_DRAWER_drawScaledStringBilinear[gc->drawer])(gc, chars, length, font, x, y, xRatio, yRatio);
1671 }
1672 
1673 // See the header file for the function documentation
1674 DRAWING_Status UI_DRAWING_drawScaledRenderableStringBilinear(MICROUI_GraphicsContext *gc, jchar *chars, jint length,
1675  MICROUI_Font *font, jint width,
1676  MICROUI_RenderableString *renderableString, jint x, jint y,
1677  jfloat xRatio, jfloat yRatio) {
1678  return (*UI_DRAWER_drawScaledRenderableStringBilinear[gc->drawer])(gc, chars, length, font, width, renderableString,
1679  x, y, xRatio, yRatio);
1680 }
1681 
1682 // See the header file for the function documentation
1683 DRAWING_Status UI_DRAWING_drawCharWithRotationBilinear(MICROUI_GraphicsContext *gc, jchar c, MICROUI_Font *font, jint x,
1684  jint y, jint xRotation, jint yRotation, jfloat angle,
1685  jint alpha) {
1686  return (*UI_DRAWER_drawCharWithRotationBilinear[gc->drawer])(gc, c, font, x, y, xRotation, yRotation, angle, alpha);
1687 }
1688 
1689 // See the header file for the function documentation
1690 DRAWING_Status UI_DRAWING_drawCharWithRotationNearestNeighbor(MICROUI_GraphicsContext *gc, jchar c, MICROUI_Font *font,
1691  jint x, jint y, jint xRotation, jint yRotation,
1692  jfloat angle, jint alpha) {
1693  return (*UI_DRAWER_drawCharWithRotationNearestNeighbor[gc->drawer])(gc, c, font, x, y, xRotation, yRotation, angle,
1694  alpha);
1695 }
1696 
1697 /*
1698  * The next functions are used as elements "1" of the tables. They call STUB functions and should be
1699  * overridden by the drawer that manages the format identified by the index "1".
1700  *
1701  * Only the functions UI_DRAWING_adjustNewImageCharacteristics_1() and UI_DRAWING_initializeNewImage_1()
1702  * are mandatory. If the drawing engine (for the format identified by the index "1") does not override these
1703  * functions, the application will not be able to open an image with the associated format (the default functions
1704  * are implemented as weak functions in case there is no drawing engine for this format).
1705  *
1706  * If no engine supports the format identified by the index "1", the application will not be able to open
1707  * an image with the associated format.
1708  */
1709 
1710 BSP_DECLARE_WEAK_FCNT bool UI_DRAWING_is_drawer_1(jbyte image_format) {
1711  (void)image_format;
1712  // default behavior: format is not supported
1713  return false;
1714 }
1715 
1716 // See the header file for the function documentation
1717 BSP_DECLARE_WEAK_FCNT uint32_t UI_DRAWING_getNewImageStrideInBytes_1(jbyte image_format, uint32_t width,
1718  uint32_t height, uint32_t default_stride) {
1719  (void)image_format;
1720  (void)width;
1721  (void)height;
1722  // does nothing and will throw an error if the application tries to open this kind of image.
1723  // see above.
1724  return default_stride;
1725 }
1726 
1727 // See the header file for the function documentation
1728 BSP_DECLARE_WEAK_FCNT void UI_DRAWING_adjustNewImageCharacteristics_1(jbyte image_format, uint32_t width,
1729  uint32_t height, uint32_t *data_size,
1730  uint32_t *data_alignment) {
1731  (void)image_format;
1732  (void)width;
1733  (void)height;
1734  (void)data_size;
1735  (void)data_alignment;
1736  // does nothing and will throw an error if the application tries to open this kind of image.
1737  // see above.
1738 }
1739 
1740 // See the header file for the function documentation
1741 BSP_DECLARE_WEAK_FCNT void UI_DRAWING_initializeNewImage_1(MICROUI_Image *image) {
1742  (void)image;
1743  // nothing to do
1744 }
1745 
1746 // See the header file for the function documentation
1747 BSP_DECLARE_WEAK_FCNT void UI_DRAWING_freeImageResources_1(MICROUI_Image *image) {
1748  (void)image;
1749  // nothing to do
1750 }
1751 
1752 // See the header file for the function documentation
1753 BSP_DECLARE_WEAK_FCNT DRAWING_Status UI_DRAWING_writePixel_1(MICROUI_GraphicsContext *gc, jint x, jint y) {
1754  return UI_DRAWING_STUB_writePixel(gc, x, y);
1755 }
1756 
1757 // See the header file for the function documentation
1758 BSP_DECLARE_WEAK_FCNT DRAWING_Status UI_DRAWING_drawLine_1(MICROUI_GraphicsContext *gc, jint startX, jint startY,
1759  jint endX, jint endY) {
1760  return UI_DRAWING_STUB_drawLine(gc, startX, startY, endX, endY);
1761 }
1762 
1763 // See the header file for the function documentation
1764 BSP_DECLARE_WEAK_FCNT DRAWING_Status UI_DRAWING_drawHorizontalLine_1(MICROUI_GraphicsContext *gc, jint x1, jint x2,
1765  jint y) {
1766  return UI_DRAWING_STUB_drawHorizontalLine(gc, x1, x2, y);
1767 }
1768 
1769 // See the header file for the function documentation
1770 BSP_DECLARE_WEAK_FCNT DRAWING_Status UI_DRAWING_drawVerticalLine_1(MICROUI_GraphicsContext *gc, jint x, jint y1,
1771  jint y2) {
1772  return UI_DRAWING_STUB_drawVerticalLine(gc, x, y1, y2);
1773 }
1774 
1775 // See the header file for the function documentation
1776 BSP_DECLARE_WEAK_FCNT DRAWING_Status UI_DRAWING_drawRectangle_1(MICROUI_GraphicsContext *gc, jint x1, jint y1, jint x2,
1777  jint y2) {
1778  return UI_DRAWING_STUB_drawRectangle(gc, x1, y1, x2, y2);
1779 }
1780 
1781 // See the header file for the function documentation
1782 BSP_DECLARE_WEAK_FCNT DRAWING_Status UI_DRAWING_fillRectangle_1(MICROUI_GraphicsContext *gc, jint x1, jint y1, jint x2,
1783  jint y2) {
1784  return UI_DRAWING_STUB_fillRectangle(gc, x1, y1, x2, y2);
1785 }
1786 
1787 // See the header file for the function documentation
1788 BSP_DECLARE_WEAK_FCNT DRAWING_Status UI_DRAWING_drawRoundedRectangle_1(MICROUI_GraphicsContext *gc, jint x, jint y,
1789  jint width, jint height, jint cornerEllipseWidth,
1790  jint cornerEllipseHeight) {
1791  return UI_DRAWING_STUB_drawRoundedRectangle(gc, x, y, width, height, cornerEllipseWidth, cornerEllipseHeight);
1792 }
1793 
1794 // See the header file for the function documentation
1795 BSP_DECLARE_WEAK_FCNT DRAWING_Status UI_DRAWING_fillRoundedRectangle_1(MICROUI_GraphicsContext *gc, jint x, jint y,
1796  jint width, jint height, jint cornerEllipseWidth,
1797  jint cornerEllipseHeight) {
1798  return UI_DRAWING_STUB_fillRoundedRectangle(gc, x, y, width, height, cornerEllipseWidth, cornerEllipseHeight);
1799 }
1800 
1801 // See the header file for the function documentation
1802 BSP_DECLARE_WEAK_FCNT DRAWING_Status UI_DRAWING_drawCircleArc_1(MICROUI_GraphicsContext *gc, jint x, jint y,
1803  jint diameter, jfloat startAngle, jfloat arcAngle) {
1804  return UI_DRAWING_STUB_drawCircleArc(gc, x, y, diameter, startAngle, arcAngle);
1805 }
1806 
1807 // See the header file for the function documentation
1808 BSP_DECLARE_WEAK_FCNT DRAWING_Status UI_DRAWING_drawEllipseArc_1(MICROUI_GraphicsContext *gc, jint x, jint y,
1809  jint width, jint height, jfloat startAngle,
1810  jfloat arcAngle) {
1811  return UI_DRAWING_STUB_drawEllipseArc(gc, x, y, width, height, startAngle, arcAngle);
1812 }
1813 
1814 // See the header file for the function documentation
1815 BSP_DECLARE_WEAK_FCNT DRAWING_Status UI_DRAWING_fillCircleArc_1(MICROUI_GraphicsContext *gc, jint x, jint y,
1816  jint diameter, jfloat startAngle, jfloat arcAngle) {
1817  return UI_DRAWING_STUB_fillCircleArc(gc, x, y, diameter, startAngle, arcAngle);
1818 }
1819 
1820 // See the header file for the function documentation
1821 BSP_DECLARE_WEAK_FCNT DRAWING_Status UI_DRAWING_fillEllipseArc_1(MICROUI_GraphicsContext *gc, jint x, jint y,
1822  jint width, jint height, jfloat startAngle,
1823  jfloat arcAngle) {
1824  return UI_DRAWING_STUB_fillEllipseArc(gc, x, y, width, height, startAngle, arcAngle);
1825 }
1826 
1827 // See the header file for the function documentation
1828 BSP_DECLARE_WEAK_FCNT DRAWING_Status UI_DRAWING_drawEllipse_1(MICROUI_GraphicsContext *gc, jint x, jint y, jint width,
1829  jint height) {
1830  return UI_DRAWING_STUB_drawEllipse(gc, x, y, width, height);
1831 }
1832 
1833 // See the header file for the function documentation
1834 BSP_DECLARE_WEAK_FCNT DRAWING_Status UI_DRAWING_fillEllipse_1(MICROUI_GraphicsContext *gc, jint x, jint y, jint width,
1835  jint height) {
1836  return UI_DRAWING_STUB_fillEllipse(gc, x, y, width, height);
1837 }
1838 
1839 // See the header file for the function documentation
1840 BSP_DECLARE_WEAK_FCNT DRAWING_Status UI_DRAWING_drawCircle_1(MICROUI_GraphicsContext *gc, jint x, jint y,
1841  jint diameter) {
1842  return UI_DRAWING_STUB_drawCircle(gc, x, y, diameter);
1843 }
1844 
1845 // See the header file for the function documentation
1846 BSP_DECLARE_WEAK_FCNT DRAWING_Status UI_DRAWING_fillCircle_1(MICROUI_GraphicsContext *gc, jint x, jint y,
1847  jint diameter) {
1848  return UI_DRAWING_STUB_fillCircle(gc, x, y, diameter);
1849 }
1850 
1851 // See the header file for the function documentation
1852 BSP_DECLARE_WEAK_FCNT DRAWING_Status UI_DRAWING_drawString_1(MICROUI_GraphicsContext *gc, jchar *chars, jint length,
1853  MICROUI_Font *font, jint x, jint y) {
1854  return UI_FONT_DRAWING_drawString(gc, chars, length, font, x, y);
1855 }
1856 
1857 // See the header file for the function documentation
1858 BSP_DECLARE_WEAK_FCNT DRAWING_Status UI_DRAWING_drawRenderableString_1(MICROUI_GraphicsContext *gc, jchar *chars,
1859  jint length, MICROUI_Font *font, jint width,
1860  MICROUI_RenderableString *renderableString,
1861  jint x, jint y) {
1862  return UI_FONT_DRAWING_drawRenderableString(gc, chars, length, font, width, renderableString, x, y);
1863 }
1864 
1865 // See the header file for the function documentation
1866 BSP_DECLARE_WEAK_FCNT DRAWING_Status UI_DRAWING_drawImage_1(MICROUI_GraphicsContext *gc, MICROUI_Image *img,
1867  jint regionX, jint regionY, jint width, jint height, jint x,
1868  jint y, jint alpha) {
1869  return UI_IMAGE_DRAWING_draw(gc, img, regionX, regionY, width, height, x, y, alpha);
1870 }
1871 
1872 // See the header file for the function documentation
1873 BSP_DECLARE_WEAK_FCNT DRAWING_Status UI_DRAWING_copyImage_1(MICROUI_GraphicsContext *gc, MICROUI_Image *img,
1874  jint regionX, jint regionY, jint width, jint height, jint x,
1875  jint y) {
1876  return UI_IMAGE_DRAWING_copy(gc, img, regionX, regionY, width, height, x, y);
1877 }
1878 
1879 // See the header file for the function documentation
1880 BSP_DECLARE_WEAK_FCNT DRAWING_Status UI_DRAWING_drawRegion_1(MICROUI_GraphicsContext *gc, jint regionX, jint regionY,
1881  jint width, jint height, jint x, jint y, jint alpha) {
1882  return UI_IMAGE_DRAWING_drawRegion(gc, regionX, regionY, width, height, x, y, alpha);
1883 }
1884 
1885 // See the header file for the function documentation
1886 BSP_DECLARE_WEAK_FCNT DRAWING_Status UI_DRAWING_drawThickFadedPoint_1(MICROUI_GraphicsContext *gc, jint x, jint y,
1887  jint thickness, jint fade) {
1888  return UI_DRAWING_STUB_drawThickFadedPoint(gc, x, y, thickness, fade);
1889 }
1890 
1891 // See the header file for the function documentation
1892 BSP_DECLARE_WEAK_FCNT DRAWING_Status UI_DRAWING_drawThickFadedLine_1(MICROUI_GraphicsContext *gc, jint startX,
1893  jint startY, jint endX, jint endY, jint thickness,
1894  jint fade, DRAWING_Cap startCap,
1895  DRAWING_Cap endCap) {
1896  return UI_DRAWING_STUB_drawThickFadedLine(gc, startX, startY, endX, endY, thickness, fade, startCap, endCap);
1897 }
1898 
1899 // See the header file for the function documentation
1900 BSP_DECLARE_WEAK_FCNT DRAWING_Status UI_DRAWING_drawThickFadedCircle_1(MICROUI_GraphicsContext *gc, jint x, jint y,
1901  jint diameter, jint thickness, jint fade) {
1902  return UI_DRAWING_STUB_drawThickFadedCircle(gc, x, y, diameter, thickness, fade);
1903 }
1904 
1905 // See the header file for the function documentation
1906 BSP_DECLARE_WEAK_FCNT DRAWING_Status UI_DRAWING_drawThickFadedCircleArc_1(MICROUI_GraphicsContext *gc, jint x, jint y,
1907  jint diameter, jfloat startAngle,
1908  jfloat arcAngle, jint thickness, jint fade,
1909  DRAWING_Cap start, DRAWING_Cap end) {
1910  return UI_DRAWING_STUB_drawThickFadedCircleArc(gc, x, y, diameter, startAngle, arcAngle, thickness, fade, start,
1911  end);
1912 }
1913 
1914 // See the header file for the function documentation
1915 BSP_DECLARE_WEAK_FCNT DRAWING_Status UI_DRAWING_drawThickFadedEllipse_1(MICROUI_GraphicsContext *gc, jint x, jint y,
1916  jint width, jint height, jint thickness,
1917  jint fade) {
1918  return UI_DRAWING_STUB_drawThickFadedEllipse(gc, x, y, width, height, thickness, fade);
1919 }
1920 
1921 // See the header file for the function documentation
1922 BSP_DECLARE_WEAK_FCNT DRAWING_Status UI_DRAWING_drawThickLine_1(MICROUI_GraphicsContext *gc, jint startX, jint startY,
1923  jint endX, jint endY, jint thickness) {
1924  return UI_DRAWING_STUB_drawThickLine(gc, startX, startY, endX, endY, thickness);
1925 }
1926 
1927 // See the header file for the function documentation
1928 BSP_DECLARE_WEAK_FCNT DRAWING_Status UI_DRAWING_drawThickCircle_1(MICROUI_GraphicsContext *gc, jint x, jint y,
1929  jint diameter, jint thickness) {
1930  return UI_DRAWING_STUB_drawThickCircle(gc, x, y, diameter, thickness);
1931 }
1932 
1933 // See the header file for the function documentation
1934 BSP_DECLARE_WEAK_FCNT DRAWING_Status UI_DRAWING_drawThickEllipse_1(MICROUI_GraphicsContext *gc, jint x, jint y,
1935  jint width, jint height, jint thickness) {
1936  return UI_DRAWING_STUB_drawThickEllipse(gc, x, y, width, height, thickness);
1937 }
1938 
1939 // See the header file for the function documentation
1940 BSP_DECLARE_WEAK_FCNT DRAWING_Status UI_DRAWING_drawThickCircleArc_1(MICROUI_GraphicsContext *gc, jint x, jint y,
1941  jint diameter, jfloat startAngle, jfloat arcAngle,
1942  jint thickness) {
1943  return UI_DRAWING_STUB_drawThickCircleArc(gc, x, y, diameter, startAngle, arcAngle, thickness);
1944 }
1945 
1946 // See the header file for the function documentation
1947 BSP_DECLARE_WEAK_FCNT DRAWING_Status UI_DRAWING_drawFlippedImage_1(MICROUI_GraphicsContext *gc, MICROUI_Image *img,
1948  jint regionX, jint regionY, jint width, jint height,
1949  jint x, jint y, DRAWING_Flip transformation,
1950  jint alpha) {
1951  return UI_IMAGE_DRAWING_drawFlipped(gc, img, regionX, regionY, width, height, x, y, transformation, alpha);
1952 }
1953 
1954 // See the header file for the function documentation
1955 BSP_DECLARE_WEAK_FCNT DRAWING_Status UI_DRAWING_drawRotatedImageNearestNeighbor_1(MICROUI_GraphicsContext *gc,
1956  MICROUI_Image *img, jint x, jint y,
1957  jint rotationX, jint rotationY,
1958  jfloat angle, jint alpha) {
1959  return UI_IMAGE_DRAWING_drawRotatedNearestNeighbor(gc, img, x, y, rotationX, rotationY, angle, alpha);
1960 }
1961 
1962 // See the header file for the function documentation
1963 BSP_DECLARE_WEAK_FCNT DRAWING_Status UI_DRAWING_drawRotatedImageBilinear_1(MICROUI_GraphicsContext *gc,
1964  MICROUI_Image *img, jint x, jint y,
1965  jint rotationX, jint rotationY, jfloat angle,
1966  jint alpha) {
1967  return UI_IMAGE_DRAWING_drawRotatedBilinear(gc, img, x, y, rotationX, rotationY, angle, alpha);
1968 }
1969 
1970 // See the header file for the function documentation
1971 BSP_DECLARE_WEAK_FCNT DRAWING_Status UI_DRAWING_drawScaledImageNearestNeighbor_1(MICROUI_GraphicsContext *gc,
1972  MICROUI_Image *img, jint x, jint y,
1973  jfloat factorX, jfloat factorY,
1974  jint alpha) {
1975  return UI_IMAGE_DRAWING_drawScaledNearestNeighbor(gc, img, x, y, factorX, factorY, alpha);
1976 }
1977 
1978 // See the header file for the function documentation
1979 BSP_DECLARE_WEAK_FCNT DRAWING_Status UI_DRAWING_drawScaledImageBilinear_1(MICROUI_GraphicsContext *gc,
1980  MICROUI_Image *img, jint x, jint y,
1981  jfloat factorX, jfloat factorY, jint alpha) {
1982  return UI_IMAGE_DRAWING_drawScaledBilinear(gc, img, x, y, factorX, factorY, alpha);
1983 }
1984 
1985 // See the header file for the function documentation
1986 BSP_DECLARE_WEAK_FCNT DRAWING_Status UI_DRAWING_drawScaledStringBilinear_1(MICROUI_GraphicsContext *gc, jchar *chars,
1987  jint length, MICROUI_Font *font, jint x,
1988  jint y, jfloat xRatio, jfloat yRatio) {
1989  return UI_FONT_DRAWING_drawScaledStringBilinear(gc, chars, length, font, x, y, xRatio, yRatio);
1990 }
1991 
1992 // See the header file for the function documentation
1993 BSP_DECLARE_WEAK_FCNT DRAWING_Status UI_DRAWING_drawScaledRenderableStringBilinear_1(MICROUI_GraphicsContext *gc,
1994  jchar *chars, jint length,
1995  MICROUI_Font *font, jint width,
1996  MICROUI_RenderableString *
1997  renderableString, jint x, jint y,
1998  jfloat xRatio, jfloat yRatio) {
1999  return UI_FONT_DRAWING_drawScaledRenderableStringBilinear(gc, chars, length, font, width, renderableString, x, y,
2000  xRatio, yRatio);
2001 }
2002 
2003 // See the header file for the function documentation
2004 BSP_DECLARE_WEAK_FCNT DRAWING_Status UI_DRAWING_drawCharWithRotationBilinear_1(MICROUI_GraphicsContext *gc, jchar c,
2005  MICROUI_Font *font, jint x, jint y,
2006  jint xRotation, jint yRotation,
2007  jfloat angle, jint alpha) {
2008  return UI_FONT_DRAWING_drawCharWithRotationBilinear(gc, c, font, x, y, xRotation, yRotation, angle, alpha);
2009 }
2010 
2011 // See the header file for the function documentation
2012 BSP_DECLARE_WEAK_FCNT DRAWING_Status UI_DRAWING_drawCharWithRotationNearestNeighbor_1(MICROUI_GraphicsContext *gc,
2013  jchar c, MICROUI_Font *font,
2014  jint x, jint y, jint xRotation,
2015  jint yRotation, jfloat angle,
2016  jint alpha) {
2017  return UI_FONT_DRAWING_drawCharWithRotationNearestNeighbor(gc, c, font, x, y, xRotation, yRotation, angle, alpha);
2018 }
2019 
2020 #if (UI_GC_SUPPORTED_FORMATS > 2)
2021 
2022 /*
2023  * The next functions are used as elements "2" of the tables. They call STUB functions and should be
2024  * overridden by the drawer that manages the format identified by the index "2".
2025  *
2026  * Only the functions UI_DRAWING_adjustNewImageCharacteristics_2() and UI_DRAWING_initializeNewImage_2()
2027  * are mandatory. If the drawing engine (for the format identified by the index "2") does not override these
2028  * functions, the application will not be able to open an image with the associated format (the default functions
2029  * are implemented as weak functions in case there is no drawing engine for this format).
2030  *
2031  * If no engine supports the format identified by the index "2", the application will not be able to open
2032  * an image with the associated format.
2033  */
2034 
2035 BSP_DECLARE_WEAK_FCNT bool UI_DRAWING_is_drawer_2(jbyte image_format) {
2036  (void)image_format;
2037  // default behavior: format is not supported
2038  return false;
2039 }
2040 
2041 // See the header file for the function documentation
2042 BSP_DECLARE_WEAK_FCNT uint32_t UI_DRAWING_getNewImageStrideInBytes_2(jbyte image_format, uint32_t width,
2043  uint32_t height, uint32_t default_stride) {
2044  (void)image_format;
2045  (void)width;
2046  (void)height;
2047  // does nothing and will throw an error if the application tries to open this kind of image.
2048  // see above.
2049  return default_stride;
2050 }
2051 
2052 // See the header file for the function documentation
2053 BSP_DECLARE_WEAK_FCNT void UI_DRAWING_adjustNewImageCharacteristics_2(jbyte image_format, uint32_t width,
2054  uint32_t height, uint32_t *data_size,
2055  uint32_t *data_alignment) {
2056  (void)image_format;
2057  (void)width;
2058  (void)height;
2059  (void)data_size;
2060  (void)data_alignment;
2061  // does nothing and will throw an error if the application tries to open this kind of image.
2062  // see above.
2063 }
2064 
2065 // See the header file for the function documentation
2066 BSP_DECLARE_WEAK_FCNT void UI_DRAWING_initializeNewImage_2(MICROUI_Image *image) {
2067  (void)image;
2068  // nothing to do
2069 }
2070 
2071 // See the header file for the function documentation
2072 BSP_DECLARE_WEAK_FCNT void UI_DRAWING_freeImageResources_2(MICROUI_Image *image) {
2073  (void)image;
2074  // nothing to do
2075 }
2076 
2077 // See the header file for the function documentation
2078 BSP_DECLARE_WEAK_FCNT DRAWING_Status UI_DRAWING_writePixel_2(MICROUI_GraphicsContext *gc, jint x, jint y) {
2079  return UI_DRAWING_STUB_writePixel(gc, x, y);
2080 }
2081 
2082 // See the header file for the function documentation
2083 BSP_DECLARE_WEAK_FCNT DRAWING_Status UI_DRAWING_drawLine_2(MICROUI_GraphicsContext *gc, jint startX, jint startY,
2084  jint endX, jint endY) {
2085  return UI_DRAWING_STUB_drawLine(gc, startX, startY, endX, endY);
2086 }
2087 
2088 // See the header file for the function documentation
2089 BSP_DECLARE_WEAK_FCNT DRAWING_Status UI_DRAWING_drawHorizontalLine_2(MICROUI_GraphicsContext *gc, jint x1, jint x2,
2090  jint y) {
2091  return UI_DRAWING_STUB_drawHorizontalLine(gc, x1, x2, y);
2092 }
2093 
2094 // See the header file for the function documentation
2095 BSP_DECLARE_WEAK_FCNT DRAWING_Status UI_DRAWING_drawVerticalLine_2(MICROUI_GraphicsContext *gc, jint x, jint y1,
2096  jint y2) {
2097  return UI_DRAWING_STUB_drawVerticalLine(gc, x, y1, y2);
2098 }
2099 
2100 // See the header file for the function documentation
2101 BSP_DECLARE_WEAK_FCNT DRAWING_Status UI_DRAWING_drawRectangle_2(MICROUI_GraphicsContext *gc, jint x1, jint y1, jint x2,
2102  jint y2) {
2103  return UI_DRAWING_STUB_drawRectangle(gc, x1, y1, x2, y2);
2104 }
2105 
2106 // See the header file for the function documentation
2107 BSP_DECLARE_WEAK_FCNT DRAWING_Status UI_DRAWING_fillRectangle_2(MICROUI_GraphicsContext *gc, jint x1, jint y1, jint x2,
2108  jint y2) {
2109  return UI_DRAWING_STUB_fillRectangle(gc, x1, y1, x2, y2);
2110 }
2111 
2112 // See the header file for the function documentation
2113 BSP_DECLARE_WEAK_FCNT DRAWING_Status UI_DRAWING_drawRoundedRectangle_2(MICROUI_GraphicsContext *gc, jint x, jint y,
2114  jint width, jint height, jint cornerEllipseWidth,
2115  jint cornerEllipseHeight) {
2116  return UI_DRAWING_STUB_drawRoundedRectangle(gc, x, y, width, height, cornerEllipseWidth, cornerEllipseHeight);
2117 }
2118 
2119 // See the header file for the function documentation
2120 BSP_DECLARE_WEAK_FCNT DRAWING_Status UI_DRAWING_fillRoundedRectangle_2(MICROUI_GraphicsContext *gc, jint x, jint y,
2121  jint width, jint height, jint cornerEllipseWidth,
2122  jint cornerEllipseHeight) {
2123  return UI_DRAWING_STUB_fillRoundedRectangle(gc, x, y, width, height, cornerEllipseWidth, cornerEllipseHeight);
2124 }
2125 
2126 // See the header file for the function documentation
2127 BSP_DECLARE_WEAK_FCNT DRAWING_Status UI_DRAWING_drawCircleArc_2(MICROUI_GraphicsContext *gc, jint x, jint y,
2128  jint diameter, jfloat startAngle, jfloat arcAngle) {
2129  return UI_DRAWING_STUB_drawCircleArc(gc, x, y, diameter, startAngle, arcAngle);
2130 }
2131 
2132 // See the header file for the function documentation
2133 BSP_DECLARE_WEAK_FCNT DRAWING_Status UI_DRAWING_drawEllipseArc_2(MICROUI_GraphicsContext *gc, jint x, jint y,
2134  jint width, jint height, jfloat startAngle,
2135  jfloat arcAngle) {
2136  return UI_DRAWING_STUB_drawEllipseArc(gc, x, y, width, height, startAngle, arcAngle);
2137 }
2138 
2139 // See the header file for the function documentation
2140 BSP_DECLARE_WEAK_FCNT DRAWING_Status UI_DRAWING_fillCircleArc_2(MICROUI_GraphicsContext *gc, jint x, jint y,
2141  jint diameter, jfloat startAngle, jfloat arcAngle) {
2142  return UI_DRAWING_STUB_fillCircleArc(gc, x, y, diameter, startAngle, arcAngle);
2143 }
2144 
2145 // See the header file for the function documentation
2146 BSP_DECLARE_WEAK_FCNT DRAWING_Status UI_DRAWING_fillEllipseArc_2(MICROUI_GraphicsContext *gc, jint x, jint y,
2147  jint width, jint height, jfloat startAngle,
2148  jfloat arcAngle) {
2149  return UI_DRAWING_STUB_fillEllipseArc(gc, x, y, width, height, startAngle, arcAngle);
2150 }
2151 
2152 // See the header file for the function documentation
2153 BSP_DECLARE_WEAK_FCNT DRAWING_Status UI_DRAWING_drawEllipse_2(MICROUI_GraphicsContext *gc, jint x, jint y, jint width,
2154  jint height) {
2155  return UI_DRAWING_STUB_drawEllipse(gc, x, y, width, height);
2156 }
2157 
2158 // See the header file for the function documentation
2159 BSP_DECLARE_WEAK_FCNT DRAWING_Status UI_DRAWING_fillEllipse_2(MICROUI_GraphicsContext *gc, jint x, jint y, jint width,
2160  jint height) {
2161  return UI_DRAWING_STUB_fillEllipse(gc, x, y, width, height);
2162 }
2163 
2164 // See the header file for the function documentation
2165 BSP_DECLARE_WEAK_FCNT DRAWING_Status UI_DRAWING_drawCircle_2(MICROUI_GraphicsContext *gc, jint x, jint y,
2166  jint diameter) {
2167  return UI_DRAWING_STUB_drawCircle(gc, x, y, diameter);
2168 }
2169 
2170 // See the header file for the function documentation
2171 BSP_DECLARE_WEAK_FCNT DRAWING_Status UI_DRAWING_fillCircle_2(MICROUI_GraphicsContext *gc, jint x, jint y,
2172  jint diameter) {
2173  return UI_DRAWING_STUB_fillCircle(gc, x, y, diameter);
2174 }
2175 
2176 // See the header file for the function documentation
2177 BSP_DECLARE_WEAK_FCNT DRAWING_Status UI_DRAWING_drawString_2(MICROUI_GraphicsContext *gc, jchar *chars, jint length,
2178  MICROUI_Font *font, jint x, jint y) {
2179  return UI_FONT_DRAWING_drawString(gc, chars, length, font, x, y);
2180 }
2181 
2182 // See the header file for the function documentation
2183 BSP_DECLARE_WEAK_FCNT DRAWING_Status UI_DRAWING_drawRenderableString_2(MICROUI_GraphicsContext *gc, jchar *chars,
2184  jint length, MICROUI_Font *font, jint width,
2185  MICROUI_RenderableString *renderableString,
2186  jint x, jint y) {
2187  return UI_FONT_DRAWING_drawRenderableString(gc, chars, length, font, width, renderableString, x, y);
2188 }
2189 
2190 // See the header file for the function documentation
2191 BSP_DECLARE_WEAK_FCNT DRAWING_Status UI_DRAWING_drawImage_2(MICROUI_GraphicsContext *gc, MICROUI_Image *img,
2192  jint regionX, jint regionY, jint width, jint height, jint x,
2193  jint y, jint alpha) {
2194  return UI_IMAGE_DRAWING_draw(gc, img, regionX, regionY, width, height, x, y, alpha);
2195 }
2196 
2197 // See the header file for the function documentation
2198 BSP_DECLARE_WEAK_FCNT DRAWING_Status UI_DRAWING_copyImage_2(MICROUI_GraphicsContext *gc, MICROUI_Image *img,
2199  jint regionX, jint regionY, jint width, jint height, jint x,
2200  jint y) {
2201  return UI_IMAGE_DRAWING_copy(gc, img, regionX, regionY, width, height, x, y);
2202 }
2203 
2204 // See the header file for the function documentation
2205 BSP_DECLARE_WEAK_FCNT DRAWING_Status UI_DRAWING_drawRegion_2(MICROUI_GraphicsContext *gc, jint regionX, jint regionY,
2206  jint width, jint height, jint x, jint y, jint alpha) {
2207  return UI_IMAGE_DRAWING_drawRegion(gc, regionX, regionY, width, height, x, y, alpha);
2208 }
2209 
2210 // See the header file for the function documentation
2211 BSP_DECLARE_WEAK_FCNT DRAWING_Status UI_DRAWING_drawThickFadedPoint_2(MICROUI_GraphicsContext *gc, jint x, jint y,
2212  jint thickness, jint fade) {
2213  return UI_DRAWING_STUB_drawThickFadedPoint(gc, x, y, thickness, fade);
2214 }
2215 
2216 // See the header file for the function documentation
2217 BSP_DECLARE_WEAK_FCNT DRAWING_Status UI_DRAWING_drawThickFadedLine_2(MICROUI_GraphicsContext *gc, jint startX,
2218  jint startY, jint endX, jint endY, jint thickness,
2219  jint fade, DRAWING_Cap startCap,
2220  DRAWING_Cap endCap) {
2221  return UI_DRAWING_STUB_drawThickFadedLine(gc, startX, startY, endX, endY, thickness, fade, startCap, endCap);
2222 }
2223 
2224 // See the header file for the function documentation
2225 BSP_DECLARE_WEAK_FCNT DRAWING_Status UI_DRAWING_drawThickFadedCircle_2(MICROUI_GraphicsContext *gc, jint x, jint y,
2226  jint diameter, jint thickness, jint fade) {
2227  return UI_DRAWING_STUB_drawThickFadedCircle(gc, x, y, diameter, thickness, fade);
2228 }
2229 
2230 // See the header file for the function documentation
2231 BSP_DECLARE_WEAK_FCNT DRAWING_Status UI_DRAWING_drawThickFadedCircleArc_2(MICROUI_GraphicsContext *gc, jint x, jint y,
2232  jint diameter, jfloat startAngle,
2233  jfloat arcAngle, jint thickness, jint fade,
2234  DRAWING_Cap start, DRAWING_Cap end) {
2235  return UI_DRAWING_STUB_drawThickFadedCircleArc(gc, x, y, diameter, startAngle, arcAngle, thickness, fade, start,
2236  end);
2237 }
2238 
2239 // See the header file for the function documentation
2240 BSP_DECLARE_WEAK_FCNT DRAWING_Status UI_DRAWING_drawThickFadedEllipse_2(MICROUI_GraphicsContext *gc, jint x, jint y,
2241  jint width, jint height, jint thickness,
2242  jint fade) {
2243  return UI_DRAWING_STUB_drawThickFadedEllipse(gc, x, y, width, height, thickness, fade);
2244 }
2245 
2246 // See the header file for the function documentation
2247 BSP_DECLARE_WEAK_FCNT DRAWING_Status UI_DRAWING_drawThickLine_2(MICROUI_GraphicsContext *gc, jint startX, jint startY,
2248  jint endX, jint endY, jint thickness) {
2249  return UI_DRAWING_STUB_drawThickLine(gc, startX, startY, endX, endY, thickness);
2250 }
2251 
2252 // See the header file for the function documentation
2253 BSP_DECLARE_WEAK_FCNT DRAWING_Status UI_DRAWING_drawThickCircle_2(MICROUI_GraphicsContext *gc, jint x, jint y,
2254  jint diameter, jint thickness) {
2255  return UI_DRAWING_STUB_drawThickCircle(gc, x, y, diameter, thickness);
2256 }
2257 
2258 // See the header file for the function documentation
2259 BSP_DECLARE_WEAK_FCNT DRAWING_Status UI_DRAWING_drawThickEllipse_2(MICROUI_GraphicsContext *gc, jint x, jint y,
2260  jint width, jint height, jint thickness) {
2261  return UI_DRAWING_STUB_drawThickEllipse(gc, x, y, width, height, thickness);
2262 }
2263 
2264 // See the header file for the function documentation
2265 BSP_DECLARE_WEAK_FCNT DRAWING_Status UI_DRAWING_drawThickCircleArc_2(MICROUI_GraphicsContext *gc, jint x, jint y,
2266  jint diameter, jfloat startAngle, jfloat arcAngle,
2267  jint thickness) {
2268  return UI_DRAWING_STUB_drawThickCircleArc(gc, x, y, diameter, startAngle, arcAngle, thickness);
2269 }
2270 
2271 // See the header file for the function documentation
2272 BSP_DECLARE_WEAK_FCNT DRAWING_Status UI_DRAWING_drawFlippedImage_2(MICROUI_GraphicsContext *gc, MICROUI_Image *img,
2273  jint regionX, jint regionY, jint width, jint height,
2274  jint x, jint y, DRAWING_Flip transformation,
2275  jint alpha) {
2276  return UI_IMAGE_DRAWING_drawFlipped(gc, img, regionX, regionY, width, height, x, y, transformation, alpha);
2277 }
2278 
2279 // See the header file for the function documentation
2280 BSP_DECLARE_WEAK_FCNT DRAWING_Status UI_DRAWING_drawRotatedImageNearestNeighbor_2(MICROUI_GraphicsContext *gc,
2281  MICROUI_Image *img, jint x, jint y,
2282  jint rotationX, jint rotationY,
2283  jfloat angle, jint alpha) {
2284  return UI_IMAGE_DRAWING_drawRotatedNearestNeighbor(gc, img, x, y, rotationX, rotationY, angle, alpha);
2285 }
2286 
2287 // See the header file for the function documentation
2288 BSP_DECLARE_WEAK_FCNT DRAWING_Status UI_DRAWING_drawRotatedImageBilinear_2(MICROUI_GraphicsContext *gc,
2289  MICROUI_Image *img, jint x, jint y,
2290  jint rotationX, jint rotationY, jfloat angle,
2291  jint alpha) {
2292  return UI_IMAGE_DRAWING_drawRotatedBilinear(gc, img, x, y, rotationX, rotationY, angle, alpha);
2293 }
2294 
2295 // See the header file for the function documentation
2296 BSP_DECLARE_WEAK_FCNT DRAWING_Status UI_DRAWING_drawScaledImageNearestNeighbor_2(MICROUI_GraphicsContext *gc,
2297  MICROUI_Image *img, jint x, jint y,
2298  jfloat factorX, jfloat factorY,
2299  jint alpha) {
2300  return UI_IMAGE_DRAWING_drawScaledNearestNeighbor(gc, img, x, y, factorX, factorY, alpha);
2301 }
2302 
2303 // See the header file for the function documentation
2304 BSP_DECLARE_WEAK_FCNT DRAWING_Status UI_DRAWING_drawScaledImageBilinear_2(MICROUI_GraphicsContext *gc,
2305  MICROUI_Image *img, jint x, jint y,
2306  jfloat factorX, jfloat factorY, jint alpha) {
2307  return UI_IMAGE_DRAWING_drawScaledBilinear(gc, img, x, y, factorX, factorY, alpha);
2308 }
2309 
2310 // See the header file for the function documentation
2311 BSP_DECLARE_WEAK_FCNT DRAWING_Status UI_DRAWING_drawScaledStringBilinear_2(MICROUI_GraphicsContext *gc, jchar *chars,
2312  jint length, MICROUI_Font *font, jint x,
2313  jint y, jfloat xRatio, jfloat yRatio) {
2314  return UI_FONT_DRAWING_drawScaledStringBilinear(gc, chars, length, font, x, y, xRatio, yRatio);
2315 }
2316 
2317 // See the header file for the function documentation
2318 BSP_DECLARE_WEAK_FCNT DRAWING_Status UI_DRAWING_drawScaledRenderableStringBilinear_2(MICROUI_GraphicsContext *gc,
2319  jchar *chars, jint length,
2320  MICROUI_Font *font, jint width,
2321  MICROUI_RenderableString *
2322  renderableString, jint x, jint y,
2323  jfloat xRatio, jfloat yRatio) {
2324  return UI_FONT_DRAWING_drawScaledRenderableStringBilinear(gc, chars, length, font, width, renderableString, x, y,
2325  xRatio, yRatio);
2326 }
2327 
2328 // See the header file for the function documentation
2329 BSP_DECLARE_WEAK_FCNT DRAWING_Status UI_DRAWING_drawCharWithRotationBilinear_2(MICROUI_GraphicsContext *gc, jchar c,
2330  MICROUI_Font *font, jint x, jint y,
2331  jint xRotation, jint yRotation,
2332  jfloat angle, jint alpha) {
2333  return UI_FONT_DRAWING_drawCharWithRotationBilinear(gc, c, font, x, y, xRotation, yRotation, angle, alpha);
2334 }
2335 
2336 // See the header file for the function documentation
2337 BSP_DECLARE_WEAK_FCNT DRAWING_Status UI_DRAWING_drawCharWithRotationNearestNeighbor_2(MICROUI_GraphicsContext *gc,
2338  jchar c, MICROUI_Font *font,
2339  jint x, jint y, jint xRotation,
2340  jint yRotation, jfloat angle,
2341  jint alpha) {
2342  return UI_FONT_DRAWING_drawCharWithRotationNearestNeighbor(gc, c, font, x, y, xRotation, yRotation, angle, alpha);
2343 }
2344 
2345 #endif // (UI_GC_SUPPORTED_FORMATS > 2)
2346 
2347 #else // #if defined(UI_GC_SUPPORTED_FORMATS) && (UI_GC_SUPPORTED_FORMATS > 1)
2348 
2349 /*
2350  * The VEE port supports only one destination format: the display buffer format. The
2351  * application can only create immutable images or mutable images with the same format as
2352  * the display buffer. All drawing functions are redirected to the software implementation
2353  * by default. A third party implementation (often on a GPU) can replace each weak function
2354  * independently.
2355  *
2356  * The VEE Port can tune the new image characteristics to add a header before the pixel
2357  * array for instance.
2358  */
2359 
2360 #endif // #if defined(UI_GC_SUPPORTED_FORMATS) && (UI_GC_SUPPORTED_FORMATS > 1)
2361 
2362 // -----------------------------------------------------------------------------
2363 // EOF
2364 // -----------------------------------------------------------------------------
MicroEJ MicroUI library low level API: enable some features according to the hardware capabilities.