59 return (int32_t)(((float)sx * t->
ua) + t->
ue);
90 return (int32_t)(((float)sy * t->
ud) + t->
uf);
120 return (t->
ub != 0.0F) || (t->
uc != 0.0F);
150 const int32_t px = (int32_t)(((
float)ux * t->
ua) + ((
float)uy * t->
uc) + t->
ue);
151 const int32_t py = (int32_t)(((
float)ux * t->
ub) + ((
float)uy * t->
ud) + t->
uf);
152 *fx = t->
bx + (int32_t)(((int64_t)(px - t->
vx) * (int64_t)t->
bw) / (int64_t)t->
vw);
153 *fy = t->
by + (int32_t)(((int64_t)(py - t->
vy) * (int64_t)t->
bh) / (int64_t)t->
vh);
185 return t->
bx + (int32_t)(((int64_t)(ux - t->
vx) * (int64_t)t->
bw) / (int64_t)t->
vw);
217 return t->
by + (int32_t)(((int64_t)(uy - t->
vy) * (int64_t)t->
bh) / (int64_t)t->
vh);
247 const int32_t uw = (int32_t)((
float)sw * t->
ua);
248 return (int32_t)(((int64_t)uw * (int64_t)t->
bw) / (int64_t)t->
vw);
282 while ((*i < len) && (
priv_ra8_svgp_ws((
char)s[*i]) || (s[*i] == (uint8_t)
','))) {
286 if ((*i < len) && ((s[*i] == (uint8_t)
'-') || (s[*i] == (uint8_t)
'+'))) {
287 sgn = (s[*i] == (uint8_t)
'-') ? -1.0F : 1.0F;
291 while ((*i < len) && (s[*i] >= (uint8_t)
'0') && (s[*i] <= (uint8_t)
'9')) {
292 v = (v * (float)
k_svg_dec) + ((
float)s[*i] - (
float)
'0');
295 if ((*i < len) && (s[*i] == (uint8_t)
'.')) {
298 while ((*i < len) && (s[*i] >= (uint8_t)
'0') && (s[*i] <= (uint8_t)
'9')) {
300 v += frac * ((float)s[*i] - (float)
'0');
333 svg_utf_t id = {.a = 1.0F, .b = 0.0F, .c = 0.0F, .d = 1.0F, .e = 0.0F, .f = 0.0F};
368 .b = (a.
b * b.a) + (a.
d * b.b),
369 .c = (a.
a * b.c) + (a.
c * b.d),
370 .d = (a.
b * b.c) + (a.
d * b.d),
371 .e = (a.
a * b.e) + (a.
c * b.f) + a.
e,
372 .f = (a.
b * b.e) + (a.
d * b.f) + a.
f};
410 const char c = (char)s[at];
411 return ((c >=
'0') && (c <=
'9')) || (c ==
'-') || (c ==
'+') || (c ==
'.');
418typedef enum : uint8_t {
432typedef enum : uint8_t {
467 static const float k_pi = 3.14159265F;
468 static const float k_deg_half = 180.0F;
469 return deg * (k_pi / k_deg_half);
507 while ((*j < vlen) && (
priv_ra8_svgp_ws((
char)v[*j]) || (v[*j] == (uint8_t)
','))) {
550 const float cx = (na >= 3) ? args[1] : 0.0F;
551 const float cy = (na >= 3) ? args[2] : 0.0F;
556 .e = (cx * (1.0F - co)) + (cy * si),
557 .f = (cy * (1.0F - co)) - (cx * si)};
598 .f = (na >= 2) ? args[1] : 0.0F};
604 .d = (na >= 2) ? args[1] : args[0],
734 while ((i < vlen) && (
priv_ra8_svgp_ws((
char)v[i]) || (v[i] == (uint8_t)
','))) {
739 while ((op < vlen) && (v[op] != (uint8_t)
'(')) {
751 while ((j < vlen) && (v[j] != (uint8_t)
')')) {
754 i = (j < vlen) ? (j + 1U) : vlen;
Annotation-attribute framework macros for ra8-firmware.
#define RA8_INTERNAL
Marker that a function is intended to be static (file-local).
bool priv_ra8_svgp_ws(char c)
Test whether a character is XML whitespace.
bool priv_ra8_svgp_attr(const uint8_t *s, size_t len, const char *name, size_t *voff, size_t *vlen)
Find attribute name in tag span s[0..len); return its value slice.
bool priv_ra8_svgp_starts_ci(const uint8_t *s, size_t len, size_t at, const char *lit)
Test whether a byte span starts with a literal at a given offset, case-insensitively.
Cross-TU surface for the split minimal-SVG subset (#112).
@ k_svg_path_args
Max args of a path command (A).
@ k_svg_argc_cube
Arg count of C.
A user transform= as a full 2x3 affine matrix.
float c
Row0 col1 (x shear).
float a
Row0 col0 (x scale).
float b
Row1 col0 (y shear).
float d
Row1 col1 (y scale).