microui  3.0.0
microui
ui_drawing.c
1 /*
2  * C
3  *
4  * Copyright 2023 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 should specify the define "LLUI_GC_SUPPORTED_FORMATS". When not set or smaller than
34  * "2", this file considers only one destination format is available: the same format than
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 3.0.0
48  * @see ui_drawing.h
49  */
50 
51 // -----------------------------------------------------------------------------
52 // Includes
53 // -----------------------------------------------------------------------------
54 
55 #include <LLUI_DISPLAY.h>
56 
57 #include "ui_drawing.h"
58 #include "ui_drawing_stub.h"
59 #include "ui_drawing_soft.h"
60 #include "dw_drawing_soft.h"
61 #include "ui_image_drawing.h"
62 #include "bsp_util.h"
63 
64 // --------------------------------------------------------------------------------
65 // Defines
66 // --------------------------------------------------------------------------------
67 
68 #if !defined(LLUI_GC_SUPPORTED_FORMATS) || (LLUI_GC_SUPPORTED_FORMATS <= 1)
69 
70 /*
71  * The fonctions UI_DRAWING_DEFAULT_xxx() are directly called by LLUI_DISPLAY_impl.c,
72  * LLUI_PAINTER_impl.c and LLDW_PAINTER_impl.c. Other files can override each weak
73  * function independently to use a GPU.
74  */
75 
76 #define UI_DRAWING_DEFAULT_writePixel UI_DRAWING_writePixel
77 #define UI_DRAWING_DEFAULT_drawLine UI_DRAWING_drawLine
78 #define UI_DRAWING_DEFAULT_drawHorizontalLine UI_DRAWING_drawHorizontalLine
79 #define UI_DRAWING_DEFAULT_drawVerticalLine UI_DRAWING_drawVerticalLine
80 #define UI_DRAWING_DEFAULT_drawRectangle UI_DRAWING_drawRectangle
81 #define UI_DRAWING_DEFAULT_fillRectangle UI_DRAWING_fillRectangle
82 #define UI_DRAWING_DEFAULT_drawRoundedRectangle UI_DRAWING_drawRoundedRectangle
83 #define UI_DRAWING_DEFAULT_fillRoundedRectangle UI_DRAWING_fillRoundedRectangle
84 #define UI_DRAWING_DEFAULT_drawCircleArc UI_DRAWING_drawCircleArc
85 #define UI_DRAWING_DEFAULT_drawEllipseArc UI_DRAWING_drawEllipseArc
86 #define UI_DRAWING_DEFAULT_fillCircleArc UI_DRAWING_fillCircleArc
87 #define UI_DRAWING_DEFAULT_fillEllipseArc UI_DRAWING_fillEllipseArc
88 #define UI_DRAWING_DEFAULT_drawEllipse UI_DRAWING_drawEllipse
89 #define UI_DRAWING_DEFAULT_fillEllipse UI_DRAWING_fillEllipse
90 #define UI_DRAWING_DEFAULT_drawCircle UI_DRAWING_drawCircle
91 #define UI_DRAWING_DEFAULT_fillCircle UI_DRAWING_fillCircle
92 #define UI_DRAWING_DEFAULT_drawImage UI_DRAWING_drawImage
93 #define UI_DRAWING_DEFAULT_copyImage UI_DRAWING_copyImage
94 #define UI_DRAWING_DEFAULT_drawRegion UI_DRAWING_drawRegion
95 
96 #define UI_DRAWING_DEFAULT_drawThickFadedPoint UI_DRAWING_drawThickFadedPoint
97 #define UI_DRAWING_DEFAULT_drawThickFadedLine UI_DRAWING_drawThickFadedLine
98 #define UI_DRAWING_DEFAULT_drawThickFadedCircle UI_DRAWING_drawThickFadedCircle
99 #define UI_DRAWING_DEFAULT_drawThickFadedCircleArc UI_DRAWING_drawThickFadedCircleArc
100 #define UI_DRAWING_DEFAULT_drawThickFadedEllipse UI_DRAWING_drawThickFadedEllipse
101 #define UI_DRAWING_DEFAULT_drawThickLine UI_DRAWING_drawThickLine
102 #define UI_DRAWING_DEFAULT_drawThickCircle UI_DRAWING_drawThickCircle
103 #define UI_DRAWING_DEFAULT_drawThickEllipse UI_DRAWING_drawThickEllipse
104 #define UI_DRAWING_DEFAULT_drawThickCircleArc UI_DRAWING_drawThickCircleArc
105 #define UI_DRAWING_DEFAULT_drawFlippedImage UI_DRAWING_drawFlippedImage
106 #define UI_DRAWING_DEFAULT_drawRotatedImageNearestNeighbor UI_DRAWING_drawRotatedImageNearestNeighbor
107 #define UI_DRAWING_DEFAULT_drawRotatedImageBilinear UI_DRAWING_drawRotatedImageBilinear
108 #define UI_DRAWING_DEFAULT_drawScaledImageNearestNeighbor UI_DRAWING_drawScaledImageNearestNeighbor
109 #define UI_DRAWING_DEFAULT_drawScaledImageBilinear UI_DRAWING_drawScaledImageBilinear
110 
111 #else // !defined(LLUI_GC_SUPPORTED_FORMATS) || (LLUI_GC_SUPPORTED_FORMATS <= 1)
112 
113 /*
114  * The fonctions UI_DRAWING_DEFAULT_xxx() are indirectly called through some tables.
115  * The functions have got the identifier "0" as suffix. Another file can override
116  * each weak function independently to use a GPU.
117  */
118 
119 #define UI_DRAWING_DEFAULT_writePixel UI_DRAWING_writePixel_0
120 #define UI_DRAWING_DEFAULT_drawLine UI_DRAWING_drawLine_0
121 #define UI_DRAWING_DEFAULT_drawHorizontalLine UI_DRAWING_drawHorizontalLine_0
122 #define UI_DRAWING_DEFAULT_drawVerticalLine UI_DRAWING_drawVerticalLine_0
123 #define UI_DRAWING_DEFAULT_drawRectangle UI_DRAWING_drawRectangle_0
124 #define UI_DRAWING_DEFAULT_fillRectangle UI_DRAWING_fillRectangle_0
125 #define UI_DRAWING_DEFAULT_drawRoundedRectangle UI_DRAWING_drawRoundedRectangle_0
126 #define UI_DRAWING_DEFAULT_fillRoundedRectangle UI_DRAWING_fillRoundedRectangle_0
127 #define UI_DRAWING_DEFAULT_drawCircleArc UI_DRAWING_drawCircleArc_0
128 #define UI_DRAWING_DEFAULT_drawEllipseArc UI_DRAWING_drawEllipseArc_0
129 #define UI_DRAWING_DEFAULT_fillCircleArc UI_DRAWING_fillCircleArc_0
130 #define UI_DRAWING_DEFAULT_fillEllipseArc UI_DRAWING_fillEllipseArc_0
131 #define UI_DRAWING_DEFAULT_drawEllipse UI_DRAWING_drawEllipse_0
132 #define UI_DRAWING_DEFAULT_fillEllipse UI_DRAWING_fillEllipse_0
133 #define UI_DRAWING_DEFAULT_drawCircle UI_DRAWING_drawCircle_0
134 #define UI_DRAWING_DEFAULT_fillCircle UI_DRAWING_fillCircle_0
135 #define UI_DRAWING_DEFAULT_drawImage UI_DRAWING_drawImage_0
136 #define UI_DRAWING_DEFAULT_copyImage UI_DRAWING_copyImage_0
137 #define UI_DRAWING_DEFAULT_drawRegion UI_DRAWING_drawRegion_0
138 
139 #define UI_DRAWING_DEFAULT_drawThickFadedPoint UI_DRAWING_drawThickFadedPoint_0
140 #define UI_DRAWING_DEFAULT_drawThickFadedLine UI_DRAWING_drawThickFadedLine_0
141 #define UI_DRAWING_DEFAULT_drawThickFadedCircle UI_DRAWING_drawThickFadedCircle_0
142 #define UI_DRAWING_DEFAULT_drawThickFadedCircleArc UI_DRAWING_drawThickFadedCircleArc_0
143 #define UI_DRAWING_DEFAULT_drawThickFadedEllipse UI_DRAWING_drawThickFadedEllipse_0
144 #define UI_DRAWING_DEFAULT_drawThickLine UI_DRAWING_drawThickLine_0
145 #define UI_DRAWING_DEFAULT_drawThickCircle UI_DRAWING_drawThickCircle_0
146 #define UI_DRAWING_DEFAULT_drawThickEllipse UI_DRAWING_drawThickEllipse_0
147 #define UI_DRAWING_DEFAULT_drawThickCircleArc UI_DRAWING_drawThickCircleArc_0
148 #define UI_DRAWING_DEFAULT_drawFlippedImage UI_DRAWING_drawFlippedImage_0
149 #define UI_DRAWING_DEFAULT_drawRotatedImageNearestNeighbor UI_DRAWING_drawRotatedImageNearestNeighbor_0
150 #define UI_DRAWING_DEFAULT_drawRotatedImageBilinear UI_DRAWING_drawRotatedImageBilinear_0
151 #define UI_DRAWING_DEFAULT_drawScaledImageNearestNeighbor UI_DRAWING_drawScaledImageNearestNeighbor_0
152 #define UI_DRAWING_DEFAULT_drawScaledImageBilinear UI_DRAWING_drawScaledImageBilinear_0
153 
154 #endif // !defined(LLUI_GC_SUPPORTED_FORMATS) || (LLUI_GC_SUPPORTED_FORMATS <= 1)
155 
156 // --------------------------------------------------------------------------------
157 // Extern functions
158 // --------------------------------------------------------------------------------
159 
160 #if defined(LLUI_GC_SUPPORTED_FORMATS) && (LLUI_GC_SUPPORTED_FORMATS > 1)
161 
162 /*
163  * @brief Set of drawing functions according to the index of the destination format in
164  * the drawing tables ("0", "1" or "2").
165  *
166  * These functions must be declared in other H files.
167  */
168 
169 #if (LLUI_GC_SUPPORTED_FORMATS > 3)
170 #error "Increase the number of following functions and update the next tables"
171 #endif
172 
173 extern DRAWING_Status UI_DRAWING_writePixel_0(MICROUI_GraphicsContext* gc, jint x, jint y);
174 extern DRAWING_Status UI_DRAWING_drawLine_0(MICROUI_GraphicsContext* gc, jint startX, jint startY, jint endX, jint endY);
175 extern DRAWING_Status UI_DRAWING_drawHorizontalLine_0(MICROUI_GraphicsContext* gc, jint x1, jint x2, jint y);
176 extern DRAWING_Status UI_DRAWING_drawVerticalLine_0(MICROUI_GraphicsContext* gc, jint x, jint y1, jint y2);
177 extern DRAWING_Status UI_DRAWING_drawRectangle_0(MICROUI_GraphicsContext* gc, jint x1, jint y1, jint x2, jint y2);
178 extern DRAWING_Status UI_DRAWING_fillRectangle_0(MICROUI_GraphicsContext* gc, jint x1, jint y1, jint x2, jint y2);
179 extern DRAWING_Status UI_DRAWING_drawRoundedRectangle_0(MICROUI_GraphicsContext* gc, jint x, jint y, jint width, jint height, jint cornerEllipseWidth, jint cornerEllipseHeight);
180 extern DRAWING_Status UI_DRAWING_fillRoundedRectangle_0(MICROUI_GraphicsContext* gc, jint x, jint y, jint width, jint height, jint cornerEllipseWidth, jint cornerEllipseHeight);
181 extern DRAWING_Status UI_DRAWING_drawCircleArc_0(MICROUI_GraphicsContext* gc, jint x, jint y, jint diameter, jfloat startAngle, jfloat arcAngle);
182 extern DRAWING_Status UI_DRAWING_drawEllipseArc_0(MICROUI_GraphicsContext* gc, jint x, jint y, jint width, jint height, jfloat startAngle, jfloat arcAngle);
183 extern DRAWING_Status UI_DRAWING_fillCircleArc_0(MICROUI_GraphicsContext* gc, jint x, jint y, jint diameter, jfloat startAngle, jfloat arcAngle);
184 extern DRAWING_Status UI_DRAWING_fillEllipseArc_0(MICROUI_GraphicsContext* gc, jint x, jint y, jint width, jint height, jfloat startAngle, jfloat arcAngle);
185 extern DRAWING_Status UI_DRAWING_drawEllipse_0(MICROUI_GraphicsContext* gc, jint x, jint y, jint width, jint height);
186 extern DRAWING_Status UI_DRAWING_fillEllipse_0(MICROUI_GraphicsContext* gc, jint x, jint y, jint width, jint height);
187 extern DRAWING_Status UI_DRAWING_drawCircle_0(MICROUI_GraphicsContext* gc, jint x, jint y, jint diameter);
188 extern DRAWING_Status UI_DRAWING_fillCircle_0(MICROUI_GraphicsContext* gc, jint x, jint y, jint diameter);
189 extern DRAWING_Status UI_DRAWING_drawImage_0(MICROUI_GraphicsContext* gc, MICROUI_Image* img, jint regionX, jint regionY, jint width, jint height, jint x, jint y, jint alpha);
190 extern DRAWING_Status UI_DRAWING_copyImage_0(MICROUI_GraphicsContext* gc, MICROUI_Image* img, jint regionX, jint regionY, jint width, jint height, jint x, jint y);
191 extern DRAWING_Status UI_DRAWING_drawRegion_0(MICROUI_GraphicsContext* gc, jint regionX, jint regionY, jint width, jint height, jint x, jint y, jint alpha);
192 extern DRAWING_Status UI_DRAWING_drawThickFadedPoint_0(MICROUI_GraphicsContext* gc, jint x, jint y, jint thickness, jint fade);
193 extern DRAWING_Status UI_DRAWING_drawThickFadedLine_0(MICROUI_GraphicsContext* gc, jint startX, jint startY, jint endX, jint endY, jint thickness, jint fade, DRAWING_Cap startCap, DRAWING_Cap endCap);
194 extern DRAWING_Status UI_DRAWING_drawThickFadedCircle_0(MICROUI_GraphicsContext* gc, jint x, jint y, jint diameter, jint thickness, jint fade);
195 extern DRAWING_Status UI_DRAWING_drawThickFadedCircleArc_0(MICROUI_GraphicsContext* gc, jint x, jint y, jint diameter, jfloat startAngle, jfloat arcAngle, jint thickness, jint fade, DRAWING_Cap start, DRAWING_Cap end);
196 extern DRAWING_Status UI_DRAWING_drawThickFadedEllipse_0(MICROUI_GraphicsContext* gc, jint x, jint y, jint width, jint height, jint thickness, jint fade);
197 extern DRAWING_Status UI_DRAWING_drawThickLine_0(MICROUI_GraphicsContext* gc, jint startX, jint startY, jint endX, jint endY, jint thickness);
198 extern DRAWING_Status UI_DRAWING_drawThickCircle_0(MICROUI_GraphicsContext* gc, jint x, jint y, jint diameter, jint thickness);
199 extern DRAWING_Status UI_DRAWING_drawThickEllipse_0(MICROUI_GraphicsContext* gc, jint x, jint y, jint width, jint height, jint thickness);
200 extern DRAWING_Status UI_DRAWING_drawThickCircleArc_0(MICROUI_GraphicsContext* gc, jint x, jint y, jint diameter, jfloat startAngle, jfloat arcAngle, jint thickness);
201 extern DRAWING_Status UI_DRAWING_drawFlippedImage_0(MICROUI_GraphicsContext* gc, MICROUI_Image* img, jint regionX, jint regionY, jint width, jint height, jint x, jint y, DRAWING_Flip transformation, jint alpha);
202 extern DRAWING_Status UI_DRAWING_drawRotatedImageNearestNeighbor_0(MICROUI_GraphicsContext* gc, MICROUI_Image* img, jint x, jint y, jint rotationX, jint rotationY, jfloat angle, jint alpha);
203 extern DRAWING_Status UI_DRAWING_drawRotatedImageBilinear_0(MICROUI_GraphicsContext* gc, MICROUI_Image* img, jint x, jint y, jint rotationX, jint rotationY, jfloat angle, jint alpha);
204 extern DRAWING_Status UI_DRAWING_drawScaledImageNearestNeighbor_0(MICROUI_GraphicsContext* gc, MICROUI_Image* img, jint x, jint y, jfloat factorX, jfloat factorY, jint alpha);
205 extern DRAWING_Status UI_DRAWING_drawScaledImageBilinear_0(MICROUI_GraphicsContext* gc, MICROUI_Image* img, jint x, jint y, jfloat factorX, jfloat factorY, jint alpha);
206 
207 extern uint32_t UI_DRAWING_getNewImageStrideInBytes_1(jbyte image_format, uint32_t width, uint32_t height, uint32_t default_stride);
208 extern void UI_DRAWING_adjustNewImageCharacteristics_1(jbyte image_format, uint32_t width, uint32_t height, uint32_t* data_size, uint32_t* data_alignment);
209 extern void UI_DRAWING_initializeNewImage_1(MICROUI_Image* image);
210 extern DRAWING_Status UI_DRAWING_writePixel_1(MICROUI_GraphicsContext* gc, jint x, jint y);
211 extern DRAWING_Status UI_DRAWING_drawLine_1(MICROUI_GraphicsContext* gc, jint startX, jint startY, jint endX, jint endY);
212 extern DRAWING_Status UI_DRAWING_drawHorizontalLine_1(MICROUI_GraphicsContext* gc, jint x1, jint x2, jint y);
213 extern DRAWING_Status UI_DRAWING_drawVerticalLine_1(MICROUI_GraphicsContext* gc, jint x, jint y1, jint y2);
214 extern DRAWING_Status UI_DRAWING_drawRectangle_1(MICROUI_GraphicsContext* gc, jint x1, jint y1, jint x2, jint y2);
215 extern DRAWING_Status UI_DRAWING_fillRectangle_1(MICROUI_GraphicsContext* gc, jint x1, jint y1, jint x2, jint y2);
216 extern DRAWING_Status UI_DRAWING_drawRoundedRectangle_1(MICROUI_GraphicsContext* gc, jint x, jint y, jint width, jint height, jint cornerEllipseWidth, jint cornerEllipseHeight);
217 extern DRAWING_Status UI_DRAWING_fillRoundedRectangle_1(MICROUI_GraphicsContext* gc, jint x, jint y, jint width, jint height, jint cornerEllipseWidth, jint cornerEllipseHeight);
218 extern DRAWING_Status UI_DRAWING_drawCircleArc_1(MICROUI_GraphicsContext* gc, jint x, jint y, jint diameter, jfloat startAngle, jfloat arcAngle);
219 extern DRAWING_Status UI_DRAWING_drawEllipseArc_1(MICROUI_GraphicsContext* gc, jint x, jint y, jint width, jint height, jfloat startAngle, jfloat arcAngle);
220 extern DRAWING_Status UI_DRAWING_fillCircleArc_1(MICROUI_GraphicsContext* gc, jint x, jint y, jint diameter, jfloat startAngle, jfloat arcAngle);
221 extern DRAWING_Status UI_DRAWING_fillEllipseArc_1(MICROUI_GraphicsContext* gc, jint x, jint y, jint width, jint height, jfloat startAngle, jfloat arcAngle);
222 extern DRAWING_Status UI_DRAWING_drawEllipse_1(MICROUI_GraphicsContext* gc, jint x, jint y, jint width, jint height);
223 extern DRAWING_Status UI_DRAWING_fillEllipse_1(MICROUI_GraphicsContext* gc, jint x, jint y, jint width, jint height);
224 extern DRAWING_Status UI_DRAWING_drawCircle_1(MICROUI_GraphicsContext* gc, jint x, jint y, jint diameter);
225 extern DRAWING_Status UI_DRAWING_fillCircle_1(MICROUI_GraphicsContext* gc, jint x, jint y, jint diameter);
226 extern DRAWING_Status UI_DRAWING_drawImage_1(MICROUI_GraphicsContext* gc, MICROUI_Image* img, jint regionX, jint regionY, jint width, jint height, jint x, jint y, jint alpha);
227 extern DRAWING_Status UI_DRAWING_copyImage_1(MICROUI_GraphicsContext* gc, MICROUI_Image* img, jint regionX, jint regionY, jint width, jint height, jint x, jint y);
228 extern DRAWING_Status UI_DRAWING_drawRegion_1(MICROUI_GraphicsContext* gc, jint regionX, jint regionY, jint width, jint height, jint x, jint y, jint alpha);
229 extern DRAWING_Status UI_DRAWING_drawThickFadedPoint_1(MICROUI_GraphicsContext* gc, jint x, jint y, jint thickness, jint fade);
230 extern DRAWING_Status UI_DRAWING_drawThickFadedLine_1(MICROUI_GraphicsContext* gc, jint startX, jint startY, jint endX, jint endY, jint thickness, jint fade, DRAWING_Cap startCap, DRAWING_Cap endCap);
231 extern DRAWING_Status UI_DRAWING_drawThickFadedCircle_1(MICROUI_GraphicsContext* gc, jint x, jint y, jint diameter, jint thickness, jint fade);
232 extern DRAWING_Status UI_DRAWING_drawThickFadedCircleArc_1(MICROUI_GraphicsContext* gc, jint x, jint y, jint diameter, jfloat startAngle, jfloat arcAngle, jint thickness, jint fade, DRAWING_Cap start, DRAWING_Cap end);
233 extern DRAWING_Status UI_DRAWING_drawThickFadedEllipse_1(MICROUI_GraphicsContext* gc, jint x, jint y, jint width, jint height, jint thickness, jint fade);
234 extern DRAWING_Status UI_DRAWING_drawThickLine_1(MICROUI_GraphicsContext* gc, jint startX, jint startY, jint endX, jint endY, jint thickness);
235 extern DRAWING_Status UI_DRAWING_drawThickCircle_1(MICROUI_GraphicsContext* gc, jint x, jint y, jint diameter, jint thickness);
236 extern DRAWING_Status UI_DRAWING_drawThickEllipse_1(MICROUI_GraphicsContext* gc, jint x, jint y, jint width, jint height, jint thickness);
237 extern DRAWING_Status UI_DRAWING_drawThickCircleArc_1(MICROUI_GraphicsContext* gc, jint x, jint y, jint diameter, jfloat startAngle, jfloat arcAngle, jint thickness);
238 extern DRAWING_Status UI_DRAWING_drawFlippedImage_1(MICROUI_GraphicsContext* gc, MICROUI_Image* img, jint regionX, jint regionY, jint width, jint height, jint x, jint y, DRAWING_Flip transformation, jint alpha);
239 extern DRAWING_Status UI_DRAWING_drawRotatedImageNearestNeighbor_1(MICROUI_GraphicsContext* gc, MICROUI_Image* img, jint x, jint y, jint rotationX, jint rotationY, jfloat angle, jint alpha);
240 extern DRAWING_Status UI_DRAWING_drawRotatedImageBilinear_1(MICROUI_GraphicsContext* gc, MICROUI_Image* img, jint x, jint y, jint rotationX, jint rotationY, jfloat angle, jint alpha);
241 extern DRAWING_Status UI_DRAWING_drawScaledImageNearestNeighbor_1(MICROUI_GraphicsContext* gc, MICROUI_Image* img, jint x, jint y, jfloat factorX, jfloat factorY, jint alpha);
242 extern DRAWING_Status UI_DRAWING_drawScaledImageBilinear_1(MICROUI_GraphicsContext* gc, MICROUI_Image* img, jint x, jint y, jfloat factorX, jfloat factorY, jint alpha);
243 
244 #if (LLUI_GC_SUPPORTED_FORMATS > 2)
245 extern uint32_t UI_DRAWING_getNewImageStrideInBytes_2(jbyte image_format, uint32_t width, uint32_t height, uint32_t default_stride);
246 extern void UI_DRAWING_adjustNewImageCharacteristics_2(jbyte image_format, uint32_t width, uint32_t height, uint32_t* data_size, uint32_t* data_alignment);
247 extern void UI_DRAWING_initializeNewImage_2(MICROUI_Image* image);
248 extern DRAWING_Status UI_DRAWING_writePixel_2(MICROUI_GraphicsContext* gc, jint x, jint y);
249 extern DRAWING_Status UI_DRAWING_drawLine_2(MICROUI_GraphicsContext* gc, jint startX, jint startY, jint endX, jint endY);
250 extern DRAWING_Status UI_DRAWING_drawHorizontalLine_2(MICROUI_GraphicsContext* gc, jint x1, jint x2, jint y);
251 extern DRAWING_Status UI_DRAWING_drawVerticalLine_2(MICROUI_GraphicsContext* gc, jint x, jint y1, jint y2);
252 extern DRAWING_Status UI_DRAWING_drawRectangle_2(MICROUI_GraphicsContext* gc, jint x1, jint y1, jint x2, jint y2);
253 extern DRAWING_Status UI_DRAWING_fillRectangle_2(MICROUI_GraphicsContext* gc, jint x1, jint y1, jint x2, jint y2);
254 extern DRAWING_Status UI_DRAWING_drawRoundedRectangle_2(MICROUI_GraphicsContext* gc, jint x, jint y, jint width, jint height, jint cornerEllipseWidth, jint cornerEllipseHeight);
255 extern DRAWING_Status UI_DRAWING_fillRoundedRectangle_2(MICROUI_GraphicsContext* gc, jint x, jint y, jint width, jint height, jint cornerEllipseWidth, jint cornerEllipseHeight);
256 extern DRAWING_Status UI_DRAWING_drawCircleArc_2(MICROUI_GraphicsContext* gc, jint x, jint y, jint diameter, jfloat startAngle, jfloat arcAngle);
257 extern DRAWING_Status UI_DRAWING_drawEllipseArc_2(MICROUI_GraphicsContext* gc, jint x, jint y, jint width, jint height, jfloat startAngle, jfloat arcAngle);
258 extern DRAWING_Status UI_DRAWING_fillCircleArc_2(MICROUI_GraphicsContext* gc, jint x, jint y, jint diameter, jfloat startAngle, jfloat arcAngle);
259 extern DRAWING_Status UI_DRAWING_fillEllipseArc_2(MICROUI_GraphicsContext* gc, jint x, jint y, jint width, jint height, jfloat startAngle, jfloat arcAngle);
260 extern DRAWING_Status UI_DRAWING_drawEllipse_2(MICROUI_GraphicsContext* gc, jint x, jint y, jint width, jint height);
261 extern DRAWING_Status UI_DRAWING_fillEllipse_2(MICROUI_GraphicsContext* gc, jint x, jint y, jint width, jint height);
262 extern DRAWING_Status UI_DRAWING_drawCircle_2(MICROUI_GraphicsContext* gc, jint x, jint y, jint diameter);
263 extern DRAWING_Status UI_DRAWING_fillCircle_2(MICROUI_GraphicsContext* gc, jint x, jint y, jint diameter);
264 extern DRAWING_Status UI_DRAWING_drawImage_2(MICROUI_GraphicsContext* gc, MICROUI_Image* img, jint regionX, jint regionY, jint width, jint height, jint x, jint y, jint alpha);
265 extern DRAWING_Status UI_DRAWING_copyImage_2(MICROUI_GraphicsContext* gc, MICROUI_Image* img, jint regionX, jint regionY, jint width, jint height, jint x, jint y);
266 extern DRAWING_Status UI_DRAWING_drawRegion_2(MICROUI_GraphicsContext* gc, jint regionX, jint regionY, jint width, jint height, jint x, jint y, jint alpha);
267 extern DRAWING_Status UI_DRAWING_drawThickFadedPoint_2(MICROUI_GraphicsContext* gc, jint x, jint y, jint thickness, jint fade);
268 extern DRAWING_Status UI_DRAWING_drawThickFadedLine_2(MICROUI_GraphicsContext* gc, jint startX, jint startY, jint endX, jint endY, jint thickness, jint fade, DRAWING_Cap startCap, DRAWING_Cap endCap);
269 extern DRAWING_Status UI_DRAWING_drawThickFadedCircle_2(MICROUI_GraphicsContext* gc, jint x, jint y, jint diameter, jint thickness, jint fade);
270 extern DRAWING_Status UI_DRAWING_drawThickFadedCircleArc_2(MICROUI_GraphicsContext* gc, jint x, jint y, jint diameter, jfloat startAngle, jfloat arcAngle, jint thickness, jint fade, DRAWING_Cap start, DRAWING_Cap end);
271 extern DRAWING_Status UI_DRAWING_drawThickFadedEllipse_2(MICROUI_GraphicsContext* gc, jint x, jint y, jint width, jint height, jint thickness, jint fade);
272 extern DRAWING_Status UI_DRAWING_drawThickLine_2(MICROUI_GraphicsContext* gc, jint startX, jint startY, jint endX, jint endY, jint thickness);
273 extern DRAWING_Status UI_DRAWING_drawThickCircle_2(MICROUI_GraphicsContext* gc, jint x, jint y, jint diameter, jint thickness);
274 extern DRAWING_Status UI_DRAWING_drawThickEllipse_2(MICROUI_GraphicsContext* gc, jint x, jint y, jint width, jint height, jint thickness);
275 extern DRAWING_Status UI_DRAWING_drawThickCircleArc_2(MICROUI_GraphicsContext* gc, jint x, jint y, jint diameter, jfloat startAngle, jfloat arcAngle, jint thickness);
276 extern DRAWING_Status UI_DRAWING_drawFlippedImage_2(MICROUI_GraphicsContext* gc, MICROUI_Image* img, jint regionX, jint regionY, jint width, jint height, jint x, jint y, DRAWING_Flip transformation, jint alpha);
277 extern DRAWING_Status UI_DRAWING_drawRotatedImageNearestNeighbor_2(MICROUI_GraphicsContext* gc, MICROUI_Image* img, jint x, jint y, jint rotationX, jint rotationY, jfloat angle, jint alpha);
278 extern DRAWING_Status UI_DRAWING_drawRotatedImageBilinear_2(MICROUI_GraphicsContext* gc, MICROUI_Image* img, jint x, jint y, jint rotationX, jint rotationY, jfloat angle, jint alpha);
279 extern DRAWING_Status UI_DRAWING_drawScaledImageNearestNeighbor_2(MICROUI_GraphicsContext* gc, MICROUI_Image* img, jint x, jint y, jfloat factorX, jfloat factorY, jint alpha);
280 extern DRAWING_Status UI_DRAWING_drawScaledImageBilinear_2(MICROUI_GraphicsContext* gc, MICROUI_Image* img, jint x, jint y, jfloat factorX, jfloat factorY, jint alpha);
281 #endif // (LLUI_GC_SUPPORTED_FORMATS > 2)
282 
283 #endif // defined(LLUI_GC_SUPPORTED_FORMATS) && (LLUI_GC_SUPPORTED_FORMATS > 1)
284 
285 // --------------------------------------------------------------------------------
286 // Typedef of drawing functions
287 // --------------------------------------------------------------------------------
288 
289 #if defined(LLUI_GC_SUPPORTED_FORMATS) && (LLUI_GC_SUPPORTED_FORMATS > 1)
290 
291 /*
292  * @brief Typedef used by next tables. See the function comments in ui_drawing.h
293  */
294 
295 typedef uint32_t (* UI_DRAWING_getNewImageStrideInBytes_t) (jbyte image_format, uint32_t width, uint32_t height, uint32_t default_stride);
296 typedef void (* UI_DRAWING_adjustNewImageCharacteristics_t) (jbyte image_format, uint32_t width, uint32_t height, uint32_t* data_size, uint32_t* data_alignment);
297 typedef void (* UI_DRAWING_initializeNewImage_t) (MICROUI_Image* image);
298 typedef DRAWING_Status (* UI_DRAWING_writePixel_t) (MICROUI_GraphicsContext* gc, jint x, jint y);
299 typedef DRAWING_Status (* UI_DRAWING_drawLine_t) (MICROUI_GraphicsContext* gc, jint startX, jint startY, jint endX, jint endY);
300 typedef DRAWING_Status (* UI_DRAWING_drawHorizontalLine_t) (MICROUI_GraphicsContext* gc, jint x1, jint x2, jint y);
301 typedef DRAWING_Status (* UI_DRAWING_drawVerticalLine_t) (MICROUI_GraphicsContext* gc, jint x, jint y1, jint y2);
302 typedef DRAWING_Status (* UI_DRAWING_drawRectangle_t) (MICROUI_GraphicsContext* gc, jint x1, jint y1, jint x2, jint y2);
303 typedef DRAWING_Status (* UI_DRAWING_fillRectangle_t) (MICROUI_GraphicsContext* gc, jint x1, jint y1, jint x2, jint y2);
304 typedef DRAWING_Status (* UI_DRAWING_drawRoundedRectangle_t) (MICROUI_GraphicsContext* gc, jint x, jint y, jint width, jint height, jint cornerEllipseWidth, jint cornerEllipseHeight);
305 typedef DRAWING_Status (* UI_DRAWING_fillRoundedRectangle_t) (MICROUI_GraphicsContext* gc, jint x, jint y, jint width, jint height, jint cornerEllipseWidth, jint cornerEllipseHeight);
306 typedef DRAWING_Status (* UI_DRAWING_drawCircleArc_t) (MICROUI_GraphicsContext* gc, jint x, jint y, jint diameter, jfloat startAngle, jfloat arcAngle);
307 typedef DRAWING_Status (* UI_DRAWING_drawEllipseArc_t) (MICROUI_GraphicsContext* gc, jint x, jint y, jint width, jint height, jfloat startAngle, jfloat arcAngle);
308 typedef DRAWING_Status (* UI_DRAWING_fillCircleArc_t) (MICROUI_GraphicsContext* gc, jint x, jint y, jint diameter, jfloat startAngle, jfloat arcAngle);
309 typedef DRAWING_Status (* UI_DRAWING_fillEllipseArc_t) (MICROUI_GraphicsContext* gc, jint x, jint y, jint width, jint height, jfloat startAngle, jfloat arcAngle);
310 typedef DRAWING_Status (* UI_DRAWING_drawEllipse_t) (MICROUI_GraphicsContext* gc, jint x, jint y, jint width, jint height);
311 typedef DRAWING_Status (* UI_DRAWING_fillEllipse_t) (MICROUI_GraphicsContext* gc, jint x, jint y, jint width, jint height);
312 typedef DRAWING_Status (* UI_DRAWING_drawCircle_t) (MICROUI_GraphicsContext* gc, jint x, jint y, jint diameter);
313 typedef DRAWING_Status (* UI_DRAWING_fillCircle_t) (MICROUI_GraphicsContext* gc, jint x, jint y, jint diameter);
314 typedef DRAWING_Status (* UI_DRAWING_drawImage_t) (MICROUI_GraphicsContext* gc, MICROUI_Image* img, jint regionX, jint regionY, jint width, jint height, jint x, jint y, jint alpha);
315 typedef DRAWING_Status (* UI_DRAWING_copyImage_t) (MICROUI_GraphicsContext* gc, MICROUI_Image* img, jint regionX, jint regionY, jint width, jint height, jint x, jint y);
316 typedef DRAWING_Status (* UI_DRAWING_drawRegion_t) (MICROUI_GraphicsContext* gc, jint regionX, jint regionY, jint width, jint height, jint x, jint y, jint alpha);
317 typedef DRAWING_Status (* UI_DRAWING_drawThickFadedPoint_t) (MICROUI_GraphicsContext* gc, jint x, jint y, jint thickness, jint fade);
318 typedef DRAWING_Status (* UI_DRAWING_drawThickFadedLine_t) (MICROUI_GraphicsContext* gc, jint startX, jint startY, jint endX, jint endY, jint thickness, jint fade, DRAWING_Cap startCap, DRAWING_Cap endCap);
319 typedef DRAWING_Status (* UI_DRAWING_drawThickFadedCircle_t) (MICROUI_GraphicsContext* gc, jint x, jint y, jint diameter, jint thickness, jint fade);
320 typedef DRAWING_Status (* UI_DRAWING_drawThickFadedCircleArc_t) (MICROUI_GraphicsContext* gc, jint x, jint y, jint diameter, jfloat startAngle, jfloat arcAngle, jint thickness, jint fade, DRAWING_Cap start, DRAWING_Cap end);
321 typedef DRAWING_Status (* UI_DRAWING_drawThickFadedEllipse_t) (MICROUI_GraphicsContext* gc, jint x, jint y, jint width, jint height, jint thickness, jint fade);
322 typedef DRAWING_Status (* UI_DRAWING_drawThickLine_t) (MICROUI_GraphicsContext* gc, jint startX, jint startY, jint endX, jint endY, jint thickness);
323 typedef DRAWING_Status (* UI_DRAWING_drawThickCircle_t) (MICROUI_GraphicsContext* gc, jint x, jint y, jint diameter, jint thickness);
324 typedef DRAWING_Status (* UI_DRAWING_drawThickEllipse_t) (MICROUI_GraphicsContext* gc, jint x, jint y, jint width, jint height, jint thickness);
325 typedef DRAWING_Status (* UI_DRAWING_drawThickCircleArc_t) (MICROUI_GraphicsContext* gc, jint x, jint y, jint diameter, jfloat startAngle, jfloat arcAngle, jint thickness);
326 typedef DRAWING_Status (* UI_DRAWING_drawFlippedImage_t) (MICROUI_GraphicsContext* gc, MICROUI_Image* img, jint regionX, jint regionY, jint width, jint height, jint x, jint y, DRAWING_Flip transformation, jint alpha);
327 typedef DRAWING_Status (* UI_DRAWING_drawRotatedImageNearestNeighbor_t) (MICROUI_GraphicsContext* gc, MICROUI_Image* img, jint x, jint y, jint rotationX, jint rotationY, jfloat angle, jint alpha);
328 typedef DRAWING_Status (* UI_DRAWING_drawRotatedImageBilinear_t) (MICROUI_GraphicsContext* gc, MICROUI_Image* img, jint x, jint y, jint rotationX, jint rotationY, jfloat angle, jint alpha);
329 typedef DRAWING_Status (* UI_DRAWING_drawScaledImageNearestNeighbor_t) (MICROUI_GraphicsContext* gc, MICROUI_Image* img, jint x, jint y, jfloat factorX, jfloat factorY, jint alpha);
330 typedef DRAWING_Status (* UI_DRAWING_drawScaledImageBilinear_t) (MICROUI_GraphicsContext* gc, MICROUI_Image* img, jint x, jint y, jfloat factorX, jfloat factorY, jint alpha);
331 
332 #endif // #if defined(LLUI_GC_SUPPORTED_FORMATS) && (LLUI_GC_SUPPORTED_FORMATS > 1)
333 
334 // --------------------------------------------------------------------------------
335 // Tables according to the destination format.
336 // --------------------------------------------------------------------------------
337 
338 #if defined(LLUI_GC_SUPPORTED_FORMATS) && (LLUI_GC_SUPPORTED_FORMATS > 1)
339 
340 static const UI_DRAWING_getNewImageStrideInBytes_t UI_DRAWER_getNewImageStrideInBytes[] = {
341  &UI_DRAWING_getNewImageStrideInBytes,
342  &UI_DRAWING_getNewImageStrideInBytes_1,
343 #if (LLUI_GC_SUPPORTED_FORMATS > 2)
344  &UI_DRAWING_getNewImageStrideInBytes_2,
345 #endif
346 };
347 
348 static const UI_DRAWING_adjustNewImageCharacteristics_t UI_DRAWER_adjustNewImageCharacteristics[] = {
349  &UI_DRAWING_adjustNewImageCharacteristics,
350  &UI_DRAWING_adjustNewImageCharacteristics_1,
351 #if (LLUI_GC_SUPPORTED_FORMATS > 2)
352  &UI_DRAWING_adjustNewImageCharacteristics_2,
353 #endif
354 };
355 
356 static const UI_DRAWING_initializeNewImage_t UI_DRAWER_initializeNewImage[] = {
357  &UI_DRAWING_initializeNewImage,
358  &UI_DRAWING_initializeNewImage_1,
359 #if (LLUI_GC_SUPPORTED_FORMATS > 2)
360  &UI_DRAWING_initializeNewImage_2,
361 #endif
362 };
363 
364 static const UI_DRAWING_writePixel_t UI_DRAWER_writePixel[] = {
365  &UI_DRAWING_writePixel_0,
366  &UI_DRAWING_writePixel_1,
367 #if (LLUI_GC_SUPPORTED_FORMATS > 2)
368  &UI_DRAWING_writePixel_2,
369 #endif
370 };
371 
372 static const UI_DRAWING_drawLine_t UI_DRAWER_drawLine[] = {
373  &UI_DRAWING_drawLine_0,
374  &UI_DRAWING_drawLine_1,
375 #if (LLUI_GC_SUPPORTED_FORMATS > 2)
376  &UI_DRAWING_drawLine_2,
377 #endif
378 };
379 
380 static const UI_DRAWING_drawHorizontalLine_t UI_DRAWER_drawHorizontalLine[] = {
381  &UI_DRAWING_drawHorizontalLine_0,
382  &UI_DRAWING_drawHorizontalLine_1,
383 #if (LLUI_GC_SUPPORTED_FORMATS > 2)
384  &UI_DRAWING_drawHorizontalLine_2,
385 #endif
386 };
387 
388 static const UI_DRAWING_drawVerticalLine_t UI_DRAWER_drawVerticalLine[] = {
389  &UI_DRAWING_drawVerticalLine_0,
390  &UI_DRAWING_drawVerticalLine_1,
391 #if (LLUI_GC_SUPPORTED_FORMATS > 2)
392  &UI_DRAWING_drawVerticalLine_2,
393 #endif
394 };
395 
396 static const UI_DRAWING_drawRectangle_t UI_DRAWER_drawRectangle[] = {
397  &UI_DRAWING_drawRectangle_0,
398  &UI_DRAWING_drawRectangle_1,
399 #if (LLUI_GC_SUPPORTED_FORMATS > 2)
400  &UI_DRAWING_drawRectangle_2,
401 #endif
402 };
403 
404 static const UI_DRAWING_fillRectangle_t UI_DRAWER_fillRectangle[] = {
405  &UI_DRAWING_fillRectangle_0,
406  &UI_DRAWING_fillRectangle_1,
407 #if (LLUI_GC_SUPPORTED_FORMATS > 2)
408  &UI_DRAWING_fillRectangle_2,
409 #endif
410 };
411 
412 static const UI_DRAWING_drawRoundedRectangle_t UI_DRAWER_drawRoundedRectangle[] = {
413  &UI_DRAWING_drawRoundedRectangle_0,
414  &UI_DRAWING_drawRoundedRectangle_1,
415 #if (LLUI_GC_SUPPORTED_FORMATS > 2)
416  &UI_DRAWING_drawRoundedRectangle_2,
417 #endif
418 };
419 
420 static const UI_DRAWING_fillRoundedRectangle_t UI_DRAWER_fillRoundedRectangle[] = {
421  &UI_DRAWING_fillRoundedRectangle_0,
422  &UI_DRAWING_fillRoundedRectangle_1,
423 #if (LLUI_GC_SUPPORTED_FORMATS > 2)
424  &UI_DRAWING_fillRoundedRectangle_2,
425 #endif
426 };
427 
428 static const UI_DRAWING_drawCircleArc_t UI_DRAWER_drawCircleArc[] = {
429  &UI_DRAWING_drawCircleArc_0,
430  &UI_DRAWING_drawCircleArc_1,
431 #if (LLUI_GC_SUPPORTED_FORMATS > 2)
432  &UI_DRAWING_drawCircleArc_2,
433 #endif
434 };
435 
436 static const UI_DRAWING_drawEllipseArc_t UI_DRAWER_drawEllipseArc[] = {
437  &UI_DRAWING_drawEllipseArc_0,
438  &UI_DRAWING_drawEllipseArc_1,
439 #if (LLUI_GC_SUPPORTED_FORMATS > 2)
440  &UI_DRAWING_drawEllipseArc_2,
441 #endif
442 };
443 
444 static const UI_DRAWING_fillCircleArc_t UI_DRAWER_fillCircleArc[] = {
445  &UI_DRAWING_fillCircleArc_0,
446  &UI_DRAWING_fillCircleArc_1,
447 #if (LLUI_GC_SUPPORTED_FORMATS > 2)
448  &UI_DRAWING_fillCircleArc_2,
449 #endif
450 };
451 
452 static const UI_DRAWING_fillEllipseArc_t UI_DRAWER_fillEllipseArc[] = {
453  &UI_DRAWING_fillEllipseArc_0,
454  &UI_DRAWING_fillEllipseArc_1,
455 #if (LLUI_GC_SUPPORTED_FORMATS > 2)
456  &UI_DRAWING_fillEllipseArc_2,
457 #endif
458 };
459 
460 static const UI_DRAWING_drawEllipse_t UI_DRAWER_drawEllipse[] = {
461  &UI_DRAWING_drawEllipse_0,
462  &UI_DRAWING_drawEllipse_1,
463 #if (LLUI_GC_SUPPORTED_FORMATS > 2)
464  &UI_DRAWING_drawEllipse_2,
465 #endif
466 };
467 
468 static const UI_DRAWING_fillEllipse_t UI_DRAWER_fillEllipse[] = {
469  &UI_DRAWING_fillEllipse_0,
470  &UI_DRAWING_fillEllipse_1,
471 #if (LLUI_GC_SUPPORTED_FORMATS > 2)
472  &UI_DRAWING_fillEllipse_2,
473 #endif
474 };
475 
476 static const UI_DRAWING_drawCircle_t UI_DRAWER_drawCircle[] = {
477  &UI_DRAWING_drawCircle_0,
478  &UI_DRAWING_drawCircle_1,
479 #if (LLUI_GC_SUPPORTED_FORMATS > 2)
480  &UI_DRAWING_drawCircle_2,
481 #endif
482 };
483 
484 static const UI_DRAWING_fillCircle_t UI_DRAWER_fillCircle[] = {
485  &UI_DRAWING_fillCircle_0,
486  &UI_DRAWING_fillCircle_1,
487 #if (LLUI_GC_SUPPORTED_FORMATS > 2)
488  &UI_DRAWING_fillCircle_2,
489 #endif
490 };
491 
492 static const UI_DRAWING_drawImage_t UI_DRAWER_drawImage[] = {
493  &UI_DRAWING_drawImage_0,
494  &UI_DRAWING_drawImage_1,
495 #if (LLUI_GC_SUPPORTED_FORMATS > 2)
496  &UI_DRAWING_drawImage_2,
497 #endif
498 };
499 
500 static const UI_DRAWING_copyImage_t UI_DRAWER_copyImage[] = {
501  &UI_DRAWING_copyImage_0,
502  &UI_DRAWING_copyImage_1,
503 #if (LLUI_GC_SUPPORTED_FORMATS > 2)
504  &UI_DRAWING_copyImage_2,
505 #endif
506 };
507 
508 static const UI_DRAWING_drawRegion_t UI_DRAWER_drawRegion[] = {
509  &UI_DRAWING_drawRegion_0,
510  &UI_DRAWING_drawRegion_1,
511 #if (LLUI_GC_SUPPORTED_FORMATS > 2)
512  &UI_DRAWING_drawRegion_2,
513 #endif
514 };
515 
516 static const UI_DRAWING_drawThickFadedPoint_t UI_DRAWER_drawThickFadedPoint[] = {
517  &UI_DRAWING_drawThickFadedPoint_0,
518  &UI_DRAWING_drawThickFadedPoint_1,
519 #if (LLUI_GC_SUPPORTED_FORMATS > 2)
520  &UI_DRAWING_drawThickFadedPoint_2,
521 #endif
522 };
523 
524 static const UI_DRAWING_drawThickFadedLine_t UI_DRAWER_drawThickFadedLine[] = {
525  &UI_DRAWING_drawThickFadedLine_0,
526  &UI_DRAWING_drawThickFadedLine_1,
527 #if (LLUI_GC_SUPPORTED_FORMATS > 2)
528  &UI_DRAWING_drawThickFadedLine_2,
529 #endif
530 };
531 
532 static const UI_DRAWING_drawThickFadedCircle_t UI_DRAWER_drawThickFadedCircle[] = {
533  &UI_DRAWING_drawThickFadedCircle_0,
534  &UI_DRAWING_drawThickFadedCircle_1,
535 #if (LLUI_GC_SUPPORTED_FORMATS > 2)
536  &UI_DRAWING_drawThickFadedCircle_2,
537 #endif
538 };
539 
540 static const UI_DRAWING_drawThickFadedCircleArc_t UI_DRAWER_drawThickFadedCircleArc[] = {
541  &UI_DRAWING_drawThickFadedCircleArc_0,
542  &UI_DRAWING_drawThickFadedCircleArc_1,
543 #if (LLUI_GC_SUPPORTED_FORMATS > 2)
544  &UI_DRAWING_drawThickFadedCircleArc_2,
545 #endif
546 };
547 
548 static const UI_DRAWING_drawThickFadedEllipse_t UI_DRAWER_drawThickFadedEllipse[] = {
549  &UI_DRAWING_drawThickFadedEllipse_0,
550  &UI_DRAWING_drawThickFadedEllipse_1,
551 #if (LLUI_GC_SUPPORTED_FORMATS > 2)
552  &UI_DRAWING_drawThickFadedEllipse_2,
553 #endif
554 };
555 
556 static const UI_DRAWING_drawThickLine_t UI_DRAWER_drawThickLine[] = {
557  &UI_DRAWING_drawThickLine_0,
558  &UI_DRAWING_drawThickLine_1,
559 #if (LLUI_GC_SUPPORTED_FORMATS > 2)
560  &UI_DRAWING_drawThickLine_2,
561 #endif
562 };
563 
564 static const UI_DRAWING_drawThickCircle_t UI_DRAWER_drawThickCircle[] = {
565  &UI_DRAWING_drawThickCircle_0,
566  &UI_DRAWING_drawThickCircle_1,
567 #if (LLUI_GC_SUPPORTED_FORMATS > 2)
568  &UI_DRAWING_drawThickCircle_2,
569 #endif
570 };
571 
572 static const UI_DRAWING_drawThickEllipse_t UI_DRAWER_drawThickEllipse[] = {
573  &UI_DRAWING_drawThickEllipse_0,
574  &UI_DRAWING_drawThickEllipse_1,
575 #if (LLUI_GC_SUPPORTED_FORMATS > 2)
576  &UI_DRAWING_drawThickEllipse_2,
577 #endif
578 };
579 
580 static const UI_DRAWING_drawThickCircleArc_t UI_DRAWER_drawThickCircleArc[] = {
581  &UI_DRAWING_drawThickCircleArc_0,
582  &UI_DRAWING_drawThickCircleArc_1,
583 #if (LLUI_GC_SUPPORTED_FORMATS > 2)
584  &UI_DRAWING_drawThickCircleArc_2,
585 #endif
586 };
587 
588 static const UI_DRAWING_drawFlippedImage_t UI_DRAWER_drawFlippedImage[] = {
589  &UI_DRAWING_drawFlippedImage_0,
590  &UI_DRAWING_drawFlippedImage_1,
591 #if (LLUI_GC_SUPPORTED_FORMATS > 2)
592  &UI_DRAWING_drawFlippedImage_2,
593 #endif
594 };
595 
596 static const UI_DRAWING_drawRotatedImageNearestNeighbor_t UI_DRAWER_drawRotatedImageNearestNeighbor[] = {
597  &UI_DRAWING_drawRotatedImageNearestNeighbor_0,
598  &UI_DRAWING_drawRotatedImageNearestNeighbor_1,
599 #if (LLUI_GC_SUPPORTED_FORMATS > 2)
600  &UI_DRAWING_drawRotatedImageNearestNeighbor_2,
601 #endif
602 };
603 
604 static const UI_DRAWING_drawRotatedImageBilinear_t UI_DRAWER_drawRotatedImageBilinear[] = {
605  &UI_DRAWING_drawRotatedImageBilinear_0,
606  &UI_DRAWING_drawRotatedImageBilinear_1,
607 #if (LLUI_GC_SUPPORTED_FORMATS > 2)
608  &UI_DRAWING_drawRotatedImageBilinear_2,
609 #endif
610 };
611 
612 static const UI_DRAWING_drawScaledImageNearestNeighbor_t UI_DRAWER_drawScaledImageNearestNeighbor[] = {
613  &UI_DRAWING_drawScaledImageNearestNeighbor_0,
614  &UI_DRAWING_drawScaledImageNearestNeighbor_1,
615 #if (LLUI_GC_SUPPORTED_FORMATS > 2)
616  &UI_DRAWING_drawScaledImageNearestNeighbor_2,
617 #endif
618 };
619 
620 static const UI_DRAWING_drawScaledImageBilinear_t UI_DRAWER_drawScaledImageBilinear[] = {
621  &UI_DRAWING_drawScaledImageBilinear_0,
622  &UI_DRAWING_drawScaledImageBilinear_1,
623 #if (LLUI_GC_SUPPORTED_FORMATS > 2)
624  &UI_DRAWING_drawScaledImageBilinear_2,
625 #endif
626 };
627 
628 #endif // defined(LLUI_GC_SUPPORTED_FORMATS) && (LLUI_GC_SUPPORTED_FORMATS > 1)
629 
630 // --------------------------------------------------------------------------------
631 // LLUI_DISPLAY_impl.h functions that depend on image format
632 // (the functions are redirected to ui_drawing.h)
633 // --------------------------------------------------------------------------------
634 
635 #if !defined(LLUI_GC_SUPPORTED_FORMATS) || (LLUI_GC_SUPPORTED_FORMATS <= 1)
636 
637 /*
638  * The VEE port supports only one destination format: the displat buffer format. The
639  * application mutable images have the same format as the display buffer.
640  */
641 
642 // See the header file for the function documentation
643 int32_t LLUI_DISPLAY_IMPL_getDrawerIdentifier(jbyte image_format) {
644  return LLUI_DISPLAY_isDisplayFormat(image_format) ? 0 /* no error */ : -1 /* means invalid */;
645 }
646 
647 // See the header file for the function documentation
648 uint32_t LLUI_DISPLAY_IMPL_getNewImageStrideInBytes(jbyte image_format, uint32_t width, uint32_t height, uint32_t default_stride) {
649  // just make an indirection (useful for multi destination formats)
650  return UI_DRAWING_getNewImageStrideInBytes(image_format, width, height, default_stride);
651 }
652 
653 // See the header file for the function documentation
654 void LLUI_DISPLAY_IMPL_adjustNewImageCharacteristics(jbyte image_format, uint32_t width, uint32_t height, uint32_t* data_size, uint32_t* data_alignment) {
655  // just make an indirection (useful for multi destination formats)
656  UI_DRAWING_adjustNewImageCharacteristics(image_format, width, height, data_size, data_alignment);
657 }
658 
659 // See the header file for the function documentation
660 void LLUI_DISPLAY_IMPL_initializeNewImage(MICROUI_Image* image) {
661  // just make an indirection (useful for multi destination formats)
662  UI_DRAWING_initializeNewImage(image);
663 }
664 
665 #else // #if !defined(LLUI_GC_SUPPORTED_FORMATS) || (LLUI_GC_SUPPORTED_FORMATS <= 1)
666 
667 /*
668  * The VEE port supports several destination formats. All drawing functions use a
669  * dedicated table to redirect to the right implementation. The VEE Port must implement
670  * the functions UI_DRAWING_is_drawer_X() to identify the right drawer according to
671  * the destination format.
672  *
673  * The "DEFAULT" functions (see below) are used as element "0" of the tables (this is the
674  * display buffer format).
675  */
676 
677 int32_t LLUI_DISPLAY_IMPL_getDrawerIdentifier(jbyte image_format) {
678 
679  int32_t index;
680 
681  if (LLUI_DISPLAY_isDisplayFormat(image_format)) {
682  index = 0;
683  } else if (UI_DRAWING_is_drawer_1(image_format)) {
684  index = 1;
685 #if (LLUI_GC_SUPPORTED_FORMATS > 2)
686  } else if (UI_DRAWING_is_drawer_2(image_format)) {
687  index = 2;
688 #endif
689  }
690  else {
691  // unknown format
692  index = -1;
693  }
694 
695  return index;
696 }
697 
698 /*
699  * @brief See the header file for the function documentation
700  *
701  * Implementation details: The new image to create is an immutable image or a mutable image.
702  *
703  * - If it is a mutable image, that means a drawer is able to draw into it (see
704  * LLUI_DISPLAY_IMPL_getDrawerIdentifier()). In this case, this function redirects the
705  * implementation to the drawer (that should be able to adjust image characteristics if
706  * required).
707  *
708  * - If it is an immutable image (PNG decoder, automatic image format convert, etc.), that
709  * means (most of the time) no drawer can manage this image format. In such case, this function
710  * redirects the implementation to the default implementation (the indirection table
711  * UI_DRAWER_getNewImageStrideInBytes points to the default function at index 0).
712  *
713  * - In the case a drawer is available for this new immutable image, this function redirects
714  * to the drawer.
715  */
716 uint32_t LLUI_DISPLAY_IMPL_getNewImageStrideInBytes(jbyte image_format, uint32_t width, uint32_t height, uint32_t default_stride) {
717  int32_t drawer = LLUI_DISPLAY_IMPL_getDrawerIdentifier(image_format);
718  drawer = (drawer >= 0) ? drawer : 0;
719  return (*UI_DRAWER_getNewImageStrideInBytes[drawer])(image_format, width, height, default_stride);
720 }
721 
722 // See the header file foar the function documentation and implementation of
723 // LLUI_DISPLAY_IMPL_getNewImageStrideInBytes
724 void LLUI_DISPLAY_IMPL_adjustNewImageCharacteristics(jbyte image_format, uint32_t width, uint32_t height, uint32_t* data_size, uint32_t* data_alignment) {
725  int32_t drawer = LLUI_DISPLAY_IMPL_getDrawerIdentifier(image_format);
726  drawer = (drawer >= 0) ? drawer : 0;
727  (*UI_DRAWER_adjustNewImageCharacteristics[drawer])(image_format, width, height, data_size, data_alignment);
728 }
729 
730 // See the header file for the function documentation and implementation of
731 // LLUI_DISPLAY_IMPL_getNewImageStrideInBytes
732 void LLUI_DISPLAY_IMPL_initializeNewImage(MICROUI_Image* image) {
733  int32_t drawer = LLUI_DISPLAY_IMPL_getDrawerIdentifier(image->format);
734  drawer = (drawer >= 0) ? drawer : 0;
735  (*UI_DRAWER_initializeNewImage[drawer])(image);
736 }
737 
738 #endif // #if !defined(LLUI_GC_SUPPORTED_FORMATS) || (LLUI_GC_SUPPORTED_FORMATS <= 1)
739 
740 // --------------------------------------------------------------------------------
741 // ui_drawing.h functions
742 // (the function names don't differ regardless of the available number of destination formats)
743 // --------------------------------------------------------------------------------
744 
745 // See the header file for the function documentation
746 BSP_DECLARE_WEAK_FCNT uint32_t UI_DRAWING_getNewImageStrideInBytes(jbyte image_format, uint32_t width, uint32_t height, uint32_t default_stride) {
747  (void)image_format;
748  (void)width;
749  (void)height;
750  // no specific stride by default
751  return default_stride;
752 }
753 
754 // See the header file for the function documentation
755 BSP_DECLARE_WEAK_FCNT void UI_DRAWING_adjustNewImageCharacteristics(jbyte image_format, uint32_t width, uint32_t height, uint32_t* data_size, uint32_t* data_alignment){
756  (void)image_format;
757  (void)width;
758  (void)height;
759  (void)data_size;
760  (void)data_alignment;
761  // nothing to adjust by default
762 }
763 
764 // See the header file for the function documentation
765 BSP_DECLARE_WEAK_FCNT void UI_DRAWING_initializeNewImage(MICROUI_Image* image){
766  (void)image;
767  // nothing to initialize by default
768 }
769 
770 // --------------------------------------------------------------------------------
771 // ui_drawing.h functions
772 // (the function names differ according to the available number of destination formats)
773 // --------------------------------------------------------------------------------
774 
775 // See the header file for the function documentation
776 BSP_DECLARE_WEAK_FCNT DRAWING_Status UI_DRAWING_DEFAULT_writePixel(MICROUI_GraphicsContext* gc, jint x, jint y){
777  return UI_DRAWING_SOFT_writePixel(gc, x, y);
778 }
779 
780 // See the header file for the function documentation
781 BSP_DECLARE_WEAK_FCNT DRAWING_Status UI_DRAWING_DEFAULT_drawLine(MICROUI_GraphicsContext* gc, jint startX, jint startY, jint endX, jint endY){
782  return UI_DRAWING_SOFT_drawLine(gc, startX, startY, endX, endY);
783 }
784 
785 // See the header file for the function documentation
786 BSP_DECLARE_WEAK_FCNT DRAWING_Status UI_DRAWING_DEFAULT_drawHorizontalLine(MICROUI_GraphicsContext* gc, jint x1, jint x2, jint y){
787  return UI_DRAWING_SOFT_drawHorizontalLine(gc, x1, x2, y);
788 }
789 
790 // See the header file for the function documentation
791 BSP_DECLARE_WEAK_FCNT DRAWING_Status UI_DRAWING_DEFAULT_drawVerticalLine(MICROUI_GraphicsContext* gc, jint x, jint y1, jint y2){
792  return UI_DRAWING_SOFT_drawVerticalLine(gc, x, y1, y2);
793 }
794 
795 // See the header file for the function documentation
796 BSP_DECLARE_WEAK_FCNT DRAWING_Status UI_DRAWING_DEFAULT_drawRectangle(MICROUI_GraphicsContext* gc, jint x1, jint y1, jint x2, jint y2){
797  return UI_DRAWING_SOFT_drawRectangle(gc, x1, y1, x2, y2);
798 }
799 
800 // See the header file for the function documentation
801 BSP_DECLARE_WEAK_FCNT DRAWING_Status UI_DRAWING_DEFAULT_fillRectangle(MICROUI_GraphicsContext* gc, jint x1, jint y1, jint x2, jint y2){
802  return UI_DRAWING_SOFT_fillRectangle(gc, x1, y1, x2, y2);
803 }
804 
805 // See the header file for the function documentation
806 BSP_DECLARE_WEAK_FCNT DRAWING_Status UI_DRAWING_DEFAULT_drawRoundedRectangle(MICROUI_GraphicsContext* gc, jint x, jint y, jint width, jint height, jint cornerEllipseWidth, jint cornerEllipseHeight){
807  return UI_DRAWING_SOFT_drawRoundedRectangle(gc, x, y, width, height, cornerEllipseWidth, cornerEllipseHeight);
808 }
809 
810 // See the header file for the function documentation
811 BSP_DECLARE_WEAK_FCNT DRAWING_Status UI_DRAWING_DEFAULT_fillRoundedRectangle(MICROUI_GraphicsContext* gc, jint x, jint y, jint width, jint height, jint cornerEllipseWidth, jint cornerEllipseHeight){
812  return UI_DRAWING_SOFT_fillRoundedRectangle(gc, x, y, width, height, cornerEllipseWidth, cornerEllipseHeight);
813 }
814 
815 // See the header file for the function documentation
816 BSP_DECLARE_WEAK_FCNT DRAWING_Status UI_DRAWING_DEFAULT_drawCircleArc(MICROUI_GraphicsContext* gc, jint x, jint y, jint diameter, jfloat startAngle, jfloat arcAngle){
817  return UI_DRAWING_SOFT_drawCircleArc(gc, x, y, diameter, startAngle, arcAngle);
818 }
819 
820 // See the header file for the function documentation
821 BSP_DECLARE_WEAK_FCNT DRAWING_Status UI_DRAWING_DEFAULT_drawEllipseArc(MICROUI_GraphicsContext* gc, jint x, jint y, jint width, jint height, jfloat startAngle, jfloat arcAngle){
822  return UI_DRAWING_SOFT_drawEllipseArc(gc, x, y, width, height, startAngle, arcAngle);
823 }
824 
825 // See the header file for the function documentation
826 BSP_DECLARE_WEAK_FCNT DRAWING_Status UI_DRAWING_DEFAULT_fillCircleArc(MICROUI_GraphicsContext* gc, jint x, jint y, jint diameter, jfloat startAngle, jfloat arcAngle){
827  return UI_DRAWING_SOFT_fillCircleArc(gc, x, y, diameter, startAngle, arcAngle);
828 }
829 
830 // See the header file for the function documentation
831 BSP_DECLARE_WEAK_FCNT DRAWING_Status UI_DRAWING_DEFAULT_fillEllipseArc(MICROUI_GraphicsContext* gc, jint x, jint y, jint width, jint height, jfloat startAngle, jfloat arcAngle){
832  return UI_DRAWING_SOFT_fillEllipseArc(gc, x, y, width, height, startAngle, arcAngle);
833 }
834 
835 // See the header file for the function documentation
836 BSP_DECLARE_WEAK_FCNT DRAWING_Status UI_DRAWING_DEFAULT_drawEllipse(MICROUI_GraphicsContext* gc, jint x, jint y, jint width, jint height){
837  return UI_DRAWING_SOFT_drawEllipse(gc, x, y, width, height);
838 }
839 
840 // See the header file for the function documentation
841 BSP_DECLARE_WEAK_FCNT DRAWING_Status UI_DRAWING_DEFAULT_fillEllipse(MICROUI_GraphicsContext* gc, jint x, jint y, jint width, jint height){
842  return UI_DRAWING_SOFT_fillEllipse(gc, x, y, width, height);
843 }
844 
845 // See the header file for the function documentation
846 BSP_DECLARE_WEAK_FCNT DRAWING_Status UI_DRAWING_DEFAULT_drawCircle(MICROUI_GraphicsContext* gc, jint x, jint y, jint diameter){
847  return UI_DRAWING_SOFT_drawCircle(gc, x, y, diameter);
848 }
849 
850 // See the header file for the function documentation
851 BSP_DECLARE_WEAK_FCNT DRAWING_Status UI_DRAWING_DEFAULT_fillCircle(MICROUI_GraphicsContext* gc, jint x, jint y, jint diameter){
852  return UI_DRAWING_SOFT_fillCircle(gc, x, y, diameter);
853 }
854 
855 // See the header file for the function documentation
856 BSP_DECLARE_WEAK_FCNT DRAWING_Status UI_DRAWING_DEFAULT_drawImage(MICROUI_GraphicsContext* gc, MICROUI_Image* img, jint regionX, jint regionY, jint width, jint height, jint x, jint y, jint alpha){
857 #if !defined(LLUI_IMAGE_CUSTOM_FORMATS)
858  return UI_DRAWING_SOFT_drawImage(gc, img, regionX, regionY, width, height, x, y, alpha);
859 #else
860  return UI_IMAGE_DRAWING_draw(gc, img, regionX, regionY, width, height, x, y, alpha);
861 #endif
862 }
863 
864 // See the header file for the function documentation
865 BSP_DECLARE_WEAK_FCNT DRAWING_Status UI_DRAWING_DEFAULT_copyImage(MICROUI_GraphicsContext* gc, MICROUI_Image* img, jint regionX, jint regionY, jint width, jint height, jint x, jint y){
866 #if !defined(LLUI_IMAGE_CUSTOM_FORMATS)
867  return UI_DRAWING_SOFT_copyImage(gc, img, regionX, regionY, width, height, x, y);
868 #else
869  return UI_IMAGE_DRAWING_copy(gc, img, regionX, regionY, width, height, x, y);
870 #endif
871 }
872 
873 // See the header file for the function documentation
874 BSP_DECLARE_WEAK_FCNT DRAWING_Status UI_DRAWING_DEFAULT_drawRegion(MICROUI_GraphicsContext* gc, jint regionX, jint regionY, jint width, jint height, jint x, jint y, jint alpha){
875 #if !defined(LLUI_IMAGE_CUSTOM_FORMATS)
876  return UI_DRAWING_SOFT_drawRegion(gc, regionX, regionY, width, height, x, y, alpha);
877 #else
878  return UI_IMAGE_DRAWING_drawRegion(gc, regionX, regionY, width, height, x, y, alpha);
879 #endif
880 }
881 
882 // See the header file for the function documentation
883 BSP_DECLARE_WEAK_FCNT DRAWING_Status UI_DRAWING_DEFAULT_drawThickFadedPoint(MICROUI_GraphicsContext* gc, jint x, jint y, jint thickness, jint fade){
884  return DW_DRAWING_SOFT_drawThickFadedPoint(gc, x, y, thickness, fade);
885 }
886 
887 // See the header file for the function documentation
888 BSP_DECLARE_WEAK_FCNT DRAWING_Status UI_DRAWING_DEFAULT_drawThickFadedLine(MICROUI_GraphicsContext* gc, jint startX, jint startY, jint endX, jint endY, jint thickness, jint fade, DRAWING_Cap startCap, DRAWING_Cap endCap){
889  return DW_DRAWING_SOFT_drawThickFadedLine(gc, startX, startY, endX, endY, thickness, fade, startCap, endCap);
890 }
891 
892 // See the header file for the function documentation
893 BSP_DECLARE_WEAK_FCNT DRAWING_Status UI_DRAWING_DEFAULT_drawThickFadedCircle(MICROUI_GraphicsContext* gc, jint x, jint y, jint diameter, jint thickness, jint fade){
894  return DW_DRAWING_SOFT_drawThickFadedCircle(gc, x, y, diameter, thickness, fade);
895 }
896 
897 // See the header file for the function documentation
898 BSP_DECLARE_WEAK_FCNT DRAWING_Status UI_DRAWING_DEFAULT_drawThickFadedCircleArc(MICROUI_GraphicsContext* gc, jint x, jint y, jint diameter, jfloat startAngle, jfloat arcAngle, jint thickness, jint fade, DRAWING_Cap start, DRAWING_Cap end){
899  return DW_DRAWING_SOFT_drawThickFadedCircleArc(gc, x, y, diameter, startAngle, arcAngle, thickness, fade, start, end);
900 }
901 
902 // See the header file for the function documentation
903 BSP_DECLARE_WEAK_FCNT DRAWING_Status UI_DRAWING_DEFAULT_drawThickFadedEllipse(MICROUI_GraphicsContext* gc, jint x, jint y, jint width, jint height, jint thickness, jint fade){
904  return DW_DRAWING_SOFT_drawThickFadedEllipse(gc, x, y, width, height, thickness, fade);
905 }
906 
907 // See the header file for the function documentation
908 BSP_DECLARE_WEAK_FCNT DRAWING_Status UI_DRAWING_DEFAULT_drawThickLine(MICROUI_GraphicsContext* gc, jint startX, jint startY, jint endX, jint endY, jint thickness){
909  return DW_DRAWING_SOFT_drawThickLine(gc, startX, startY, endX, endY, thickness);
910 }
911 
912 // See the header file for the function documentation
913 BSP_DECLARE_WEAK_FCNT DRAWING_Status UI_DRAWING_DEFAULT_drawThickCircle(MICROUI_GraphicsContext* gc, jint x, jint y, jint diameter, jint thickness){
914  return DW_DRAWING_SOFT_drawThickCircle(gc, x, y, diameter, thickness);
915 }
916 
917 // See the header file for the function documentation
918 BSP_DECLARE_WEAK_FCNT DRAWING_Status UI_DRAWING_DEFAULT_drawThickEllipse(MICROUI_GraphicsContext* gc, jint x, jint y, jint width, jint height, jint thickness){
919  return DW_DRAWING_SOFT_drawThickEllipse(gc, x, y, width, height, thickness);
920 }
921 
922 // See the header file for the function documentation
923 BSP_DECLARE_WEAK_FCNT DRAWING_Status UI_DRAWING_DEFAULT_drawThickCircleArc(MICROUI_GraphicsContext* gc, jint x, jint y, jint diameter, jfloat startAngle, jfloat arcAngle, jint thickness){
924  return DW_DRAWING_SOFT_drawThickCircleArc(gc, x, y, diameter, startAngle, arcAngle, thickness);
925 }
926 
927 // See the header file for the function documentation
928 BSP_DECLARE_WEAK_FCNT DRAWING_Status UI_DRAWING_DEFAULT_drawFlippedImage(MICROUI_GraphicsContext* gc, MICROUI_Image* img, jint regionX, jint regionY, jint width, jint height, jint x, jint y, DRAWING_Flip transformation, jint alpha){
929 #if !defined(LLUI_IMAGE_CUSTOM_FORMATS)
930  return DW_DRAWING_SOFT_drawFlippedImage(gc, img, regionX, regionY, width, height, x, y, transformation, alpha);
931 #else
932  return UI_IMAGE_DRAWING_drawFlipped(gc, img, regionX, regionY, width, height, x, y, transformation, alpha);
933 #endif
934 }
935 
936 // See the header file for the function documentation
937 BSP_DECLARE_WEAK_FCNT DRAWING_Status UI_DRAWING_DEFAULT_drawRotatedImageNearestNeighbor(MICROUI_GraphicsContext* gc, MICROUI_Image* img, jint x, jint y, jint rotationX, jint rotationY, jfloat angle, jint alpha){
938 #if !defined(LLUI_IMAGE_CUSTOM_FORMATS)
939  return DW_DRAWING_SOFT_drawRotatedImageNearestNeighbor(gc, img, x, y, rotationX, rotationY, angle, alpha);
940 #else
941  return UI_IMAGE_DRAWING_drawRotatedNearestNeighbor(gc, img, x, y, rotationX, rotationY, angle, alpha);
942 #endif
943 }
944 
945 // See the header file for the function documentation
946 BSP_DECLARE_WEAK_FCNT DRAWING_Status UI_DRAWING_DEFAULT_drawRotatedImageBilinear(MICROUI_GraphicsContext* gc, MICROUI_Image* img, jint x, jint y, jint rotationX, jint rotationY, jfloat angle, jint alpha){
947 #if !defined(LLUI_IMAGE_CUSTOM_FORMATS)
948  return DW_DRAWING_SOFT_drawRotatedImageBilinear(gc, img, x, y, rotationX, rotationY, angle, alpha);
949 #else
950  return UI_IMAGE_DRAWING_drawRotatedBilinear(gc, img, x, y, rotationX, rotationY, angle, alpha);
951 #endif
952 }
953 
954 // See the header file for the function documentation
955 BSP_DECLARE_WEAK_FCNT DRAWING_Status UI_DRAWING_DEFAULT_drawScaledImageNearestNeighbor(MICROUI_GraphicsContext* gc, MICROUI_Image* img, jint x, jint y, jfloat factorX, jfloat factorY, jint alpha){
956 #if !defined(LLUI_IMAGE_CUSTOM_FORMATS)
957  return DW_DRAWING_SOFT_drawScaledImageNearestNeighbor(gc, img, x, y, factorX, factorY, alpha);
958 #else
959  return UI_IMAGE_DRAWING_drawScaledNearestNeighbor(gc, img, x, y, factorX, factorY, alpha);
960 #endif
961 }
962 
963 // See the header file for the function documentation
964 BSP_DECLARE_WEAK_FCNT DRAWING_Status UI_DRAWING_DEFAULT_drawScaledImageBilinear(MICROUI_GraphicsContext* gc, MICROUI_Image* img, jint x, jint y, jfloat factorX, jfloat factorY, jint alpha){
965 #if !defined(LLUI_IMAGE_CUSTOM_FORMATS)
966  return DW_DRAWING_SOFT_drawScaledImageBilinear(gc, img, x, y, factorX, factorY, alpha);
967 #else
968  return UI_IMAGE_DRAWING_drawScaledBilinear(gc, img, x, y, factorX, factorY, alpha);
969 #endif
970 }
971 
972 #if defined(LLUI_GC_SUPPORTED_FORMATS) && (LLUI_GC_SUPPORTED_FORMATS > 1)
973 
974 /*
975  * The VEE port supports several destination formats. All drawing functions use a
976  * dedicated table to redirect to the right implementation. The VEE Port must implement
977  * the functions UI_DRAWING_is_drawer_X() to identify the right drawer according to
978  * the destination format.
979  *
980  * The "DEFAULT" functions (see above) are used as element "0" of the tables (== display
981  * buffer format).
982  */
983 
984 // See the header file for the function documentation
985 DRAWING_Status UI_DRAWING_writePixel(MICROUI_GraphicsContext* gc, jint x, jint y){
986  return (*UI_DRAWER_writePixel[gc->drawer])(gc, x, y);
987 }
988 
989 // See the header file for the function documentation
990 DRAWING_Status UI_DRAWING_drawLine(MICROUI_GraphicsContext* gc, jint startX, jint startY, jint endX, jint endY){
991  return (*UI_DRAWER_drawLine[gc->drawer])(gc, startX, startY, endX, endY);
992 }
993 
994 // See the header file for the function documentation
995 DRAWING_Status UI_DRAWING_drawHorizontalLine(MICROUI_GraphicsContext* gc, jint x1, jint x2, jint y){
996  return (*UI_DRAWER_drawHorizontalLine[gc->drawer])(gc, x1, x2, y);
997 }
998 
999 // See the header file for the function documentation
1000 DRAWING_Status UI_DRAWING_drawVerticalLine(MICROUI_GraphicsContext* gc, jint x, jint y1, jint y2){
1001  return (*UI_DRAWER_drawVerticalLine[gc->drawer])(gc, x, y1, y2);
1002 }
1003 
1004 // See the header file for the function documentation
1005 DRAWING_Status UI_DRAWING_drawRectangle(MICROUI_GraphicsContext* gc, jint x1, jint y1, jint x2, jint y2){
1006  return (*UI_DRAWER_drawRectangle[gc->drawer])(gc, x1, y1, x2, y2);
1007 }
1008 
1009 // See the header file for the function documentation
1010 DRAWING_Status UI_DRAWING_fillRectangle(MICROUI_GraphicsContext* gc, jint x1, jint y1, jint x2, jint y2){
1011  return (*UI_DRAWER_fillRectangle[gc->drawer])(gc, x1, y1, x2, y2);
1012 }
1013 
1014 // See the header file for the function documentation
1015 DRAWING_Status UI_DRAWING_drawRoundedRectangle(MICROUI_GraphicsContext* gc, jint x, jint y, jint width, jint height, jint cornerEllipseWidth, jint cornerEllipseHeight){
1016  return (*UI_DRAWER_drawRoundedRectangle[gc->drawer])(gc, x, y, width, height, cornerEllipseWidth, cornerEllipseHeight);
1017 }
1018 
1019 // See the header file for the function documentation
1020 DRAWING_Status UI_DRAWING_fillRoundedRectangle(MICROUI_GraphicsContext* gc, jint x, jint y, jint width, jint height, jint cornerEllipseWidth, jint cornerEllipseHeight){
1021  return (*UI_DRAWER_fillRoundedRectangle[gc->drawer])(gc, x, y, width, height, cornerEllipseWidth, cornerEllipseHeight);
1022 }
1023 
1024 // See the header file for the function documentation
1025 DRAWING_Status UI_DRAWING_drawCircleArc(MICROUI_GraphicsContext* gc, jint x, jint y, jint diameter, jfloat startAngle, jfloat arcAngle){
1026  return (*UI_DRAWER_drawCircleArc[gc->drawer])(gc, x, y, diameter, startAngle, arcAngle);
1027 }
1028 
1029 // See the header file for the function documentation
1030 DRAWING_Status UI_DRAWING_drawEllipseArc(MICROUI_GraphicsContext* gc, jint x, jint y, jint width, jint height, jfloat startAngle, jfloat arcAngle){
1031  return (*UI_DRAWER_drawEllipseArc[gc->drawer])(gc, x, y, width, height, startAngle, arcAngle);
1032 }
1033 
1034 // See the header file for the function documentation
1035 DRAWING_Status UI_DRAWING_fillCircleArc(MICROUI_GraphicsContext* gc, jint x, jint y, jint diameter, jfloat startAngle, jfloat arcAngle){
1036  return (*UI_DRAWER_fillCircleArc[gc->drawer])(gc, x, y, diameter, startAngle, arcAngle);
1037 }
1038 
1039 // See the header file for the function documentation
1040 DRAWING_Status UI_DRAWING_fillEllipseArc(MICROUI_GraphicsContext* gc, jint x, jint y, jint width, jint height, jfloat startAngle, jfloat arcAngle){
1041  return (*UI_DRAWER_fillEllipseArc[gc->drawer])(gc, x, y, width, height, startAngle, arcAngle);
1042 }
1043 
1044 // See the header file for the function documentation
1045 DRAWING_Status UI_DRAWING_drawEllipse(MICROUI_GraphicsContext* gc, jint x, jint y, jint width, jint height){
1046  return (*UI_DRAWER_drawEllipse[gc->drawer])(gc, x, y, width, height);
1047 }
1048 
1049 // See the header file for the function documentation
1050 DRAWING_Status UI_DRAWING_fillEllipse(MICROUI_GraphicsContext* gc, jint x, jint y, jint width, jint height){
1051  return (*UI_DRAWER_fillEllipse[gc->drawer])(gc, x, y, width, height);
1052 }
1053 
1054 // See the header file for the function documentation
1055 DRAWING_Status UI_DRAWING_drawCircle(MICROUI_GraphicsContext* gc, jint x, jint y, jint diameter){
1056  return (*UI_DRAWER_drawCircle[gc->drawer])(gc, x, y, diameter);
1057 }
1058 
1059 // See the header file for the function documentation
1060 DRAWING_Status UI_DRAWING_fillCircle(MICROUI_GraphicsContext* gc, jint x, jint y, jint diameter){
1061  return (*UI_DRAWER_fillCircle[gc->drawer])(gc, x, y, diameter);
1062 }
1063 
1064 // See the header file for the function documentation
1065 DRAWING_Status UI_DRAWING_drawImage(MICROUI_GraphicsContext* gc, MICROUI_Image* img, jint regionX, jint regionY, jint width, jint height, jint x, jint y, jint alpha){
1066  return (*UI_DRAWER_drawImage[gc->drawer])(gc, img, regionX, regionY, width, height, x, y, alpha);
1067 }
1068 
1069 // See the header file for the function documentation
1070 DRAWING_Status UI_DRAWING_copyImage(MICROUI_GraphicsContext* gc, MICROUI_Image* img, jint regionX, jint regionY, jint width, jint height, jint x, jint y){
1071  return (*UI_DRAWER_copyImage[gc->drawer])(gc, img, regionX, regionY, width, height, x, y);
1072 }
1073 
1074 // See the header file for the function documentation
1075 DRAWING_Status UI_DRAWING_drawRegion(MICROUI_GraphicsContext* gc, jint regionX, jint regionY, jint width, jint height, jint x, jint y, jint alpha){
1076  return (*UI_DRAWER_drawRegion[gc->drawer])(gc, regionX, regionY, width, height, x, y, alpha);
1077 }
1078 
1079 // See the header file for the function documentation
1080 DRAWING_Status UI_DRAWING_drawThickFadedPoint(MICROUI_GraphicsContext* gc, jint x, jint y, jint thickness, jint fade){
1081  return (*UI_DRAWER_drawThickFadedPoint[gc->drawer])(gc, x, y, thickness, fade);
1082 }
1083 
1084 // See the header file for the function documentation
1085 DRAWING_Status UI_DRAWING_drawThickFadedLine(MICROUI_GraphicsContext* gc, jint startX, jint startY, jint endX, jint endY, jint thickness, jint fade, DRAWING_Cap startCap, DRAWING_Cap endCap){
1086  return (*UI_DRAWER_drawThickFadedLine[gc->drawer])(gc, startX, startY, endX, endY, thickness, fade, startCap, endCap);
1087 }
1088 
1089 // See the header file for the function documentation
1090 DRAWING_Status UI_DRAWING_drawThickFadedCircle(MICROUI_GraphicsContext* gc, jint x, jint y, jint diameter, jint thickness, jint fade){
1091  return (*UI_DRAWER_drawThickFadedCircle[gc->drawer])(gc, x, y, diameter, thickness, fade);
1092 }
1093 
1094 // See the header file for the function documentation
1095 DRAWING_Status UI_DRAWING_drawThickFadedCircleArc(MICROUI_GraphicsContext* gc, jint x, jint y, jint diameter, jfloat startAngle, jfloat arcAngle, jint thickness, jint fade, DRAWING_Cap start, DRAWING_Cap end){
1096  return (*UI_DRAWER_drawThickFadedCircleArc[gc->drawer])(gc, x, y, diameter, startAngle, arcAngle, thickness, fade, start, end);
1097 }
1098 
1099 // See the header file for the function documentation
1100 DRAWING_Status UI_DRAWING_drawThickFadedEllipse(MICROUI_GraphicsContext* gc, jint x, jint y, jint width, jint height, jint thickness, jint fade){
1101  return (*UI_DRAWER_drawThickFadedEllipse[gc->drawer])(gc, x, y, width, height, thickness, fade);
1102 }
1103 
1104 // See the header file for the function documentation
1105 DRAWING_Status UI_DRAWING_drawThickLine(MICROUI_GraphicsContext* gc, jint startX, jint startY, jint endX, jint endY, jint thickness){
1106  return (*UI_DRAWER_drawThickLine[gc->drawer])(gc, startX, startY, endX, endY, thickness);
1107 }
1108 
1109 // See the header file for the function documentation
1110 DRAWING_Status UI_DRAWING_drawThickCircle(MICROUI_GraphicsContext* gc, jint x, jint y, jint diameter, jint thickness){
1111  return (*UI_DRAWER_drawThickCircle[gc->drawer])(gc, x, y, diameter, thickness);
1112 }
1113 
1114 // See the header file for the function documentation
1115 DRAWING_Status UI_DRAWING_drawThickEllipse(MICROUI_GraphicsContext* gc, jint x, jint y, jint width, jint height, jint thickness){
1116  return (*UI_DRAWER_drawThickEllipse[gc->drawer])(gc, x, y, width, height, thickness);
1117 }
1118 
1119 // See the header file for the function documentation
1120 DRAWING_Status UI_DRAWING_drawThickCircleArc(MICROUI_GraphicsContext* gc, jint x, jint y, jint diameter, jfloat startAngle, jfloat arcAngle, jint thickness){
1121  return (*UI_DRAWER_drawThickCircleArc[gc->drawer])(gc, x, y, diameter, startAngle, arcAngle, thickness);
1122 }
1123 
1124 // See the header file for the function documentation
1125 DRAWING_Status UI_DRAWING_drawFlippedImage(MICROUI_GraphicsContext* gc, MICROUI_Image* img, jint regionX, jint regionY, jint width, jint height, jint x, jint y, DRAWING_Flip transformation, jint alpha){
1126  return (*UI_DRAWER_drawFlippedImage[gc->drawer])(gc, img, regionX, regionY, width, height, x, y, transformation, alpha);
1127 }
1128 
1129 // See the header file for the function documentation
1130 DRAWING_Status UI_DRAWING_drawRotatedImageNearestNeighbor(MICROUI_GraphicsContext* gc, MICROUI_Image* img, jint x, jint y, jint rotationX, jint rotationY, jfloat angle, jint alpha){
1131  return (*UI_DRAWER_drawRotatedImageNearestNeighbor[gc->drawer])(gc, img, x, y, rotationX, rotationY, angle, alpha);
1132 }
1133 
1134 // See the header file for the function documentation
1135 DRAWING_Status UI_DRAWING_drawRotatedImageBilinear(MICROUI_GraphicsContext* gc, MICROUI_Image* img, jint x, jint y, jint rotationX, jint rotationY, jfloat angle, jint alpha){
1136  return (*UI_DRAWER_drawRotatedImageBilinear[gc->drawer])(gc, img, x, y, rotationX, rotationY, angle, alpha);
1137 }
1138 
1139 // See the header file for the function documentation
1140 DRAWING_Status UI_DRAWING_drawScaledImageNearestNeighbor(MICROUI_GraphicsContext* gc, MICROUI_Image* img, jint x, jint y, jfloat factorX, jfloat factorY, jint alpha){
1141  return (*UI_DRAWER_drawScaledImageNearestNeighbor[gc->drawer])(gc, img, x, y, factorX, factorY, alpha);
1142 }
1143 
1144 // See the header file for the function documentation
1145 DRAWING_Status UI_DRAWING_drawScaledImageBilinear(MICROUI_GraphicsContext* gc, MICROUI_Image* img, jint x, jint y, jfloat factorX, jfloat factorY, jint alpha){
1146  return (*UI_DRAWER_drawScaledImageBilinear[gc->drawer])(gc, img, x, y, factorX, factorY, alpha);
1147 }
1148 
1149 /*
1150  * The next functions are used as elements "1" of the tables. They call STUB fonctions and should be
1151  * overridden by the drawer that manages the format identified by the index "1".
1152  *
1153  * Only the functions UI_DRAWING_adjustNewImageCharacteristics_1() and UI_DRAWING_initializeNewImage_1()
1154  * are mandatory. If the drawing engine (for the format identified by the index "1") does not override these
1155  * functions, the application will not be able to open an image with the associated format (the default functions
1156  * are implemented as weak functions in case there is no drawing engine for this format).
1157  *
1158  * If no engine supports the format identified by the index "1", the application will not be able to open
1159  * an image with the associated format.
1160  */
1161 
1162 BSP_DECLARE_WEAK_FCNT bool UI_DRAWING_is_drawer_1(jbyte image_format) {
1163  (void)image_format;
1164  // default behavior: format is not supported
1165  return false;
1166 }
1167 
1168 // See the header file for the function documentation
1169 BSP_DECLARE_WEAK_FCNT uint32_t UI_DRAWING_getNewImageStrideInBytes_1(jbyte image_format, uint32_t width, uint32_t height, uint32_t default_stride){
1170  (void)image_format;
1171  (void)width;
1172  (void)height;
1173  // does nothing and will throw an error if the application tries to open this kind of image.
1174  // see above.
1175  return default_stride;
1176 }
1177 
1178 // See the header file for the function documentation
1179 BSP_DECLARE_WEAK_FCNT void UI_DRAWING_adjustNewImageCharacteristics_1(jbyte image_format, uint32_t width, uint32_t height, uint32_t* data_size, uint32_t* data_alignment){
1180  (void)image_format;
1181  (void)width;
1182  (void)height;
1183  (void)data_size;
1184  (void)data_alignment;
1185  // does nothing and will throw an error if the application tries to open this kind of image.
1186  // see above.
1187 }
1188 
1189 // See the header file for the function documentation
1190 BSP_DECLARE_WEAK_FCNT void UI_DRAWING_initializeNewImage_1(MICROUI_Image* image){
1191  (void)image;
1192  // nothing to do
1193 }
1194 
1195 // See the header file for the function documentation
1196 BSP_DECLARE_WEAK_FCNT DRAWING_Status UI_DRAWING_writePixel_1(MICROUI_GraphicsContext* gc, jint x, jint y){
1197  return UI_DRAWING_STUB_writePixel(gc, x, y);
1198 }
1199 
1200 // See the header file for the function documentation
1201 BSP_DECLARE_WEAK_FCNT DRAWING_Status UI_DRAWING_drawLine_1(MICROUI_GraphicsContext* gc, jint startX, jint startY, jint endX, jint endY){
1202  return UI_DRAWING_STUB_drawLine(gc, startX, startY, endX, endY);
1203 }
1204 
1205 // See the header file for the function documentation
1206 BSP_DECLARE_WEAK_FCNT DRAWING_Status UI_DRAWING_drawHorizontalLine_1(MICROUI_GraphicsContext* gc, jint x1, jint x2, jint y){
1207  return UI_DRAWING_STUB_drawHorizontalLine(gc, x1, x2, y);
1208 }
1209 
1210 // See the header file for the function documentation
1211 BSP_DECLARE_WEAK_FCNT DRAWING_Status UI_DRAWING_drawVerticalLine_1(MICROUI_GraphicsContext* gc, jint x, jint y1, jint y2){
1212  return UI_DRAWING_STUB_drawVerticalLine(gc, x, y1, y2);
1213 }
1214 
1215 // See the header file for the function documentation
1216 BSP_DECLARE_WEAK_FCNT DRAWING_Status UI_DRAWING_drawRectangle_1(MICROUI_GraphicsContext* gc, jint x1, jint y1, jint x2, jint y2){
1217  return UI_DRAWING_STUB_drawRectangle(gc, x1, y1, x2, y2);
1218 }
1219 
1220 // See the header file for the function documentation
1221 BSP_DECLARE_WEAK_FCNT DRAWING_Status UI_DRAWING_fillRectangle_1(MICROUI_GraphicsContext* gc, jint x1, jint y1, jint x2, jint y2){
1222  return UI_DRAWING_STUB_fillRectangle(gc, x1, y1, x2, y2);
1223 }
1224 
1225 // See the header file for the function documentation
1226 BSP_DECLARE_WEAK_FCNT DRAWING_Status UI_DRAWING_drawRoundedRectangle_1(MICROUI_GraphicsContext* gc, jint x, jint y, jint width, jint height, jint cornerEllipseWidth, jint cornerEllipseHeight){
1227  return UI_DRAWING_STUB_drawRoundedRectangle(gc, x, y, width, height, cornerEllipseWidth, cornerEllipseHeight);
1228 }
1229 
1230 // See the header file for the function documentation
1231 BSP_DECLARE_WEAK_FCNT DRAWING_Status UI_DRAWING_fillRoundedRectangle_1(MICROUI_GraphicsContext* gc, jint x, jint y, jint width, jint height, jint cornerEllipseWidth, jint cornerEllipseHeight){
1232  return UI_DRAWING_STUB_fillRoundedRectangle(gc, x, y, width, height, cornerEllipseWidth, cornerEllipseHeight);
1233 }
1234 
1235 // See the header file for the function documentation
1236 BSP_DECLARE_WEAK_FCNT DRAWING_Status UI_DRAWING_drawCircleArc_1(MICROUI_GraphicsContext* gc, jint x, jint y, jint diameter, jfloat startAngle, jfloat arcAngle){
1237  return UI_DRAWING_STUB_drawCircleArc(gc, x, y, diameter, startAngle, arcAngle);
1238 }
1239 
1240 // See the header file for the function documentation
1241 BSP_DECLARE_WEAK_FCNT DRAWING_Status UI_DRAWING_drawEllipseArc_1(MICROUI_GraphicsContext* gc, jint x, jint y, jint width, jint height, jfloat startAngle, jfloat arcAngle){
1242  return UI_DRAWING_STUB_drawEllipseArc(gc, x, y, width, height, startAngle, arcAngle);
1243 }
1244 
1245 // See the header file for the function documentation
1246 BSP_DECLARE_WEAK_FCNT DRAWING_Status UI_DRAWING_fillCircleArc_1(MICROUI_GraphicsContext* gc, jint x, jint y, jint diameter, jfloat startAngle, jfloat arcAngle){
1247  return UI_DRAWING_STUB_fillCircleArc(gc, x, y, diameter, startAngle, arcAngle);
1248 }
1249 
1250 // See the header file for the function documentation
1251 BSP_DECLARE_WEAK_FCNT DRAWING_Status UI_DRAWING_fillEllipseArc_1(MICROUI_GraphicsContext* gc, jint x, jint y, jint width, jint height, jfloat startAngle, jfloat arcAngle){
1252  return UI_DRAWING_STUB_fillEllipseArc(gc, x, y, width, height, startAngle, arcAngle);
1253 }
1254 
1255 // See the header file for the function documentation
1256 BSP_DECLARE_WEAK_FCNT DRAWING_Status UI_DRAWING_drawEllipse_1(MICROUI_GraphicsContext* gc, jint x, jint y, jint width, jint height){
1257  return UI_DRAWING_STUB_drawEllipse(gc, x, y, width, height);
1258 }
1259 
1260 // See the header file for the function documentation
1261 BSP_DECLARE_WEAK_FCNT DRAWING_Status UI_DRAWING_fillEllipse_1(MICROUI_GraphicsContext* gc, jint x, jint y, jint width, jint height){
1262  return UI_DRAWING_STUB_fillEllipse(gc, x, y, width, height);
1263 }
1264 
1265 // See the header file for the function documentation
1266 BSP_DECLARE_WEAK_FCNT DRAWING_Status UI_DRAWING_drawCircle_1(MICROUI_GraphicsContext* gc, jint x, jint y, jint diameter){
1267  return UI_DRAWING_STUB_drawCircle(gc, x, y, diameter);
1268 }
1269 
1270 // See the header file for the function documentation
1271 BSP_DECLARE_WEAK_FCNT DRAWING_Status UI_DRAWING_fillCircle_1(MICROUI_GraphicsContext* gc, jint x, jint y, jint diameter){
1272  return UI_DRAWING_STUB_fillCircle(gc, x, y, diameter);
1273 }
1274 
1275 // See the header file for the function documentation
1276 BSP_DECLARE_WEAK_FCNT DRAWING_Status UI_DRAWING_drawImage_1(MICROUI_GraphicsContext* gc, MICROUI_Image* img, jint regionX, jint regionY, jint width, jint height, jint x, jint y, jint alpha){
1277  return UI_IMAGE_DRAWING_draw(gc, img, regionX, regionY, width, height, x, y, alpha);
1278 }
1279 
1280 // See the header file for the function documentation
1281 BSP_DECLARE_WEAK_FCNT DRAWING_Status UI_DRAWING_copyImage_1(MICROUI_GraphicsContext* gc, MICROUI_Image* img, jint regionX, jint regionY, jint width, jint height, jint x, jint y){
1282  return UI_IMAGE_DRAWING_copy(gc, img, regionX, regionY, width, height, x, y);
1283 }
1284 
1285 // See the header file for the function documentation
1286 BSP_DECLARE_WEAK_FCNT DRAWING_Status UI_DRAWING_drawRegion_1(MICROUI_GraphicsContext* gc, jint regionX, jint regionY, jint width, jint height, jint x, jint y, jint alpha){
1287  return UI_IMAGE_DRAWING_drawRegion(gc, regionX, regionY, width, height, x, y, alpha);
1288 }
1289 
1290 // See the header file for the function documentation
1291 BSP_DECLARE_WEAK_FCNT DRAWING_Status UI_DRAWING_drawThickFadedPoint_1(MICROUI_GraphicsContext* gc, jint x, jint y, jint thickness, jint fade){
1292  return UI_DRAWING_STUB_drawThickFadedPoint(gc, x, y, thickness, fade);
1293 }
1294 
1295 // See the header file for the function documentation
1296 BSP_DECLARE_WEAK_FCNT DRAWING_Status UI_DRAWING_drawThickFadedLine_1(MICROUI_GraphicsContext* gc, jint startX, jint startY, jint endX, jint endY, jint thickness, jint fade, DRAWING_Cap startCap, DRAWING_Cap endCap){
1297  return UI_DRAWING_STUB_drawThickFadedLine(gc, startX, startY, endX, endY, thickness, fade, startCap, endCap);
1298 }
1299 
1300 // See the header file for the function documentation
1301 BSP_DECLARE_WEAK_FCNT DRAWING_Status UI_DRAWING_drawThickFadedCircle_1(MICROUI_GraphicsContext* gc, jint x, jint y, jint diameter, jint thickness, jint fade){
1302  return UI_DRAWING_STUB_drawThickFadedCircle(gc, x, y, diameter, thickness, fade);
1303 }
1304 
1305 // See the header file for the function documentation
1306 BSP_DECLARE_WEAK_FCNT DRAWING_Status UI_DRAWING_drawThickFadedCircleArc_1(MICROUI_GraphicsContext* gc, jint x, jint y, jint diameter, jfloat startAngle, jfloat arcAngle, jint thickness, jint fade, DRAWING_Cap start, DRAWING_Cap end){
1307  return UI_DRAWING_STUB_drawThickFadedCircleArc(gc, x, y, diameter, startAngle, arcAngle, thickness, fade, start, end);
1308 }
1309 
1310 // See the header file for the function documentation
1311 BSP_DECLARE_WEAK_FCNT DRAWING_Status UI_DRAWING_drawThickFadedEllipse_1(MICROUI_GraphicsContext* gc, jint x, jint y, jint width, jint height, jint thickness, jint fade){
1312  return UI_DRAWING_STUB_drawThickFadedEllipse(gc, x, y, width, height, thickness, fade);
1313 }
1314 
1315 // See the header file for the function documentation
1316 BSP_DECLARE_WEAK_FCNT DRAWING_Status UI_DRAWING_drawThickLine_1(MICROUI_GraphicsContext* gc, jint startX, jint startY, jint endX, jint endY, jint thickness){
1317  return UI_DRAWING_STUB_drawThickLine(gc, startX, startY, endX, endY, thickness);
1318 }
1319 
1320 // See the header file for the function documentation
1321 BSP_DECLARE_WEAK_FCNT DRAWING_Status UI_DRAWING_drawThickCircle_1(MICROUI_GraphicsContext* gc, jint x, jint y, jint diameter, jint thickness){
1322  return UI_DRAWING_STUB_drawThickCircle(gc, x, y, diameter, thickness);
1323 }
1324 
1325 // See the header file for the function documentation
1326 BSP_DECLARE_WEAK_FCNT DRAWING_Status UI_DRAWING_drawThickEllipse_1(MICROUI_GraphicsContext* gc, jint x, jint y, jint width, jint height, jint thickness){
1327  return UI_DRAWING_STUB_drawThickEllipse(gc, x, y, width, height, thickness);
1328 }
1329 
1330 // See the header file for the function documentation
1331 BSP_DECLARE_WEAK_FCNT DRAWING_Status UI_DRAWING_drawThickCircleArc_1(MICROUI_GraphicsContext* gc, jint x, jint y, jint diameter, jfloat startAngle, jfloat arcAngle, jint thickness){
1332  return UI_DRAWING_STUB_drawThickCircleArc(gc, x, y, diameter, startAngle, arcAngle, thickness);
1333 }
1334 
1335 // See the header file for the function documentation
1336 BSP_DECLARE_WEAK_FCNT DRAWING_Status UI_DRAWING_drawFlippedImage_1(MICROUI_GraphicsContext* gc, MICROUI_Image* img, jint regionX, jint regionY, jint width, jint height, jint x, jint y, DRAWING_Flip transformation, jint alpha){
1337  return UI_IMAGE_DRAWING_drawFlipped(gc, img, regionX, regionY, width, height, x, y, transformation, alpha);
1338 }
1339 
1340 // See the header file for the function documentation
1341 BSP_DECLARE_WEAK_FCNT DRAWING_Status UI_DRAWING_drawRotatedImageNearestNeighbor_1(MICROUI_GraphicsContext* gc, MICROUI_Image* img, jint x, jint y, jint rotationX, jint rotationY, jfloat angle, jint alpha){
1342  return UI_IMAGE_DRAWING_drawRotatedNearestNeighbor(gc, img, x, y, rotationX, rotationY, angle, alpha);
1343 }
1344 
1345 // See the header file for the function documentation
1346 BSP_DECLARE_WEAK_FCNT DRAWING_Status UI_DRAWING_drawRotatedImageBilinear_1(MICROUI_GraphicsContext* gc, MICROUI_Image* img, jint x, jint y, jint rotationX, jint rotationY, jfloat angle, jint alpha){
1347  return UI_IMAGE_DRAWING_drawRotatedBilinear(gc, img, x, y, rotationX, rotationY, angle, alpha);
1348 }
1349 
1350 // See the header file for the function documentation
1351 BSP_DECLARE_WEAK_FCNT DRAWING_Status UI_DRAWING_drawScaledImageNearestNeighbor_1(MICROUI_GraphicsContext* gc, MICROUI_Image* img, jint x, jint y, jfloat factorX, jfloat factorY, jint alpha){
1352  return UI_IMAGE_DRAWING_drawScaledNearestNeighbor(gc, img, x, y, factorX, factorY, alpha);
1353 }
1354 
1355 // See the header file for the function documentation
1356 BSP_DECLARE_WEAK_FCNT DRAWING_Status UI_DRAWING_drawScaledImageBilinear_1(MICROUI_GraphicsContext* gc, MICROUI_Image* img, jint x, jint y, jfloat factorX, jfloat factorY, jint alpha){
1357  return UI_IMAGE_DRAWING_drawScaledBilinear(gc, img, x, y, factorX, factorY, alpha);
1358 }
1359 
1360 #if (LLUI_GC_SUPPORTED_FORMATS > 2)
1361 
1362 /*
1363  * The next functions are used as elements "2" of the tables. They call STUB fonctions and should be
1364  * overridden by the drawer that manages the format identified by the index "2".
1365  *
1366  * Only the functions UI_DRAWING_adjustNewImageCharacteristics_2() and UI_DRAWING_initializeNewImage_2()
1367  * are mandatory. If the drawing engine (for the format identified by the index "2") does not override these
1368  * functions, the application will not be able to open an image with the associated format (the default functions
1369  * are implemented as weak functions in case there is no drawing engine for this format).
1370  *
1371  * If no engine supports the format identified by the index "2", the application will not be able to open
1372  * an image with the associated format.
1373  */
1374 
1375 BSP_DECLARE_WEAK_FCNT bool UI_DRAWING_is_drawer_2(jbyte image_format) {
1376  (void)image_format;
1377  // default behavior: format is not supported
1378  return false;
1379 }
1380 
1381 // See the header file for the function documentation
1382 BSP_DECLARE_WEAK_FCNT uint32_t UI_DRAWING_getNewImageStrideInBytes_2(jbyte image_format, uint32_t width, uint32_t height, uint32_t default_stride){
1383  (void)image_format;
1384  (void)width;
1385  (void)height;
1386  // does nothing and will throw an error if the application tries to open this kind of image.
1387  // see above.
1388  return default_stride;
1389 }
1390 
1391 // See the header file for the function documentation
1392 BSP_DECLARE_WEAK_FCNT void UI_DRAWING_adjustNewImageCharacteristics_2(jbyte image_format, uint32_t width, uint32_t height, uint32_t* data_size, uint32_t* data_alignment){
1393  (void)image_format;
1394  (void)width;
1395  (void)height;
1396  (void)data_size;
1397  (void)data_alignment;
1398  // does nothing and will throw an error if the application tries to open this kind of image.
1399  // see above.
1400 }
1401 
1402 // See the header file for the function documentation
1403 BSP_DECLARE_WEAK_FCNT void UI_DRAWING_initializeNewImage_2(MICROUI_Image* image){
1404  (void)image;
1405  // nothing to do
1406 }
1407 
1408 // See the header file for the function documentation
1409 BSP_DECLARE_WEAK_FCNT DRAWING_Status UI_DRAWING_writePixel_2(MICROUI_GraphicsContext* gc, jint x, jint y){
1410  return UI_DRAWING_STUB_writePixel(gc, x, y);
1411 }
1412 
1413 // See the header file for the function documentation
1414 BSP_DECLARE_WEAK_FCNT DRAWING_Status UI_DRAWING_drawLine_2(MICROUI_GraphicsContext* gc, jint startX, jint startY, jint endX, jint endY){
1415  return UI_DRAWING_STUB_drawLine(gc, startX, startY, endX, endY);
1416 }
1417 
1418 // See the header file for the function documentation
1419 BSP_DECLARE_WEAK_FCNT DRAWING_Status UI_DRAWING_drawHorizontalLine_2(MICROUI_GraphicsContext* gc, jint x1, jint x2, jint y){
1420  return UI_DRAWING_STUB_drawHorizontalLine(gc, x1, x2, y);
1421 }
1422 
1423 // See the header file for the function documentation
1424 BSP_DECLARE_WEAK_FCNT DRAWING_Status UI_DRAWING_drawVerticalLine_2(MICROUI_GraphicsContext* gc, jint x, jint y1, jint y2){
1425  return UI_DRAWING_STUB_drawVerticalLine(gc, x, y1, y2);
1426 }
1427 
1428 // See the header file for the function documentation
1429 BSP_DECLARE_WEAK_FCNT DRAWING_Status UI_DRAWING_drawRectangle_2(MICROUI_GraphicsContext* gc, jint x1, jint y1, jint x2, jint y2){
1430  return UI_DRAWING_STUB_drawRectangle(gc, x1, y1, x2, y2);
1431 }
1432 
1433 // See the header file for the function documentation
1434 BSP_DECLARE_WEAK_FCNT DRAWING_Status UI_DRAWING_fillRectangle_2(MICROUI_GraphicsContext* gc, jint x1, jint y1, jint x2, jint y2){
1435  return UI_DRAWING_STUB_fillRectangle(gc, x1, y1, x2, y2);
1436 }
1437 
1438 // See the header file for the function documentation
1439 BSP_DECLARE_WEAK_FCNT DRAWING_Status UI_DRAWING_drawRoundedRectangle_2(MICROUI_GraphicsContext* gc, jint x, jint y, jint width, jint height, jint cornerEllipseWidth, jint cornerEllipseHeight){
1440  return UI_DRAWING_STUB_drawRoundedRectangle(gc, x, y, width, height, cornerEllipseWidth, cornerEllipseHeight);
1441 }
1442 
1443 // See the header file for the function documentation
1444 BSP_DECLARE_WEAK_FCNT DRAWING_Status UI_DRAWING_fillRoundedRectangle_2(MICROUI_GraphicsContext* gc, jint x, jint y, jint width, jint height, jint cornerEllipseWidth, jint cornerEllipseHeight){
1445  return UI_DRAWING_STUB_fillRoundedRectangle(gc, x, y, width, height, cornerEllipseWidth, cornerEllipseHeight);
1446 }
1447 
1448 // See the header file for the function documentation
1449 BSP_DECLARE_WEAK_FCNT DRAWING_Status UI_DRAWING_drawCircleArc_2(MICROUI_GraphicsContext* gc, jint x, jint y, jint diameter, jfloat startAngle, jfloat arcAngle){
1450  return UI_DRAWING_STUB_drawCircleArc(gc, x, y, diameter, startAngle, arcAngle);
1451 }
1452 
1453 // See the header file for the function documentation
1454 BSP_DECLARE_WEAK_FCNT DRAWING_Status UI_DRAWING_drawEllipseArc_2(MICROUI_GraphicsContext* gc, jint x, jint y, jint width, jint height, jfloat startAngle, jfloat arcAngle){
1455  return UI_DRAWING_STUB_drawEllipseArc(gc, x, y, width, height, startAngle, arcAngle);
1456 }
1457 
1458 // See the header file for the function documentation
1459 BSP_DECLARE_WEAK_FCNT DRAWING_Status UI_DRAWING_fillCircleArc_2(MICROUI_GraphicsContext* gc, jint x, jint y, jint diameter, jfloat startAngle, jfloat arcAngle){
1460  return UI_DRAWING_STUB_fillCircleArc(gc, x, y, diameter, startAngle, arcAngle);
1461 }
1462 
1463 // See the header file for the function documentation
1464 BSP_DECLARE_WEAK_FCNT DRAWING_Status UI_DRAWING_fillEllipseArc_2(MICROUI_GraphicsContext* gc, jint x, jint y, jint width, jint height, jfloat startAngle, jfloat arcAngle){
1465  return UI_DRAWING_STUB_fillEllipseArc(gc, x, y, width, height, startAngle, arcAngle);
1466 }
1467 
1468 // See the header file for the function documentation
1469 BSP_DECLARE_WEAK_FCNT DRAWING_Status UI_DRAWING_drawEllipse_2(MICROUI_GraphicsContext* gc, jint x, jint y, jint width, jint height){
1470  return UI_DRAWING_STUB_drawEllipse(gc, x, y, width, height);
1471 }
1472 
1473 // See the header file for the function documentation
1474 BSP_DECLARE_WEAK_FCNT DRAWING_Status UI_DRAWING_fillEllipse_2(MICROUI_GraphicsContext* gc, jint x, jint y, jint width, jint height){
1475  return UI_DRAWING_STUB_fillEllipse(gc, x, y, width, height);
1476 }
1477 
1478 // See the header file for the function documentation
1479 BSP_DECLARE_WEAK_FCNT DRAWING_Status UI_DRAWING_drawCircle_2(MICROUI_GraphicsContext* gc, jint x, jint y, jint diameter){
1480  return UI_DRAWING_STUB_drawCircle(gc, x, y, diameter);
1481 }
1482 
1483 // See the header file for the function documentation
1484 BSP_DECLARE_WEAK_FCNT DRAWING_Status UI_DRAWING_fillCircle_2(MICROUI_GraphicsContext* gc, jint x, jint y, jint diameter){
1485  return UI_DRAWING_STUB_fillCircle(gc, x, y, diameter);
1486 }
1487 
1488 // See the header file for the function documentation
1489 BSP_DECLARE_WEAK_FCNT DRAWING_Status UI_DRAWING_drawImage_2(MICROUI_GraphicsContext* gc, MICROUI_Image* img, jint regionX, jint regionY, jint width, jint height, jint x, jint y, jint alpha){
1490  return UI_IMAGE_DRAWING_draw(gc, img, regionX, regionY, width, height, x, y, alpha);
1491 }
1492 
1493 // See the header file for the function documentation
1494 BSP_DECLARE_WEAK_FCNT DRAWING_Status UI_DRAWING_copyImage_2(MICROUI_GraphicsContext* gc, MICROUI_Image* img, jint regionX, jint regionY, jint width, jint height, jint x, jint y){
1495  return UI_IMAGE_DRAWING_copy(gc, img, regionX, regionY, width, height, x, y);
1496 }
1497 
1498 // See the header file for the function documentation
1499 BSP_DECLARE_WEAK_FCNT DRAWING_Status UI_DRAWING_drawRegion_2(MICROUI_GraphicsContext* gc, jint regionX, jint regionY, jint width, jint height, jint x, jint y, jint alpha){
1500  return UI_IMAGE_DRAWING_drawRegion(gc, regionX, regionY, width, height, x, y, alpha);
1501 }
1502 
1503 // See the header file for the function documentation
1504 BSP_DECLARE_WEAK_FCNT DRAWING_Status UI_DRAWING_drawThickFadedPoint_2(MICROUI_GraphicsContext* gc, jint x, jint y, jint thickness, jint fade){
1505  return UI_DRAWING_STUB_drawThickFadedPoint(gc, x, y, thickness, fade);
1506 }
1507 
1508 // See the header file for the function documentation
1509 BSP_DECLARE_WEAK_FCNT DRAWING_Status UI_DRAWING_drawThickFadedLine_2(MICROUI_GraphicsContext* gc, jint startX, jint startY, jint endX, jint endY, jint thickness, jint fade, DRAWING_Cap startCap, DRAWING_Cap endCap){
1510  return UI_DRAWING_STUB_drawThickFadedLine(gc, startX, startY, endX, endY, thickness, fade, startCap, endCap);
1511 }
1512 
1513 // See the header file for the function documentation
1514 BSP_DECLARE_WEAK_FCNT DRAWING_Status UI_DRAWING_drawThickFadedCircle_2(MICROUI_GraphicsContext* gc, jint x, jint y, jint diameter, jint thickness, jint fade){
1515  return UI_DRAWING_STUB_drawThickFadedCircle(gc, x, y, diameter, thickness, fade);
1516 }
1517 
1518 // See the header file for the function documentation
1519 BSP_DECLARE_WEAK_FCNT DRAWING_Status UI_DRAWING_drawThickFadedCircleArc_2(MICROUI_GraphicsContext* gc, jint x, jint y, jint diameter, jfloat startAngle, jfloat arcAngle, jint thickness, jint fade, DRAWING_Cap start, DRAWING_Cap end){
1520  return UI_DRAWING_STUB_drawThickFadedCircleArc(gc, x, y, diameter, startAngle, arcAngle, thickness, fade, start, end);
1521 }
1522 
1523 // See the header file for the function documentation
1524 BSP_DECLARE_WEAK_FCNT DRAWING_Status UI_DRAWING_drawThickFadedEllipse_2(MICROUI_GraphicsContext* gc, jint x, jint y, jint width, jint height, jint thickness, jint fade){
1525  return UI_DRAWING_STUB_drawThickFadedEllipse(gc, x, y, width, height, thickness, fade);
1526 }
1527 
1528 // See the header file for the function documentation
1529 BSP_DECLARE_WEAK_FCNT DRAWING_Status UI_DRAWING_drawThickLine_2(MICROUI_GraphicsContext* gc, jint startX, jint startY, jint endX, jint endY, jint thickness){
1530  return UI_DRAWING_STUB_drawThickLine(gc, startX, startY, endX, endY, thickness);
1531 }
1532 
1533 // See the header file for the function documentation
1534 BSP_DECLARE_WEAK_FCNT DRAWING_Status UI_DRAWING_drawThickCircle_2(MICROUI_GraphicsContext* gc, jint x, jint y, jint diameter, jint thickness){
1535  return UI_DRAWING_STUB_drawThickCircle(gc, x, y, diameter, thickness);
1536 }
1537 
1538 // See the header file for the function documentation
1539 BSP_DECLARE_WEAK_FCNT DRAWING_Status UI_DRAWING_drawThickEllipse_2(MICROUI_GraphicsContext* gc, jint x, jint y, jint width, jint height, jint thickness){
1540  return UI_DRAWING_STUB_drawThickEllipse(gc, x, y, width, height, thickness);
1541 }
1542 
1543 // See the header file for the function documentation
1544 BSP_DECLARE_WEAK_FCNT DRAWING_Status UI_DRAWING_drawThickCircleArc_2(MICROUI_GraphicsContext* gc, jint x, jint y, jint diameter, jfloat startAngle, jfloat arcAngle, jint thickness){
1545  return UI_DRAWING_STUB_drawThickCircleArc(gc, x, y, diameter, startAngle, arcAngle, thickness);
1546 }
1547 
1548 // See the header file for the function documentation
1549 BSP_DECLARE_WEAK_FCNT DRAWING_Status UI_DRAWING_drawFlippedImage_2(MICROUI_GraphicsContext* gc, MICROUI_Image* img, jint regionX, jint regionY, jint width, jint height, jint x, jint y, DRAWING_Flip transformation, jint alpha){
1550  return UI_IMAGE_DRAWING_drawFlipped(gc, img, regionX, regionY, width, height, x, y, transformation, alpha);
1551 }
1552 
1553 // See the header file for the function documentation
1554 BSP_DECLARE_WEAK_FCNT DRAWING_Status UI_DRAWING_drawRotatedImageNearestNeighbor_2(MICROUI_GraphicsContext* gc, MICROUI_Image* img, jint x, jint y, jint rotationX, jint rotationY, jfloat angle, jint alpha){
1555  return UI_IMAGE_DRAWING_drawRotatedNearestNeighbor(gc, img, x, y, rotationX, rotationY, angle, alpha);
1556 }
1557 
1558 // See the header file for the function documentation
1559 BSP_DECLARE_WEAK_FCNT DRAWING_Status UI_DRAWING_drawRotatedImageBilinear_2(MICROUI_GraphicsContext* gc, MICROUI_Image* img, jint x, jint y, jint rotationX, jint rotationY, jfloat angle, jint alpha){
1560  return UI_IMAGE_DRAWING_drawRotatedBilinear(gc, img, x, y, rotationX, rotationY, angle, alpha);
1561 }
1562 
1563 // See the header file for the function documentation
1564 BSP_DECLARE_WEAK_FCNT DRAWING_Status UI_DRAWING_drawScaledImageNearestNeighbor_2(MICROUI_GraphicsContext* gc, MICROUI_Image* img, jint x, jint y, jfloat factorX, jfloat factorY, jint alpha){
1565  return UI_IMAGE_DRAWING_drawScaledNearestNeighbor(gc, img, x, y, factorX, factorY, alpha);
1566 }
1567 
1568 // See the header file for the function documentation
1569 BSP_DECLARE_WEAK_FCNT DRAWING_Status UI_DRAWING_drawScaledImageBilinear_2(MICROUI_GraphicsContext* gc, MICROUI_Image* img, jint x, jint y, jfloat factorX, jfloat factorY, jint alpha){
1570  return UI_IMAGE_DRAWING_drawScaledBilinear(gc, img, x, y, factorX, factorY, alpha);
1571 }
1572 
1573 #endif // (LLUI_GC_SUPPORTED_FORMATS > 2)
1574 
1575 #else // #if defined(LLUI_GC_SUPPORTED_FORMATS) && (LLUI_GC_SUPPORTED_FORMATS > 1)
1576 
1577 /*
1578  * The VEE port supports only one destination format: the display buffer format. The
1579  * application can only create immutable images or mutable images with the same format as
1580  * the display buffer. All drawing functions are redirected to the software implementation
1581  * by default. A third party implementation (often on a GPU) can replace each weak function
1582  * independently.
1583  *
1584  * The VEE Port can tune the new image characteristics to add a header before the pixel
1585  * array for instance.
1586  */
1587 
1588 #endif // #if defined(LLUI_GC_SUPPORTED_FORMATS) && (LLUI_GC_SUPPORTED_FORMATS > 1)
1589 
1590 // -----------------------------------------------------------------------------
1591 // EOF
1592 // -----------------------------------------------------------------------------