18 #if !defined VG_HELPER_H
21 #if defined __cplusplus
42 #define VG_LOG_ERROR(fmt, ...) VG_LOG_ERROR_PRINT(fmt, ## __VA_ARGS__)
50 #if defined VG_LOG_INFO_ENABLED && (VG_LOG_INFO_ENABLED == 1)
51 #define VG_LOG_INFO(fmt, ...) VG_LOG_INFO_PRINT(fmt, ## __VA_ARGS__)
53 #define VG_LOG_INFO(fmt, ...)
59 #define MEJ_LOG_ERROR_MICROVG(fmt, ...) VG_LOG_ERROR(fmt, ## __VA_ARGS__)
64 #define MEJ_LOG_INFO_MICROVG(fmt, ...) VG_LOG_INFO(fmt, ## __VA_ARGS__)
75 #define VG_HELPER_NULL_GRADIENT 0
84 #define FT_FACE_FLAG_COMPLEX_LAYOUT (((uint32_t)1) << 31)
87 #define M_PI 3.1415926535
90 #define RAD_TO_DEG(r) ((r) * (180.0f / M_PI))
91 #define DEG_TO_RAD(d) (((d) * M_PI) / 180.0f)
93 #define JFLOAT_TO_UINT32_t(f) (*(uint32_t *)&(f))
94 #define UINT32_t_TO_JFLOAT(i) (*(float *)&(i))
99 #define REGISTERDESC(desc, buf, buf_len) if ((buf_len) >= sizeof(desc)) { (void)memcpy((buf), (desc), sizeof(desc)); }
MicroEJ MicroVG library low level API: enable some features according to the hardware capacities.
uint32_t VG_HELPER_apply_alpha(uint32_t color, uint32_t alpha)
Applies the global opacity on given color.
void VG_HELPER_layout_dispose(int faceHandle)
Releases the font layouter's state built from a font face, when that face is about to be freed....
void LLUI_DISPLAY_waitAsynchronousDrawingEnd(void)
Waits until the end of current asynchronous drawing.
void VG_HELPER_layout_stop(void)
Releases what the layouter still holds for the current iteration. Does nothing when there is nothing ...
void VG_HELPER_prepare_matrix(jfloat *dest, jfloat x, jfloat y, const jfloat *matrix)
Converts a MicroVG matrix in another MicroVG matrix applying a translation.
void VG_HELPER_layout_configure(int faceHandle, const unsigned short *text, int length)
Configures the font layouter with a font and a text.
const jfloat * VG_HELPER_check_matrix(const jfloat *matrix)
Checks if the matrix is null. In that case, returns an identity matrix. This allows to prevent to mak...
int VG_HELPER_get_utf(const unsigned short *text, int length, int *offset)
Gets the UTF character from a text buffer at the given offset and updates the offset to point to the ...
bool VG_HELPER_layout_load_glyph(uint32_t *glyph_idx, int *x_advance, int *y_advance, int *x_offset, int *y_offset)
Loads the next layouted glyph and gets index and positions.