microvg  6.0.1
microvg
vg_drawing_bvi.h
1 /*
2  * Copyright 2023-2024 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 6.0.1
20  * @see ui_drawing_bvi.h
21  */
22 
23 #include "vg_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_, \
48  UI_DRAWING_IDENTIFIER_BVI_FORMAT)
49 #define VG_DRAWING_BVI_drawImage CONCAT(VG_DRAWING_drawImage_, UI_DRAWING_IDENTIFIER_BVI_FORMAT)
50 
51 // --------------------------------------------------------------------------------
52 // vg_drawing.h API
53 // (the function names differ according to the available number of destination formats)
54 // --------------------------------------------------------------------------------
55 
56 /*
57  * @brief Implementation of drawPath over a BufferedVectorImage. See vg_drawing.h
58  */
59 DRAWING_Status VG_DRAWING_BVI_drawPath(MICROUI_GraphicsContext *gc, const jbyte *path, const jfloat *matrix,
60  jint fillRule, jint blend, jint color);
61 
62 /*
63  * @brief Implementation of drawGradient over a BufferedVectorImage. See vg_drawing.h
64  */
65 DRAWING_Status VG_DRAWING_BVI_drawGradient(MICROUI_GraphicsContext *gc, const jbyte *path, const jfloat *matrix,
66  jint fillRule, jint alpha, jint blend, const jint *gradient,
67  const jfloat *gradientMatrix);
68 
69 /*
70  * @brief Implementation of drawString over a BufferedVectorImage. See vg_drawing.h
71  */
72 DRAWING_Status VG_DRAWING_BVI_drawString(MICROUI_GraphicsContext *gc, const jchar *text, jint faceHandle, jfloat size,
73  const jfloat *matrix, jint alpha, jint blend, jfloat letterSpacing);
74 
75 /*
76  * @brief Implementation of drawStringGradient over a BufferedVectorImage. See vg_drawing.h
77  */
78 DRAWING_Status VG_DRAWING_BVI_drawStringGradient(MICROUI_GraphicsContext *gc, const jchar *text, jint faceHandle,
79  jfloat size, const jfloat *matrix, jint alpha, jint blend,
80  jfloat letterSpacing, const jint *gradientData,
81  const jfloat *gradientMatrix);
82 
83 /*
84  * @brief Implementation of drawStringOnCircle over a BufferedVectorImage. See vg_drawing.h
85  */
86 DRAWING_Status VG_DRAWING_BVI_drawStringOnCircle(MICROUI_GraphicsContext *gc, const jchar *text, jint faceHandle,
87  jfloat size, const jfloat *matrix, jint alpha, jint blend,
88  jfloat letterSpacing, jfloat radius, jint direction);
89 
90 /*
91  * @brief Implementation of drawStringOnCircleGradient over a BufferedVectorImage. See vg_drawing.h
92  */
93 DRAWING_Status VG_DRAWING_BVI_drawStringOnCircleGradient(MICROUI_GraphicsContext *gc, const jchar *text,
94  jint faceHandle, jfloat size, const jfloat *matrix, jint alpha,
95  jint blend, jfloat letterSpacing, jfloat radius,
96  jint direction, const jint *gradientData,
97  const jfloat *gradientMatrix);
98 
99 /*
100  * @brief Implementation of drawImage over a BufferedVectorImage. See vg_drawing.h
101  */
102 DRAWING_Status VG_DRAWING_BVI_drawImage(MICROUI_GraphicsContext *gc, const void *image, const jfloat *matrix,
103  jint alpha, jlong elapsed, const float color_matrix[], jint *errno);
104 
105 // --------------------------------------------------------------------------------
106 // EOF
107 // --------------------------------------------------------------------------------
108 
109 #endif // #if defined VG_FEATURE_BUFFERED_VECTOR_IMAGE
110 
111 #ifdef __cplusplus
112 }
113 #endif
114 #endif // VG_DRAWING_BVI_H
MicroEJ MicroVG library low level API: enable some features according to the hardware capacities.