NovaSVG 0.10.0
A header-only SVG library
Loading...
Searching...
No Matches
path.h File Reference
#include "private.h"
#include "utils.h"
#include <assert.h>
Include dependency graph for path.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

struct  novasvg::render::bezier_t
 
struct  novasvg::render::dasher_t
 
struct  novasvg::render::extents_calculator_t
 

Namespaces

namespace  novasvg
 Main namespace for the NovaSVG library.
 
namespace  novasvg::render
 

Functions

NOVASVG_INLINE void novasvg::render::path_iterator_init (path_iterator_t *it, const path_t *path)
 Initializes a path iterator for a given path.
 
NOVASVG_INLINE bool novasvg::render::path_iterator_has_next (const path_iterator_t *it)
 Checks if there are more elements to iterate over.
 
NOVASVG_INLINE path_command_t novasvg::render::path_iterator_next (path_iterator_t *it, point_t points[3])
 Retrieves the current command and its associated points, then advances the iterator.
 
NOVASVG_INLINE path_t * novasvg::render::path_create (void)
 Creates a new path object.
 
NOVASVG_INLINE path_t * novasvg::render::path_reference (path_t *path)
 Increases the reference count of a path object.
 
NOVASVG_INLINE void novasvg::render::path_destroy (path_t *path)
 Decreases the reference count of a path object.
 
NOVASVG_INLINE int novasvg::render::path_get_reference_count (const path_t *path)
 Retrieves the reference count of a path object.
 
NOVASVG_INLINE int novasvg::render::path_get_elements (const path_t *path, const path_element_t **elements)
 Retrieves the elements of a path.
 
NOVASVG_INLINE path_element_t * novasvg::render::path_add_command (path_t *path, path_command_t command, int npoints)
 
NOVASVG_INLINE void novasvg::render::path_move_to (path_t *path, float x, float y)
 Moves the current point to a new position.
 
NOVASVG_INLINE void novasvg::render::path_line_to (path_t *path, float x, float y)
 Adds a straight line segment to the path.
 
NOVASVG_INLINE void novasvg::render::path_quad_to (path_t *path, float x1, float y1, float x2, float y2)
 Adds a quadratic Bézier curve to the path.
 
NOVASVG_INLINE void novasvg::render::path_cubic_to (path_t *path, float x1, float y1, float x2, float y2, float x3, float y3)
 Adds a cubic Bézier curve to the path.
 
NOVASVG_INLINE void novasvg::render::path_arc_to (path_t *path, float rx, float ry, float angle, bool large_arc_flag, bool sweep_flag, float x, float y)
 Adds an elliptical arc to the path.
 
NOVASVG_INLINE void novasvg::render::path_close (path_t *path)
 Closes the current sub-path.
 
NOVASVG_INLINE void novasvg::render::path_get_current_point (const path_t *path, float *x, float *y)
 Retrieves the current point of the path.
 
NOVASVG_INLINE void novasvg::render::path_reserve (path_t *path, int count)
 Reserves space for path elements.
 
NOVASVG_INLINE void novasvg::render::path_reset (path_t *path)
 Resets the path.
 
NOVASVG_INLINE void novasvg::render::path_add_rect (path_t *path, float x, float y, float w, float h)
 Adds a rectangle to the path.
 
NOVASVG_INLINE void novasvg::render::path_add_round_rect (path_t *path, float x, float y, float w, float h, float rx, float ry)
 Adds a rounded rectangle to the path.
 
NOVASVG_INLINE void novasvg::render::path_add_ellipse (path_t *path, float cx, float cy, float rx, float ry)
 Adds an ellipse to the path.
 
NOVASVG_INLINE void novasvg::render::path_add_circle (path_t *path, float cx, float cy, float r)
 Adds a circle to the path.
 
NOVASVG_INLINE void novasvg::render::path_add_arc (path_t *path, float cx, float cy, float r, float a0, float a1, bool ccw)
 Adds an arc to the path.
 
NOVASVG_INLINE void novasvg::render::path_transform (path_t *path, const matrix_t *matrix)
 Applies a transformation matrix to the path.
 
NOVASVG_INLINE void novasvg::render::path_add_path (path_t *path, const path_t *source, const matrix_t *matrix)
 Adds a sub-path to the path.
 
NOVASVG_INLINE void novasvg::render::path_traverse (const path_t *path, path_traverse_func_t traverse_func, void *closure)
 Traverses the path and calls the callback for each element.
 
NOVASVG_INLINE void novasvg::render::split_bezier (const bezier_t *b, bezier_t *first, bezier_t *second)
 
NOVASVG_INLINE void novasvg::render::path_traverse_flatten (const path_t *path, path_traverse_func_t traverse_func, void *closure)
 Traverses the path with Bézier curves flattened to line segments.
 
NOVASVG_INLINE void novasvg::render::dash_traverse_func (void *closure, path_command_t command, const point_t *points, int npoints)
 
NOVASVG_INLINE void novasvg::render::path_traverse_dashed (const path_t *path, float offset, const float *dashes, int ndashes, path_traverse_func_t traverse_func, void *closure)
 Traverses the path with a dashed pattern and calls the callback for each segment.
 
NOVASVG_INLINE path_t * novasvg::render::path_clone (const path_t *path)
 Creates a copy of the path.
 
NOVASVG_INLINE void novasvg::render::clone_traverse_func (void *closure, path_command_t command, const point_t *points, int npoints)
 
NOVASVG_INLINE path_t * novasvg::render::path_clone_flatten (const path_t *path)
 Creates a copy of the path with Bézier curves flattened to line segments.
 
NOVASVG_INLINE path_t * novasvg::render::path_clone_dashed (const path_t *path, float offset, const float *dashes, int ndashes)
 Creates a copy of the path with a dashed pattern applied.
 
NOVASVG_INLINE void novasvg::render::extents_traverse_func (void *closure, path_command_t command, const point_t *points, int npoints)
 
NOVASVG_INLINE float novasvg::render::path_extents (const path_t *path, rect_t *extents, bool tight)
 Computes the bounding box and total length of the path.
 
NOVASVG_INLINE float novasvg::render::path_length (const path_t *path)
 Calculates the total length of the path.
 
NOVASVG_INLINE bool novasvg::render::parse_arc_flag (const char **begin, const char *end, bool *flag)
 
NOVASVG_INLINE bool novasvg::render::parse_path_coordinates (const char **begin, const char *end, float values[6], int offset, int count)
 
NOVASVG_INLINE bool novasvg::render::path_parse (path_t *path, const char *data, int length)
 Parses SVG path data into a path_t object.