|
ra8-firmware 0.1.0
Bare-metal firmware for the Renesas RA8 family (RA8D2 / RA8P1)
|
SVG shape rasterisers: rect / circle / line / polygon + fill + arc (#112). More...
Go to the source code of this file.
Data Structures | |
| struct | svg_arc_t |
| Centre-parametrisation of an SVG elliptical arc. More... | |
Functions | |
| void | priv_ra8_svgp_draw_rect (const uint8_t *s, size_t len, const svg_xform_t *t) |
| Draw one SVG 'rect' element using its fill colour or gradient. | |
| void | priv_ra8_svgp_draw_circle (const uint8_t *s, size_t len, const svg_xform_t *t) |
| Draw one SVG 'circle' element using its fill colour or gradient. | |
| void | priv_ra8_svgp_draw_line (const uint8_t *s, size_t len, const svg_xform_t *t) |
| Draw one SVG 'line' element using its stroke colour. | |
| static int32_t | internal_parse_points (const uint8_t *v, size_t vlen, const svg_xform_t *t, int32_t *xs, int32_t *ys) |
| Parse a 'points' attribute value into framebuffer-space vertices. | |
| static void | internal_sort_i32 (int32_t *a, int32_t m) |
Sort m int32 values in a into ascending order using insertion sort. | |
| static int32_t | internal_scanline_x (const int32_t *xs, const int32_t *ys, int32_t n, int32_t y, int32_t *xint) |
Collect framebuffer X coordinates where polygon edges cross scanline y. | |
| void | priv_ra8_svgp_fill_poly (const int32_t *xs, const int32_t *ys, int32_t n, uint32_t color) |
| Even-odd scanline fill of polygon (xs,ys)[0..n) with a solid colour. | |
| static uint32_t | internal_col_lerp (uint32_t a, uint32_t b, float f) |
Linear-interpolate two 0x00RRGGBB colours by factor f in [0, 1]. | |
| static uint32_t | internal_grad_eval (const svg_grad_t *g, float px, float py) |
Evaluate gradient g at bbox-relative point (px, py). | |
| void | priv_ra8_svgp_fill_poly_grad (const int32_t *xs, const int32_t *ys, int32_t n, const svg_grad_t *g) |
| Per-pixel gradient scanline fill of polygon (xs,ys)[0..n). | |
| void | priv_ra8_svgp_draw_polygon (const uint8_t *s, size_t len, const svg_xform_t *t) |
| Draw one SVG 'polygon' element as a filled polygon. | |
| void | priv_ra8_svgp_draw_polyline (const uint8_t *s, size_t len, const svg_xform_t *t) |
| Draw one SVG 'polyline' element as connected stroke line segments. | |
| static float | internal_absf (float v) |
Compute the absolute value of a float without using libm fabsf. | |
| static void | internal_arc_solve (svg_arc_t *a, float x1p, float y1p, float rx, float ry, float mx, float my, bool large, bool sweep) |
| Solve an arc's centre + start/sweep angles (F.6.5.2 / F.6.5.5-6). | |
| static svg_arc_t | internal_arc_center (svg_pt_t p0, svg_pt_t p_end, int32_t rx_in, int32_t ry_in, int32_t rot_deg, bool large, bool sweep) |
| Convert an SVG endpoint-parametrised arc to centre parametrisation. | |
| static int32_t | internal_arc_segs (float dt) |
Compute a bounded segment count for an arc of signed sweep dt. | |
| void | priv_ra8_svgp_flatten_arc (const svg_xform_t *t, svg_pt_t p0, const int32_t *args, svg_pt_t p_end, int32_t *xs, int32_t *ys, int32_t *n) |
| Flatten an SVG elliptical arc into the polygon vertex array. | |
Variables | |
| static const float | s_svg_2pi = 6.28318531F |
| 2*Pi, for wrapping an arc's signed sweep into range. | |
SVG shape rasterisers: rect / circle / line / polygon + fill + arc (#112).
The <rect>, <circle>, <line>, <polygon>, and <polyline> rasterisers, the even-odd scanline polygon fill (solid and per-pixel gradient), the gradient colour evaluator, and the elliptical-arc flatten (shared with the <path> A command). Axis-aligned shapes keep the ra8_gfx fast path; rotated / sheared shapes are mapped through the affine and scanline-filled. No DOM, no heap. See reflow_svg_internal.h for the shared geometry types and cross-TU helper contracts.
[Ring 4 / Reflow] {World: NS}
Definition in file reflow_svg_shape.c.
|
static |
Compute the absolute value of a float without using libm fabsf.
Returns -v when v is negative, otherwise returns v unchanged. Used in internal_arc_center and internal_arc_segs to avoid dragging in the full libm dependency for a trivial operation that the compiler can inline.
| [in] | v | Float value whose absolute value is needed. |
v. | -v | When v < 0.0F. |
| v | When v >= 0.0F. |
v is any finite float value (NaN and infinity return themselves). v. v is not modified.Definition at line 686 of file reflow_svg_shape.c.
Referenced by internal_arc_center(), and internal_arc_segs().
|
static |
Convert an SVG endpoint-parametrised arc to centre parametrisation.
Implements the SVG 1.1 implementation-notes F.6.5 algorithm: out-of-range radii are scaled up (F.6.6.2), the centre is solved via internal_arc_solve (F.6.5.2), and the start angle plus signed sweep are derived (F.6.5.5/6) honouring the large-arc and sweep flags. Pure (no MMIO/heap); uses libm cosf, sinf, sqrtf.
| [in] | p0 | Arc start (current point, user space). |
| [in] | p_end | Arc end (user space, already absolute). |
| [in] | rx_in | Requested semi-axis X (its absolute value is used). |
| [in] | ry_in | Requested semi-axis Y (its absolute value is used). |
| [in] | rot_deg | X-axis rotation in degrees. |
| [in] | large | Large-arc flag. |
| [in] | sweep | Sweep (positive-angle) flag. |
| {.ok=false} | Zero radius, or p0 and p_end are coincident. |
| {.ok=true} | All fields valid: centre, semi-axes, start angle, sweep. |
rx_in and ry_in fit in a float without overflow (SVG coords are bounded). p0 and p_end are valid user-space points.Definition at line 816 of file reflow_svg_shape.c.
References svg_arc_t::cos_phi, internal_absf(), internal_arc_solve(), svg_arc_t::ok, svg_arc_t::sin_phi, svg_pt_t::x, and svg_pt_t::y.
Referenced by priv_ra8_svgp_flatten_arc().
|
static |
Compute a bounded segment count for an arc of signed sweep dt.
Divides the absolute value of dt by the target radians-per-segment function-local arc step (~pi/8) and adds 1 to ensure at least one segment. The result is clamped to k_svg_arc_seg_max (24) to keep the vertex count bounded regardless of the sweep angle.
| [in] | dt | Signed arc sweep in radians; negative values are valid. |
| 1..k_svg_arc_seg_max | Always within this range. |
dt is a finite float; the absolute value is used for the calculation. dt is finite so division by the positive local arc step is defined.dt is not modified.Definition at line 878 of file reflow_svg_shape.c.
References internal_absf(), and k_svg_arc_seg_max.
Referenced by priv_ra8_svgp_flatten_arc().
|
static |
Solve an arc's centre + start/sweep angles (F.6.5.2 / F.6.5.5-6).
Finishes internal_arc_center from its rotated half-chord (x1p,y1p), the (radius-corrected) semi-axes (rx,ry), and the endpoint midpoint (mx,my). Fills a's centre, start angle, signed sweep, radii, and sets a->ok to true. The cos_phi / sin_phi fields of a must already be set by the caller. The signed sweep a->dt is adjusted so its direction is consistent with sweep (positive angle) and large (large-arc) flags.
| [in,out] | a | Arc struct; centre, angles, radii, and ok are written. |
| [in] | x1p | Rotated half-chord X (F.6.5.1, user space). |
| [in] | y1p | Rotated half-chord Y (F.6.5.1, user space). |
| [in] | rx | Corrected semi-axis X. |
| [in] | ry | Corrected semi-axis Y. |
| [in] | mx | Endpoint midpoint X (user space). |
| [in] | my | Endpoint midpoint Y (user space). |
| [in] | large | Large-arc flag from the 'A' command. |
| [in] | sweep | Sweep (positive-angle) flag from the 'A' command. |
a is a valid non-NULL pointer with cos_phi / sin_phi already set. rx > 0.0F and ry > 0.0F (degenerate radii handled by the caller).a->ok is set to true. a->cx, a->cy, a->t1, a->dt, a->rx, a->ry are valid.Definition at line 744 of file reflow_svg_shape.c.
References svg_arc_t::cos_phi, svg_arc_t::cx, svg_arc_t::cy, svg_arc_t::dt, svg_arc_t::ok, svg_arc_t::rx, svg_arc_t::ry, s_svg_2pi, svg_arc_t::sin_phi, and svg_arc_t::t1.
Referenced by internal_arc_center().
|
static |
Linear-interpolate two 0x00RRGGBB colours by factor f in [0, 1].
Extracts the R, G, and B channels from a and b, interpolates each independently as (channel_a + (channel_b - channel_a) * f), and recombines into a 0x00RRGGBB result. The factor f is not clamped by this function; the gradient evaluator is responsible for providing a value in [0,1]. Used by internal_grad_eval to blend adjacent gradient stops.
| [in] | a | Colour A in 0x00RRGGBB format. |
| [in] | b | Colour B in 0x00RRGGBB format. |
| [in] | f | Interpolation factor; 0.0F returns a, 1.0F returns b. |
| 0x000000..0xFFFFFF | The per-channel linear blend of a and b at f. |
f is in the range [0.0F, 1.0F] to produce a value between a and b. a and b have bits [31:24] clear (0x00RRGGBB format).Definition at line 421 of file reflow_svg_shape.c.
References k_svg_chan_mask, k_svg_hex_chan, and k_svg_sh_r.
Referenced by internal_grad_eval().
|
static |
Evaluate gradient g at bbox-relative point (px, py).
For a linear gradient the scalar parameter is the projection of (px - x1, py - y1) onto the vector (x2 - x1, y2 - y1) normalised by the squared length of that vector. For a radial gradient the parameter is the Euclidean distance from (x1, y1) divided by radius x2. The parameter is compared against stop offsets; values before the first stop return the first stop colour, values after the last return the last stop colour, and values between two stops are linearly interpolated by internal_col_lerp. Returns the default fill colour when g->nstops is zero.
| [in] | g | Gradient to evaluate; must not be NULL and must have nstops >= 1. |
| [in] | px | Bounding-box-relative X position in [0, 1]. |
| [in] | py | Bounding-box-relative Y position in [0, 1]. |
| (uint32_t)k_svg_def_fill | When g->nstops is 0. |
| 0x000000..0xFFFFFF | Interpolated or clamped stop colour. |
g is a valid non-NULL pointer to an initialised svg_grad_t. px and py are bounding-box-relative coordinates (typically in [0,1]).g is not modified.Definition at line 477 of file reflow_svg_shape.c.
References svg_stop_t::col, internal_col_lerp(), k_svg_def_fill, k_svg_grad_radial, svg_grad_t::kind, svg_grad_t::nstops, svg_stop_t::off, svg_grad_t::stops, svg_grad_t::x1, svg_grad_t::x2, svg_grad_t::y1, and svg_grad_t::y2.
Referenced by priv_ra8_svgp_fill_poly_grad().
|
static |
Parse a 'points' attribute value into framebuffer-space vertices.
Scans v[0..vlen) for whitespace/comma-separated x,y integer pairs via priv_ra8_svgp_num, maps each pair through the full affine via priv_ra8_svgp_map_point, and stores the result in xs[n] / ys[n]. Terminates when k_svg_poly_max vertices have been collected or the end of the span is reached. Returns the count of vertex pairs filled.
| [in] | v | Byte span containing the 'points' value text; must not be NULL. |
| [in] | vlen | Total valid bytes in v. |
| [in] | t | Active coordinate transform; must not be NULL. |
| [out] | xs | Array of at least k_svg_poly_max int32_t for X coords; must not be NULL. |
| [out] | ys | Array of at least k_svg_poly_max int32_t for Y coords; must not be NULL. |
xs / ys. | 0 | No valid x,y pairs found. |
| 1..k_svg_poly_max | Count of vertices parsed and mapped. |
v is a valid pointer to at least vlen bytes. xs and ys are valid arrays of at least k_svg_poly_max elements.xs[0..return-1] and ys[0..return-1] hold framebuffer coordinates. Definition at line 233 of file reflow_svg_shape.c.
References k_svg_poly_max, priv_ra8_svgp_map_point(), priv_ra8_svgp_num(), and priv_ra8_svgp_ws().
Referenced by priv_ra8_svgp_draw_polygon(), and priv_ra8_svgp_draw_polyline().
|
static |
Collect framebuffer X coordinates where polygon edges cross scanline y.
Iterates over all n edges of the polygon. For each edge from vertex i to vertex (i+1)n, checks whether scanline y passes through it (using the half-open interval [y0,y1) or [y1,y0)). For crossing edges, computes the X intercept via linear interpolation with 64-bit arithmetic and stores it in xint. Stops early if k_svg_poly_max crossings are found.
| [in] | xs | Array of n polygon vertex X coordinates (framebuffer); must not be NULL. |
| [in] | ys | Array of n polygon vertex Y coordinates (framebuffer); must not be NULL. |
| [in] | n | Number of polygon vertices. |
| [in] | y | Scanline Y coordinate to test. |
| [out] | xint | Array of at least k_svg_poly_max int32_t for crossing X values; must not be NULL. |
xint. | 0 | No edges cross scanline y. |
| m | m intercept X values in xint[0..m-1], unsorted. |
xs and ys are valid pointers to at least n elements. xint is a valid array of at least k_svg_poly_max elements.xint[0..return-1] hold the X coordinates of edge-scanline intersections. Definition at line 323 of file reflow_svg_shape.c.
References k_svg_poly_max.
Referenced by priv_ra8_svgp_fill_poly(), and priv_ra8_svgp_fill_poly_grad().
|
static |
Sort m int32 values in a into ascending order using insertion sort.
Uses the classic O(m^2) insertion sort, which is efficient for small arrays (m is bounded by k_svg_poly_max scanline crossings per row). Works in-place with a single temporary variable per outer iteration. Used by the scanline fill algorithm to sort X-intercept coordinates before pairing them for span fill.
| [in,out] | a | Array of m int32_t values to sort in place; must not be NULL. |
| [in] | m | Count of valid elements in a; must be >= 0. |
a is a valid pointer to at least m elements. m is in [0, k_svg_poly_max].a[0..m-1] are sorted in non-decreasing order. a is unchanged.Definition at line 277 of file reflow_svg_shape.c.
Referenced by priv_ra8_svgp_fill_poly(), and priv_ra8_svgp_fill_poly_grad().
| void priv_ra8_svgp_draw_circle | ( | const uint8_t * | s, |
| size_t | len, | ||
| const svg_xform_t * | t ) |
Draw one SVG 'circle' element using its fill colour or gradient.
Reads 'cx', 'cy', and 'r' attributes from the tag span s[0..len). Axis-aligned solid circles use the ra8_gfx_circle fast-path; under a rotating/shearing transform the circle is approximated by a k_svg_circle_seg N-gon whose vertices are mapped through the full affine, then scanline-filled by priv_ra8_svgp_fill_poly or priv_ra8_svgp_fill_poly_grad. Returns without drawing when both gi < 0 and fill == k_svg_no_paint.
| [in] | s | Byte span of the element tag; must not be NULL. |
| [in] | len | Total valid bytes in s (the tag span length). |
| [in] | t | Active coordinate transform; must not be NULL. |
s is a valid pointer to at least len bytes. t is a valid non-NULL pointer to an initialised svg_xform_t.Definition at line 119 of file reflow_svg_shape.c.
References svg_grads::g, svg_xform_t::grads, k_svg_circle_seg, k_svg_def_fill, k_svg_no_paint, priv_ra8_svgp_attr_num(), priv_ra8_svgp_fill_poly(), priv_ra8_svgp_fill_poly_grad(), priv_ra8_svgp_has_rot(), priv_ra8_svgp_map_point(), priv_ra8_svgp_mx(), priv_ra8_svgp_my(), priv_ra8_svgp_resolve_fill(), priv_ra8_svgp_sx(), ra8_gfx_circle(), and s_svg_2pi.
Referenced by internal_dispatch_shape().
| void priv_ra8_svgp_draw_line | ( | const uint8_t * | s, |
| size_t | len, | ||
| const svg_xform_t * | t ) |
Draw one SVG 'line' element using its stroke colour.
Reads 'stroke' paint, 'x1', 'y1', 'x2', and 'y2' attributes from the tag span s[0..len). Both endpoints are mapped through the full affine via priv_ra8_svgp_map_point and the result is forwarded to ra8_gfx_line. Returns without drawing when 'stroke' is absent or parses to k_svg_no_paint. Note: 'fill' is ignored for 'line' elements (SVG specification).
| [in] | s | Byte span of the element tag; must not be NULL. |
| [in] | len | Total valid bytes in s (the tag span length). |
| [in] | t | Active coordinate transform; must not be NULL. |
s is a valid pointer to at least len bytes. t is a valid non-NULL pointer to an initialised svg_xform_t.Definition at line 177 of file reflow_svg_shape.c.
References k_svg_no_paint, priv_ra8_svgp_attr_num(), priv_ra8_svgp_attr_paint(), priv_ra8_svgp_map_point(), and ra8_gfx_line().
Referenced by internal_dispatch_shape().
| void priv_ra8_svgp_draw_polygon | ( | const uint8_t * | s, |
| size_t | len, | ||
| const svg_xform_t * | t ) |
Draw one SVG 'polygon' element as a filled polygon.
Resolves the fill (solid or gradient), reads the 'points' attribute, parses vertices into framebuffer space via internal_parse_points, and fills the resulting polygon with priv_ra8_svgp_fill_poly or priv_ra8_svgp_fill_poly_grad. Returns without drawing when the fill is absent/none or the 'points' attribute is not present.
| [in] | s | Byte span of the element tag; must not be NULL. |
| [in] | len | Total valid bytes in s. |
| [in] | t | Active coordinate transform; must not be NULL. |
s is a valid pointer to at least len bytes. t is a valid non-NULL pointer to an initialised svg_xform_t.Definition at line 601 of file reflow_svg_shape.c.
References svg_grads::g, svg_xform_t::grads, internal_parse_points(), k_svg_def_fill, k_svg_no_paint, k_svg_poly_max, priv_ra8_svgp_attr(), priv_ra8_svgp_fill_poly(), priv_ra8_svgp_fill_poly_grad(), and priv_ra8_svgp_resolve_fill().
Referenced by internal_dispatch_shape().
| void priv_ra8_svgp_draw_polyline | ( | const uint8_t * | s, |
| size_t | len, | ||
| const svg_xform_t * | t ) |
Draw one SVG 'polyline' element as connected stroke line segments.
Reads the 'stroke' paint and the 'points' attribute. Parses vertex pairs into framebuffer space via internal_parse_points and connects adjacent vertices with ra8_gfx_line. Returns without drawing when the stroke colour is absent/none or the 'points' attribute is not present.
| [in] | s | Byte span of the element tag; must not be NULL. |
| [in] | len | Total valid bytes in s. |
| [in] | t | Active coordinate transform; must not be NULL. |
s is a valid pointer to at least len bytes. t is a valid non-NULL pointer to an initialised svg_xform_t.Definition at line 644 of file reflow_svg_shape.c.
References internal_parse_points(), k_svg_no_paint, k_svg_poly_max, priv_ra8_svgp_attr(), priv_ra8_svgp_attr_paint(), and ra8_gfx_line().
Referenced by internal_dispatch_shape().
| void priv_ra8_svgp_draw_rect | ( | const uint8_t * | s, |
| size_t | len, | ||
| const svg_xform_t * | t ) |
Draw one SVG 'rect' element using its fill colour or gradient.
Reads 'x', 'y', 'width', and 'height' attributes from the tag span s[0..len). Axis-aligned solid rects use the ra8_gfx_rect fast-path; under a rotating/shearing transform the 4 corners are mapped through the full affine via priv_ra8_svgp_map_point and the resulting quad is scanline-filled by priv_ra8_svgp_fill_poly or priv_ra8_svgp_fill_poly_grad. Returns without drawing when both gi < 0 and fill == k_svg_no_paint.
| [in] | s | Byte span of the element tag; must not be NULL. |
| [in] | len | Total valid bytes in s (the tag span length). |
| [in] | t | Active coordinate transform; must not be NULL. |
s is a valid pointer to at least len bytes. t is a valid non-NULL pointer to an initialised svg_xform_t.Definition at line 61 of file reflow_svg_shape.c.
References svg_grads::g, svg_xform_t::grads, k_svg_def_fill, k_svg_no_paint, k_svg_rect_pts, priv_ra8_svgp_attr_num(), priv_ra8_svgp_fill_poly(), priv_ra8_svgp_fill_poly_grad(), priv_ra8_svgp_has_rot(), priv_ra8_svgp_map_point(), priv_ra8_svgp_mx(), priv_ra8_svgp_my(), priv_ra8_svgp_resolve_fill(), priv_ra8_svgp_sx(), and ra8_gfx_rect().
Referenced by internal_dispatch_shape().
| void priv_ra8_svgp_fill_poly | ( | const int32_t * | xs, |
| const int32_t * | ys, | ||
| int32_t | n, | ||
| uint32_t | color ) |
Even-odd scanline fill of polygon (xs,ys)[0..n) with a solid colour.
Computes the bounding Y range of the polygon, then for each scanline Y in [ymin, ymax] calls internal_scanline_x to collect intercepts, sorts them via internal_sort_i32, and fills pairs of spans with ra8_gfx_line. Returns immediately for polygons with fewer than k_svg_poly_min vertices.
| [in] | xs | Array of n framebuffer X coordinates; must not be NULL. |
| [in] | ys | Array of n framebuffer Y coordinates; must not be NULL. |
| [in] | n | Number of polygon vertices. |
| [in] | color | Fill colour in 0x00RRGGBB format. |
xs and ys are valid pointers to at least n elements. n <= k_svg_poly_max.color. n < k_svg_poly_min.Definition at line 371 of file reflow_svg_shape.c.
References internal_scanline_x(), internal_sort_i32(), k_svg_poly_max, k_svg_poly_min, and ra8_gfx_line().
Referenced by priv_ra8_svgp_draw_circle(), priv_ra8_svgp_draw_path(), priv_ra8_svgp_draw_polygon(), and priv_ra8_svgp_draw_rect().
| void priv_ra8_svgp_fill_poly_grad | ( | const int32_t * | xs, |
| const int32_t * | ys, | ||
| int32_t | n, | ||
| const svg_grad_t * | g ) |
Per-pixel gradient scanline fill of polygon (xs,ys)[0..n).
Computes the bounding box of the polygon, then for each scanline Y in [ymin, ymax] collects edge intercepts via internal_scanline_x and sorts them. For each filled span, iterates over pixels and evaluates the gradient at the bounding-box-relative position ((x-xmin)/bw, (y-ymin)/bh) via internal_grad_eval. Each pixel is written individually with ra8_gfx_pixel. Returns immediately when n < k_svg_poly_min.
| [in] | xs | Array of n framebuffer X coordinates; must not be NULL. |
| [in] | ys | Array of n framebuffer Y coordinates; must not be NULL. |
| [in] | n | Number of polygon vertices. |
| [in] | g | Gradient descriptor to evaluate per pixel; must not be NULL. |
xs and ys are valid pointers to at least n elements. g is a valid non-NULL pointer with g->nstops >= 1.n < k_svg_poly_min.Definition at line 541 of file reflow_svg_shape.c.
References internal_grad_eval(), internal_scanline_x(), internal_sort_i32(), k_svg_poly_max, k_svg_poly_min, and ra8_gfx_pixel().
Referenced by priv_ra8_svgp_draw_circle(), priv_ra8_svgp_draw_path(), priv_ra8_svgp_draw_polygon(), and priv_ra8_svgp_draw_rect().
| void priv_ra8_svgp_flatten_arc | ( | const svg_xform_t * | t, |
| svg_pt_t | p0, | ||
| const int32_t * | args, | ||
| svg_pt_t | p_end, | ||
| int32_t * | xs, | ||
| int32_t * | ys, | ||
| int32_t * | n ) |
Flatten an SVG elliptical arc into the polygon vertex array.
Converts the endpoint-parametrised arc (P0 to p_end, with radii, rotation, and flags from args) to centre form via internal_arc_center. When the arc is degenerate (ok==false), appends a single line-to p_end. Otherwise samples the arc at internal_arc_segs(a.dt) parameter values using trigonometry (the ellipse equation in the rotated frame) and appends each mapped framebuffer point. Bounded by k_svg_poly_max.
| [in] | t | Active coordinate transform; must not be NULL. |
| [in] | p0 | Arc start point (current path position, user space). |
| [in] | args | Arc argument array indexed by svg_arc_* constants; must not be NULL. |
| [in] | p_end | Arc end point (absolute, user space). |
| [out] | xs | Vertex X array of at least k_svg_poly_max elements; must not be NULL. |
| [out] | ys | Vertex Y array of at least k_svg_poly_max elements; must not be NULL. |
| [in,out] | n | Current vertex count; updated by this function. |
t is a valid non-NULL pointer to an initialised svg_xform_t. args has at least k_svg_path_args (7) valid int32_t entries.*n is increased by the number of arc sample points appended. *n <= k_svg_poly_max on exit.Definition at line 917 of file reflow_svg_shape.c.
References svg_arc_t::cos_phi, svg_arc_t::cx, svg_arc_t::cy, svg_arc_t::dt, internal_arc_center(), internal_arc_segs(), k_svg_arc_large, k_svg_arc_rot, k_svg_arc_rx, k_svg_arc_ry, k_svg_arc_sweep, k_svg_poly_max, svg_arc_t::ok, priv_ra8_svgp_map_point(), svg_arc_t::rx, svg_arc_t::ry, svg_arc_t::sin_phi, svg_arc_t::t1, svg_pt_t::x, and svg_pt_t::y.
Referenced by internal_path_curve().
|
static |
2*Pi, for wrapping an arc's signed sweep into range.
Definition at line 29 of file reflow_svg_shape.c.
Referenced by internal_arc_solve(), and priv_ra8_svgp_draw_circle().