microvg  3.0.1
microvg
vg_drawing_bvi.h
1 /*
2  * Copyright 2023 MicroEJ Corp. All rights reserved.
3  * Use of this source code is governed by a BSD-style license that can be found with this software.
4  */
5 
6 #if !defined VG_DRAWING_BVI_H
7 #define VG_DRAWING_BVI_H
8 #ifdef __cplusplus
9 extern "C" {
10 #endif
11 
12 /*
13  * @file
14  * @brief Implementation of a set of vg_drawing.h drawing functions (library MicroVG).
15  * These are implementations over a BufferedVectorImage and the destination buffer format
16  * is the BufferedVectorImage format. When the drawing cannot be performed for any reason,
17  * the stub implementation is used insted.
18  * @author MicroEJ Developer Team
19  * @version 3.0.1
20  * @see ui_drawing_bvi.h
21  */
22 
23 #include "microvg_configuration.h"
24 #if defined VG_FEATURE_BUFFERED_VECTOR_IMAGE
25 
26 // --------------------------------------------------------------------------------
27 // Includes
28 // --------------------------------------------------------------------------------
29 
30 #include <LLVG_BVI_impl.h>
31 
32 #include "vg_drawing.h"
33 #include "ui_drawing.h"
34 
35 // --------------------------------------------------------------------------------
36 // Defines
37 // --------------------------------------------------------------------------------
38 
39 /*
40  * @brief Redirects all vg_drawing.h functions to the BufferedVectorImage functions
41  */
42 #define VG_DRAWING_BVI_drawPath CONCAT(VG_DRAWING_drawPath_, UI_DRAWING_IDENTIFIER_BVI_FORMAT)
43 #define VG_DRAWING_BVI_drawGradient CONCAT(VG_DRAWING_drawGradient_, UI_DRAWING_IDENTIFIER_BVI_FORMAT)
44 #define VG_DRAWING_BVI_drawString CONCAT(VG_DRAWING_drawString_, UI_DRAWING_IDENTIFIER_BVI_FORMAT)
45 #define VG_DRAWING_BVI_drawStringGradient CONCAT(VG_DRAWING_drawStringGradient_, UI_DRAWING_IDENTIFIER_BVI_FORMAT)
46 #define VG_DRAWING_BVI_drawStringOnCircle CONCAT(VG_DRAWING_drawStringOnCircle_, UI_DRAWING_IDENTIFIER_BVI_FORMAT)
47 #define VG_DRAWING_BVI_drawStringOnCircleGradient CONCAT(VG_DRAWING_drawStringOnCircleGradient_, UI_DRAWING_IDENTIFIER_BVI_FORMAT)
48 #define VG_DRAWING_BVI_drawImage CONCAT(VG_DRAWING_drawImage_, UI_DRAWING_IDENTIFIER_BVI_FORMAT)
49 
50 // --------------------------------------------------------------------------------
51 // vg_drawing.h API
52 // (the function names differ according to the available number of destination formats)
53 // --------------------------------------------------------------------------------
54 
55 /*
56  * @brief Implementation of drawPath over a BufferedVectorImage. See vg_drawing.h
57  */
58 DRAWING_Status VG_DRAWING_BVI_drawPath(MICROUI_GraphicsContext* gc, jbyte* path, jint x, jint y, jfloat* matrix, jint fillRule, jint blend, jint color);
59 
60 /*
61  * @brief Implementation of drawGradient over a BufferedVectorImage. See vg_drawing.h
62  */
63 DRAWING_Status VG_DRAWING_BVI_drawGradient(MICROUI_GraphicsContext* gc, jbyte* path, jint x, jint y, jfloat* matrix, jint fillRule, jint alpha, jint blend, jint* gradient, jfloat* gradientMatrix);
64 
65 /*
66  * @brief Implementation of drawString over a BufferedVectorImage. See vg_drawing.h
67  */
68 DRAWING_Status VG_DRAWING_BVI_drawString(MICROUI_GraphicsContext* gc, jchar* text, jint faceHandle, jfloat size, jfloat x, jfloat y, jfloat* matrix, jint alpha, jint blend, jfloat letterSpacing);
69 
70 /*
71  * @brief Implementation of drawStringGradient over a BufferedVectorImage. See vg_drawing.h
72  */
73 DRAWING_Status VG_DRAWING_BVI_drawStringGradient(MICROUI_GraphicsContext* gc, jchar* text, jint faceHandle, jfloat size, jfloat x, jfloat y, jfloat* matrix, jint alpha, jint blend, jfloat letterSpacing, jint *gradientData, jfloat *gradientMatrix);
74 
75 /*
76  * @brief Implementation of drawStringOnCircle over a BufferedVectorImage. See vg_drawing.h
77  */
78 DRAWING_Status VG_DRAWING_BVI_drawStringOnCircle(MICROUI_GraphicsContext* gc, jchar* text, jint faceHandle, jfloat size, jint x, jint y, jfloat* matrix, jint alpha, jint blend, jfloat letterSpacing, jfloat radius, jint direction);
79 
80 /*
81  * @brief Implementation of drawStringOnCircleGradient over a BufferedVectorImage. See vg_drawing.h
82  */
83 DRAWING_Status VG_DRAWING_BVI_drawStringOnCircleGradient(MICROUI_GraphicsContext* gc, jchar* text, jint faceHandle, jfloat size, jint x, jint y, jfloat* matrix, jint alpha, jint blend, jfloat letterSpacing, jfloat radius, jint direction, jint *gradientData, jfloat *gradientMatrix);
84 
85 /*
86  * @brief Implementation of drawImage over a BufferedVectorImage. See vg_drawing.h
87  */
88 DRAWING_Status VG_DRAWING_BVI_drawImage(MICROUI_GraphicsContext* gc, void* image, jfloat *matrix, jint alpha, jlong elapsed, const float color_matrix[], jint* errno);
89 
90 // --------------------------------------------------------------------------------
91 // EOF
92 // --------------------------------------------------------------------------------
93 
94 #endif // #if defined VG_FEATURE_BUFFERED_VECTOR_IMAGE
95 
96 #ifdef __cplusplus
97 }
98 #endif
99 #endif // VG_DRAWING_BVI_H
MicroEJ MicroVG library low level API: enable some features according to the hardware capacities...