NovaSVG 0.10.0
A header-only SVG library
Loading...
Searching...
No Matches
novasvg::render Namespace Reference

Classes

struct  bezier_t
 
struct  canvas
 
struct  color
 Represents a color with red, green, blue, and alpha components. More...
 
struct  color_entry_t
 
struct  dasher_t
 
struct  extents_calculator_t
 
struct  font_face
 
struct  font_face_cache
 
struct  font_face_entry
 
struct  glyph
 
struct  glyph_cache_t
 
struct  gradient_data_t
 
struct  gradient_paint_t
 
struct  gradient_stop_t
 Represents a gradient stop. More...
 
struct  linear_gradient_values_t
 
struct  matrix
 A structure representing a 2D transformation matrix. More...
 
struct  paint
 
struct  path
 
union  path_element
 
struct  path_iterator
 Iterator for traversing path elements in a path. More...
 
struct  point
 A structure representing a point in 2D space. More...
 
struct  radial_gradient_values_t
 
struct  rect
 A structure representing a rectangle in 2D space. More...
 
struct  solid_paint_t
 
struct  span_buffer_t
 
struct  span_t
 
struct  state
 
struct  stroke_dash_t
 
struct  stroke_data_t
 
struct  stroke_style_t
 
struct  surface
 
struct  text_iterator
 Iterator for traversing code points in text data. More...
 
struct  texture_data_t
 
struct  texture_paint_t
 

Typedefs

typedef void(* composition_solid_function_t) (uint32_t *dest, int length, uint32_t color, uint32_t const_alpha)
 
typedef void(* composition_function_t) (uint32_t *dest, int length, const uint32_t *src, uint32_t const_alpha)
 
typedef int mutex_t
 
typedef struct novasvg::render::glyph glyph_t
 
typedef struct novasvg::render::font_face_entry font_face_entry_t
 
typedef int ref_count_t
 
typedef struct novasvg::render::state state_t
 
typedef void(* destroy_func_t) (void *closure)
 A function pointer type for a cleanup callback.
 
typedef void(* write_func_t) (void *closure, void *data, int size)
 A function pointer type for a write callback.
 
typedef struct novasvg::render::point point_t
 A structure representing a point in 2D space.
 
typedef struct novasvg::render::rect rect_t
 A structure representing a rectangle in 2D space.
 
using matrix_t = struct novasvg::render::matrix
 A structure representing a 2D transformation matrix.
 
typedef struct path path_t
 Represents a 2D path for drawing operations.
 
typedef enum novasvg::render::path_command path_command_t
 Enumeration defining path commands.
 
typedef union novasvg::render::path_element path_element_t
 
typedef struct novasvg::render::path_iterator path_iterator_t
 Iterator for traversing path elements in a path.
 
typedef void(* path_traverse_func_t) (void *closure, path_command_t command, const point_t *points, int npoints)
 Callback function type for traversing a path.
 
typedef enum novasvg::render::text_encoding text_encoding_t
 Text encodings used for converting text data to code points.
 
typedef struct novasvg::render::text_iterator text_iterator_t
 Iterator for traversing code points in text data.
 
typedef unsigned int codepoint_t
 Represents a Unicode code point.
 
typedef struct font_face font_face_t
 Represents a font face.
 
typedef struct font_face_cache font_face_cache_t
 Represents a cache of loaded font faces.
 
typedef struct novasvg::render::color color_t
 Represents a color with red, green, blue, and alpha components.
 
using surface_t = struct surface
 Represents an image surface for drawing operations.
 
typedef struct paint paint_t
 Represents a paint object used for drawing operations.
 
typedef struct canvas canvas_t
 Represents a drawing context.
 

Enumerations

enum  paint_type_t { NOVASVG_PAINT_TYPE_COLOR , NOVASVG_PAINT_TYPE_GRADIENT , NOVASVG_PAINT_TYPE_TEXTURE }
 
enum  gradient_type_t { NOVASVG_GRADIENT_TYPE_LINEAR , NOVASVG_GRADIENT_TYPE_RADIAL }
 
enum  path_command { NOVASVG_PATH_COMMAND_MOVE_TO , NOVASVG_PATH_COMMAND_LINE_TO , NOVASVG_PATH_COMMAND_CUBIC_TO , NOVASVG_PATH_COMMAND_CLOSE }
 Enumeration defining path commands. More...
 
enum  text_encoding { NOVASVG_TEXT_ENCODING_LATIN1 , NOVASVG_TEXT_ENCODING_UTF8 , NOVASVG_TEXT_ENCODING_UTF16 , NOVASVG_TEXT_ENCODING_UTF32 }
 Text encodings used for converting text data to code points. More...
 
enum  texture_type_t { NOVASVG_TEXTURE_TYPE_PLAIN , NOVASVG_TEXTURE_TYPE_TILED }
 Defines the type of texture, either plain or tiled. More...
 
enum  spread_method_t { NOVASVG_SPREAD_METHOD_PAD , NOVASVG_SPREAD_METHOD_REFLECT , NOVASVG_SPREAD_METHOD_REPEAT }
 Defines the spread method for gradients. More...
 
enum  fill_rule_t { NOVASVG_FILL_RULE_NON_ZERO , NOVASVG_FILL_RULE_EVEN_ODD }
 Defines fill rule types for filling paths. More...
 
enum  operator_t {
  NOVASVG_OPERATOR_CLEAR , NOVASVG_OPERATOR_SRC , NOVASVG_OPERATOR_DST , NOVASVG_OPERATOR_SRC_OVER ,
  NOVASVG_OPERATOR_DST_OVER , NOVASVG_OPERATOR_SRC_IN , NOVASVG_OPERATOR_DST_IN , NOVASVG_OPERATOR_SRC_OUT ,
  NOVASVG_OPERATOR_DST_OUT , NOVASVG_OPERATOR_SRC_ATOP , NOVASVG_OPERATOR_DST_ATOP , NOVASVG_OPERATOR_XOR ,
  NOVASVG_OPERATOR_MULTIPLY , NOVASVG_OPERATOR_SCREEN , NOVASVG_OPERATOR_DARKEN , NOVASVG_OPERATOR_LIGHTEN ,
  NOVASVG_OPERATOR_DIFFERENCE , NOVASVG_OPERATOR_EXCLUSION
}
 Defines compositing operations. More...
 
enum  line_cap_t { NOVASVG_LINE_CAP_BUTT , NOVASVG_LINE_CAP_ROUND , NOVASVG_LINE_CAP_SQUARE }
 Defines the shape used at the ends of open subpaths. More...
 
enum  line_join_t { NOVASVG_LINE_JOIN_MITER , NOVASVG_LINE_JOIN_ROUND , NOVASVG_LINE_JOIN_BEVEL }
 Defines the shape used at the corners of paths. More...
 

Functions

NOVASVG_INLINE uint32_t premultiply_color_with_opacity (const color_t *color, float opacity)
 
NOVASVG_INLINE uint32_t INTERPOLATE_PIXEL_255 (uint32_t x, uint32_t a, uint32_t y, uint32_t b)
 
NOVASVG_INLINE uint32_t INTERPOLATE_PIXEL_256 (uint32_t x, uint32_t a, uint32_t y, uint32_t b)
 
NOVASVG_INLINE uint32_t BYTE_MUL (uint32_t x, uint32_t a)
 
NOVASVG_INLINE void memfill32 (unsigned int *dest, int length, unsigned int value)
 
NOVASVG_INLINE int gradient_clamp (const gradient_data_t *gradient, int ipos)
 
NOVASVG_INLINE uint32_t gradient_pixel_fixed (const gradient_data_t *gradient, int fixed_pos)
 
NOVASVG_INLINE uint32_t gradient_pixel (const gradient_data_t *gradient, float pos)
 
NOVASVG_INLINE void fetch_linear_gradient (uint32_t *buffer, const linear_gradient_values_t *v, const gradient_data_t *gradient, int y, int x, int length)
 
NOVASVG_INLINE void fetch_radial_gradient (uint32_t *buffer, const radial_gradient_values_t *v, const gradient_data_t *gradient, int y, int x, int length)
 
NOVASVG_INLINE void composition_solid_clear (uint32_t *dest, int length, uint32_t color, uint32_t const_alpha)
 
NOVASVG_INLINE void composition_solid_source (uint32_t *dest, int length, uint32_t color, uint32_t const_alpha)
 
NOVASVG_INLINE void composition_solid_destination (uint32_t *dest, int length, uint32_t color, uint32_t const_alpha)
 
NOVASVG_INLINE void composition_solid_source_over (uint32_t *dest, int length, uint32_t color, uint32_t const_alpha)
 
NOVASVG_INLINE void composition_solid_destination_over (uint32_t *dest, int length, uint32_t color, uint32_t const_alpha)
 
NOVASVG_INLINE void composition_solid_source_in (uint32_t *dest, int length, uint32_t color, uint32_t const_alpha)
 
NOVASVG_INLINE void composition_solid_destination_in (uint32_t *dest, int length, uint32_t color, uint32_t const_alpha)
 
NOVASVG_INLINE void composition_solid_source_out (uint32_t *dest, int length, uint32_t color, uint32_t const_alpha)
 
NOVASVG_INLINE void composition_solid_destination_out (uint32_t *dest, int length, uint32_t color, uint32_t const_alpha)
 
NOVASVG_INLINE void composition_solid_source_atop (uint32_t *dest, int length, uint32_t color, uint32_t const_alpha)
 
NOVASVG_INLINE void composition_solid_destination_atop (uint32_t *dest, int length, uint32_t color, uint32_t const_alpha)
 
NOVASVG_INLINE void composition_solid_xor (uint32_t *dest, int length, uint32_t color, uint32_t const_alpha)
 
NOVASVG_INLINE int blend_mul255 (int x, int y)
 
template<operator_t Mode>
NOVASVG_INLINE int blend_mode_channel (int cs, int cb, int as, int ab)
 
template<operator_t Mode>
NOVASVG_INLINE uint32_t blend_mode_pixel (uint32_t dest, uint32_t src)
 
template<operator_t Mode>
NOVASVG_INLINE void composition_blend_mode (uint32_t *dest, int length, const uint32_t *src, uint32_t const_alpha)
 
template<operator_t Mode>
NOVASVG_INLINE void composition_solid_blend_mode (uint32_t *dest, int length, uint32_t color, uint32_t const_alpha)
 
NOVASVG_INLINE void composition_clear (uint32_t *dest, int length, const uint32_t *src, uint32_t const_alpha)
 
NOVASVG_INLINE void composition_source (uint32_t *dest, int length, const uint32_t *src, uint32_t const_alpha)
 
NOVASVG_INLINE void composition_destination (uint32_t *dest, int length, const uint32_t *src, uint32_t const_alpha)
 
NOVASVG_INLINE void composition_source_over (uint32_t *dest, int length, const uint32_t *src, uint32_t const_alpha)
 
NOVASVG_INLINE void composition_destination_over (uint32_t *dest, int length, const uint32_t *src, uint32_t const_alpha)
 
NOVASVG_INLINE void composition_source_in (uint32_t *dest, int length, const uint32_t *src, uint32_t const_alpha)
 
NOVASVG_INLINE void composition_destination_in (uint32_t *dest, int length, const uint32_t *src, uint32_t const_alpha)
 
NOVASVG_INLINE void composition_source_out (uint32_t *dest, int length, const uint32_t *src, uint32_t const_alpha)
 
NOVASVG_INLINE void composition_destination_out (uint32_t *dest, int length, const uint32_t *src, uint32_t const_alpha)
 
NOVASVG_INLINE void composition_source_atop (uint32_t *dest, int length, const uint32_t *src, uint32_t const_alpha)
 
NOVASVG_INLINE void composition_destination_atop (uint32_t *dest, int length, const uint32_t *src, uint32_t const_alpha)
 
NOVASVG_INLINE void composition_xor (uint32_t *dest, int length, const uint32_t *src, uint32_t const_alpha)
 
NOVASVG_INLINE void blend_solid (surface_t *surface, operator_t op, uint32_t solid, const span_buffer_t *span_buffer)
 
NOVASVG_INLINE void blend_linear_gradient (surface_t *surface, operator_t op, const gradient_data_t *gradient, const span_buffer_t *span_buffer)
 
NOVASVG_INLINE void blend_radial_gradient (surface_t *surface, operator_t op, const gradient_data_t *gradient, const span_buffer_t *span_buffer)
 
NOVASVG_INLINE void blend_untransformed_argb (surface_t *surface, operator_t op, const texture_data_t *texture, const span_buffer_t *span_buffer)
 
NOVASVG_INLINE void blend_transformed_argb (surface_t *surface, operator_t op, const texture_data_t *texture, const span_buffer_t *span_buffer)
 
NOVASVG_INLINE void blend_untransformed_tiled_argb (surface_t *surface, operator_t op, const texture_data_t *texture, const span_buffer_t *span_buffer)
 
NOVASVG_INLINE void blend_transformed_tiled_argb (surface_t *surface, operator_t op, const texture_data_t *texture, const span_buffer_t *span_buffer)
 
NOVASVG_INLINE uint32_t interpolate_4_pixels (uint32_t tl, uint32_t tr, uint32_t bl, uint32_t br, uint32_t distx, uint32_t disty)
 
NOVASVG_INLINE void blend_transformed_bilinear_tiled_argb (surface_t *surface, operator_t op, const texture_data_t *texture, const span_buffer_t *span_buffer)
 
NOVASVG_INLINE void blend_color (canvas_t *canvas, const color_t *color, const span_buffer_t *span_buffer)
 
NOVASVG_INLINE void blend_gradient (canvas_t *canvas, const gradient_paint_t *gradient, const span_buffer_t *span_buffer)
 
NOVASVG_INLINE void blend_texture (canvas_t *canvas, const texture_paint_t *texture, const span_buffer_t *span_buffer)
 
NOVASVG_INLINE void blend (canvas_t *canvas, const span_buffer_t *span_buffer)
 
NOVASVG_INLINE int render_version (void)
 Gets the version of the novasvg rendering library.
 
NOVASVG_INLINE const char * render_version_string (void)
 Gets the version of the novasvg rendering library as a string.
 
NOVASVG_INLINE state_t * state_create (void)
 
NOVASVG_INLINE void state_reset (state_t *state)
 
NOVASVG_INLINE void state_copy (state_t *state, const state_t *source)
 
NOVASVG_INLINE void state_destroy (state_t *state)
 
NOVASVG_INLINE canvas_t * canvas_create (surface_t *surface)
 Creates a drawing context on a surface.
 
NOVASVG_INLINE canvas_t * canvas_reference (canvas_t *canvas)
 Increases the reference count of the canvas.
 
NOVASVG_INLINE void canvas_destroy (canvas_t *canvas)
 Decreases the reference count and destroys the canvas when it reaches zero.
 
NOVASVG_INLINE int canvas_get_reference_count (const canvas_t *canvas)
 Retrieves the reference count of the canvas.
 
NOVASVG_INLINE surface_t * canvas_get_surface (const canvas_t *canvas)
 Gets the surface associated with the canvas.
 
NOVASVG_INLINE void canvas_save (canvas_t *canvas)
 Saves the current state of the canvas.
 
NOVASVG_INLINE void canvas_restore (canvas_t *canvas)
 Restores the canvas to the most recently saved state.
 
NOVASVG_INLINE void canvas_set_rgb (canvas_t *canvas, float r, float g, float b)
 Sets the current paint to a solid color.
 
NOVASVG_INLINE void canvas_set_rgba (canvas_t *canvas, float r, float g, float b, float a)
 Sets the current paint to a solid color.
 
NOVASVG_INLINE void canvas_set_color (canvas_t *canvas, const color_t *color)
 Sets the current paint to a solid color.
 
NOVASVG_INLINE void canvas_set_linear_gradient (canvas_t *canvas, float x1, float y1, float x2, float y2, spread_method_t spread, const gradient_stop_t *stops, int nstops, const matrix_t *matrix)
 Sets the current paint to a linear gradient.
 
NOVASVG_INLINE void canvas_set_radial_gradient (canvas_t *canvas, float cx, float cy, float cr, float fx, float fy, float fr, spread_method_t spread, const gradient_stop_t *stops, int nstops, const matrix_t *matrix)
 Sets the current paint to a radial gradient.
 
NOVASVG_INLINE void canvas_set_texture (canvas_t *canvas, surface_t *surface, texture_type_t type, float opacity, const matrix_t *matrix)
 Sets the current paint to a texture.
 
NOVASVG_INLINE void canvas_set_paint (canvas_t *canvas, paint_t *paint)
 Sets the current paint.
 
NOVASVG_INLINE paint_t * canvas_get_paint (const canvas_t *canvas, color_t *color)
 Retrieves the current paint.
 
NOVASVG_INLINE void canvas_set_font_face_cache (canvas_t *canvas, font_face_cache_t *cache)
 Assigns a font-face cache to the canvas for font management.
 
NOVASVG_INLINE font_face_cache_t * canvas_get_font_face_cache (const canvas_t *canvas)
 Returns the font-face cache associated with the canvas.
 
NOVASVG_INLINE void canvas_add_font_face (canvas_t *canvas, const char *family, bool bold, bool italic, font_face_t *face)
 Add a font face to the canvas using the specified family and style.
 
NOVASVG_INLINE bool canvas_add_font_file (canvas_t *canvas, const char *family, bool bold, bool italic, const char *filename, int ttcindex)
 Load a font face from a file and add it to the canvas using the specified family and style.
 
NOVASVG_INLINE bool canvas_select_font_face (canvas_t *canvas, const char *family, bool bold, bool italic)
 Selects and sets the current font face on the canvas.
 
NOVASVG_INLINE void canvas_set_font (canvas_t *canvas, font_face_t *face, float size)
 Sets the font face and size for text rendering on the canvas.
 
NOVASVG_INLINE void canvas_set_font_face (canvas_t *canvas, font_face_t *face)
 Sets the font face for text rendering on the canvas.
 
NOVASVG_INLINE font_face_t * canvas_get_font_face (const canvas_t *canvas)
 Retrieves the current font face used for text rendering on the canvas.
 
NOVASVG_INLINE void canvas_set_font_size (canvas_t *canvas, float size)
 Sets the font size for text rendering on the canvas.
 
NOVASVG_INLINE float canvas_get_font_size (const canvas_t *canvas)
 Retrieves the current font size used for text rendering on the canvas.
 
NOVASVG_INLINE void canvas_set_fill_rule (canvas_t *canvas, fill_rule_t winding)
 Sets the fill rule.
 
NOVASVG_INLINE fill_rule_t canvas_get_fill_rule (const canvas_t *canvas)
 Retrieves the current fill rule.
 
NOVASVG_INLINE void canvas_set_operator (canvas_t *canvas, operator_t op)
 Sets the compositing operator.
 
NOVASVG_INLINE operator_t canvas_get_operator (const canvas_t *canvas)
 Retrieves the current compositing operator.
 
NOVASVG_INLINE void canvas_set_opacity (canvas_t *canvas, float opacity)
 Sets the global opacity.
 
NOVASVG_INLINE float canvas_get_opacity (const canvas_t *canvas)
 Retrieves the current global opacity.
 
NOVASVG_INLINE void canvas_set_line_width (canvas_t *canvas, float line_width)
 Sets the line width.
 
NOVASVG_INLINE float canvas_get_line_width (const canvas_t *canvas)
 Retrieves the current line width.
 
NOVASVG_INLINE void canvas_set_line_cap (canvas_t *canvas, line_cap_t line_cap)
 Sets the line cap style.
 
NOVASVG_INLINE line_cap_t canvas_get_line_cap (const canvas_t *canvas)
 Retrieves the current line cap style.
 
NOVASVG_INLINE void canvas_set_line_join (canvas_t *canvas, line_join_t line_join)
 Sets the line join style.
 
NOVASVG_INLINE line_join_t canvas_get_line_join (const canvas_t *canvas)
 Retrieves the current line join style.
 
NOVASVG_INLINE void canvas_set_miter_limit (canvas_t *canvas, float miter_limit)
 Sets the miter limit.
 
NOVASVG_INLINE float canvas_get_miter_limit (const canvas_t *canvas)
 Retrieves the current miter limit.
 
NOVASVG_INLINE void canvas_set_dash (canvas_t *canvas, float offset, const float *dashes, int ndashes)
 Sets the dash pattern.
 
NOVASVG_INLINE void canvas_set_dash_offset (canvas_t *canvas, float offset)
 Sets the dash offset.
 
NOVASVG_INLINE float canvas_get_dash_offset (const canvas_t *canvas)
 Retrieves the current dash offset.
 
NOVASVG_INLINE void canvas_set_dash_array (canvas_t *canvas, const float *dashes, int ndashes)
 Sets the dash pattern.
 
NOVASVG_INLINE int canvas_get_dash_array (const canvas_t *canvas, const float **dashes)
 Retrieves the current dash pattern.
 
NOVASVG_INLINE void canvas_translate (canvas_t *canvas, float tx, float ty)
 Translates the current transformation matrix by offsets tx and ty.
 
NOVASVG_INLINE void canvas_scale (canvas_t *canvas, float sx, float sy)
 Scales the current transformation matrix by factors sx and sy.
 
NOVASVG_INLINE void canvas_shear (canvas_t *canvas, float shx, float shy)
 Shears the current transformation matrix by factors shx and shy.
 
NOVASVG_INLINE void canvas_rotate (canvas_t *canvas, float angle)
 Rotates the current transformation matrix by the specified angle (in radians).
 
NOVASVG_INLINE void canvas_transform (canvas_t *canvas, const matrix_t *matrix)
 Multiplies the current transformation matrix with the specified matrix.
 
NOVASVG_INLINE void canvas_reset_matrix (canvas_t *canvas)
 Resets the current transformation matrix to the identity matrix.
 
NOVASVG_INLINE void canvas_set_matrix (canvas_t *canvas, const matrix_t *matrix)
 Resets the current transformation matrix to the specified matrix.
 
NOVASVG_INLINE void canvas_get_matrix (const canvas_t *canvas, matrix_t *matrix)
 Stores the current transformation matrix in matrix.
 
NOVASVG_INLINE void canvas_map (const canvas_t *canvas, float x, float y, float *xx, float *yy)
 Transforms the point (x, y) using the current transformation matrix and stores the result in (xx, yy).
 
NOVASVG_INLINE void canvas_map_point (const canvas_t *canvas, const point_t *src, point_t *dst)
 Transforms the src point using the current transformation matrix and stores the result in dst.
 
NOVASVG_INLINE void canvas_map_rect (const canvas_t *canvas, const rect_t *src, rect_t *dst)
 Transforms the src rectangle using the current transformation matrix and stores the result in dst.
 
NOVASVG_INLINE void canvas_move_to (canvas_t *canvas, float x, float y)
 Moves the current point to a new position.
 
NOVASVG_INLINE void canvas_line_to (canvas_t *canvas, float x, float y)
 Adds a straight line segment to the current path.
 
NOVASVG_INLINE void canvas_quad_to (canvas_t *canvas, float x1, float y1, float x2, float y2)
 Adds a quadratic Bézier curve to the current path.
 
NOVASVG_INLINE void canvas_cubic_to (canvas_t *canvas, float x1, float y1, float x2, float y2, float x3, float y3)
 Adds a cubic Bézier curve to the current path.
 
NOVASVG_INLINE void canvas_arc_to (canvas_t *canvas, float rx, float ry, float angle, bool large_arc_flag, bool sweep_flag, float x, float y)
 Adds an elliptical arc to the current path.
 
NOVASVG_INLINE void canvas_rect (canvas_t *canvas, float x, float y, float w, float h)
 Adds a rectangle to the current path.
 
NOVASVG_INLINE void canvas_round_rect (canvas_t *canvas, float x, float y, float w, float h, float rx, float ry)
 Adds a rounded rectangle to the current path.
 
NOVASVG_INLINE void canvas_ellipse (canvas_t *canvas, float cx, float cy, float rx, float ry)
 Adds an ellipse to the current path.
 
NOVASVG_INLINE void canvas_circle (canvas_t *canvas, float cx, float cy, float r)
 Adds a circle to the current path.
 
NOVASVG_INLINE void canvas_arc (canvas_t *canvas, float cx, float cy, float r, float a0, float a1, bool ccw)
 Adds an arc to the current path.
 
NOVASVG_INLINE void canvas_add_path (canvas_t *canvas, const path_t *path)
 Adds a path to the current path.
 
NOVASVG_INLINE void canvas_new_path (canvas_t *canvas)
 Starts a new path on the canvas.
 
NOVASVG_INLINE void canvas_close_path (canvas_t *canvas)
 Closes the current path.
 
NOVASVG_INLINE void canvas_get_current_point (const canvas_t *canvas, float *x, float *y)
 Retrieves the current point of the canvas.
 
NOVASVG_INLINE path_t * canvas_get_path (const canvas_t *canvas)
 Gets the current path from the canvas.
 
NOVASVG_INLINE bool canvas_fill_contains (canvas_t *canvas, float x, float y)
 Tests whether a point lies within the current fill region.
 
NOVASVG_INLINE bool canvas_stroke_contains (canvas_t *canvas, float x, float y)
 Tests whether a point lies within the current stroke region.
 
NOVASVG_INLINE bool canvas_clip_contains (canvas_t *canvas, float x, float y)
 Tests whether a point lies within the current clipping region.
 
NOVASVG_INLINE void canvas_fill_extents (canvas_t *canvas, rect_t *extents)
 Computes the bounding box of the area that would be affected by a fill operation.
 
NOVASVG_INLINE void canvas_stroke_extents (canvas_t *canvas, rect_t *extents)
 Computes the bounding box of the area that would be affected by a stroke operation.
 
NOVASVG_INLINE void canvas_clip_extents (canvas_t *canvas, rect_t *extents)
 Gets the bounding box of the current clipping region.
 
NOVASVG_INLINE void canvas_fill (canvas_t *canvas)
 A drawing operator that fills the current path according to the current fill rule.
 
NOVASVG_INLINE void canvas_stroke (canvas_t *canvas)
 A drawing operator that strokes the current path according to the current stroke settings.
 
NOVASVG_INLINE void canvas_clip (canvas_t *canvas)
 A drawing operator that intersects the current clipping region with the current path according to the current fill rule.
 
NOVASVG_INLINE void canvas_paint (canvas_t *canvas)
 A drawing operator that paints the current clipping region using the current paint.
 
NOVASVG_INLINE void canvas_fill_preserve (canvas_t *canvas)
 A drawing operator that fills the current path according to the current fill rule.
 
NOVASVG_INLINE void canvas_stroke_preserve (canvas_t *canvas)
 A drawing operator that strokes the current path according to the current stroke settings.
 
NOVASVG_INLINE void canvas_clip_preserve (canvas_t *canvas)
 A drawing operator that intersects the current clipping region with the current path according to the current fill rule.
 
NOVASVG_INLINE void canvas_fill_rect (canvas_t *canvas, float x, float y, float w, float h)
 Fills a rectangle according to the current fill rule.
 
NOVASVG_INLINE void canvas_fill_path (canvas_t *canvas, const path_t *path)
 Fills a path according to the current fill rule.
 
NOVASVG_INLINE void canvas_stroke_rect (canvas_t *canvas, float x, float y, float w, float h)
 Strokes a rectangle with the current stroke settings.
 
NOVASVG_INLINE void canvas_stroke_path (canvas_t *canvas, const path_t *path)
 Strokes a path with the current stroke settings.
 
NOVASVG_INLINE void canvas_clip_rect (canvas_t *canvas, float x, float y, float w, float h)
 Intersects the current clipping region with a rectangle according to the current fill rule.
 
NOVASVG_INLINE void canvas_clip_path (canvas_t *canvas, const path_t *path)
 Intersects the current clipping region with a path according to the current fill rule.
 
NOVASVG_INLINE float canvas_add_glyph (canvas_t *canvas, codepoint_t codepoint, float x, float y)
 Adds a glyph to the current path at the specified origin.
 
NOVASVG_INLINE float canvas_add_text (canvas_t *canvas, const void *text, int length, text_encoding_t encoding, float x, float y)
 Adds text to the current path at the specified origin.
 
NOVASVG_INLINE float canvas_fill_text (canvas_t *canvas, const void *text, int length, text_encoding_t encoding, float x, float y)
 Fills a text at the specified origin.
 
NOVASVG_INLINE float canvas_stroke_text (canvas_t *canvas, const void *text, int length, text_encoding_t encoding, float x, float y)
 Strokes a text at the specified origin.
 
NOVASVG_INLINE float canvas_clip_text (canvas_t *canvas, const void *text, int length, text_encoding_t encoding, float x, float y)
 Intersects the current clipping region with text at the specified origin.
 
NOVASVG_INLINE void canvas_font_metrics (const canvas_t *canvas, float *ascent, float *descent, float *line_gap, rect_t *extents)
 Retrieves font metrics for the current font.
 
NOVASVG_INLINE void canvas_glyph_metrics (canvas_t *canvas, codepoint_t codepoint, float *advance_width, float *left_side_bearing, rect_t *extents)
 Retrieves metrics for a specific glyph.
 
NOVASVG_INLINE float canvas_text_extents (canvas_t *canvas, const void *text, int length, text_encoding_t encoding, rect_t *extents)
 Retrieves the extents of a text.
 
NOVASVG_INLINE void text_iterator_init (text_iterator_t *it, const void *text, int length, text_encoding_t encoding)
 Initializes a text iterator.
 
NOVASVG_INLINE bool text_iterator_has_next (const text_iterator_t *it)
 Checks if there are more code points to iterate.
 
NOVASVG_INLINE codepoint_t text_iterator_next (text_iterator_t *it)
 Retrieves the next code point and advances the iterator.
 
NOVASVG_INLINE font_face_t * font_face_load_from_file (const char *filename, int ttcindex)
 Loads a font face from a file.
 
NOVASVG_INLINE font_face_t * font_face_load_from_data (const void *data, unsigned int length, int ttcindex, destroy_func_t destroy_func, void *closure)
 Loads a font face from memory.
 
NOVASVG_INLINE font_face_t * font_face_reference (font_face_t *face)
 Increments the reference count of a font face.
 
NOVASVG_INLINE void font_face_destroy (font_face_t *face)
 Decrements the reference count and potentially destroys the font face.
 
NOVASVG_INLINE int font_face_get_reference_count (const font_face_t *face)
 Retrieves the current reference count of a font face.
 
NOVASVG_INLINE float font_face_get_units_per_em (const font_face_t *face)
 
NOVASVG_INLINE void font_face_enumerate_codepoints (const font_face_t *face, void(*callback)(uint32_t codepoint, void *closure), void *closure)
 
NOVASVG_INLINE void font_face_get_metrics (const font_face_t *face, float size, float *ascent, float *descent, float *line_gap, rect_t *extents)
 Retrieves metrics for a font face at a specified size.
 
NOVASVG_INLINE void font_face_get_glyph_metrics (font_face_t *face, float size, codepoint_t codepoint, float *advance_width, float *left_side_bearing, rect_t *extents)
 Retrieves metrics for a specified glyph at a given size.
 
NOVASVG_INLINE float font_face_get_kern_advance (font_face_t *face, float size, codepoint_t ch1, codepoint_t ch2)
 
NOVASVG_INLINE float font_face_get_glyph_path (font_face_t *face, float size, float x, float y, codepoint_t codepoint, path_t *path)
 Retrieves the path of a glyph and its advance width.
 
NOVASVG_INLINE float font_face_traverse_glyph_path (font_face_t *face, float size, float x, float y, codepoint_t codepoint, path_traverse_func_t traverse_func, void *closure)
 Traverses the path of a glyph and calls a callback for each path element.
 
NOVASVG_INLINE void font_face_init_ligatures (font_face_t *face)
 
NOVASVG_INLINE codepoint_t font_face_apply_ligature (font_face_t *face, text_iterator_t *it, codepoint_t codepoint)
 
NOVASVG_INLINE float font_face_text_extents (font_face_t *face, float size, const void *text, int length, text_encoding_t encoding, rect_t *extents)
 Computes the bounding box of a text string and its advance width.
 
NOVASVG_INLINE font_face_cache_t * font_face_cache_create (void)
 Create a new, empty font‐face cache.
 
NOVASVG_INLINE font_face_cache_t * font_face_cache_reference (font_face_cache_t *cache)
 Increments the reference count of a font‐face cache.
 
NOVASVG_INLINE void font_face_cache_destroy (font_face_cache_t *cache)
 Decrement the reference count of a font‐face cache and destroy it when it reaches zero.
 
NOVASVG_INLINE int font_face_cache_reference_count (const font_face_cache_t *cache)
 Retrieve the current reference count of a font‐face cache.
 
NOVASVG_INLINE void font_face_cache_reset (font_face_cache_t *cache)
 Remove all entries from a font‐face cache.
 
NOVASVG_INLINE void font_face_cache_add (font_face_cache_t *cache, const char *family, bool bold, bool italic, font_face_t *face)
 Add a font face to the cache with the specified family and style.
 
NOVASVG_INLINE bool font_face_cache_add_file (font_face_cache_t *cache, const char *family, bool bold, bool italic, const char *filename, int ttcindex)
 Load a font face from a file and add it to the cache with the specified family and style.
 
NOVASVG_INLINE font_face_t * font_face_cache_get (font_face_cache_t *cache, const char *family, bool bold, bool italic)
 Retrieve a font face from the cache by family and style.
 
NOVASVG_INLINE int font_face_cache_load_file (font_face_cache_t *cache, const char *filename)
 Load all font faces from a file and add them to the cache.
 
NOVASVG_INLINE int font_face_cache_load_dir (font_face_cache_t *cache, const char *dirname)
 Load all font faces from files in a directory recursively and add them to the cache.
 
NOVASVG_INLINE int font_face_cache_load_sys (font_face_cache_t *cache)
 Load all available system font faces and add them to the cache.
 
NOVASVG_INLINE void matrix_init (matrix_t *matrix, float a, float b, float c, float d, float e, float f)
 Initializes a 2D transformation matrix.
 
NOVASVG_INLINE void matrix_init_identity (matrix_t *matrix)
 Initializes a 2D transformation matrix to the identity matrix.
 
NOVASVG_INLINE void matrix_init_translate (matrix_t *matrix, float tx, float ty)
 Initializes a 2D transformation matrix for translation.
 
NOVASVG_INLINE void matrix_init_scale (matrix_t *matrix, float sx, float sy)
 Initializes a 2D transformation matrix for scaling.
 
NOVASVG_INLINE void matrix_init_rotate (matrix_t *matrix, float angle)
 Initializes a 2D transformation matrix for rotation.
 
NOVASVG_INLINE void matrix_init_shear (matrix_t *matrix, float shx, float shy)
 Initializes a 2D transformation matrix for shearing.
 
NOVASVG_INLINE void matrix_translate (matrix_t *matrix, float tx, float ty)
 Adds a translation with offsets tx and ty to the matrix.
 
NOVASVG_INLINE void matrix_scale (matrix_t *matrix, float sx, float sy)
 Scales the matrix by factors sx and sy
 
NOVASVG_INLINE void matrix_rotate (matrix_t *matrix, float angle)
 Rotates the matrix by the specified angle (in radians).
 
NOVASVG_INLINE void matrix_shear (matrix_t *matrix, float shx, float shy)
 Shears the matrix by factors shx and shy.
 
NOVASVG_INLINE void matrix_multiply (matrix_t *matrix, const matrix_t *left, const matrix_t *right)
 Multiplies left and right matrices and stores the result in matrix.
 
NOVASVG_INLINE bool matrix_invert (const matrix_t *matrix, matrix_t *inverse)
 Calculates the inverse of matrix and stores it in inverse.
 
NOVASVG_INLINE void matrix_map (const matrix_t *matrix, float x, float y, float *xx, float *yy)
 Transforms the point (x, y) using matrix and stores the result in (xx, yy).
 
NOVASVG_INLINE void matrix_map_point (const matrix_t *matrix, const point_t *src, point_t *dst)
 Transforms the src point using matrix and stores the result in dst.
 
NOVASVG_INLINE void matrix_map_points (const matrix_t *matrix, const point_t *src, point_t *dst, int count)
 Transforms an array of src points using matrix and stores the results in dst.
 
NOVASVG_INLINE void matrix_map_rect (const matrix_t *matrix, const rect_t *src, rect_t *dst)
 Transforms the src rectangle using matrix and stores the result in dst.
 
NOVASVG_INLINE int parse_matrix_parameters (const char **begin, const char *end, float values[6], int required, int optional)
 
NOVASVG_INLINE bool matrix_parse (matrix_t *matrix, const char *data, int length)
 Parses an SVG transform string into a matrix.
 
NOVASVG_INLINE void color_init_rgb (color_t *color, float r, float g, float b)
 Initializes a color using RGB components in the 0-1 range.
 
NOVASVG_INLINE void color_init_rgba (color_t *color, float r, float g, float b, float a)
 Initializes a color using RGBA components in the 0-1 range.
 
NOVASVG_INLINE void color_init_rgb8 (color_t *color, int r, int g, int b)
 Initializes a color using RGB components in the 0-255 range.
 
NOVASVG_INLINE void color_init_rgba8 (color_t *color, int r, int g, int b, int a)
 Initializes a color using RGBA components in the 0-255 range.
 
NOVASVG_INLINE void color_init_rgba32 (color_t *color, unsigned int value)
 Initializes a color from a 32-bit unsigned RGBA value.
 
NOVASVG_INLINE void color_init_argb32 (color_t *color, unsigned int value)
 Initializes a color from a 32-bit unsigned ARGB value.
 
NOVASVG_INLINE void color_init_hsl (color_t *color, float h, float s, float l)
 Initializes a color with the specified HSL color values.
 
NOVASVG_INLINE void color_init_hsla (color_t *color, float h, float s, float l, float a)
 Initializes a color with the specified HSLA color values.
 
NOVASVG_INLINE unsigned int color_to_rgba32 (const color_t *color)
 Converts a color to a 32-bit unsigned RGBA value.
 
NOVASVG_INLINE unsigned int color_to_argb32 (const color_t *color)
 Converts a color to a 32-bit unsigned ARGB value.
 
NOVASVG_INLINE int color_parse (color_t *color, const char *data, int length)
 Parses a color from a string using CSS color syntax.
 
NOVASVG_INLINE paint_t * paint_create_rgb (float r, float g, float b)
 Creates a solid RGB paint.
 
NOVASVG_INLINE paint_t * paint_create_rgba (float r, float g, float b, float a)
 Creates a solid RGBA paint.
 
NOVASVG_INLINE paint_t * paint_create_color (const color_t *color)
 Creates a solid color paint.
 
NOVASVG_INLINE paint_t * paint_create_linear_gradient (float x1, float y1, float x2, float y2, spread_method_t spread, const gradient_stop_t *stops, int nstops, const matrix_t *matrix)
 Creates a linear gradient paint.
 
NOVASVG_INLINE paint_t * paint_create_radial_gradient (float cx, float cy, float cr, float fx, float fy, float fr, spread_method_t spread, const gradient_stop_t *stops, int nstops, const matrix_t *matrix)
 Creates a radial gradient paint.
 
NOVASVG_INLINE paint_t * paint_create_texture (surface_t *surface, texture_type_t type, float opacity, const matrix_t *matrix)
 Creates a texture paint from a surface.
 
NOVASVG_INLINE paint_t * paint_reference (paint_t *paint)
 Increments the reference count of a paint object.
 
NOVASVG_INLINE void paint_destroy (paint_t *paint)
 Decrements the reference count and destroys the paint if the count reaches zero.
 
NOVASVG_INLINE int paint_get_reference_count (const paint_t *paint)
 Retrieves the reference count of a paint object.
 
NOVASVG_INLINE void path_iterator_init (path_iterator_t *it, const path_t *path)
 Initializes a path iterator for a given path.
 
NOVASVG_INLINE bool path_iterator_has_next (const path_iterator_t *it)
 Checks if there are more elements to iterate over.
 
NOVASVG_INLINE path_command_t 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 * path_create (void)
 Creates a new path object.
 
NOVASVG_INLINE path_t * path_reference (path_t *path)
 Increases the reference count of a path object.
 
NOVASVG_INLINE void path_destroy (path_t *path)
 Decreases the reference count of a path object.
 
NOVASVG_INLINE int path_get_reference_count (const path_t *path)
 Retrieves the reference count of a path object.
 
NOVASVG_INLINE int path_get_elements (const path_t *path, const path_element_t **elements)
 Retrieves the elements of a path.
 
NOVASVG_INLINE path_element_t * path_add_command (path_t *path, path_command_t command, int npoints)
 
NOVASVG_INLINE void path_move_to (path_t *path, float x, float y)
 Moves the current point to a new position.
 
NOVASVG_INLINE void path_line_to (path_t *path, float x, float y)
 Adds a straight line segment to the path.
 
NOVASVG_INLINE void 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 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 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 path_close (path_t *path)
 Closes the current sub-path.
 
NOVASVG_INLINE void path_get_current_point (const path_t *path, float *x, float *y)
 Retrieves the current point of the path.
 
NOVASVG_INLINE void path_reserve (path_t *path, int count)
 Reserves space for path elements.
 
NOVASVG_INLINE void path_reset (path_t *path)
 Resets the path.
 
NOVASVG_INLINE void path_add_rect (path_t *path, float x, float y, float w, float h)
 Adds a rectangle to the path.
 
NOVASVG_INLINE void 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 path_add_ellipse (path_t *path, float cx, float cy, float rx, float ry)
 Adds an ellipse to the path.
 
NOVASVG_INLINE void path_add_circle (path_t *path, float cx, float cy, float r)
 Adds a circle to the path.
 
NOVASVG_INLINE void 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 path_transform (path_t *path, const matrix_t *matrix)
 Applies a transformation matrix to the path.
 
NOVASVG_INLINE void path_add_path (path_t *path, const path_t *source, const matrix_t *matrix)
 Adds a sub-path to the path.
 
NOVASVG_INLINE void 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 split_bezier (const bezier_t *b, bezier_t *first, bezier_t *second)
 
NOVASVG_INLINE void 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 dash_traverse_func (void *closure, path_command_t command, const point_t *points, int npoints)
 
NOVASVG_INLINE void 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 * path_clone (const path_t *path)
 Creates a copy of the path.
 
NOVASVG_INLINE void clone_traverse_func (void *closure, path_command_t command, const point_t *points, int npoints)
 
NOVASVG_INLINE path_t * 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 * 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 extents_traverse_func (void *closure, path_command_t command, const point_t *points, int npoints)
 
NOVASVG_INLINE float path_extents (const path_t *path, rect_t *extents, bool tight)
 Computes the bounding box and total length of the path.
 
NOVASVG_INLINE float path_length (const path_t *path)
 Calculates the total length of the path.
 
NOVASVG_INLINE bool parse_arc_flag (const char **begin, const char *end, bool *flag)
 
NOVASVG_INLINE bool parse_path_coordinates (const char **begin, const char *end, float values[6], int offset, int count)
 
NOVASVG_INLINE bool path_parse (path_t *path, const char *data, int length)
 Parses SVG path data into a path_t object.
 
void span_buffer_init (span_buffer_t *span_buffer)
 
void span_buffer_init_rect (span_buffer_t *span_buffer, int x, int y, int width, int height)
 
void span_buffer_reset (span_buffer_t *span_buffer)
 
void span_buffer_destroy (span_buffer_t *span_buffer)
 
void span_buffer_copy (span_buffer_t *span_buffer, const span_buffer_t *source)
 
bool span_buffer_contains (const span_buffer_t *span_buffer, float x, float y)
 
void span_buffer_extents (span_buffer_t *span_buffer, rect_t *extents)
 
void span_buffer_intersect (span_buffer_t *span_buffer, const span_buffer_t *a, const span_buffer_t *b)
 
void rasterize (span_buffer_t *span_buffer, const path_t *path, const matrix_t *matrix, const rect_t *clip_rect, const stroke_data_t *stroke_data, fill_rule_t winding)
 
NOVASVG_INLINE void span_buffer_update_extents (span_buffer_t *span_buffer)
 
NOVASVG_INLINE PVG_FT_Outline * ft_outline_create (int points, int contours)
 
NOVASVG_INLINE void ft_outline_destroy (PVG_FT_Outline *outline)
 
NOVASVG_INLINE PVG_FT_Pos ft_coord_round (float v)
 
NOVASVG_INLINE void ft_outline_move_to (PVG_FT_Outline *ft, float x, float y)
 
NOVASVG_INLINE void ft_outline_line_to (PVG_FT_Outline *ft, float x, float y)
 
NOVASVG_INLINE void ft_outline_cubic_to (PVG_FT_Outline *ft, float x1, float y1, float x2, float y2, float x3, float y3)
 
NOVASVG_INLINE void ft_outline_close (PVG_FT_Outline *ft)
 
NOVASVG_INLINE void ft_outline_end (PVG_FT_Outline *ft)
 
NOVASVG_INLINE PVG_FT_Outline * ft_outline_convert_stroke (const path_t *path, const matrix_t *matrix, const stroke_data_t *stroke_data)
 
NOVASVG_INLINE PVG_FT_Outline * ft_outline_convert (const path_t *path, const matrix_t *matrix, const stroke_data_t *stroke_data)
 
NOVASVG_INLINE PVG_FT_Outline * ft_outline_convert_dash (const path_t *path, const matrix_t *matrix, const stroke_dash_t *stroke_dash)
 
NOVASVG_INLINE void spans_generation_callback (int count, const PVG_FT_Span *spans, void *user)
 
surface_t * surface_create (int width, int height)
 Creates a new image surface with the specified dimensions.
 
surface_t * surface_create_for_data (unsigned char *data, int width, int height, int stride)
 Creates an image surface using existing pixel data.
 
surface_t * surface_load_from_image_file (const char *filename)
 Loads an image surface from a file.
 
surface_t * surface_load_from_image_data (const void *data, int length)
 Loads an image surface from raw image data.
 
surface_t * surface_load_from_image_base64 (const char *data, int length)
 Loads an image surface from base64-encoded data.
 
surface_t * surface_reference (surface_t *surface)
 Increments the reference count for a surface.
 
void surface_destroy (surface_t *surface)
 Decrements the reference count and destroys the surface if the count reaches zero.
 
int surface_get_reference_count (const surface_t *surface)
 Gets the current reference count of a surface.
 
unsigned char * surface_get_data (const surface_t *surface)
 Gets the pixel data of the surface.
 
int surface_get_width (const surface_t *surface)
 Gets the width of the surface.
 
int surface_get_height (const surface_t *surface)
 Gets the height of the surface.
 
int surface_get_stride (const surface_t *surface)
 Gets the stride of the surface.
 
void surface_clear (surface_t *surface, const color_t *color)
 Clears the entire surface with the specified color.
 
void convert_argb_to_rgba (unsigned char *dst, const unsigned char *src, int width, int height, int stride)
 Converts pixel data from premultiplied ARGB to RGBA format.
 
void convert_rgba_to_argb (unsigned char *dst, const unsigned char *src, int width, int height, int stride)
 Converts pixel data from RGBA to premultiplied ARGB format.
 
NOVASVG_INLINE uint8_t * base64_decode (const char *data, int length, size_t *out_length)
 
NOVASVG_INLINE uint32_t premultiply_argb (uint32_t color)
 
NOVASVG_INLINE bool parse_number (const char **begin, const char *end, float *number)
 
NOVASVG_INLINE bool skip_delim (const char **begin, const char *end, const char delim)
 
NOVASVG_INLINE bool skip_string (const char **begin, const char *end, const char *data)
 
NOVASVG_INLINE bool skip_ws (const char **begin, const char *end)
 
NOVASVG_INLINE bool skip_ws_and_delim (const char **begin, const char *end, char delim)
 
NOVASVG_INLINE bool skip_ws_and_comma (const char **begin, const char *end)
 
NOVASVG_INLINE bool skip_ws_or_delim (const char **begin, const char *end, char delim, bool *has_delim)
 
NOVASVG_INLINE bool skip_ws_or_comma (const char **begin, const char *end, bool *has_comma)
 
NOVASVG_INLINE void skip_css_unit (const char **begin, const char *end, float *number)
 

Variables

NOVASVG_INLINE const composition_solid_function_t composition_solid_table []
 
NOVASVG_INLINE const composition_function_t composition_table []
 

Typedef Documentation

◆ canvas_t

Represents a drawing context.

Examples
/home/runner/work/novasvg/novasvg/include/novasvg/detail/render/render.h.

Definition at line 1473 of file render.h.

◆ codepoint_t

typedef unsigned int novasvg::render::codepoint_t

Represents a Unicode code point.

Examples
/home/runner/work/novasvg/novasvg/include/novasvg/detail/render/render.h.

Definition at line 768 of file render.h.

◆ color_t

Represents a color with red, green, blue, and alpha components.

Examples
/home/runner/work/novasvg/novasvg/include/novasvg/detail/render/render.h.

◆ composition_function_t

typedef void(* novasvg::render::composition_function_t) (uint32_t *dest, int length, const uint32_t *src, uint32_t const_alpha)

Definition at line 720 of file blend.h.

◆ composition_solid_function_t

typedef void(* novasvg::render::composition_solid_function_t) (uint32_t *dest, int length, uint32_t color, uint32_t const_alpha)

Definition at line 519 of file blend.h.

◆ destroy_func_t

typedef void(* novasvg::render::destroy_func_t) (void *closure)

A function pointer type for a cleanup callback.

Parameters
closureA pointer to the resource to be cleaned up.
Examples
/home/runner/work/novasvg/novasvg/include/novasvg/detail/render/render.h.

Definition at line 92 of file render.h.

◆ font_face_cache_t

Represents a cache of loaded font faces.

Examples
/home/runner/work/novasvg/novasvg/include/novasvg/detail/render/render.h.

Definition at line 912 of file render.h.

◆ font_face_entry_t

◆ font_face_t

Represents a font face.

Examples
/home/runner/work/novasvg/novasvg/include/novasvg/detail/render/render.h.

Definition at line 799 of file render.h.

◆ glyph_t

◆ matrix_t

A structure representing a 2D transformation matrix.

Examples
/home/runner/work/novasvg/novasvg/include/novasvg/detail/render/render.h.

Definition at line 110 of file novasvg.h.

◆ mutex_t

Definition at line 5136 of file font.h.

◆ paint_t

Represents a paint object used for drawing operations.

Examples
/home/runner/work/novasvg/novasvg/include/novasvg/detail/render/render.h.

Definition at line 1319 of file render.h.

◆ path_command_t

◆ path_element_t

◆ path_iterator_t

◆ path_t

typedef struct path novasvg::render::path_t

Represents a 2D path for drawing operations.

Examples
/home/runner/work/novasvg/novasvg/include/novasvg/detail/render/render.h.

Definition at line 305 of file render.h.

◆ path_traverse_func_t

typedef void(* novasvg::render::path_traverse_func_t) (void *closure, path_command_t command, const point_t *points, int npoints)

Callback function type for traversing a path.

This function type defines a callback used to traverse path elements.

Parameters
closureA pointer to user-defined data passed to the callback.
commandThe current path command.
pointsAn array of points associated with the command.
npointsThe number of points in the array.
Examples
/home/runner/work/novasvg/novasvg/include/novasvg/detail/render/render.h.

Definition at line 658 of file render.h.

◆ point_t

◆ rect_t

A structure representing a rectangle in 2D space.

Examples
/home/runner/work/novasvg/novasvg/include/novasvg/detail/render/render.h.

◆ ref_count_t

Definition at line 43 of file private.h.

◆ state_t

◆ surface_t

Represents an image surface for drawing operations.

Stores pixel data in a 32-bit premultiplied ARGB format (0xAARRGGBB), where red, green, and blue channels are multiplied by the alpha channel and divided by 255.

Examples
/home/runner/work/novasvg/novasvg/include/novasvg/detail/render/render.h.

Definition at line 1152 of file render.h.

◆ text_encoding_t

◆ text_iterator_t

◆ write_func_t

typedef void(* novasvg::render::write_func_t) (void *closure, void *data, int size)

A function pointer type for a write callback.

Parameters
closureA pointer to user-defined data or context.
dataA pointer to the data to be written.
sizeThe size of the data in bytes.
Examples
/home/runner/work/novasvg/novasvg/include/novasvg/detail/render/render.h.

Definition at line 100 of file render.h.

Enumeration Type Documentation

◆ fill_rule_t

Defines fill rule types for filling paths.

Enumerator
NOVASVG_FILL_RULE_NON_ZERO 

Non-zero winding fill rule.

NOVASVG_FILL_RULE_EVEN_ODD 

Even-odd fill rule.

Examples
/home/runner/work/novasvg/novasvg/include/novasvg/detail/render/render.h.

Definition at line 1421 of file render.h.

◆ gradient_type_t

Enumerator
NOVASVG_GRADIENT_TYPE_LINEAR 
NOVASVG_GRADIENT_TYPE_RADIAL 

Definition at line 89 of file private.h.

◆ line_cap_t

Defines the shape used at the ends of open subpaths.

Enumerator
NOVASVG_LINE_CAP_BUTT 

Flat edge at the end of the stroke.

NOVASVG_LINE_CAP_ROUND 

Rounded ends at the end of the stroke.

NOVASVG_LINE_CAP_SQUARE 

Square ends at the end of the stroke.

Examples
/home/runner/work/novasvg/novasvg/include/novasvg/detail/render/render.h.

Definition at line 1455 of file render.h.

◆ line_join_t

Defines the shape used at the corners of paths.

Enumerator
NOVASVG_LINE_JOIN_MITER 

Miter join with sharp corners.

NOVASVG_LINE_JOIN_ROUND 

Rounded join.

NOVASVG_LINE_JOIN_BEVEL 

Beveled join with a flattened corner.

Examples
/home/runner/work/novasvg/novasvg/include/novasvg/detail/render/render.h.

Definition at line 1464 of file render.h.

◆ operator_t

Defines compositing operations.

Enumerator
NOVASVG_OPERATOR_CLEAR 

Clears the destination (resulting in a fully transparent image).

NOVASVG_OPERATOR_SRC 

Source replaces destination.

NOVASVG_OPERATOR_DST 

Destination is kept, source is ignored.

NOVASVG_OPERATOR_SRC_OVER 

Source is composited over destination.

NOVASVG_OPERATOR_DST_OVER 

Destination is composited over source.

NOVASVG_OPERATOR_SRC_IN 

Source within destination (only the overlapping part of source is shown).

NOVASVG_OPERATOR_DST_IN 

Destination within source.

NOVASVG_OPERATOR_SRC_OUT 

Source outside destination (non-overlapping part of source is shown).

NOVASVG_OPERATOR_DST_OUT 

Destination outside source.

NOVASVG_OPERATOR_SRC_ATOP 

Source atop destination (source shown over destination but only in the destination's bounds).

NOVASVG_OPERATOR_DST_ATOP 

Destination atop source (destination shown over source but only in the source's bounds).

NOVASVG_OPERATOR_XOR 

Source and destination are combined, but their overlapping regions are cleared.

NOVASVG_OPERATOR_MULTIPLY 

Backdrop * source: darkens, white is neutral.

NOVASVG_OPERATOR_SCREEN 

Inverse of multiply: lightens, black is neutral.

NOVASVG_OPERATOR_DARKEN 

The darker of backdrop and source, per channel.

NOVASVG_OPERATOR_LIGHTEN 

The lighter of backdrop and source, per channel.

NOVASVG_OPERATOR_DIFFERENCE 

Absolute difference of backdrop and source, per channel.

NOVASVG_OPERATOR_EXCLUSION 

Like difference, with lower contrast.

Examples
/home/runner/work/novasvg/novasvg/include/novasvg/detail/render/render.h.

Definition at line 1429 of file render.h.

◆ paint_type_t

Enumerator
NOVASVG_PAINT_TYPE_COLOR 
NOVASVG_PAINT_TYPE_GRADIENT 
NOVASVG_PAINT_TYPE_TEXTURE 

Definition at line 73 of file private.h.

◆ path_command

Enumeration defining path commands.

Enumerator
NOVASVG_PATH_COMMAND_MOVE_TO 

Moves the current point to a new position.

NOVASVG_PATH_COMMAND_LINE_TO 

Draws a straight line to a new point.

NOVASVG_PATH_COMMAND_CUBIC_TO 

Draws a cubic Bézier curve to a new point.

NOVASVG_PATH_COMMAND_CLOSE 

Closes the current path by drawing a line to the starting point.

Examples
/home/runner/work/novasvg/novasvg/include/novasvg/detail/render/render.h.

Definition at line 310 of file render.h.

◆ spread_method_t

Defines the spread method for gradients.

Enumerator
NOVASVG_SPREAD_METHOD_PAD 

Pad the gradient's edges.

NOVASVG_SPREAD_METHOD_REFLECT 

Reflect the gradient beyond its bounds.

NOVASVG_SPREAD_METHOD_REPEAT 

Repeat the gradient pattern.

Examples
/home/runner/work/novasvg/novasvg/include/novasvg/detail/render/render.h.

Definition at line 1302 of file render.h.

◆ text_encoding

Text encodings used for converting text data to code points.

Enumerator
NOVASVG_TEXT_ENCODING_LATIN1 

Latin-1 encoding.

NOVASVG_TEXT_ENCODING_UTF8 

UTF-8 encoding.

NOVASVG_TEXT_ENCODING_UTF16 

UTF-16 encoding.

NOVASVG_TEXT_ENCODING_UTF32 

UTF-32 encoding.

Examples
/home/runner/work/novasvg/novasvg/include/novasvg/detail/render/render.h.

Definition at line 748 of file render.h.

◆ texture_type_t

Defines the type of texture, either plain or tiled.

Enumerator
NOVASVG_TEXTURE_TYPE_PLAIN 

Plain texture.

NOVASVG_TEXTURE_TYPE_TILED 

Tiled texture.

Examples
/home/runner/work/novasvg/novasvg/include/novasvg/detail/render/render.h.

Definition at line 1294 of file render.h.

Function Documentation

◆ base64_decode()

NOVASVG_INLINE uint8_t * novasvg::render::base64_decode ( const char *  data,
int  length,
size_t *  out_length 
)

Definition at line 7822 of file surface.h.

Referenced by surface_load_from_image_base64().

◆ blend()

◆ blend_color()

◆ blend_gradient()

NOVASVG_INLINE void novasvg::render::blend_gradient ( canvas_t *  canvas,
const gradient_paint_t *  gradient,
const span_buffer_t *  span_buffer 
)

◆ blend_linear_gradient()

◆ blend_mode_channel()

template<operator_t Mode>
NOVASVG_INLINE int novasvg::render::blend_mode_channel ( int  cs,
int  cb,
int  as,
int  ab 
)

◆ blend_mode_pixel()

template<operator_t Mode>
NOVASVG_INLINE uint32_t novasvg::render::blend_mode_pixel ( uint32_t  dest,
uint32_t  src 
)

Definition at line 484 of file blend.h.

References blend_mul255(), novasvg_alpha, NOVASVG_MAX, and NOVASVG_MIN.

◆ blend_mul255()

NOVASVG_INLINE int novasvg::render::blend_mul255 ( int  x,
int  y 
)

Definition at line 459 of file blend.h.

Referenced by blend_mode_channel(), and blend_mode_pixel().

◆ blend_radial_gradient()

◆ blend_solid()

◆ blend_texture()

◆ blend_transformed_argb()

◆ blend_transformed_bilinear_tiled_argb()

◆ blend_transformed_tiled_argb()

◆ blend_untransformed_argb()

◆ blend_untransformed_tiled_argb()

◆ BYTE_MUL()

◆ canvas_add_font_face()

void novasvg::render::canvas_add_font_face ( canvas_t *  canvas,
const char *  family,
bool  bold,
bool  italic,
font_face_t *  face 
)

Add a font face to the canvas using the specified family and style.

Parameters
canvasA pointer to a canvas_t object.
familyThe font family name to associate with the face.
boldWhether the font is bold.
italicWhether the font is italic.
faceA pointer to the font_face_t object to add.
Examples
/home/runner/work/novasvg/novasvg/include/novasvg/detail/render/render.h.

Definition at line 228 of file canvas.h.

References novasvg::render::canvas::face_cache, font_face_cache_add(), and font_face_cache_create().

◆ canvas_add_font_file()

bool novasvg::render::canvas_add_font_file ( canvas_t *  canvas,
const char *  family,
bool  bold,
bool  italic,
const char *  filename,
int  ttcindex 
)

Load a font face from a file and add it to the canvas using the specified family and style.

Parameters
canvasA pointer to a canvas_t object.
familyThe font family name to associate with the face.
boldWhether the font is bold.
italicWhether the font is italic.
filenamePath to the font file.
ttcindexIndex within a TrueType Collection (use 0 for regular font files).
Returns
true on success, or false if the font could not be loaded.
Examples
/home/runner/work/novasvg/novasvg/include/novasvg/detail/render/render.h.

Definition at line 235 of file canvas.h.

References novasvg::render::canvas::face_cache, font_face_cache_add_file(), and font_face_cache_create().

◆ canvas_add_glyph()

float novasvg::render::canvas_add_glyph ( canvas_t *  canvas,
codepoint_t  codepoint,
float  x,
float  y 
)

Adds a glyph to the current path at the specified origin.

Parameters
canvasA pointer to a canvas_t object.
codepointThe glyph codepoint.
xThe x-coordinate of the origin.
yThe y-coordinate of the origin.
Returns
The advance width of the glyph.
Examples
/home/runner/work/novasvg/novasvg/include/novasvg/detail/render/render.h.

Definition at line 664 of file canvas.h.

References novasvg::render::state::font_face, font_face_get_glyph_path(), novasvg::render::state::font_size, novasvg::render::canvas::path, and novasvg::render::canvas::state.

◆ canvas_add_path()

void novasvg::render::canvas_add_path ( canvas_t *  canvas,
const path_t *  path 
)

Adds a path to the current path.

Appends the elements of the specified path to the current path.

Parameters
canvasA pointer to a canvas_t object.
pathA pointer to the path_t object to be added.
Examples
/home/runner/work/novasvg/novasvg/include/novasvg/detail/render/render.h.

Definition at line 485 of file canvas.h.

References novasvg::render::canvas::path, and path_add_path().

Referenced by canvas_clip_path(), canvas_fill_path(), and canvas_stroke_path().

◆ canvas_add_text()

float novasvg::render::canvas_add_text ( canvas_t *  canvas,
const void *  text,
int  length,
text_encoding_t  encoding,
float  x,
float  y 
)

Adds text to the current path at the specified origin.

Parameters
canvasA pointer to a canvas_t object.
textThe text data.
lengthThe length of the text data, or -1 if null-terminated.
encodingThe encoding of the text data.
xThe x-coordinate of the origin.
yThe y-coordinate of the origin.
Returns
The total advance width of the text.
Examples
/home/runner/work/novasvg/novasvg/include/novasvg/detail/render/render.h.

Definition at line 672 of file canvas.h.

References novasvg::render::state::font_face, font_face_apply_ligature(), font_face_get_glyph_path(), font_face_get_kern_advance(), novasvg::render::state::font_size, novasvg::render::canvas::path, novasvg::render::canvas::state, text, text_iterator_has_next(), text_iterator_init(), and text_iterator_next().

Referenced by canvas_clip_text(), canvas_fill_text(), and canvas_stroke_text().

◆ canvas_arc()

void novasvg::render::canvas_arc ( canvas_t *  canvas,
float  cx,
float  cy,
float  r,
float  a0,
float  a1,
bool  ccw 
)

Adds an arc to the current path.

Adds an arc centered at the specified coordinates, with a given radius, starting and ending at the specified angles. The direction of the arc is determined by ccw. This arc segment is added to the current path.

Parameters
canvasA pointer to a canvas_t object.
cxThe x-coordinate of the arc's center.
cyThe y-coordinate of the arc's center.
rThe radius of the arc.
a0The starting angle of the arc in radians.
a1The ending angle of the arc in radians.
ccwIf true, add the arc counter-clockwise; otherwise, clockwise.
Examples
/home/runner/work/novasvg/novasvg/include/novasvg/detail/render/render.h.

Definition at line 480 of file canvas.h.

References novasvg::render::canvas::path, and path_add_arc().

◆ canvas_arc_to()

void novasvg::render::canvas_arc_to ( canvas_t *  canvas,
float  rx,
float  ry,
float  angle,
bool  large_arc_flag,
bool  sweep_flag,
float  x,
float  y 
)

Adds an elliptical arc to the current path.

Adds an elliptical arc from the current point to the specified end point, defined by radii, rotation angle, and flags for arc type and direction. This arc segment is added to the current path. Equivalent to the SVG A command.

Parameters
canvasA pointer to a canvas_t object.
rxThe x-radius of the ellipse.
ryThe y-radius of the ellipse.
angleThe rotation angle of the ellipse in degrees.
large_arc_flagIf true, add the large arc; otherwise, add the small arc.
sweep_flagIf true, add the arc in the positive-angle direction; otherwise, in the negative-angle direction.
xThe x-coordinate of the end point.
yThe y-coordinate of the end point.
Examples
/home/runner/work/novasvg/novasvg/include/novasvg/detail/render/render.h.

Definition at line 455 of file canvas.h.

References novasvg::render::canvas::path, and path_arc_to().

◆ canvas_circle()

void novasvg::render::canvas_circle ( canvas_t *  canvas,
float  cx,
float  cy,
float  r 
)

Adds a circle to the current path.

Adds a circle centered at the specified coordinates with the given radius to the current path.

Parameters
canvasA pointer to a canvas_t object.
cxThe x-coordinate of the circle's center.
cyThe y-coordinate of the circle's center.
rThe radius of the circle.
Examples
/home/runner/work/novasvg/novasvg/include/novasvg/detail/render/render.h.

Definition at line 475 of file canvas.h.

References novasvg::render::canvas::path, and path_add_circle().

◆ canvas_clip()

void novasvg::render::canvas_clip ( canvas_t *  canvas)

A drawing operator that intersects the current clipping region with the current path according to the current fill rule.

The current path will be cleared after this operation.

Parameters
canvasA pointer to a canvas_t object.
Examples
/home/runner/work/novasvg/novasvg/include/novasvg/detail/render/render.h.

Definition at line 572 of file canvas.h.

References canvas_clip_preserve(), and canvas_new_path().

Referenced by canvas_clip_path(), canvas_clip_rect(), and canvas_clip_text().

◆ canvas_clip_contains()

bool novasvg::render::canvas_clip_contains ( canvas_t *  canvas,
float  x,
float  y 
)

Tests whether a point lies within the current clipping region.

Determines whether the point at coordinates (x, y) falls within the active clipping region on the canvas.

If no clipping is applied, the default clipping region covers the entire canvas area starting at (0, 0) with width and height equal to the canvas dimensions.

Parameters
canvasA pointer to a canvas_t object.
xThe X coordinate of the point, in user space.
yThe Y coordinate of the point, in user space.
Returns
true if the point is within the clipping region, false otherwise.
Examples
/home/runner/work/novasvg/novasvg/include/novasvg/detail/render/render.h.

Definition at line 522 of file canvas.h.

References novasvg::render::canvas::clip_rect, novasvg::render::state::clip_spans, novasvg::render::state::clipping, novasvg::render::rect::h, span_buffer_contains(), novasvg::render::canvas::state, novasvg::render::rect::w, novasvg::render::rect::x, and novasvg::render::rect::y.

◆ canvas_clip_extents()

void novasvg::render::canvas_clip_extents ( canvas_t *  canvas,
rect_t *  extents 
)

Gets the bounding box of the current clipping region.

Computes an axis-aligned bounding box in user space that encloses the currently active clipping region on the canvas.

If no clip is applied, the returned rectangle covers the entire canvas area, starting at (0, 0) with width and height equal to the canvas dimensions.

Parameters
canvasA pointer to a canvas_t object.
extentsA pointer to a rect_t structure that receives the bounding box.
Examples
/home/runner/work/novasvg/novasvg/include/novasvg/detail/render/render.h.

Definition at line 548 of file canvas.h.

References novasvg::render::canvas::clip_rect, novasvg::render::state::clip_spans, novasvg::render::state::clipping, novasvg::render::rect::h, span_buffer_extents(), novasvg::render::canvas::state, novasvg::render::rect::w, novasvg::render::rect::x, and novasvg::render::rect::y.

◆ canvas_clip_path()

void novasvg::render::canvas_clip_path ( canvas_t *  canvas,
const path_t *  path 
)

Intersects the current clipping region with a path according to the current fill rule.

Note
The current path will be cleared by this operation.
Parameters
canvasA pointer to a canvas_t object.
pathThe path_t object.
Examples
/home/runner/work/novasvg/novasvg/include/novasvg/detail/render/render.h.

Definition at line 657 of file canvas.h.

References canvas_add_path(), canvas_clip(), and canvas_new_path().

◆ canvas_clip_preserve()

void novasvg::render::canvas_clip_preserve ( canvas_t *  canvas)

A drawing operator that intersects the current clipping region with the current path according to the current fill rule.

The current path will be preserved after this operation.

Parameters
canvasA pointer to a canvas_t object.
Examples
/home/runner/work/novasvg/novasvg/include/novasvg/detail/render/render.h.

Definition at line 610 of file canvas.h.

References novasvg::render::canvas::clip_rect, novasvg::render::state::clip_spans, novasvg::render::canvas::clip_spans, novasvg::render::state::clipping, novasvg::render::canvas::fill_spans, novasvg::render::state::matrix, novasvg::render::canvas::path, rasterize(), span_buffer_copy(), span_buffer_intersect(), novasvg::render::canvas::state, and novasvg::render::state::winding.

Referenced by canvas_clip().

◆ canvas_clip_rect()

void novasvg::render::canvas_clip_rect ( canvas_t *  canvas,
float  x,
float  y,
float  w,
float  h 
)

Intersects the current clipping region with a rectangle according to the current fill rule.

Note
The current path will be cleared by this operation.
Parameters
canvasA pointer to a canvas_t object.
xThe x-coordinate of the rectangle's origin.
yThe y-coordinate of the rectangle's origin.
wThe width of the rectangle.
hThe height of the rectangle.
Examples
/home/runner/work/novasvg/novasvg/include/novasvg/detail/render/render.h.

Definition at line 650 of file canvas.h.

References canvas_clip(), canvas_new_path(), and canvas_rect().

◆ canvas_clip_text()

float novasvg::render::canvas_clip_text ( canvas_t *  canvas,
const void *  text,
int  length,
text_encoding_t  encoding,
float  x,
float  y 
)

Intersects the current clipping region with text at the specified origin.

Note
The current path will be cleared by this operation.
Parameters
canvasA pointer to a canvas_t object.
textThe text data.
lengthThe length of the text data, or -1 if null-terminated.
encodingThe encoding of the text data.
xThe x-coordinate of the origin.
yThe y-coordinate of the origin.
Returns
The total advance width of the text.
Examples
/home/runner/work/novasvg/novasvg/include/novasvg/detail/render/render.h.

Definition at line 711 of file canvas.h.

References canvas_add_text(), canvas_clip(), canvas_new_path(), and text.

◆ canvas_close_path()

void novasvg::render::canvas_close_path ( canvas_t *  canvas)

Closes the current path.

Closes the current path by adding a straight line back to the starting point.

Parameters
canvasA pointer to a canvas_t object.
Examples
/home/runner/work/novasvg/novasvg/include/novasvg/detail/render/render.h.

Definition at line 495 of file canvas.h.

References novasvg::render::canvas::path, and path_close().

◆ canvas_create()

◆ canvas_cubic_to()

void novasvg::render::canvas_cubic_to ( canvas_t *  canvas,
float  x1,
float  y1,
float  x2,
float  y2,
float  x3,
float  y3 
)

Adds a cubic Bézier curve to the current path.

Adds a cubic Bézier curve from the current point to the specified end point, using the given control points. This curve is added to the current path. Equivalent to the SVG C command.

Parameters
canvasA pointer to a canvas_t object.
x1The x-coordinate of the first control point.
y1The y-coordinate of the first control point.
x2The x-coordinate of the second control point.
y2The y-coordinate of the second control point.
x3The x-coordinate of the end point of the curve.
y3The y-coordinate of the end point of the curve.
Examples
/home/runner/work/novasvg/novasvg/include/novasvg/detail/render/render.h.

Definition at line 450 of file canvas.h.

References novasvg::render::canvas::path, and path_cubic_to().

◆ canvas_destroy()

◆ canvas_ellipse()

void novasvg::render::canvas_ellipse ( canvas_t *  canvas,
float  cx,
float  cy,
float  rx,
float  ry 
)

Adds an ellipse to the current path.

Adds an ellipse centered at the specified coordinates with the given radii to the current path.

Parameters
canvasA pointer to a canvas_t object.
cxThe x-coordinate of the ellipse's center.
cyThe y-coordinate of the ellipse's center.
rxThe x-radius of the ellipse.
ryThe y-radius of the ellipse.
Examples
/home/runner/work/novasvg/novasvg/include/novasvg/detail/render/render.h.

Definition at line 470 of file canvas.h.

References novasvg::render::canvas::path, and path_add_ellipse().

◆ canvas_fill()

void novasvg::render::canvas_fill ( canvas_t *  canvas)

A drawing operator that fills the current path according to the current fill rule.

The current path will be cleared after this operation.

Parameters
canvasA pointer to a canvas_t object.
Examples
/home/runner/work/novasvg/novasvg/include/novasvg/detail/render/render.h.

Definition at line 560 of file canvas.h.

References canvas_fill_preserve(), and canvas_new_path().

Referenced by canvas_fill_path(), canvas_fill_rect(), and canvas_fill_text().

◆ canvas_fill_contains()

bool novasvg::render::canvas_fill_contains ( canvas_t *  canvas,
float  x,
float  y 
)

Tests whether a point lies within the current fill region.

Determines whether the point at coordinates (x, y) falls within the area that would be filled by a canvas_fill() operation, given the current path, fill rule, and transformation state.

Note
Clipping and surface dimensions are not considered in this test.
Parameters
canvasA pointer to a canvas_t object.
xThe X coordinate of the point, in user space.
yThe Y coordinate of the point, in user space.
Returns
true if the point is within the fill region, false otherwise.
Examples
/home/runner/work/novasvg/novasvg/include/novasvg/detail/render/render.h.

Definition at line 510 of file canvas.h.

References novasvg::render::canvas::fill_spans, novasvg::render::state::matrix, novasvg::render::canvas::path, rasterize(), span_buffer_contains(), novasvg::render::canvas::state, and novasvg::render::state::winding.

◆ canvas_fill_extents()

void novasvg::render::canvas_fill_extents ( canvas_t *  canvas,
rect_t *  extents 
)

Computes the bounding box of the area that would be affected by a fill operation.

Computes an axis-aligned bounding box in user space that encloses the area which would be affected by a fill operation (canvas_fill()) given the current path, fill rule, and transformation state.

Note
Clipping and surface dimensions are not considered in this calculation.
Parameters
canvasA pointer to a canvas_t object.
extentsA pointer to a rect_t structure that receives the bounding box.
Examples
/home/runner/work/novasvg/novasvg/include/novasvg/detail/render/render.h.

Definition at line 536 of file canvas.h.

References novasvg::render::canvas::fill_spans, novasvg::render::state::matrix, novasvg::render::canvas::path, rasterize(), span_buffer_extents(), novasvg::render::canvas::state, and novasvg::render::state::winding.

◆ canvas_fill_path()

void novasvg::render::canvas_fill_path ( canvas_t *  canvas,
const path_t *  path 
)

Fills a path according to the current fill rule.

Note
The current path will be cleared by this operation.
Parameters
canvasA pointer to a canvas_t object.
pathThe path_t object.
Examples
/home/runner/work/novasvg/novasvg/include/novasvg/detail/render/render.h.

Definition at line 629 of file canvas.h.

References canvas_add_path(), canvas_fill(), and canvas_new_path().

◆ canvas_fill_preserve()

void novasvg::render::canvas_fill_preserve ( canvas_t *  canvas)

A drawing operator that fills the current path according to the current fill rule.

The current path will be preserved after this operation.

Parameters
canvasA pointer to a canvas_t object.
Examples
/home/runner/work/novasvg/novasvg/include/novasvg/detail/render/render.h.

Definition at line 588 of file canvas.h.

References blend(), novasvg::render::canvas::clip_rect, novasvg::render::state::clip_spans, novasvg::render::canvas::clip_spans, novasvg::render::state::clipping, novasvg::render::canvas::fill_spans, novasvg::render::state::matrix, novasvg::render::canvas::path, rasterize(), span_buffer_intersect(), novasvg::render::canvas::state, and novasvg::render::state::winding.

Referenced by canvas_fill().

◆ canvas_fill_rect()

void novasvg::render::canvas_fill_rect ( canvas_t *  canvas,
float  x,
float  y,
float  w,
float  h 
)

Fills a rectangle according to the current fill rule.

Note
The current path will be cleared by this operation.
Parameters
canvasA pointer to a canvas_t object.
xThe x-coordinate of the rectangle's origin.
yThe y-coordinate of the rectangle's origin.
wThe width of the rectangle.
hThe height of the rectangle.
Examples
/home/runner/work/novasvg/novasvg/include/novasvg/detail/render/render.h.

Definition at line 622 of file canvas.h.

References canvas_fill(), canvas_new_path(), and canvas_rect().

◆ canvas_fill_text()

float novasvg::render::canvas_fill_text ( canvas_t *  canvas,
const void *  text,
int  length,
text_encoding_t  encoding,
float  x,
float  y 
)

Fills a text at the specified origin.

Note
The current path will be cleared by this operation.
Parameters
canvasA pointer to a canvas_t object.
textThe text data.
lengthThe length of the text data, or -1 if null-terminated.
encodingThe encoding of the text data.
xThe x-coordinate of the origin.
yThe y-coordinate of the origin.
Returns
The total advance width of the text.
Examples
/home/runner/work/novasvg/novasvg/include/novasvg/detail/render/render.h.

Definition at line 695 of file canvas.h.

References canvas_add_text(), canvas_fill(), canvas_new_path(), and text.

◆ canvas_font_metrics()

void novasvg::render::canvas_font_metrics ( const canvas_t *  canvas,
float *  ascent,
float *  descent,
float *  line_gap,
rect_t *  extents 
)

Retrieves font metrics for the current font.

Parameters
canvasA pointer to a canvas_t object.
ascentThe ascent of the font.
descentThe descent of the font.
line_gapThe line gap of the font.
extentsThe bounding box of the font.
Examples
/home/runner/work/novasvg/novasvg/include/novasvg/detail/render/render.h.

Definition at line 719 of file canvas.h.

References novasvg::render::state::font_face, font_face_get_metrics(), novasvg::render::state::font_size, novasvg::render::rect::h, novasvg::render::canvas::state, novasvg::render::rect::w, novasvg::render::rect::x, and novasvg::render::rect::y.

◆ canvas_get_current_point()

void novasvg::render::canvas_get_current_point ( const canvas_t *  canvas,
float *  x,
float *  y 
)

Retrieves the current point of the canvas.

Gets the coordinates of the current point in the canvas, which is the last point added or moved to in the current path.

Parameters
canvasA pointer to a canvas_t object.
xThe x-coordinate of the current point.
yThe y-coordinate of the current point.
Examples
/home/runner/work/novasvg/novasvg/include/novasvg/detail/render/render.h.

Definition at line 500 of file canvas.h.

References novasvg::render::canvas::path, and path_get_current_point().

◆ canvas_get_dash_array()

int novasvg::render::canvas_get_dash_array ( const canvas_t *  canvas,
const float **  dashes 
)

Retrieves the current dash pattern.

If not set, the default dash array is NULL.

Parameters
canvasA pointer to a canvas_t object.
dashesPointer to store the dash array.
Returns
The number of dash lengths.
Examples
/home/runner/work/novasvg/novasvg/include/novasvg/detail/render/render.h.

Definition at line 373 of file canvas.h.

References novasvg::render::stroke_dash_t::array, novasvg::render::stroke_data_t::dash, novasvg::render::stroke_dash_t::data, novasvg::render::stroke_dash_t::size, novasvg::render::canvas::state, and novasvg::render::state::stroke.

◆ canvas_get_dash_offset()

float novasvg::render::canvas_get_dash_offset ( const canvas_t *  canvas)

Retrieves the current dash offset.

If not set, the default dash offset is 0.

Parameters
canvasA pointer to a canvas_t object.
Returns
The current dash offset.
Examples
/home/runner/work/novasvg/novasvg/include/novasvg/detail/render/render.h.

Definition at line 362 of file canvas.h.

References novasvg::render::stroke_data_t::dash, novasvg::render::stroke_dash_t::offset, novasvg::render::canvas::state, and novasvg::render::state::stroke.

◆ canvas_get_fill_rule()

fill_rule_t novasvg::render::canvas_get_fill_rule ( const canvas_t *  canvas)

Retrieves the current fill rule.

If not set, the default fill rule is NOVASVG_FILL_RULE_NON_ZERO.

Parameters
canvasA pointer to a canvas_t object.
Returns
The current fill rule.
Examples
/home/runner/work/novasvg/novasvg/include/novasvg/detail/render/render.h.

Definition at line 286 of file canvas.h.

References novasvg::render::canvas::state, and novasvg::render::state::winding.

◆ canvas_get_font_face()

font_face_t * novasvg::render::canvas_get_font_face ( const canvas_t *  canvas)

Retrieves the current font face used for text rendering on the canvas.

If not set, the default font face is NULL.

Parameters
canvasA pointer to a canvas_t object.
Returns
A pointer to a font_face_t object representing the current font face.
Examples
/home/runner/work/novasvg/novasvg/include/novasvg/detail/render/render.h.

Definition at line 266 of file canvas.h.

References novasvg::render::state::font_face, and novasvg::render::canvas::state.

◆ canvas_get_font_face_cache()

font_face_cache_t * novasvg::render::canvas_get_font_face_cache ( const canvas_t *  canvas)

Returns the font-face cache associated with the canvas.

Parameters
canvasA pointer to a canvas_t object.
Returns
A pointer to the associated font_face_cache_t object, or NULL if none is set.
Examples
/home/runner/work/novasvg/novasvg/include/novasvg/detail/render/render.h.

Definition at line 223 of file canvas.h.

References novasvg::render::canvas::face_cache.

◆ canvas_get_font_size()

float novasvg::render::canvas_get_font_size ( const canvas_t *  canvas)

Retrieves the current font size used for text rendering on the canvas.

If not set, the default font size is 12.

Parameters
canvasA pointer to a canvas_t object.
Returns
The current font size, in pixels. This value represents the height of the rendered text.
Examples
/home/runner/work/novasvg/novasvg/include/novasvg/detail/render/render.h.

Definition at line 276 of file canvas.h.

References novasvg::render::state::font_size, and novasvg::render::canvas::state.

◆ canvas_get_line_cap()

line_cap_t novasvg::render::canvas_get_line_cap ( const canvas_t *  canvas)

Retrieves the current line cap style.

If not set, the default line cap is NOVASVG_LINE_CAP_BUTT.

Parameters
canvasA pointer to a canvas_t object.
Returns
The current line cap style.
Examples
/home/runner/work/novasvg/novasvg/include/novasvg/detail/render/render.h.

Definition at line 326 of file canvas.h.

References novasvg::render::stroke_style_t::cap, novasvg::render::canvas::state, novasvg::render::state::stroke, and novasvg::render::stroke_data_t::style.

◆ canvas_get_line_join()

line_join_t novasvg::render::canvas_get_line_join ( const canvas_t *  canvas)

Retrieves the current line join style.

If not set, the default line join is NOVASVG_LINE_JOIN_MITER.

Parameters
canvasA pointer to a canvas_t object.
Returns
The current line join style.
Examples
/home/runner/work/novasvg/novasvg/include/novasvg/detail/render/render.h.

Definition at line 336 of file canvas.h.

References novasvg::render::stroke_style_t::join, novasvg::render::canvas::state, novasvg::render::state::stroke, and novasvg::render::stroke_data_t::style.

◆ canvas_get_line_width()

float novasvg::render::canvas_get_line_width ( const canvas_t *  canvas)

Retrieves the current line width.

If not set, the default line width is 1.

Parameters
canvasA pointer to a canvas_t object.
Returns
The current line width.
Examples
/home/runner/work/novasvg/novasvg/include/novasvg/detail/render/render.h.

Definition at line 316 of file canvas.h.

References novasvg::render::canvas::state, novasvg::render::state::stroke, novasvg::render::stroke_data_t::style, and novasvg::render::stroke_style_t::width.

◆ canvas_get_matrix()

void novasvg::render::canvas_get_matrix ( const canvas_t *  canvas,
matrix_t *  matrix 
)

Stores the current transformation matrix in matrix.

Parameters
canvasA pointer to a canvas_t object.
Apointer to the matrix_t to store the matrix.
Examples
/home/runner/work/novasvg/novasvg/include/novasvg/detail/render/render.h.

Definition at line 415 of file canvas.h.

References novasvg::render::state::matrix, and novasvg::render::canvas::state.

◆ canvas_get_miter_limit()

float novasvg::render::canvas_get_miter_limit ( const canvas_t *  canvas)

Retrieves the current miter limit.

If not set, the default miter limit is 10.

Parameters
canvasA pointer to a canvas_t object.
Returns
The current miter limit value.
Examples
/home/runner/work/novasvg/novasvg/include/novasvg/detail/render/render.h.

Definition at line 346 of file canvas.h.

References novasvg::render::stroke_style_t::miter_limit, novasvg::render::canvas::state, novasvg::render::state::stroke, and novasvg::render::stroke_data_t::style.

◆ canvas_get_opacity()

float novasvg::render::canvas_get_opacity ( const canvas_t *  canvas)

Retrieves the current global opacity.

If not set, the default global opacity is 1.

Parameters
canvasA pointer to a canvas_t object.
Returns
The current opacity value.
Examples
/home/runner/work/novasvg/novasvg/include/novasvg/detail/render/render.h.

Definition at line 306 of file canvas.h.

References novasvg::render::state::opacity, and novasvg::render::canvas::state.

◆ canvas_get_operator()

operator_t novasvg::render::canvas_get_operator ( const canvas_t *  canvas)

Retrieves the current compositing operator.

If not set, the default compositing operator is NOVASVG_OPERATOR_SRC_OVER.

Parameters
canvasA pointer to a canvas_t object.
Returns
The current compositing operator.
Examples
/home/runner/work/novasvg/novasvg/include/novasvg/detail/render/render.h.

Definition at line 296 of file canvas.h.

References novasvg::render::state::op, and novasvg::render::canvas::state.

◆ canvas_get_paint()

paint_t * novasvg::render::canvas_get_paint ( const canvas_t *  canvas,
color_t *  color 
)

Retrieves the current paint.

If not set, the default paint is opaque black color.

Parameters
canvasA pointer to a canvas_t object.
colorA pointer to a color_t object where the current color will be stored.
Returns
The current paint_t used for drawing operations. If no paint is set, NULL is returned.
Examples
/home/runner/work/novasvg/novasvg/include/novasvg/detail/render/render.h.

Definition at line 209 of file canvas.h.

References novasvg::render::state::color, novasvg::render::state::paint, and novasvg::render::canvas::state.

◆ canvas_get_path()

path_t * novasvg::render::canvas_get_path ( const canvas_t *  canvas)

Gets the current path from the canvas.

Retrieves the path object representing the sequence of path commands added to the canvas.

Parameters
canvasA pointer to a canvas_t object.
Returns
The current path.
Examples
/home/runner/work/novasvg/novasvg/include/novasvg/detail/render/render.h.

Definition at line 505 of file canvas.h.

References novasvg::render::canvas::path.

◆ canvas_get_reference_count()

int novasvg::render::canvas_get_reference_count ( const canvas_t *  canvas)

Retrieves the reference count of the canvas.

Parameters
canvasA pointer to a canvas_t object.
Returns
The current reference count.
Examples
/home/runner/work/novasvg/novasvg/include/novasvg/detail/render/render.h.

Definition at line 132 of file canvas.h.

References novasvg_get_reference_count.

◆ canvas_get_surface()

surface_t * novasvg::render::canvas_get_surface ( const canvas_t *  canvas)

Gets the surface associated with the canvas.

Parameters
canvasA pointer to a canvas_t object.
Returns
A pointer to the surface_t object.
Examples
/home/runner/work/novasvg/novasvg/include/novasvg/detail/render/render.h.

Definition at line 137 of file canvas.h.

References novasvg::render::canvas::surface.

◆ canvas_glyph_metrics()

void novasvg::render::canvas_glyph_metrics ( canvas_t *  canvas,
codepoint_t  codepoint,
float *  advance_width,
float *  left_side_bearing,
rect_t *  extents 
)

Retrieves metrics for a specific glyph.

Parameters
canvasA pointer to a canvas_t object.
codepointThe glyph codepoint.
advance_widthThe advance width of the glyph.
left_side_bearingThe left side bearing of the glyph.
extentsThe bounding box of the glyph.
Examples
/home/runner/work/novasvg/novasvg/include/novasvg/detail/render/render.h.

Definition at line 738 of file canvas.h.

References novasvg::render::state::font_face, font_face_get_glyph_metrics(), novasvg::render::state::font_size, novasvg::render::rect::h, novasvg::render::canvas::state, novasvg::render::rect::w, novasvg::render::rect::x, and novasvg::render::rect::y.

◆ canvas_line_to()

void novasvg::render::canvas_line_to ( canvas_t *  canvas,
float  x,
float  y 
)

Adds a straight line segment to the current path.

Adds a straight line from the current point to the specified coordinates. This segment is added to the current path. Equivalent to the SVG L command.

Parameters
canvasA pointer to a canvas_t object.
xThe x-coordinate of the end point of the line.
yThe y-coordinate of the end point of the line.
Examples
/home/runner/work/novasvg/novasvg/include/novasvg/detail/render/render.h.

Definition at line 440 of file canvas.h.

References novasvg::render::canvas::path, and path_line_to().

◆ canvas_map()

void novasvg::render::canvas_map ( const canvas_t *  canvas,
float  x,
float  y,
float *  xx,
float *  yy 
)

Transforms the point (x, y) using the current transformation matrix and stores the result in (xx, yy).

Parameters
canvasA pointer to a canvas_t object.
xThe x-coordinate of the point to transform.
yThe y-coordinate of the point to transform.
xxA pointer to store the transformed x-coordinate.
yyA pointer to store the transformed y-coordinate.
Examples
/home/runner/work/novasvg/novasvg/include/novasvg/detail/render/render.h.

Definition at line 420 of file canvas.h.

References novasvg::render::state::matrix, matrix_map(), and novasvg::render::canvas::state.

◆ canvas_map_point()

void novasvg::render::canvas_map_point ( const canvas_t *  canvas,
const point_t *  src,
point_t *  dst 
)

Transforms the src point using the current transformation matrix and stores the result in dst.

Note
src and dst can be identical.
Parameters
canvasA pointer to a canvas_t object.
srcA pointer to the point_t point to transform.
dstA pointer to the point_t to store the transformed point.
Examples
/home/runner/work/novasvg/novasvg/include/novasvg/detail/render/render.h.

Definition at line 425 of file canvas.h.

References novasvg::render::state::matrix, matrix_map_point(), and novasvg::render::canvas::state.

◆ canvas_map_rect()

void novasvg::render::canvas_map_rect ( const canvas_t *  canvas,
const rect_t *  src,
rect_t *  dst 
)

Transforms the src rectangle using the current transformation matrix and stores the result in dst.

Note
src and dst can be identical.
Parameters
canvasA pointer to a canvas_t object.
srcA pointer to the rect_t rectangle to transform.
dstA pointer to the rect_t to store the transformed rectangle.
Examples
/home/runner/work/novasvg/novasvg/include/novasvg/detail/render/render.h.

Definition at line 430 of file canvas.h.

References novasvg::render::state::matrix, matrix_map_rect(), and novasvg::render::canvas::state.

◆ canvas_move_to()

void novasvg::render::canvas_move_to ( canvas_t *  canvas,
float  x,
float  y 
)

Moves the current point to a new position.

Moves the current point to the specified coordinates without adding a line. This operation is added to the current path. Equivalent to the SVG M command.

Parameters
canvasA pointer to a canvas_t object.
xThe x-coordinate of the new position.
yThe y-coordinate of the new position.
Examples
/home/runner/work/novasvg/novasvg/include/novasvg/detail/render/render.h.

Definition at line 435 of file canvas.h.

References novasvg::render::canvas::path, and path_move_to().

◆ canvas_new_path()

void novasvg::render::canvas_new_path ( canvas_t *  canvas)

Starts a new path on the canvas.

Begins a new path, clearing any existing path data. The new path starts with no commands.

Parameters
canvasA pointer to a canvas_t object.
Examples
/home/runner/work/novasvg/novasvg/include/novasvg/detail/render/render.h.

Definition at line 490 of file canvas.h.

References novasvg::render::canvas::path, and path_reset().

Referenced by canvas_clip(), canvas_clip_path(), canvas_clip_rect(), canvas_clip_text(), canvas_fill(), canvas_fill_path(), canvas_fill_rect(), canvas_fill_text(), canvas_stroke(), canvas_stroke_path(), canvas_stroke_rect(), and canvas_stroke_text().

◆ canvas_paint()

void novasvg::render::canvas_paint ( canvas_t *  canvas)

A drawing operator that paints the current clipping region using the current paint.

Note
The current path will not be affected by this operation.
Parameters
canvasA pointer to a canvas_t object.
Examples
/home/runner/work/novasvg/novasvg/include/novasvg/detail/render/render.h.

Definition at line 578 of file canvas.h.

References blend(), novasvg::render::state::clip_spans, novasvg::render::canvas::clip_spans, novasvg::render::state::clipping, novasvg::render::surface::height, span_buffer_init_rect(), novasvg::render::canvas::state, novasvg::render::canvas::surface, and novasvg::render::surface::width.

◆ canvas_quad_to()

void novasvg::render::canvas_quad_to ( canvas_t *  canvas,
float  x1,
float  y1,
float  x2,
float  y2 
)

Adds a quadratic Bézier curve to the current path.

Adds a quadratic Bézier curve from the current point to the specified end point, using the given control point. This curve is added to the current path. Equivalent to the SVG Q command.

Parameters
canvasA pointer to a canvas_t object.
x1The x-coordinate of the control point.
y1The y-coordinate of the control point.
x2The x-coordinate of the end point of the curve.
y2The y-coordinate of the end point of the curve.
Examples
/home/runner/work/novasvg/novasvg/include/novasvg/detail/render/render.h.

Definition at line 445 of file canvas.h.

References novasvg::render::canvas::path, and path_quad_to().

◆ canvas_rect()

void novasvg::render::canvas_rect ( canvas_t *  canvas,
float  x,
float  y,
float  w,
float  h 
)

Adds a rectangle to the current path.

Adds a rectangle with the specified position and dimensions to the current path.

Parameters
canvasA pointer to a canvas_t object.
xThe x-coordinate of the rectangle's origin.
yThe y-coordinate of the rectangle's origin.
wThe width of the rectangle.
hThe height of the rectangle.
Examples
/home/runner/work/novasvg/novasvg/include/novasvg/detail/render/render.h.

Definition at line 460 of file canvas.h.

References novasvg::render::canvas::path, and path_add_rect().

Referenced by canvas_clip_rect(), canvas_fill_rect(), and canvas_stroke_rect().

◆ canvas_reference()

canvas_t * novasvg::render::canvas_reference ( canvas_t *  canvas)

Increases the reference count of the canvas.

Parameters
canvasA pointer to a canvas_t object.
Returns
The same pointer to the canvas_t object.
Examples
/home/runner/work/novasvg/novasvg/include/novasvg/detail/render/render.h.

Definition at line 102 of file canvas.h.

References novasvg_increment_reference.

◆ canvas_reset_matrix()

void novasvg::render::canvas_reset_matrix ( canvas_t *  canvas)

Resets the current transformation matrix to the identity matrix.

Parameters
canvasA pointer to a canvas_t object.
Examples
/home/runner/work/novasvg/novasvg/include/novasvg/detail/render/render.h.

Definition at line 405 of file canvas.h.

References novasvg::render::state::matrix, matrix_init_identity(), and novasvg::render::canvas::state.

◆ canvas_restore()

void novasvg::render::canvas_restore ( canvas_t *  canvas)

Restores the canvas to the most recently saved state.

Parameters
canvasA pointer to a canvas_t object.
Examples
/home/runner/work/novasvg/novasvg/include/novasvg/detail/render/render.h.

Definition at line 154 of file canvas.h.

References novasvg::render::canvas::freed_state, novasvg::render::state::next, novasvg::render::canvas::state, and state_reset().

◆ canvas_rotate()

void novasvg::render::canvas_rotate ( canvas_t *  canvas,
float  angle 
)

Rotates the current transformation matrix by the specified angle (in radians).

Parameters
canvasA pointer to a canvas_t object.
angleThe rotation angle in radians.
Examples
/home/runner/work/novasvg/novasvg/include/novasvg/detail/render/render.h.

Definition at line 395 of file canvas.h.

References novasvg::render::state::matrix, matrix_rotate(), and novasvg::render::canvas::state.

◆ canvas_round_rect()

void novasvg::render::canvas_round_rect ( canvas_t *  canvas,
float  x,
float  y,
float  w,
float  h,
float  rx,
float  ry 
)

Adds a rounded rectangle to the current path.

Adds a rectangle with rounded corners defined by the specified position, dimensions, and corner radii to the current path.

Parameters
canvasA pointer to a canvas_t object.
xThe x-coordinate of the rectangle's origin.
yThe y-coordinate of the rectangle's origin.
wThe width of the rectangle.
hThe height of the rectangle.
rxThe x-radius of the corners.
ryThe y-radius of the corners.
Examples
/home/runner/work/novasvg/novasvg/include/novasvg/detail/render/render.h.

Definition at line 465 of file canvas.h.

References novasvg::render::canvas::path, and path_add_round_rect().

◆ canvas_save()

void novasvg::render::canvas_save ( canvas_t *  canvas)

Saves the current state of the canvas.

Parameters
canvasA pointer to a canvas_t object.
Examples
/home/runner/work/novasvg/novasvg/include/novasvg/detail/render/render.h.

Definition at line 142 of file canvas.h.

References novasvg::render::canvas::freed_state, novasvg::render::state::next, novasvg::render::canvas::state, state_copy(), and state_create().

◆ canvas_scale()

void novasvg::render::canvas_scale ( canvas_t *  canvas,
float  sx,
float  sy 
)

Scales the current transformation matrix by factors sx and sy.

Parameters
canvasA pointer to a canvas_t object.
sxThe scaling factor in the x-direction.
syThe scaling factor in the y-direction.
Examples
/home/runner/work/novasvg/novasvg/include/novasvg/detail/render/render.h.

Definition at line 385 of file canvas.h.

References novasvg::render::state::matrix, matrix_scale(), and novasvg::render::canvas::state.

◆ canvas_select_font_face()

bool novasvg::render::canvas_select_font_face ( canvas_t *  canvas,
const char *  family,
bool  bold,
bool  italic 
)

Selects and sets the current font face on the canvas.

Parameters
canvasA pointer to a canvas_t object.
familyThe font family name to select.
boldWhether to match a bold variant.
italicWhether to match an italic variant.
Returns
true if a matching font was found and set, false otherwise.
Examples
/home/runner/work/novasvg/novasvg/include/novasvg/detail/render/render.h.

Definition at line 242 of file canvas.h.

References canvas_set_font_face(), novasvg::render::canvas::face_cache, and font_face_cache_get().

◆ canvas_set_color()

void novasvg::render::canvas_set_color ( canvas_t *  canvas,
const color_t *  color 
)

Sets the current paint to a solid color.

If not set, the default paint is opaque black color.

Parameters
canvasA pointer to a canvas_t object.
colorA pointer to a color_t object.
Examples
/home/runner/work/novasvg/novasvg/include/novasvg/detail/render/render.h.

Definition at line 176 of file canvas.h.

References novasvg::render::color::a, novasvg::render::color::b, canvas_set_rgba(), novasvg::render::color::g, and novasvg::render::color::r.

◆ canvas_set_dash()

void novasvg::render::canvas_set_dash ( canvas_t *  canvas,
float  offset,
const float *  dashes,
int  ndashes 
)

Sets the dash pattern.

If not set, the default dash offset is 0, and the default dash array is NULL.

Parameters
canvasA pointer to a canvas_t object.
offsetThe dash offset.
dashesArray of dash lengths.
ndashesNumber of dash lengths.
Examples
/home/runner/work/novasvg/novasvg/include/novasvg/detail/render/render.h.

Definition at line 351 of file canvas.h.

References canvas_set_dash_array(), and canvas_set_dash_offset().

◆ canvas_set_dash_array()

void novasvg::render::canvas_set_dash_array ( canvas_t *  canvas,
const float *  dashes,
int  ndashes 
)

Sets the dash pattern.

If not set, the default dash array is NULL.

Parameters
canvasA pointer to a canvas_t object.
dashesArray of dash lengths.
ndashesNumber of dash lengths.
Examples
/home/runner/work/novasvg/novasvg/include/novasvg/detail/render/render.h.

Definition at line 367 of file canvas.h.

References novasvg::render::stroke_dash_t::array, novasvg::render::stroke_data_t::dash, novasvg_array_append_data, novasvg_array_clear, novasvg::render::canvas::state, and novasvg::render::state::stroke.

Referenced by canvas_set_dash().

◆ canvas_set_dash_offset()

void novasvg::render::canvas_set_dash_offset ( canvas_t *  canvas,
float  offset 
)

Sets the dash offset.

If not set, the default dash offset is 0.

Parameters
canvasA pointer to a canvas_t object.
offsetThe dash offset.
Examples
/home/runner/work/novasvg/novasvg/include/novasvg/detail/render/render.h.

Definition at line 357 of file canvas.h.

References novasvg::render::stroke_data_t::dash, novasvg::render::stroke_dash_t::offset, novasvg::render::canvas::state, and novasvg::render::state::stroke.

Referenced by canvas_set_dash().

◆ canvas_set_fill_rule()

void novasvg::render::canvas_set_fill_rule ( canvas_t *  canvas,
fill_rule_t  winding 
)

Sets the fill rule.

If not set, the default fill rule is NOVASVG_FILL_RULE_NON_ZERO.

Parameters
canvasA pointer to a canvas_t object.
windingThe fill rule.
Examples
/home/runner/work/novasvg/novasvg/include/novasvg/detail/render/render.h.

Definition at line 281 of file canvas.h.

References novasvg::render::canvas::state, and novasvg::render::state::winding.

◆ canvas_set_font()

void novasvg::render::canvas_set_font ( canvas_t *  canvas,
font_face_t *  face,
float  size 
)

Sets the font face and size for text rendering on the canvas.

If not set, the default font face is NULL, and the default face size is 12.

Parameters
canvasA pointer to a canvas_t object.
faceA pointer to a font_face_t object representing the font face to use.
sizeThe size of the font, in pixels. This determines the height of the rendered text.
Examples
/home/runner/work/novasvg/novasvg/include/novasvg/detail/render/render.h.

Definition at line 253 of file canvas.h.

References canvas_set_font_face(), and canvas_set_font_size().

◆ canvas_set_font_face()

void novasvg::render::canvas_set_font_face ( canvas_t *  canvas,
font_face_t *  face 
)

Sets the font face for text rendering on the canvas.

If not set, the default font face is NULL.

Parameters
canvasA pointer to a canvas_t object.
faceA pointer to a font_face_t object representing the font face to use.
Examples
/home/runner/work/novasvg/novasvg/include/novasvg/detail/render/render.h.

Definition at line 259 of file canvas.h.

References novasvg::render::state::font_face, font_face_destroy(), font_face_reference(), and novasvg::render::canvas::state.

Referenced by canvas_select_font_face(), and canvas_set_font().

◆ canvas_set_font_face_cache()

void novasvg::render::canvas_set_font_face_cache ( canvas_t *  canvas,
font_face_cache_t *  cache 
)

Assigns a font-face cache to the canvas for font management.

Parameters
canvasA pointer to a canvas_t object.
cacheA pointer to a font_face_cache_t object, or NULL to unset the current cache.
Examples
/home/runner/work/novasvg/novasvg/include/novasvg/detail/render/render.h.

Definition at line 216 of file canvas.h.

References novasvg::render::canvas::face_cache, font_face_cache_destroy(), and font_face_cache_reference().

◆ canvas_set_font_size()

void novasvg::render::canvas_set_font_size ( canvas_t *  canvas,
float  size 
)

Sets the font size for text rendering on the canvas.

If not set, the default font size is 12.

Parameters
canvasA pointer to a canvas_t object.
sizeThe size of the font, in pixels. This value defines the height of the rendered text.
Examples
/home/runner/work/novasvg/novasvg/include/novasvg/detail/render/render.h.

Definition at line 271 of file canvas.h.

References novasvg::render::state::font_size, and novasvg::render::canvas::state.

Referenced by canvas_set_font().

◆ canvas_set_line_cap()

void novasvg::render::canvas_set_line_cap ( canvas_t *  canvas,
line_cap_t  line_cap 
)

Sets the line cap style.

If not set, the default line cap is NOVASVG_LINE_CAP_BUTT.

Parameters
canvasA pointer to a canvas_t object.
line_capThe line cap style.
Examples
/home/runner/work/novasvg/novasvg/include/novasvg/detail/render/render.h.

Definition at line 321 of file canvas.h.

References novasvg::render::stroke_style_t::cap, novasvg::render::canvas::state, novasvg::render::state::stroke, and novasvg::render::stroke_data_t::style.

◆ canvas_set_line_join()

void novasvg::render::canvas_set_line_join ( canvas_t *  canvas,
line_join_t  line_join 
)

Sets the line join style.

If not set, the default line join is NOVASVG_LINE_JOIN_MITER.

Parameters
canvasA pointer to a canvas_t object.
line_joinThe line join style.
Examples
/home/runner/work/novasvg/novasvg/include/novasvg/detail/render/render.h.

Definition at line 331 of file canvas.h.

References novasvg::render::stroke_style_t::join, novasvg::render::canvas::state, novasvg::render::state::stroke, and novasvg::render::stroke_data_t::style.

◆ canvas_set_line_width()

void novasvg::render::canvas_set_line_width ( canvas_t *  canvas,
float  line_width 
)

Sets the line width.

If not set, the default line width is 1.

Parameters
canvasA pointer to a canvas_t object.
line_widthThe width of the stroke.
Examples
/home/runner/work/novasvg/novasvg/include/novasvg/detail/render/render.h.

Definition at line 311 of file canvas.h.

References novasvg::render::canvas::state, novasvg::render::state::stroke, novasvg::render::stroke_data_t::style, and novasvg::render::stroke_style_t::width.

◆ canvas_set_linear_gradient()

void novasvg::render::canvas_set_linear_gradient ( canvas_t *  canvas,
float  x1,
float  y1,
float  x2,
float  y2,
spread_method_t  spread,
const gradient_stop_t *  stops,
int  nstops,
const matrix_t *  matrix 
)

Sets the current paint to a linear gradient.

If not set, the default paint is opaque black color.

Parameters
canvasA pointer to a canvas_t object.
x1The x coordinate of the start point.
y1The y coordinate of the start point.
x2The x coordinate of the end point.
y2The y coordinate of the end point.
spreadThe gradient spread method.
stopsArray of gradient stops.
nstopsNumber of gradient stops.
matrixOptional transformation matrix.
Examples
/home/runner/work/novasvg/novasvg/include/novasvg/detail/render/render.h.

Definition at line 181 of file canvas.h.

References canvas_set_paint(), paint_create_linear_gradient(), and paint_destroy().

◆ canvas_set_matrix()

void novasvg::render::canvas_set_matrix ( canvas_t *  canvas,
const matrix_t *  matrix 
)

Resets the current transformation matrix to the specified matrix.

Parameters
canvasA pointer to a canvas_t object.
matrixA pointer to the matrix_t object.
Examples
/home/runner/work/novasvg/novasvg/include/novasvg/detail/render/render.h.

Definition at line 410 of file canvas.h.

References novasvg::render::state::matrix, NOVASVG_IDENTITY_MATRIX, and novasvg::render::canvas::state.

◆ canvas_set_miter_limit()

void novasvg::render::canvas_set_miter_limit ( canvas_t *  canvas,
float  miter_limit 
)

Sets the miter limit.

If not set, the default miter limit is 10.

Parameters
canvasA pointer to a canvas_t object.
miter_limitThe miter limit value.
Examples
/home/runner/work/novasvg/novasvg/include/novasvg/detail/render/render.h.

Definition at line 341 of file canvas.h.

References novasvg::render::stroke_style_t::miter_limit, novasvg::render::canvas::state, novasvg::render::state::stroke, and novasvg::render::stroke_data_t::style.

◆ canvas_set_opacity()

void novasvg::render::canvas_set_opacity ( canvas_t *  canvas,
float  opacity 
)

Sets the global opacity.

If not set, the default global opacity is 1.

Parameters
canvasA pointer to a canvas_t object.
opacityThe opacity value (0 to 1).
Examples
/home/runner/work/novasvg/novasvg/include/novasvg/detail/render/render.h.

Definition at line 301 of file canvas.h.

References novasvg::render::state::opacity, and novasvg::render::canvas::state.

◆ canvas_set_operator()

void novasvg::render::canvas_set_operator ( canvas_t *  canvas,
operator_t  op 
)

Sets the compositing operator.

If not set, the default compositing operator is NOVASVG_OPERATOR_SRC_OVER.

Parameters
canvasA pointer to a canvas_t object.
opThe compositing operator.
Examples
/home/runner/work/novasvg/novasvg/include/novasvg/detail/render/render.h.

Definition at line 291 of file canvas.h.

References novasvg::render::state::op, and novasvg::render::canvas::state.

◆ canvas_set_paint()

void novasvg::render::canvas_set_paint ( canvas_t *  canvas,
paint_t *  paint 
)

Sets the current paint.

If not set, the default paint is opaque black color.

Parameters
canvasA pointer to a canvas_t object.
paintThe paint to be used for subsequent drawing operations.
Examples
/home/runner/work/novasvg/novasvg/include/novasvg/detail/render/render.h.

Definition at line 202 of file canvas.h.

References novasvg::render::state::paint, paint_destroy(), paint_reference(), and novasvg::render::canvas::state.

Referenced by canvas_set_linear_gradient(), canvas_set_radial_gradient(), canvas_set_rgba(), and canvas_set_texture().

◆ canvas_set_radial_gradient()

void novasvg::render::canvas_set_radial_gradient ( canvas_t *  canvas,
float  cx,
float  cy,
float  cr,
float  fx,
float  fy,
float  fr,
spread_method_t  spread,
const gradient_stop_t *  stops,
int  nstops,
const matrix_t *  matrix 
)

Sets the current paint to a radial gradient.

If not set, the default paint is opaque black color.

Parameters
canvasA pointer to a canvas_t object.
cxThe x coordinate of the center.
cyThe y coordinate of the center.
crThe radius of the gradient.
fxThe x coordinate of the focal point.
fyThe y coordinate of the focal point.
frThe radius of the focal point.
spreadThe gradient spread method.
stopsArray of gradient stops.
nstopsNumber of gradient stops.
matrixOptional transformation matrix.
Examples
/home/runner/work/novasvg/novasvg/include/novasvg/detail/render/render.h.

Definition at line 188 of file canvas.h.

References canvas_set_paint(), paint_create_radial_gradient(), and paint_destroy().

◆ canvas_set_rgb()

void novasvg::render::canvas_set_rgb ( canvas_t *  canvas,
float  r,
float  g,
float  b 
)

Sets the current paint to a solid color.

If not set, the default paint is opaque black color.

Parameters
canvasA pointer to a canvas_t object.
rThe red component (0 to 1).
gThe green component (0 to 1).
bThe blue component (0 to 1).
Examples
/home/runner/work/novasvg/novasvg/include/novasvg/detail/render/render.h.

Definition at line 165 of file canvas.h.

References canvas_set_rgba().

◆ canvas_set_rgba()

void novasvg::render::canvas_set_rgba ( canvas_t *  canvas,
float  r,
float  g,
float  b,
float  a 
)

Sets the current paint to a solid color.

If not set, the default paint is opaque black color.

Parameters
canvasA pointer to a canvas_t object.
rThe red component (0 to 1).
gThe green component (0 to 1).
bThe blue component (0 to 1).
aThe alpha component (0 to 1).
Examples
/home/runner/work/novasvg/novasvg/include/novasvg/detail/render/render.h.

Definition at line 170 of file canvas.h.

References canvas_set_paint(), novasvg::render::state::color, color_init_rgba(), and novasvg::render::canvas::state.

Referenced by canvas_set_color(), and canvas_set_rgb().

◆ canvas_set_texture()

void novasvg::render::canvas_set_texture ( canvas_t *  canvas,
surface_t *  surface,
texture_type_t  type,
float  opacity,
const matrix_t *  matrix 
)

Sets the current paint to a texture.

If not set, the default paint is opaque black color.

Parameters
canvasA pointer to a canvas_t object.
surfaceThe texture surface.
typeThe texture type (plain or tiled).
opacityThe opacity of the texture (0 to 1).
matrixOptional transformation matrix.
Examples
/home/runner/work/novasvg/novasvg/include/novasvg/detail/render/render.h.

Definition at line 195 of file canvas.h.

References canvas_set_paint(), paint_create_texture(), and paint_destroy().

◆ canvas_shear()

void novasvg::render::canvas_shear ( canvas_t *  canvas,
float  shx,
float  shy 
)

Shears the current transformation matrix by factors shx and shy.

Parameters
canvasA pointer to a canvas_t object.
shxThe shearing factor in the x-direction.
shyThe shearing factor in the y-direction.
Examples
/home/runner/work/novasvg/novasvg/include/novasvg/detail/render/render.h.

Definition at line 390 of file canvas.h.

References novasvg::render::state::matrix, matrix_shear(), and novasvg::render::canvas::state.

◆ canvas_stroke()

void novasvg::render::canvas_stroke ( canvas_t *  canvas)

A drawing operator that strokes the current path according to the current stroke settings.

The current path will be cleared after this operation.

Parameters
canvasA pointer to a canvas_t object.
Examples
/home/runner/work/novasvg/novasvg/include/novasvg/detail/render/render.h.

Definition at line 566 of file canvas.h.

References canvas_new_path(), and canvas_stroke_preserve().

Referenced by canvas_stroke_path(), canvas_stroke_rect(), and canvas_stroke_text().

◆ canvas_stroke_contains()

bool novasvg::render::canvas_stroke_contains ( canvas_t *  canvas,
float  x,
float  y 
)

Tests whether a point lies within the current stroke region.

Determines whether the point at coordinates (x, y) falls within the area that would be stroked by a canvas_stroke() operation, given the current path, stroke width, joins, caps, miter limit, dash pattern, and transformation state.

Note
Clipping and surface dimensions are not considered in this test.
Parameters
canvasA pointer to a canvas_t object.
xThe X coordinate of the point, in user space.
yThe Y coordinate of the point, in user space.
Returns
true if the point is within the stroke region, false otherwise.
Examples
/home/runner/work/novasvg/novasvg/include/novasvg/detail/render/render.h.

Definition at line 516 of file canvas.h.

References novasvg::render::canvas::fill_spans, novasvg::render::state::matrix, novasvg::render::canvas::path, rasterize(), span_buffer_contains(), novasvg::render::canvas::state, and novasvg::render::state::winding.

◆ canvas_stroke_extents()

void novasvg::render::canvas_stroke_extents ( canvas_t *  canvas,
rect_t *  extents 
)

Computes the bounding box of the area that would be affected by a stroke operation.

Computes an axis-aligned bounding box in user space that encloses the area which would be affected by a stroke operation (canvas_stroke()) given the current path, stroke width, joins, caps, miter limit, dash pattern, and transformation state.

Note
Clipping and surface dimensions are not considered in this calculation.
Parameters
canvasA pointer to a canvas_t object.
extentsA pointer to a rect_t structure that receives the bounding box.
Examples
/home/runner/work/novasvg/novasvg/include/novasvg/detail/render/render.h.

Definition at line 542 of file canvas.h.

References novasvg::render::canvas::fill_spans, novasvg::render::state::matrix, NOVASVG_FILL_RULE_NON_ZERO, novasvg::render::canvas::path, rasterize(), span_buffer_extents(), novasvg::render::canvas::state, and novasvg::render::state::stroke.

◆ canvas_stroke_path()

void novasvg::render::canvas_stroke_path ( canvas_t *  canvas,
const path_t *  path 
)

Strokes a path with the current stroke settings.

Note
The current path will be cleared by this operation.
Parameters
canvasA pointer to a canvas_t object.
pathThe path_t object.
Examples
/home/runner/work/novasvg/novasvg/include/novasvg/detail/render/render.h.

Definition at line 643 of file canvas.h.

References canvas_add_path(), canvas_new_path(), and canvas_stroke().

◆ canvas_stroke_preserve()

void novasvg::render::canvas_stroke_preserve ( canvas_t *  canvas)

◆ canvas_stroke_rect()

void novasvg::render::canvas_stroke_rect ( canvas_t *  canvas,
float  x,
float  y,
float  w,
float  h 
)

Strokes a rectangle with the current stroke settings.

Note
The current path will be cleared by this operation.
Parameters
canvasA pointer to a canvas_t object.
xThe x-coordinate of the rectangle's origin.
yThe y-coordinate of the rectangle's origin.
wThe width of the rectangle.
hThe height of the rectangle.
Examples
/home/runner/work/novasvg/novasvg/include/novasvg/detail/render/render.h.

Definition at line 636 of file canvas.h.

References canvas_new_path(), canvas_rect(), and canvas_stroke().

◆ canvas_stroke_text()

float novasvg::render::canvas_stroke_text ( canvas_t *  canvas,
const void *  text,
int  length,
text_encoding_t  encoding,
float  x,
float  y 
)

Strokes a text at the specified origin.

Note
The current path will be cleared by this operation.
Parameters
canvasA pointer to a canvas_t object.
textThe text data.
lengthThe length of the text data, or -1 if null-terminated.
encodingThe encoding of the text data.
xThe x-coordinate of the origin.
yThe y-coordinate of the origin.
Returns
The total advance width of the text.
Examples
/home/runner/work/novasvg/novasvg/include/novasvg/detail/render/render.h.

Definition at line 703 of file canvas.h.

References canvas_add_text(), canvas_new_path(), canvas_stroke(), and text.

◆ canvas_text_extents()

float novasvg::render::canvas_text_extents ( canvas_t *  canvas,
const void *  text,
int  length,
text_encoding_t  encoding,
rect_t *  extents 
)

Retrieves the extents of a text.

Parameters
canvasA pointer to a canvas_t object.
textThe text data.
lengthThe length of the text data, or -1 if null-terminated.
encodingThe encoding of the text data.
extentsThe bounding box of the text.
Returns
The total advance width of the text.
Examples
/home/runner/work/novasvg/novasvg/include/novasvg/detail/render/render.h.

Definition at line 756 of file canvas.h.

References novasvg::render::state::font_face, font_face_text_extents(), novasvg::render::state::font_size, novasvg::render::rect::h, novasvg::render::canvas::state, text, novasvg::render::rect::w, novasvg::render::rect::x, and novasvg::render::rect::y.

◆ canvas_transform()

void novasvg::render::canvas_transform ( canvas_t *  canvas,
const matrix_t *  matrix 
)

Multiplies the current transformation matrix with the specified matrix.

Parameters
canvasA pointer to a canvas_t object.
matrixA pointer to the matrix_t object.
Examples
/home/runner/work/novasvg/novasvg/include/novasvg/detail/render/render.h.

Definition at line 400 of file canvas.h.

References novasvg::render::state::matrix, matrix_multiply(), and novasvg::render::canvas::state.

◆ canvas_translate()

void novasvg::render::canvas_translate ( canvas_t *  canvas,
float  tx,
float  ty 
)

Translates the current transformation matrix by offsets tx and ty.

Parameters
canvasA pointer to a canvas_t object.
txThe translation offset in the x-direction.
tyThe translation offset in the y-direction.
Examples
/home/runner/work/novasvg/novasvg/include/novasvg/detail/render/render.h.

Definition at line 380 of file canvas.h.

References novasvg::render::state::matrix, matrix_translate(), and novasvg::render::canvas::state.

◆ clone_traverse_func()

NOVASVG_INLINE void novasvg::render::clone_traverse_func ( void *  closure,
path_command_t  command,
const point_t *  points,
int  npoints 
)

◆ color_init_argb32()

void novasvg::render::color_init_argb32 ( color_t *  color,
unsigned int  value 
)

Initializes a color from a 32-bit unsigned ARGB value.

Parameters
colorA pointer to a color_t object.
value32-bit unsigned ARGB value.
Examples
/home/runner/work/novasvg/novasvg/include/novasvg/detail/render/render.h.

Definition at line 43 of file paint.h.

References color_init_rgba8().

Referenced by color_parse().

◆ color_init_hsl()

void novasvg::render::color_init_hsl ( color_t *  color,
float  h,
float  s,
float  l 
)

Initializes a color with the specified HSL color values.

Parameters
colorA pointer to a color_t object.
hHue component in degrees (0 to 360).
sSaturation component (0 to 1).
lLightness component (0 to 1).
Examples
/home/runner/work/novasvg/novasvg/include/novasvg/detail/render/render.h.

Definition at line 52 of file paint.h.

References color_init_hsla().

◆ color_init_hsla()

void novasvg::render::color_init_hsla ( color_t *  color,
float  h,
float  s,
float  l,
float  a 
)

Initializes a color with the specified HSLA color values.

Parameters
colorA pointer to a color_t object.
hHue component in degrees (0 to 360).
sSaturation component (0 to 1).
lLightness component (0 to 1).
aAlpha component (0 to 1).
Examples
/home/runner/work/novasvg/novasvg/include/novasvg/detail/render/render.h.

Definition at line 64 of file paint.h.

References color_init_rgba().

Referenced by color_init_hsl(), and color_parse().

◆ color_init_rgb()

void novasvg::render::color_init_rgb ( color_t *  color,
float  r,
float  g,
float  b 
)

Initializes a color using RGB components in the 0-1 range.

Parameters
colorA pointer to a color_t object.
rRed component (0 to 1).
gGreen component (0 to 1).
bBlue component (0 to 1).
Examples
/home/runner/work/novasvg/novasvg/include/novasvg/detail/render/render.h.

Definition at line 11 of file paint.h.

References color_init_rgba().

◆ color_init_rgb8()

void novasvg::render::color_init_rgb8 ( color_t *  color,
int  r,
int  g,
int  b 
)

Initializes a color using RGB components in the 0-255 range.

Parameters
colorA pointer to a color_t object.
rRed component (0 to 255).
gGreen component (0 to 255).
bBlue component (0 to 255).
Examples
/home/runner/work/novasvg/novasvg/include/novasvg/detail/render/render.h.

Definition at line 24 of file paint.h.

References color_init_rgba8().

◆ color_init_rgba()

void novasvg::render::color_init_rgba ( color_t *  color,
float  r,
float  g,
float  b,
float  a 
)

Initializes a color using RGBA components in the 0-1 range.

Parameters
colorA pointer to a color_t object.
rRed component (0 to 1).
gGreen component (0 to 1).
bBlue component (0 to 1).
aAlpha component (0 to 1).
Examples
/home/runner/work/novasvg/novasvg/include/novasvg/detail/render/render.h.

Definition at line 16 of file paint.h.

References novasvg::render::color::a, novasvg::render::color::b, novasvg::render::color::g, and novasvg::render::color::r.

Referenced by canvas_set_rgba(), color_init_hsla(), color_init_rgb(), color_init_rgba8(), and color_parse().

◆ color_init_rgba32()

void novasvg::render::color_init_rgba32 ( color_t *  color,
unsigned int  value 
)

Initializes a color from a 32-bit unsigned RGBA value.

Parameters
colorA pointer to a color_t object.
value32-bit unsigned RGBA value.
Examples
/home/runner/work/novasvg/novasvg/include/novasvg/detail/render/render.h.

Definition at line 34 of file paint.h.

References color_init_rgba8().

Referenced by novasvg::Bitmap::clear().

◆ color_init_rgba8()

void novasvg::render::color_init_rgba8 ( color_t *  color,
int  r,
int  g,
int  b,
int  a 
)

Initializes a color using RGBA components in the 0-255 range.

Parameters
colorA pointer to a color_t object.
rRed component (0 to 255).
gGreen component (0 to 255).
bBlue component (0 to 255).
aAlpha component (0 to 255).
Examples
/home/runner/work/novasvg/novasvg/include/novasvg/detail/render/render.h.

Definition at line 29 of file paint.h.

References color_init_rgba().

Referenced by color_init_argb32(), color_init_rgb8(), color_init_rgba32(), and color_parse().

◆ color_parse()

int novasvg::render::color_parse ( color_t *  color,
const char *  data,
int  length 
)

Parses a color from a string using CSS color syntax.

Parameters
colorA pointer to a color_t object to store the parsed color.
dataA pointer to the input string containing the color data.
lengthThe length of the input string in bytes, or -1 if the string is null-terminated.
Returns
The number of characters consumed on success (including leading/trailing spaces), or 0 on failure.
Examples
/home/runner/work/novasvg/novasvg/include/novasvg/detail/render/render.h.

Definition at line 144 of file paint.h.

References color_init_argb32(), color_init_hsla(), color_init_rgba(), color_init_rgba8(), MAX_NAME, parse_number(), skip_delim(), skip_ws(), skip_ws_and_comma(), skip_ws_and_delim(), and novasvg::render::color_entry_t::value.

Referenced by novasvg::parseColorValue(), and novasvg::Document::render().

◆ color_to_argb32()

unsigned int novasvg::render::color_to_argb32 ( const color_t *  color)

Converts a color to a 32-bit unsigned ARGB value.

Parameters
colorA pointer to a color_t object.
Returns
32-bit unsigned ARGB value.
Examples
/home/runner/work/novasvg/novasvg/include/novasvg/detail/render/render.h.

Definition at line 84 of file paint.h.

References novasvg::render::color::a, novasvg::render::color::b, novasvg::render::color::g, and novasvg::render::color::r.

Referenced by novasvg::parseColorValue(), novasvg::Document::render(), and surface_clear().

◆ color_to_rgba32()

unsigned int novasvg::render::color_to_rgba32 ( const color_t *  color)

Converts a color to a 32-bit unsigned RGBA value.

Parameters
colorA pointer to a color_t object.
Returns
32-bit unsigned RGBA value.
Examples
/home/runner/work/novasvg/novasvg/include/novasvg/detail/render/render.h.

Definition at line 75 of file paint.h.

References novasvg::render::color::a, novasvg::render::color::b, novasvg::render::color::g, and novasvg::render::color::r.

◆ composition_blend_mode()

template<operator_t Mode>
NOVASVG_INLINE void novasvg::render::composition_blend_mode ( uint32_t *  dest,
int  length,
const uint32_t *  src,
uint32_t  const_alpha 
)

Definition at line 502 of file blend.h.

References BYTE_MUL().

◆ composition_clear()

NOVASVG_INLINE void novasvg::render::composition_clear ( uint32_t *  dest,
int  length,
const uint32_t *  src,
uint32_t  const_alpha 
)

Definition at line 542 of file blend.h.

References BYTE_MUL(), and memfill32().

◆ composition_destination()

NOVASVG_INLINE void novasvg::render::composition_destination ( uint32_t *  dest,
int  length,
const uint32_t *  src,
uint32_t  const_alpha 
)

Definition at line 566 of file blend.h.

◆ composition_destination_atop()

NOVASVG_INLINE void novasvg::render::composition_destination_atop ( uint32_t *  dest,
int  length,
const uint32_t *  src,
uint32_t  const_alpha 
)

Definition at line 684 of file blend.h.

References BYTE_MUL(), INTERPOLATE_PIXEL_255(), and novasvg_alpha.

◆ composition_destination_in()

NOVASVG_INLINE void novasvg::render::composition_destination_in ( uint32_t *  dest,
int  length,
const uint32_t *  src,
uint32_t  const_alpha 
)

Definition at line 621 of file blend.h.

References BYTE_MUL(), and novasvg_alpha.

◆ composition_destination_out()

NOVASVG_INLINE void novasvg::render::composition_destination_out ( uint32_t *  dest,
int  length,
const uint32_t *  src,
uint32_t  const_alpha 
)

Definition at line 652 of file blend.h.

References BYTE_MUL(), and novasvg_alpha.

◆ composition_destination_over()

NOVASVG_INLINE void novasvg::render::composition_destination_over ( uint32_t *  dest,
int  length,
const uint32_t *  src,
uint32_t  const_alpha 
)

Definition at line 589 of file blend.h.

References BYTE_MUL(), and novasvg_alpha.

◆ composition_solid_blend_mode()

template<operator_t Mode>
NOVASVG_INLINE void novasvg::render::composition_solid_blend_mode ( uint32_t *  dest,
int  length,
uint32_t  color,
uint32_t  const_alpha 
)

Definition at line 511 of file blend.h.

References BYTE_MUL().

◆ composition_solid_clear()

NOVASVG_INLINE void novasvg::render::composition_solid_clear ( uint32_t *  dest,
int  length,
uint32_t  color,
uint32_t  const_alpha 
)

Definition at line 312 of file blend.h.

References BYTE_MUL(), and memfill32().

◆ composition_solid_destination()

NOVASVG_INLINE void novasvg::render::composition_solid_destination ( uint32_t *  dest,
int  length,
uint32_t  color,
uint32_t  const_alpha 
)

Definition at line 337 of file blend.h.

◆ composition_solid_destination_atop()

NOVASVG_INLINE void novasvg::render::composition_solid_destination_atop ( uint32_t *  dest,
int  length,
uint32_t  color,
uint32_t  const_alpha 
)

Definition at line 424 of file blend.h.

References BYTE_MUL(), INTERPOLATE_PIXEL_255(), and novasvg_alpha.

◆ composition_solid_destination_in()

NOVASVG_INLINE void novasvg::render::composition_solid_destination_in ( uint32_t *  dest,
int  length,
uint32_t  color,
uint32_t  const_alpha 
)

Definition at line 377 of file blend.h.

References BYTE_MUL(), and novasvg_alpha.

◆ composition_solid_destination_out()

NOVASVG_INLINE void novasvg::render::composition_solid_destination_out ( uint32_t *  dest,
int  length,
uint32_t  color,
uint32_t  const_alpha 
)

Definition at line 403 of file blend.h.

References BYTE_MUL(), and novasvg_alpha.

◆ composition_solid_destination_over()

NOVASVG_INLINE void novasvg::render::composition_solid_destination_over ( uint32_t *  dest,
int  length,
uint32_t  color,
uint32_t  const_alpha 
)

Definition at line 351 of file blend.h.

References BYTE_MUL(), and novasvg_alpha.

◆ composition_solid_source()

NOVASVG_INLINE void novasvg::render::composition_solid_source ( uint32_t *  dest,
int  length,
uint32_t  color,
uint32_t  const_alpha 
)

Definition at line 324 of file blend.h.

References BYTE_MUL(), and memfill32().

◆ composition_solid_source_atop()

NOVASVG_INLINE void novasvg::render::composition_solid_source_atop ( uint32_t *  dest,
int  length,
uint32_t  color,
uint32_t  const_alpha 
)

Definition at line 413 of file blend.h.

References BYTE_MUL(), INTERPOLATE_PIXEL_255(), and novasvg_alpha.

◆ composition_solid_source_in()

NOVASVG_INLINE void novasvg::render::composition_solid_source_in ( uint32_t *  dest,
int  length,
uint32_t  color,
uint32_t  const_alpha 
)

Definition at line 361 of file blend.h.

References BYTE_MUL(), INTERPOLATE_PIXEL_255(), and novasvg_alpha.

◆ composition_solid_source_out()

NOVASVG_INLINE void novasvg::render::composition_solid_source_out ( uint32_t *  dest,
int  length,
uint32_t  color,
uint32_t  const_alpha 
)

Definition at line 387 of file blend.h.

References BYTE_MUL(), INTERPOLATE_PIXEL_255(), and novasvg_alpha.

◆ composition_solid_source_over()

NOVASVG_INLINE void novasvg::render::composition_solid_source_over ( uint32_t *  dest,
int  length,
uint32_t  color,
uint32_t  const_alpha 
)

Definition at line 341 of file blend.h.

References BYTE_MUL(), and novasvg_alpha.

◆ composition_solid_xor()

NOVASVG_INLINE void novasvg::render::composition_solid_xor ( uint32_t *  dest,
int  length,
uint32_t  color,
uint32_t  const_alpha 
)

Definition at line 438 of file blend.h.

References BYTE_MUL(), INTERPOLATE_PIXEL_255(), and novasvg_alpha.

◆ composition_source()

NOVASVG_INLINE void novasvg::render::composition_source ( uint32_t *  dest,
int  length,
const uint32_t *  src,
uint32_t  const_alpha 
)

Definition at line 554 of file blend.h.

References INTERPOLATE_PIXEL_255().

◆ composition_source_atop()

NOVASVG_INLINE void novasvg::render::composition_source_atop ( uint32_t *  dest,
int  length,
const uint32_t *  src,
uint32_t  const_alpha 
)

Definition at line 667 of file blend.h.

References BYTE_MUL(), INTERPOLATE_PIXEL_255(), and novasvg_alpha.

◆ composition_source_in()

NOVASVG_INLINE void novasvg::render::composition_source_in ( uint32_t *  dest,
int  length,
const uint32_t *  src,
uint32_t  const_alpha 
)

Definition at line 605 of file blend.h.

References BYTE_MUL(), INTERPOLATE_PIXEL_255(), and novasvg_alpha.

◆ composition_source_out()

NOVASVG_INLINE void novasvg::render::composition_source_out ( uint32_t *  dest,
int  length,
const uint32_t *  src,
uint32_t  const_alpha 
)

Definition at line 636 of file blend.h.

References BYTE_MUL(), INTERPOLATE_PIXEL_255(), and novasvg_alpha.

◆ composition_source_over()

NOVASVG_INLINE void novasvg::render::composition_source_over ( uint32_t *  dest,
int  length,
const uint32_t *  src,
uint32_t  const_alpha 
)

Definition at line 570 of file blend.h.

References BYTE_MUL(), and novasvg_alpha.

◆ composition_xor()

NOVASVG_INLINE void novasvg::render::composition_xor ( uint32_t *  dest,
int  length,
const uint32_t *  src,
uint32_t  const_alpha 
)

Definition at line 703 of file blend.h.

References BYTE_MUL(), INTERPOLATE_PIXEL_255(), and novasvg_alpha.

◆ convert_argb_to_rgba()

NOVASVG_INLINE void novasvg::render::convert_argb_to_rgba ( unsigned char *  dst,
const unsigned char *  src,
int  width,
int  height,
int  stride 
)

Converts pixel data from premultiplied ARGB to RGBA format.

Transforms pixel data from native-endian 32-bit ARGB premultiplied format to a non-premultiplied RGBA byte sequence.

Parameters
dstPointer to the destination buffer (can overlap with src).
srcPointer to the source buffer in ARGB premultiplied format.
widthImage width in pixels.
heightImage height in pixels.
strideNumber of bytes per image row in the buffers.
Examples
/home/runner/work/novasvg/novasvg/include/novasvg/detail/render/render.h.

Definition at line 7967 of file surface.h.

Referenced by novasvg::Bitmap::convertToRGBA().

◆ convert_rgba_to_argb()

NOVASVG_INLINE void novasvg::render::convert_rgba_to_argb ( unsigned char *  dst,
const unsigned char *  src,
int  width,
int  height,
int  stride 
)

Converts pixel data from RGBA to premultiplied ARGB format.

Transforms pixel data from a non-premultiplied RGBA byte sequence to a native-endian 32-bit ARGB premultiplied format.

Parameters
dstPointer to the destination buffer (can overlap with src).
srcPointer to the source buffer in RGBA format.
widthImage width in pixels.
heightImage height in pixels.
strideNumber of bytes per image row in the buffers.
Examples
/home/runner/work/novasvg/novasvg/include/novasvg/detail/render/render.h.

Definition at line 7999 of file surface.h.

◆ dash_traverse_func()

◆ extents_traverse_func()

◆ fetch_linear_gradient()

◆ fetch_radial_gradient()

◆ font_face_apply_ligature()

◆ font_face_cache_add()

void novasvg::render::font_face_cache_add ( font_face_cache_t *  cache,
const char *  family,
bool  bold,
bool  italic,
font_face_t *  face 
)

Add a font face to the cache with the specified family and style.

Parameters
cacheA pointer to a font_face_cache_t object.
familyThe font family name.
boldWhether the font is bold.
italicWhether the font is italic.
faceA pointer to the font_face_t to add. The cache increments its reference count.
Examples
/home/runner/work/novasvg/novasvg/include/novasvg/detail/render/render.h.

Definition at line 5770 of file font.h.

References novasvg::render::font_face_entry::bold, novasvg::render::font_face_entry::face, novasvg::render::font_face_entry::family, novasvg::render::font_face_entry::filename, font_face_reference(), novasvg::render::font_face_entry::italic, and novasvg::render::font_face_entry::ttcindex.

Referenced by novasvg::FontFaceCache::addFontFace(), canvas_add_font_face(), and font_face_cache_add_file().

◆ font_face_cache_add_file()

bool novasvg::render::font_face_cache_add_file ( font_face_cache_t *  cache,
const char *  family,
bool  bold,
bool  italic,
const char *  filename,
int  ttcindex 
)

Load a font face from a file and add it to the cache with the specified family and style.

Parameters
cacheA pointer to a font_face_cache_t object.
familyThe font family name to associate with the face.
boldWhether the font is bold.
italicWhether the font is italic.
filenamePath to the font file.
ttcindexIndex of the face in a TrueType collection (use 0 for non-TTC fonts).
Returns
true on success, false if the file could not be loaded.
Examples
/home/runner/work/novasvg/novasvg/include/novasvg/detail/render/render.h.

Definition at line 5788 of file font.h.

References font_face_cache_add(), font_face_destroy(), and font_face_load_from_file().

Referenced by canvas_add_font_file().

◆ font_face_cache_create()

◆ font_face_cache_destroy()

void novasvg::render::font_face_cache_destroy ( font_face_cache_t *  cache)

Decrement the reference count of a font‐face cache and destroy it when it reaches zero.

Parameters
cacheA pointer to a font_face_cache_t object to release.
Examples
/home/runner/work/novasvg/novasvg/include/novasvg/detail/render/render.h.

Definition at line 5708 of file font.h.

References font_face_cache_reset(), novasvg::render::font_face_cache::mutex, novasvg_destroy_reference, and novasvg_mutex_destroy.

Referenced by canvas_destroy(), and canvas_set_font_face_cache().

◆ font_face_cache_get()

font_face_t * novasvg::render::font_face_cache_get ( font_face_cache_t *  cache,
const char *  family,
bool  bold,
bool  italic 
)

Retrieve a font face from the cache by family and style.

Parameters
cacheA pointer to a font_face_cache_t object.
familyThe font family name.
boldWhether the font is bold.
italicWhether the font is italic.
Returns
A pointer to the matching font_face_t object, or NULL if not found. The returned face is owned by the cache and must not be destroyed by the caller.
Examples
/home/runner/work/novasvg/novasvg/include/novasvg/detail/render/render.h.

Definition at line 5812 of file font.h.

References novasvg::render::font_face_cache::entries, novasvg::render::font_face_entry::face, novasvg::render::font_face_entry::family, novasvg::render::font_face_entry::filename, font_face_load_from_file(), novasvg::render::font_face_cache::is_sorted, novasvg::render::font_face_cache::mutex, novasvg::render::font_face_entry::next, novasvg_mutex_lock, novasvg_mutex_unlock, novasvg::render::font_face_cache::size, and novasvg::render::font_face_entry::ttcindex.

Referenced by canvas_select_font_face(), novasvg::FontFaceCache::getFontFace(), and novasvg::FontFaceCache::getFontFaceLocal().

◆ font_face_cache_load_dir()

int novasvg::render::font_face_cache_load_dir ( font_face_cache_t *  cache,
const char *  dirname 
)

Load all font faces from files in a directory recursively and add them to the cache.

This scans the specified directory recursively and loads all supported font files.

Parameters
cacheA pointer to a font_face_cache_t object.
dirnamePath to the directory containing font files.
Returns
The number of faces successfully loaded, or -1 if font face cache loading is disabled.
Examples
/home/runner/work/novasvg/novasvg/include/novasvg/detail/render/render.h.

Definition at line 6199 of file font.h.

References font_face_cache_load_dir(), and font_face_cache_load_file().

Referenced by font_face_cache_load_dir(), and font_face_cache_load_sys().

◆ font_face_cache_load_file()

int novasvg::render::font_face_cache_load_file ( font_face_cache_t *  cache,
const char *  filename 
)

Load all font faces from a file and add them to the cache.

Parameters
cacheA pointer to a font_face_cache_t object.
filenamePath to the font file (TrueType, OpenType, or font collection).
Returns
The number of faces successfully loaded, or -1 if font face cache loading is disabled.
Examples
/home/runner/work/novasvg/novasvg/include/novasvg/detail/render/render.h.

Definition at line 5976 of file font.h.

References novasvg::render::font_face_entry::bold, novasvg::render::font_face_entry::face, novasvg::render::font_face_entry::family, novasvg::render::font_face_entry::filename, novasvg::render::font_face_entry::italic, style, and novasvg::render::font_face_entry::ttcindex.

Referenced by font_face_cache_load_dir().

◆ font_face_cache_load_sys()

int novasvg::render::font_face_cache_load_sys ( font_face_cache_t *  cache)

Load all available system font faces and add them to the cache.

This scans standard system font directories recursively and loads all supported font files.

Parameters
cacheA pointer to a font_face_cache_t object.
Returns
The number of faces successfully loaded, or -1 if font face cache loading is disabled.
Examples
/home/runner/work/novasvg/novasvg/include/novasvg/detail/render/render.h.

Definition at line 6231 of file font.h.

References font_face_cache_load_dir().

◆ font_face_cache_reference()

font_face_cache_t * novasvg::render::font_face_cache_reference ( font_face_cache_t *  cache)

Increments the reference count of a font‐face cache.

Parameters
cacheA pointer to a font_face_cache_t object.
Returns
A pointer to the same font_face_cache_t object with an incremented reference count.
Examples
/home/runner/work/novasvg/novasvg/include/novasvg/detail/render/render.h.

Definition at line 5702 of file font.h.

References novasvg_increment_reference.

Referenced by canvas_set_font_face_cache().

◆ font_face_cache_reference_count()

int novasvg::render::font_face_cache_reference_count ( const font_face_cache_t *  cache)

Retrieve the current reference count of a font‐face cache.

Parameters
cacheA pointer to a font_face_cache_t object.
Returns
The current reference count, or 0 if cache is NULL.
Examples
/home/runner/work/novasvg/novasvg/include/novasvg/detail/render/render.h.

Definition at line 5717 of file font.h.

References novasvg_get_reference_count.

◆ font_face_cache_reset()

◆ font_face_destroy()

◆ font_face_enumerate_codepoints()

NOVASVG_INLINE void novasvg::render::font_face_enumerate_codepoints ( const font_face_t *  face,
void(*)(uint32_t codepoint, void *closure)  callback,
void *  closure 
)

◆ font_face_get_glyph_metrics()

void novasvg::render::font_face_get_glyph_metrics ( font_face_t *  face,
float  size,
codepoint_t  codepoint,
float *  advance_width,
float *  left_side_bearing,
rect_t *  extents 
)

Retrieves metrics for a specified glyph at a given size.

Parameters
faceA pointer to a font_face_t object.
sizeThe font size in pixels.
codepointThe Unicode code point of the glyph.
advance_widthPointer to store the advance width of the glyph.
left_side_bearingPointer to store the left side bearing of the glyph.
extentsPointer to a rect_t object to store the glyph bounding box.
Examples
/home/runner/work/novasvg/novasvg/include/novasvg/detail/render/render.h.

Definition at line 5441 of file font.h.

References novasvg::render::glyph::advance_width, novasvg::render::rect::h, novasvg::render::glyph::left_side_bearing, novasvg::render::rect::w, novasvg::render::rect::x, novasvg::render::glyph::x1, novasvg::render::glyph::x2, novasvg::render::rect::y, novasvg::render::glyph::y1, and novasvg::render::glyph::y2.

Referenced by novasvg::FontFace::advanceWidthUnits(), canvas_glyph_metrics(), font_face_text_extents(), novasvg::Font::glyphBoxes(), and novasvg::Font::xHeight().

◆ font_face_get_glyph_path()

float novasvg::render::font_face_get_glyph_path ( font_face_t *  face,
float  size,
float  x,
float  y,
codepoint_t  codepoint,
path_t *  path 
)

Retrieves the path of a glyph and its advance width.

Parameters
faceA pointer to a font_face_t object.
sizeThe font size in pixels.
xThe x-coordinate for positioning the glyph.
yThe y-coordinate for positioning the glyph.
codepointThe Unicode code point of the glyph.
pathPointer to a path_t object to store the glyph path.
Returns
The advance width of the glyph.
Examples
/home/runner/work/novasvg/novasvg/include/novasvg/detail/render/render.h.

Definition at line 5490 of file font.h.

References font_face_traverse_glyph_path().

Referenced by canvas_add_glyph(), and canvas_add_text().

◆ font_face_get_kern_advance()

NOVASVG_INLINE float novasvg::render::font_face_get_kern_advance ( font_face_t *  face,
float  size,
codepoint_t  ch1,
codepoint_t  ch2 
)

◆ font_face_get_metrics()

void novasvg::render::font_face_get_metrics ( const font_face_t *  face,
float  size,
float *  ascent,
float *  descent,
float *  line_gap,
rect_t *  extents 
)

Retrieves metrics for a font face at a specified size.

Parameters
faceA pointer to a font_face_t object.
sizeThe font size in pixels.
ascentPointer to store the ascent metric.
descentPointer to store the descent metric.
line_gapPointer to store the line gap metric.
extentsPointer to a rect_t object to store the font bounding box.
Examples
/home/runner/work/novasvg/novasvg/include/novasvg/detail/render/render.h.

Definition at line 5422 of file font.h.

References novasvg::render::font_face::ascent, novasvg::render::font_face::descent, novasvg::render::rect::h, novasvg::render::font_face::line_gap, novasvg::render::rect::w, novasvg::render::rect::x, novasvg::render::font_face::x1, novasvg::render::font_face::x2, novasvg::render::rect::y, novasvg::render::font_face::y1, and novasvg::render::font_face::y2.

Referenced by novasvg::FontFace::ascentUnits(), canvas_font_metrics(), novasvg::FontFace::descentUnits(), and novasvg::Font::Font().

◆ font_face_get_reference_count()

int novasvg::render::font_face_get_reference_count ( const font_face_t *  face)

Retrieves the current reference count of a font face.

Parameters
faceA pointer to a font_face_t object.
Returns
The reference count of the font face.
Examples
/home/runner/work/novasvg/novasvg/include/novasvg/detail/render/render.h.

Definition at line 5351 of file font.h.

References novasvg_get_reference_count.

◆ font_face_get_units_per_em()

NOVASVG_INLINE float novasvg::render::font_face_get_units_per_em ( const font_face_t *  face)

Definition at line 5370 of file font.h.

References novasvg::render::font_face::info.

Referenced by novasvg::FontFace::unitsPerEm().

◆ font_face_init_ligatures()

◆ font_face_load_from_data()

font_face_t * novasvg::render::font_face_load_from_data ( const void *  data,
unsigned int  length,
int  ttcindex,
destroy_func_t  destroy_func,
void *  closure 
)

Loads a font face from memory.

Parameters
dataPointer to the font data.
lengthLength of the font data.
ttcindexIndex of the font face within a TrueType Collection (TTC).
destroy_funcFunction to free the font data when no longer needed.
closureUser-defined data passed to destroy_func.
Returns
A pointer to the loaded font_face_t object, or NULL on failure.
Examples
/home/runner/work/novasvg/novasvg/include/novasvg/detail/render/render.h.

Definition at line 5310 of file font.h.

References novasvg::render::font_face::ascent, novasvg::render::font_face::cache, novasvg::render::font_face::closure, novasvg::render::font_face::descent, novasvg::render::font_face::destroy_func, novasvg::render::font_face::info, novasvg::render::font_face::ligature_count, novasvg::render::font_face::ligatures_ready, novasvg::render::font_face::line_gap, novasvg::render::font_face::mutex, novasvg_init_reference, novasvg_mutex_init, novasvg::render::font_face::x1, novasvg::render::font_face::x2, novasvg::render::font_face::y1, and novasvg::render::font_face::y2.

Referenced by font_face_load_from_file().

◆ font_face_load_from_file()

font_face_t * novasvg::render::font_face_load_from_file ( const char *  filename,
int  ttcindex 
)

Loads a font face from a file.

Parameters
filenamePath to the font file.
ttcindexIndex of the font face within a TrueType Collection (TTC).
Returns
A pointer to the loaded font_face_t object, or NULL on failure.
Examples
/home/runner/work/novasvg/novasvg/include/novasvg/detail/render/render.h.

Definition at line 5278 of file font.h.

References font_face_load_from_data().

Referenced by font_face_cache_add_file(), and font_face_cache_get().

◆ font_face_reference()

font_face_t * novasvg::render::font_face_reference ( font_face_t *  face)

Increments the reference count of a font face.

Parameters
faceA pointer to a font_face_t object.
Returns
A pointer to the same font_face_t object with an incremented reference count.
Examples
/home/runner/work/novasvg/novasvg/include/novasvg/detail/render/render.h.

Definition at line 5334 of file font.h.

References novasvg_increment_reference.

Referenced by canvas_set_font_face(), font_face_cache_add(), and state_copy().

◆ font_face_text_extents()

float novasvg::render::font_face_text_extents ( font_face_t *  face,
float  size,
const void *  text,
int  length,
text_encoding_t  encoding,
rect_t *  extents 
)

Computes the bounding box of a text string and its advance width.

Parameters
faceA pointer to a font_face_t object.
sizeThe font size in pixels.
textPointer to the text data.
lengthLength of the text data, or -1 if null-terminated.
encodingEncoding of the text data.
extentsPointer to a rect_t object to store the bounding box of the text.
Returns
The total advance width of the text.
Examples
/home/runner/work/novasvg/novasvg/include/novasvg/detail/render/render.h.

Definition at line 5616 of file font.h.

References font_face_apply_ligature(), font_face_get_glyph_metrics(), font_face_get_kern_advance(), novasvg::render::rect::h, NOVASVG_MAX, NOVASVG_MIN, text, text_iterator_has_next(), text_iterator_init(), text_iterator_next(), novasvg::render::rect::w, novasvg::render::rect::x, and novasvg::render::rect::y.

Referenced by canvas_text_extents(), and novasvg::Font::measureText().

◆ font_face_traverse_glyph_path()

float novasvg::render::font_face_traverse_glyph_path ( font_face_t *  face,
float  size,
float  x,
float  y,
codepoint_t  codepoint,
path_traverse_func_t  traverse_func,
void *  closure 
)

Traverses the path of a glyph and calls a callback for each path element.

Parameters
faceA pointer to a font_face_t object.
sizeThe font size in pixels.
xThe x-coordinate for positioning the glyph.
yThe y-coordinate for positioning the glyph.
codepointThe Unicode code point of the glyph.
traverse_funcThe callback function to be called for each path element.
closureUser-defined data passed to the callback function.
Returns
The advance width of the glyph.
Examples
/home/runner/work/novasvg/novasvg/include/novasvg/detail/render/render.h.

Definition at line 5495 of file font.h.

References novasvg::render::glyph::advance_width, stbtt_vertex::cx, stbtt_vertex::cx1, stbtt_vertex::cy, stbtt_vertex::cy1, matrix_init_translate(), matrix_map_points(), matrix_scale(), NOVASVG_PATH_COMMAND_CUBIC_TO, NOVASVG_PATH_COMMAND_LINE_TO, NOVASVG_PATH_COMMAND_MOVE_TO, novasvg::render::glyph::nvertices, STBTT_vcubic, STBTT_vcurve, STBTT_vline, STBTT_vmove, stbtt_vertex::type, novasvg::render::glyph::vertices, stbtt_vertex::x, novasvg::render::point::x, stbtt_vertex::y, and novasvg::render::point::y.

Referenced by font_face_get_glyph_path().

◆ ft_coord_round()

NOVASVG_INLINE PVG_FT_Pos novasvg::render::ft_coord_round ( float  v)

Definition at line 200 of file rasterize.h.

◆ ft_outline_close()

NOVASVG_INLINE void novasvg::render::ft_outline_close ( PVG_FT_Outline *  ft)

Definition at line 254 of file rasterize.h.

Referenced by ft_outline_convert().

◆ ft_outline_convert()

◆ ft_outline_convert_dash()

NOVASVG_INLINE PVG_FT_Outline * novasvg::render::ft_outline_convert_dash ( const path_t *  path,
const matrix_t *  matrix,
const stroke_dash_t *  stroke_dash 
)

◆ ft_outline_convert_stroke()

◆ ft_outline_create()

NOVASVG_INLINE PVG_FT_Outline * novasvg::render::ft_outline_create ( int  points,
int  contours 
)

Definition at line 173 of file rasterize.h.

References ALIGN_SIZE.

Referenced by ft_outline_convert(), and ft_outline_convert_stroke().

◆ ft_outline_cubic_to()

NOVASVG_INLINE void novasvg::render::ft_outline_cubic_to ( PVG_FT_Outline *  ft,
float  x1,
float  y1,
float  x2,
float  y2,
float  x3,
float  y3 
)

Definition at line 236 of file rasterize.h.

References FT_COORD.

Referenced by ft_outline_convert().

◆ ft_outline_destroy()

NOVASVG_INLINE void novasvg::render::ft_outline_destroy ( PVG_FT_Outline *  outline)

Definition at line 192 of file rasterize.h.

Referenced by ft_outline_convert_stroke(), and rasterize().

◆ ft_outline_end()

NOVASVG_INLINE void novasvg::render::ft_outline_end ( PVG_FT_Outline *  ft)

Definition at line 266 of file rasterize.h.

Referenced by ft_outline_convert().

◆ ft_outline_line_to()

NOVASVG_INLINE void novasvg::render::ft_outline_line_to ( PVG_FT_Outline *  ft,
float  x,
float  y 
)

Definition at line 228 of file rasterize.h.

References FT_COORD.

Referenced by ft_outline_convert().

◆ ft_outline_move_to()

NOVASVG_INLINE void novasvg::render::ft_outline_move_to ( PVG_FT_Outline *  ft,
float  x,
float  y 
)

Definition at line 214 of file rasterize.h.

References FT_COORD.

Referenced by ft_outline_convert().

◆ gradient_clamp()

NOVASVG_INLINE int novasvg::render::gradient_clamp ( const gradient_data_t *  gradient,
int  ipos 
)

◆ gradient_pixel()

NOVASVG_INLINE uint32_t novasvg::render::gradient_pixel ( const gradient_data_t *  gradient,
float  pos 
)

◆ gradient_pixel_fixed()

NOVASVG_INLINE uint32_t novasvg::render::gradient_pixel_fixed ( const gradient_data_t *  gradient,
int  fixed_pos 
)

◆ interpolate_4_pixels()

NOVASVG_INLINE uint32_t novasvg::render::interpolate_4_pixels ( uint32_t  tl,
uint32_t  tr,
uint32_t  bl,
uint32_t  br,
uint32_t  distx,
uint32_t  disty 
)

Definition at line 1017 of file blend.h.

References INTERPOLATE_PIXEL_256().

Referenced by blend_transformed_bilinear_tiled_argb().

◆ INTERPOLATE_PIXEL_255()

◆ INTERPOLATE_PIXEL_256()

NOVASVG_INLINE uint32_t novasvg::render::INTERPOLATE_PIXEL_256 ( uint32_t  x,
uint32_t  a,
uint32_t  y,
uint32_t  b 
)

Definition at line 76 of file blend.h.

Referenced by interpolate_4_pixels().

◆ matrix_init()

void novasvg::render::matrix_init ( matrix_t *  matrix,
float  a,
float  b,
float  c,
float  d,
float  e,
float  f 
)

Initializes a 2D transformation matrix.

Parameters
matrixA pointer to the matrix_t object to be initialized.
aThe horizontal scaling factor.
bThe vertical shearing factor.
cThe horizontal shearing factor.
dThe vertical scaling factor.
eThe horizontal translation offset.
fThe vertical translation offset.
Examples
/home/runner/work/novasvg/novasvg/include/novasvg/detail/render/render.h.

Definition at line 8 of file matrix.h.

References novasvg::render::matrix::a, novasvg::render::matrix::b, novasvg::render::matrix::c, novasvg::render::matrix::d, novasvg::render::matrix::e, and novasvg::render::matrix::f.

Referenced by matrix_init_identity(), matrix_init_rotate(), matrix_init_scale(), matrix_init_shear(), matrix_init_translate(), matrix_invert(), matrix_multiply(), and novasvg::Transform::Transform().

◆ matrix_init_identity()

void novasvg::render::matrix_init_identity ( matrix_t *  matrix)

Initializes a 2D transformation matrix to the identity matrix.

Parameters
matrixA pointer to the matrix_t object to be initialized.
Examples
/home/runner/work/novasvg/novasvg/include/novasvg/detail/render/render.h.

Definition at line 15 of file matrix.h.

References matrix_init().

Referenced by canvas_reset_matrix(), matrix_parse(), novasvg::Transform::reset(), and novasvg::Transform::Transform().

◆ matrix_init_rotate()

void novasvg::render::matrix_init_rotate ( matrix_t *  matrix,
float  angle 
)

Initializes a 2D transformation matrix for rotation.

Parameters
matrixA pointer to the matrix_t object to be initialized.
angleThe rotation angle in radians.
Examples
/home/runner/work/novasvg/novasvg/include/novasvg/detail/render/render.h.

Definition at line 30 of file matrix.h.

References matrix_init().

Referenced by matrix_rotate(), path_arc_to(), and novasvg::Transform::rotated().

◆ matrix_init_scale()

void novasvg::render::matrix_init_scale ( matrix_t *  matrix,
float  sx,
float  sy 
)

Initializes a 2D transformation matrix for scaling.

Parameters
matrixA pointer to the matrix_t object to be initialized.
sxThe scaling factor in the x-direction.
syThe scaling factor in the y-direction.
Examples
/home/runner/work/novasvg/novasvg/include/novasvg/detail/render/render.h.

Definition at line 25 of file matrix.h.

References matrix_init().

Referenced by matrix_scale(), path_arc_to(), and novasvg::Transform::scaled().

◆ matrix_init_shear()

void novasvg::render::matrix_init_shear ( matrix_t *  matrix,
float  shx,
float  shy 
)

Initializes a 2D transformation matrix for shearing.

Parameters
matrixA pointer to the matrix_t object to be initialized.
shxThe shearing factor in the x-direction.
shyThe shearing factor in the y-direction.
Examples
/home/runner/work/novasvg/novasvg/include/novasvg/detail/render/render.h.

Definition at line 37 of file matrix.h.

References matrix_init().

Referenced by matrix_shear(), and novasvg::Transform::sheared().

◆ matrix_init_translate()

void novasvg::render::matrix_init_translate ( matrix_t *  matrix,
float  tx,
float  ty 
)

Initializes a 2D transformation matrix for translation.

Parameters
matrixA pointer to the matrix_t object to be initialized.
txThe translation offset in the x-direction.
tyThe translation offset in the y-direction.
Examples
/home/runner/work/novasvg/novasvg/include/novasvg/detail/render/render.h.

Definition at line 20 of file matrix.h.

References matrix_init().

Referenced by font_face_traverse_glyph_path(), matrix_translate(), novasvg::Transform::rotated(), and novasvg::Transform::translated().

◆ matrix_invert()

bool novasvg::render::matrix_invert ( const matrix_t *  matrix,
matrix_t *  inverse 
)

Calculates the inverse of matrix and stores it in inverse.

If inverse is NULL, the function only checks if the matrix is invertible.

Note
matrix and inverse can be identical.
Parameters
matrixA pointer to the matrix_t object to invert.
inverseA pointer to the matrix_t object to store the result, or NULL.
Returns
true if the matrix is invertible; false otherwise.
Examples
/home/runner/work/novasvg/novasvg/include/novasvg/detail/render/render.h.

Definition at line 81 of file matrix.h.

References novasvg::render::matrix::a, novasvg::render::matrix::b, novasvg::render::matrix::c, novasvg::render::matrix::d, novasvg::render::matrix::e, novasvg::render::matrix::f, and matrix_init().

Referenced by blend_gradient(), blend_texture(), novasvg::Transform::inverse(), and novasvg::Transform::invert().

◆ matrix_map()

void novasvg::render::matrix_map ( const matrix_t *  matrix,
float  x,
float  y,
float *  xx,
float *  yy 
)

Transforms the point (x, y) using matrix and stores the result in (xx, yy).

Parameters
matrixA pointer to a matrix_t object.
xThe x-coordinate of the point to transform.
yThe y-coordinate of the point to transform.
xxA pointer to store the transformed x-coordinate.
yyA pointer to store the transformed y-coordinate.
Examples
/home/runner/work/novasvg/novasvg/include/novasvg/detail/render/render.h.

Definition at line 100 of file matrix.h.

References novasvg::render::matrix::a, novasvg::render::matrix::b, novasvg::render::matrix::c, novasvg::render::matrix::d, novasvg::render::matrix::e, and novasvg::render::matrix::f.

Referenced by canvas_map(), novasvg::Transform::mapPoint(), matrix_map_point(), and path_arc_to().

◆ matrix_map_point()

void novasvg::render::matrix_map_point ( const matrix_t *  matrix,
const point_t *  src,
point_t *  dst 
)

Transforms the src point using matrix and stores the result in dst.

Note
src and dst can be identical.
Parameters
matrixA pointer to a matrix_t object.
srcA pointer to the point_t object to transform.
dstA pointer to the point_t to store the transformed point.
Examples
/home/runner/work/novasvg/novasvg/include/novasvg/detail/render/render.h.

Definition at line 106 of file matrix.h.

References matrix_map(), novasvg::render::point::x, and novasvg::render::point::y.

Referenced by canvas_map_point(), matrix_map_points(), and path_transform().

◆ matrix_map_points()

void novasvg::render::matrix_map_points ( const matrix_t *  matrix,
const point_t *  src,
point_t *  dst,
int  count 
)

Transforms an array of src points using matrix and stores the results in dst.

Note
src and dst can be identical.
Parameters
matrixA pointer to a matrix_t object.
srcA pointer to the array of point_t objects to transform.
dstA pointer to the array of point_t to store the transformed points.
countThe number of points to transform.
Examples
/home/runner/work/novasvg/novasvg/include/novasvg/detail/render/render.h.

Definition at line 111 of file matrix.h.

References matrix_map_point().

Referenced by font_face_traverse_glyph_path(), ft_outline_convert(), matrix_map_rect(), and path_add_path().

◆ matrix_map_rect()

void novasvg::render::matrix_map_rect ( const matrix_t *  matrix,
const rect_t *  src,
rect_t *  dst 
)

Transforms the src rectangle using matrix and stores the result in dst.

Note
src and dst can be identical.
Parameters
matrixA pointer to a matrix_t object.
srcA pointer to the rect_t object to transform.
dstA pointer to the rect_t to store the transformed rectangle.
Examples
/home/runner/work/novasvg/novasvg/include/novasvg/detail/render/render.h.

Definition at line 118 of file matrix.h.

References novasvg::render::rect::h, matrix_map_points(), novasvg::render::rect::w, novasvg::render::point::x, novasvg::render::rect::x, novasvg::render::point::y, and novasvg::render::rect::y.

Referenced by canvas_map_rect(), and novasvg::Transform::mapRect().

◆ matrix_multiply()

void novasvg::render::matrix_multiply ( matrix_t *  matrix,
const matrix_t *  left,
const matrix_t *  right 
)

Multiplies left and right matrices and stores the result in matrix.

Note
matrix can be identical to either left or right.
Parameters
matrixA pointer to the matrix_t object to store the result.
leftA pointer to the first matrix_t matrix.
rightA pointer to the second matrix_t matrix.
Examples
/home/runner/work/novasvg/novasvg/include/novasvg/detail/render/render.h.

Definition at line 70 of file matrix.h.

References novasvg::render::matrix::a, novasvg::render::matrix::b, novasvg::render::matrix::c, novasvg::render::matrix::d, novasvg::render::matrix::e, novasvg::render::matrix::f, and matrix_init().

Referenced by blend_gradient(), blend_texture(), canvas_transform(), matrix_parse(), matrix_rotate(), matrix_scale(), matrix_shear(), matrix_translate(), and novasvg::Transform::operator*().

◆ matrix_parse()

bool novasvg::render::matrix_parse ( matrix_t *  matrix,
const char *  data,
int  length 
)

Parses an SVG transform string into a matrix.

Parameters
matrixA pointer to a matrix_t object to store the result.
dataInput SVG transform string.
lengthLength of the string, or -1 if null-terminated.
Returns
true on success, false on failure.
Examples
/home/runner/work/novasvg/novasvg/include/novasvg/detail/render/render.h.

Definition at line 171 of file matrix.h.

References matrix_init_identity(), matrix_multiply(), matrix_rotate(), matrix_scale(), matrix_shear(), matrix_translate(), NOVASVG_DEG2RAD, parse_matrix_parameters(), skip_string(), skip_ws(), and skip_ws_or_comma().

Referenced by novasvg::Transform::parse().

◆ matrix_rotate()

void novasvg::render::matrix_rotate ( matrix_t *  matrix,
float  angle 
)

Rotates the matrix by the specified angle (in radians).

Parameters
matrixA pointer to the matrix_t object to be modified.
angleThe rotation angle in radians.
Examples
/home/runner/work/novasvg/novasvg/include/novasvg/detail/render/render.h.

Definition at line 56 of file matrix.h.

References matrix_init_rotate(), and matrix_multiply().

Referenced by canvas_rotate(), matrix_parse(), path_arc_to(), and novasvg::Transform::rotated().

◆ matrix_scale()

void novasvg::render::matrix_scale ( matrix_t *  matrix,
float  sx,
float  sy 
)

Scales the matrix by factors sx and sy

Parameters
matrixA pointer to the matrix_t object to be modified.
sxThe scaling factor in the x-direction.
syThe scaling factor in the y-direction.
Examples
/home/runner/work/novasvg/novasvg/include/novasvg/detail/render/render.h.

Definition at line 49 of file matrix.h.

References matrix_init_scale(), and matrix_multiply().

Referenced by canvas_scale(), font_face_traverse_glyph_path(), matrix_parse(), and path_arc_to().

◆ matrix_shear()

void novasvg::render::matrix_shear ( matrix_t *  matrix,
float  shx,
float  shy 
)

Shears the matrix by factors shx and shy.

Parameters
matrixA pointer to the matrix_t object to be modified.
shxThe shearing factor in the x-direction.
shyThe shearing factor in the y-direction.
Examples
/home/runner/work/novasvg/novasvg/include/novasvg/detail/render/render.h.

Definition at line 63 of file matrix.h.

References matrix_init_shear(), and matrix_multiply().

Referenced by canvas_shear(), and matrix_parse().

◆ matrix_translate()

void novasvg::render::matrix_translate ( matrix_t *  matrix,
float  tx,
float  ty 
)

Adds a translation with offsets tx and ty to the matrix.

Parameters
matrixA pointer to the matrix_t object to be modified.
txThe translation offset in the x-direction.
tyThe translation offset in the y-direction.
Examples
/home/runner/work/novasvg/novasvg/include/novasvg/detail/render/render.h.

Definition at line 42 of file matrix.h.

References matrix_init_translate(), and matrix_multiply().

Referenced by canvas_translate(), matrix_parse(), and novasvg::Transform::rotated().

◆ memfill32()

void novasvg::render::memfill32 ( unsigned int *  dest,
int  length,
unsigned int  value 
)

◆ paint_create_color()

paint_t * novasvg::render::paint_create_color ( const color_t *  color)

Creates a solid color paint.

Parameters
colorA pointer to the color_t object.
Returns
A pointer to the created paint_t object.
Examples
/home/runner/work/novasvg/novasvg/include/novasvg/detail/render/render.h.

Definition at line 422 of file paint.h.

References novasvg::render::color::a, novasvg::render::color::b, novasvg::render::color::g, paint_create_rgba(), and novasvg::render::color::r.

◆ paint_create_linear_gradient()

paint_t * novasvg::render::paint_create_linear_gradient ( float  x1,
float  y1,
float  x2,
float  y2,
spread_method_t  spread,
const gradient_stop_t *  stops,
int  nstops,
const matrix_t *  matrix 
)

Creates a linear gradient paint.

Parameters
x1The x coordinate of the gradient start.
y1The y coordinate of the gradient start.
x2The x coordinate of the gradient end.
y2The y coordinate of the gradient end.
spreadThe gradient spread method.
stopsArray of gradient stops.
nstopsNumber of gradient stops.
matrixOptional transformation matrix.
Returns
A pointer to the created paint_t object.
Examples
/home/runner/work/novasvg/novasvg/include/novasvg/detail/render/render.h.

Definition at line 453 of file paint.h.

References novasvg::render::gradient_paint_t::base, NOVASVG_GRADIENT_TYPE_LINEAR, and novasvg::render::gradient_paint_t::values.

Referenced by canvas_set_linear_gradient().

◆ paint_create_radial_gradient()

paint_t * novasvg::render::paint_create_radial_gradient ( float  cx,
float  cy,
float  cr,
float  fx,
float  fy,
float  fr,
spread_method_t  spread,
const gradient_stop_t *  stops,
int  nstops,
const matrix_t *  matrix 
)

Creates a radial gradient paint.

Parameters
cxThe x coordinate of the gradient center.
cyThe y coordinate of the gradient center.
crThe radius of the gradient.
fxThe x coordinate of the focal point.
fyThe y coordinate of the focal point.
frThe radius of the focal point.
spreadThe gradient spread method.
stopsArray of gradient stops.
nstopsNumber of gradient stops.
matrixOptional transformation matrix.
Returns
A pointer to the created paint_t object.
Examples
/home/runner/work/novasvg/novasvg/include/novasvg/detail/render/render.h.

Definition at line 463 of file paint.h.

References novasvg::render::gradient_paint_t::base, NOVASVG_GRADIENT_TYPE_RADIAL, and novasvg::render::gradient_paint_t::values.

Referenced by canvas_set_radial_gradient().

◆ paint_create_rgb()

paint_t * novasvg::render::paint_create_rgb ( float  r,
float  g,
float  b 
)

Creates a solid RGB paint.

Parameters
rThe red component (0 to 1).
gThe green component (0 to 1).
bThe blue component (0 to 1).
Returns
A pointer to the created paint_t object.
Examples
/home/runner/work/novasvg/novasvg/include/novasvg/detail/render/render.h.

Definition at line 404 of file paint.h.

References paint_create_rgba().

◆ paint_create_rgba()

paint_t * novasvg::render::paint_create_rgba ( float  r,
float  g,
float  b,
float  a 
)

Creates a solid RGBA paint.

Parameters
rThe red component (0 to 1).
gThe green component (0 to 1).
bThe blue component (0 to 1).
aThe alpha component (0 to 1).
Returns
A pointer to the created paint_t object.
Examples
/home/runner/work/novasvg/novasvg/include/novasvg/detail/render/render.h.

Definition at line 409 of file paint.h.

References novasvg::render::color::a, novasvg::render::color::b, novasvg::render::solid_paint_t::base, novasvg::render::solid_paint_t::color, novasvg::render::color::g, NOVASVG_PAINT_TYPE_COLOR, and novasvg::render::color::r.

Referenced by paint_create_color(), and paint_create_rgb().

◆ paint_create_texture()

paint_t * novasvg::render::paint_create_texture ( surface_t *  surface,
texture_type_t  type,
float  opacity,
const matrix_t *  matrix 
)

Creates a texture paint from a surface.

Parameters
surfaceThe texture surface.
typeThe texture type (plain or tiled).
opacityThe opacity of the texture (0 to 1).
matrixOptional transformation matrix.
Returns
A pointer to the created paint_t object.
Examples
/home/runner/work/novasvg/novasvg/include/novasvg/detail/render/render.h.

Definition at line 475 of file paint.h.

References novasvg::render::texture_paint_t::base, novasvg::render::texture_paint_t::matrix, NOVASVG_IDENTITY_MATRIX, NOVASVG_PAINT_TYPE_TEXTURE, novasvg::render::texture_paint_t::opacity, novasvg::render::texture_paint_t::surface, surface_reference(), and novasvg::render::texture_paint_t::type.

Referenced by canvas_set_texture().

◆ paint_destroy()

void novasvg::render::paint_destroy ( paint_t *  paint)

◆ paint_get_reference_count()

int novasvg::render::paint_get_reference_count ( const paint_t *  paint)

Retrieves the reference count of a paint object.

Parameters
paintA pointer to the paint_t object.
Returns
The reference count of the paint_t object.
Examples
/home/runner/work/novasvg/novasvg/include/novasvg/detail/render/render.h.

Definition at line 506 of file paint.h.

References novasvg_get_reference_count.

◆ paint_reference()

paint_t * novasvg::render::paint_reference ( paint_t *  paint)

Increments the reference count of a paint object.

Parameters
paintA pointer to the paint_t object.
Returns
A pointer to the referenced paint_t object.
Examples
/home/runner/work/novasvg/novasvg/include/novasvg/detail/render/render.h.

Definition at line 488 of file paint.h.

References novasvg_increment_reference.

Referenced by canvas_set_paint(), and state_copy().

◆ parse_arc_flag()

NOVASVG_INLINE bool novasvg::render::parse_arc_flag ( const char **  begin,
const char *  end,
bool *  flag 
)

Definition at line 725 of file path.h.

References skip_delim(), and skip_ws_or_comma().

Referenced by path_parse().

◆ parse_matrix_parameters()

NOVASVG_INLINE int novasvg::render::parse_matrix_parameters ( const char **  begin,
const char *  end,
float  values[6],
int  required,
int  optional 
)

Definition at line 149 of file matrix.h.

References parse_number(), skip_css_unit(), skip_delim(), skip_ws_and_delim(), and skip_ws_or_comma().

Referenced by matrix_parse().

◆ parse_number()

NOVASVG_INLINE bool novasvg::render::parse_number ( const char **  begin,
const char *  end,
float *  number 
)

Definition at line 88 of file utils.h.

References NOVASVG_IS_NUM.

Referenced by color_parse(), parse_matrix_parameters(), and parse_path_coordinates().

◆ parse_path_coordinates()

NOVASVG_INLINE bool novasvg::render::parse_path_coordinates ( const char **  begin,
const char *  end,
float  values[6],
int  offset,
int  count 
)

Definition at line 737 of file path.h.

References parse_number(), and skip_ws_or_comma().

Referenced by path_parse().

◆ path_add_arc()

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.

Adds an arc defined by the center (cx, cy), radius (r), start angle (a0), end angle (a1), and direction (ccw) to the path.

Parameters
pathA pointer to a path_t object.
cxThe x-coordinate of the arc's center.
cyThe y-coordinate of the arc's center.
rThe radius of the arc.
a0The start angle of the arc in radians.
a1The end angle of the arc in radians.
ccwIf true, the arc is drawn counter-clockwise; if false, clockwise.
Examples
/home/runner/work/novasvg/novasvg/include/novasvg/detail/render/render.h.

Definition at line 315 of file path.h.

References novasvg::render::path::elements, NOVASVG_HALF_PI, NOVASVG_KAPPA, NOVASVG_TWO_PI, path_cubic_to(), path_line_to(), path_move_to(), path_reserve(), and novasvg::render::path::size.

Referenced by canvas_arc().

◆ path_add_circle()

void novasvg::render::path_add_circle ( path_t *  path,
float  cx,
float  cy,
float  r 
)

Adds a circle to the path.

Adds a circle defined by its center (cx, cy) and radius (r) to the path.

Parameters
pathA pointer to a path_t object.
cxThe x-coordinate of the circle's center.
cyThe y-coordinate of the circle's center.
rThe radius of the circle.
Examples
/home/runner/work/novasvg/novasvg/include/novasvg/detail/render/render.h.

Definition at line 310 of file path.h.

References path_add_ellipse().

Referenced by canvas_circle().

◆ path_add_command()

◆ path_add_ellipse()

void novasvg::render::path_add_ellipse ( path_t *  path,
float  cx,
float  cy,
float  rx,
float  ry 
)

Adds an ellipse to the path.

Adds an ellipse defined by the center (cx, cy) and radii (rx, ry) to the path.

Parameters
pathA pointer to a path_t object.
cxThe x-coordinate of the ellipse's center.
cyThe y-coordinate of the ellipse's center.
rxThe x-radius of the ellipse.
ryThe y-radius of the ellipse.
Examples
/home/runner/work/novasvg/novasvg/include/novasvg/detail/render/render.h.

Definition at line 291 of file path.h.

References NOVASVG_KAPPA, path_close(), path_cubic_to(), path_move_to(), and path_reserve().

Referenced by novasvg::Path::addEllipse(), canvas_ellipse(), and path_add_circle().

◆ path_add_path()

void novasvg::render::path_add_path ( path_t *  path,
const path_t *  source,
const matrix_t *  matrix 
)

Adds a sub-path to the path.

Adds all elements from another path (source) to the current path, optionally applying a transformation matrix.

Parameters
pathA pointer to a path_t object.
sourceA pointer to the path_t object to copy elements from.
matrixA pointer to a matrix_t object, or NULL to apply no transformation.
Examples
/home/runner/work/novasvg/novasvg/include/novasvg/detail/render/render.h.

Definition at line 380 of file path.h.

References novasvg::render::path::elements, matrix_map_points(), novasvg_array_append, novasvg_array_ensure, NOVASVG_PATH_COMMAND_CLOSE, NOVASVG_PATH_COMMAND_CUBIC_TO, NOVASVG_PATH_COMMAND_LINE_TO, NOVASVG_PATH_COMMAND_MOVE_TO, novasvg::render::path::num_contours, novasvg::render::path::num_curves, novasvg::render::path::num_points, path_close(), path_cubic_to(), path_iterator_has_next(), path_iterator_init(), path_iterator_next(), path_line_to(), path_move_to(), novasvg::render::path::size, and novasvg::render::path::start_point.

Referenced by canvas_add_path().

◆ path_add_rect()

void novasvg::render::path_add_rect ( path_t *  path,
float  x,
float  y,
float  w,
float  h 
)

Adds a rectangle to the path.

Adds a rectangle defined by the top-left corner (x, y) and dimensions (w, h) to the path.

Parameters
pathA pointer to a path_t object.
xThe x-coordinate of the rectangle's top-left corner.
yThe y-coordinate of the rectangle's top-left corner.
wThe width of the rectangle.
hThe height of the rectangle.
Examples
/home/runner/work/novasvg/novasvg/include/novasvg/detail/render/render.h.

Definition at line 252 of file path.h.

References path_close(), path_line_to(), path_move_to(), and path_reserve().

Referenced by novasvg::Path::addRect(), canvas_rect(), and path_add_round_rect().

◆ path_add_round_rect()

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.

Adds a rounded rectangle defined by the top-left corner (x, y), dimensions (w, h), and corner radii (rx, ry) to the path.

Parameters
pathA pointer to a path_t object.
xThe x-coordinate of the rectangle's top-left corner.
yThe y-coordinate of the rectangle's top-left corner.
wThe width of the rectangle.
hThe height of the rectangle.
rxThe x-radius of the rectangle's corners.
ryThe y-radius of the rectangle's corners.
Examples
/home/runner/work/novasvg/novasvg/include/novasvg/detail/render/render.h.

Definition at line 263 of file path.h.

References NOVASVG_KAPPA, NOVASVG_MIN, path_add_rect(), path_close(), path_cubic_to(), path_line_to(), path_move_to(), and path_reserve().

Referenced by novasvg::Path::addRoundRect(), and canvas_round_rect().

◆ path_arc_to()

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.

This function adds an elliptical arc segment from the current point to the specified end point. The arc is defined by the radii, rotation angle, and flags for large arc and sweep. This is equivalent to the A command in SVG path syntax.

Parameters
pathA pointer to a path_t object.
rxThe x-radius of the ellipse.
ryThe y-radius of the ellipse.
angleThe rotation angle of the ellipse in radians.
large_arc_flagIf true, draw the large arc; otherwise, draw the small arc.
sweep_flagIf true, draw the arc in the positive-angle direction; otherwise, in the negative-angle direction.
xThe x-coordinate of the end point of the arc.
yThe y-coordinate of the end point of the arc.
Examples
/home/runner/work/novasvg/novasvg/include/novasvg/detail/render/render.h.

Definition at line 131 of file path.h.

References matrix_init_rotate(), matrix_init_scale(), matrix_map(), matrix_rotate(), matrix_scale(), NOVASVG_HALF_PI, NOVASVG_TWO_PI, path_cubic_to(), path_get_current_point(), and path_line_to().

Referenced by novasvg::Path::arcTo(), canvas_arc_to(), and path_parse().

◆ path_clone()

path_t * novasvg::render::path_clone ( const path_t *  path)

Creates a copy of the path.

Parameters
pathA pointer to the path_t object to clone.
Returns
A pointer to the newly created path clone.
Examples
/home/runner/work/novasvg/novasvg/include/novasvg/detail/render/render.h.

Definition at line 619 of file path.h.

References novasvg::render::path::elements, novasvg_array_append, novasvg::render::path::num_contours, novasvg::render::path::num_curves, novasvg::render::path::num_points, path_create(), and novasvg::render::path::start_point.

◆ path_clone_dashed()

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.

Parameters
pathA pointer to the path_t object to clone.
offsetThe starting offset into the dash pattern.
dashesAn array of dash lengths.
ndashesThe number of elements in the dashes array.
Returns
A pointer to the newly created path clone with dashed pattern.
Examples
/home/runner/work/novasvg/novasvg/include/novasvg/detail/render/render.h.

Definition at line 657 of file path.h.

References clone_traverse_func(), novasvg::render::path::elements, novasvg::render::path::num_curves, path_create(), path_reserve(), path_traverse_dashed(), and novasvg::render::path::size.

Referenced by ft_outline_convert_dash().

◆ path_clone_flatten()

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.

Parameters
pathA pointer to the path_t object to clone.
Returns
A pointer to the newly created path clone with flattened curves.
Examples
/home/runner/work/novasvg/novasvg/include/novasvg/detail/render/render.h.

Definition at line 649 of file path.h.

References clone_traverse_func(), novasvg::render::path::elements, novasvg::render::path::num_curves, path_create(), path_reserve(), path_traverse_flatten(), and novasvg::render::path::size.

◆ path_close()

void novasvg::render::path_close ( path_t *  path)

Closes the current sub-path.

This function closes the current sub-path by drawing a straight line back to the start point of the sub-path. This is equivalent to the Z command in SVG path syntax.

Parameters
pathA pointer to a path_t object.
Examples
/home/runner/work/novasvg/novasvg/include/novasvg/detail/render/render.h.

Definition at line 217 of file path.h.

References novasvg::render::path::elements, NOVASVG_PATH_COMMAND_CLOSE, path_add_command(), novasvg::render::path_element::point, novasvg::render::path::size, and novasvg::render::path::start_point.

Referenced by canvas_close_path(), clone_traverse_func(), novasvg::Path::close(), path_add_ellipse(), path_add_path(), path_add_rect(), path_add_round_rect(), and path_parse().

◆ path_create()

◆ path_cubic_to()

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.

This function adds a cubic Bézier curve segment from the current point to the specified end point, using the given two control points. This is equivalent to the C command in SVG path syntax.

Parameters
pathA pointer to a path_t object.
x1The x-coordinate of the first control point.
y1The y-coordinate of the first control point.
x2The x-coordinate of the second control point.
y2The y-coordinate of the second control point.
x3The x-coordinate of the end point of the curve.
y3The y-coordinate of the end point of the curve.
Examples
/home/runner/work/novasvg/novasvg/include/novasvg/detail/render/render.h.

Definition at line 120 of file path.h.

References novasvg::render::path::elements, NOVASVG_MAKE_POINT, NOVASVG_PATH_COMMAND_CUBIC_TO, novasvg::render::path::num_curves, path_add_command(), path_move_to(), novasvg::render::path_element::point, and novasvg::render::path::size.

Referenced by canvas_cubic_to(), clone_traverse_func(), novasvg::Path::cubicTo(), path_add_arc(), path_add_ellipse(), path_add_path(), path_add_round_rect(), path_arc_to(), path_parse(), and path_quad_to().

◆ path_destroy()

void novasvg::render::path_destroy ( path_t *  path)

Decreases the reference count of a path object.

This function decrements the reference count of the given path object. If the reference count reaches zero, the path object is destroyed and its resources are freed.

Parameters
pathA pointer to the path_t object.
Examples
/home/runner/work/novasvg/novasvg/include/novasvg/detail/render/render.h.

Definition at line 61 of file path.h.

References novasvg::render::path::elements, novasvg_array_destroy, and novasvg_destroy_reference.

Referenced by canvas_destroy(), ft_outline_convert_dash(), novasvg::Path::reset(), and novasvg::Path::~Path().

◆ path_extents()

float novasvg::render::path_extents ( const path_t *  path,
rect_t *  extents,
bool  tight 
)

Computes the bounding box and total length of the path.

Parameters
pathA pointer to a path_t object.
extentsA pointer to a rect_t object to store the bounding box.
tightIf true, computes a precise bounding box; otherwise, aligns to control points.
Returns
The total length of the path.
Examples
/home/runner/work/novasvg/novasvg/include/novasvg/detail/render/render.h.

Definition at line 701 of file path.h.

References extents_traverse_func(), novasvg::render::rect::h, novasvg::render::extents_calculator_t::length, path_traverse(), path_traverse_flatten(), novasvg::render::rect::w, novasvg::render::rect::x, novasvg::render::extents_calculator_t::x1, novasvg::render::extents_calculator_t::x2, novasvg::render::rect::y, novasvg::render::extents_calculator_t::y1, and novasvg::render::extents_calculator_t::y2.

Referenced by novasvg::Path::boundingRect(), and path_length().

◆ path_get_current_point()

void novasvg::render::path_get_current_point ( const path_t *  path,
float *  x,
float *  y 
)

Retrieves the current point of the path.

Gets the current point's coordinates in the path. This point is the last position used or the point where the path was last moved to.

Parameters
pathA pointer to a path_t object.
xThe x-coordinate of the current point.
yThe y-coordinate of the current point.
Examples
/home/runner/work/novasvg/novasvg/include/novasvg/detail/render/render.h.

Definition at line 225 of file path.h.

References novasvg::render::path::data, novasvg::render::path::elements, novasvg::render::path::num_points, novasvg::render::path_element::point, novasvg::render::path::size, novasvg::render::point::x, and novasvg::render::point::y.

Referenced by canvas_get_current_point(), path_arc_to(), and path_quad_to().

◆ path_get_elements()

int novasvg::render::path_get_elements ( const path_t *  path,
const path_element_t **  elements 
)

Retrieves the elements of a path.

Provides access to the array of path elements.

Parameters
pathA pointer to a path_t object.
elementsA pointer to a pointer that will be set to the array of path elements.
Returns
The number of elements in the path.
Examples
/home/runner/work/novasvg/novasvg/include/novasvg/detail/render/render.h.

Definition at line 74 of file path.h.

References novasvg::render::path::data, novasvg::render::path::elements, and novasvg::render::path::size.

Referenced by novasvg::Path::isEmpty().

◆ path_get_reference_count()

int novasvg::render::path_get_reference_count ( const path_t *  path)

Retrieves the reference count of a path object.

Parameters
pathA pointer to a path_t object.
Returns
The current reference count of the path object.
Examples
/home/runner/work/novasvg/novasvg/include/novasvg/detail/render/render.h.

Definition at line 69 of file path.h.

References novasvg_get_reference_count.

Referenced by novasvg::Path::isUnique().

◆ path_iterator_has_next()

bool novasvg::render::path_iterator_has_next ( const path_iterator_t *  it)

Checks if there are more elements to iterate over.

Parameters
itThe path iterator.
Returns
true if there are more elements; otherwise, false.
Examples
/home/runner/work/novasvg/novasvg/include/novasvg/detail/render/render.h.

Definition at line 18 of file path.h.

References novasvg::render::path_iterator::index, and novasvg::render::path_iterator::size.

Referenced by ft_outline_convert(), path_add_path(), path_traverse(), and path_traverse_flatten().

◆ path_iterator_init()

void novasvg::render::path_iterator_init ( path_iterator_t *  it,
const path_t *  path 
)

◆ path_iterator_next()

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.

Parameters
itThe path iterator.
pointsAn array to store the points for the current command.
Returns
The path command for the current element.
Examples
/home/runner/work/novasvg/novasvg/include/novasvg/detail/render/render.h.

Definition at line 23 of file path.h.

References novasvg::render::path_element::command, novasvg::render::path_iterator::elements, novasvg::render::path_element::header, novasvg::render::path_iterator::index, novasvg::render::path_element::length, NOVASVG_PATH_COMMAND_CLOSE, NOVASVG_PATH_COMMAND_CUBIC_TO, NOVASVG_PATH_COMMAND_LINE_TO, NOVASVG_PATH_COMMAND_MOVE_TO, and novasvg::render::path_element::point.

Referenced by ft_outline_convert(), path_add_path(), path_traverse(), and path_traverse_flatten().

◆ path_length()

float novasvg::render::path_length ( const path_t *  path)

Calculates the total length of the path.

Parameters
pathA pointer to a path_t object.
Returns
The total length of the path.
Examples
/home/runner/work/novasvg/novasvg/include/novasvg/detail/render/render.h.

Definition at line 720 of file path.h.

References path_extents().

◆ path_line_to()

void novasvg::render::path_line_to ( path_t *  path,
float  x,
float  y 
)

Adds a straight line segment to the path.

This function adds a straight line segment from the current point to the specified coordinates. This is equivalent to the L command in SVG path syntax.

Parameters
pathA pointer to a path_t object.
xThe x-coordinate of the end point of the line segment.
yThe y-coordinate of the end point of the line segment.
Examples
/home/runner/work/novasvg/novasvg/include/novasvg/detail/render/render.h.

Definition at line 101 of file path.h.

References novasvg::render::path::elements, NOVASVG_MAKE_POINT, NOVASVG_PATH_COMMAND_LINE_TO, path_add_command(), path_move_to(), novasvg::render::path_element::point, and novasvg::render::path::size.

Referenced by canvas_line_to(), clone_traverse_func(), novasvg::Path::lineTo(), path_add_arc(), path_add_path(), path_add_rect(), path_add_round_rect(), path_arc_to(), and path_parse().

◆ path_move_to()

void novasvg::render::path_move_to ( path_t *  path,
float  x,
float  y 
)

Moves the current point to a new position.

This function moves the current point to the specified coordinates without drawing a line. This is equivalent to the M command in SVG path syntax.

Parameters
pathA pointer to a path_t object.
xThe x-coordinate of the new position.
yThe y-coordinate of the new position.
Examples
/home/runner/work/novasvg/novasvg/include/novasvg/detail/render/render.h.

Definition at line 93 of file path.h.

References NOVASVG_MAKE_POINT, NOVASVG_PATH_COMMAND_MOVE_TO, novasvg::render::path::num_contours, path_add_command(), novasvg::render::path_element::point, and novasvg::render::path::start_point.

Referenced by canvas_move_to(), clone_traverse_func(), novasvg::Path::moveTo(), path_add_arc(), path_add_ellipse(), path_add_path(), path_add_rect(), path_add_round_rect(), path_cubic_to(), path_line_to(), and path_parse().

◆ path_parse()

bool novasvg::render::path_parse ( path_t *  path,
const char *  data,
int  length 
)

Parses SVG path data into a path_t object.

Parameters
pathA pointer to the path_t object to populate.
dataThe SVG path data string.
lengthThe length of data, or -1 for null-terminated data.
Returns
true if successful; false otherwise.
Examples
/home/runner/work/novasvg/novasvg/include/novasvg/detail/render/render.h.

Definition at line 748 of file path.h.

References NOVASVG_DEG2RAD, NOVASVG_IS_ALPHA, parse_arc_flag(), parse_path_coordinates(), path_arc_to(), path_close(), path_cubic_to(), path_line_to(), path_move_to(), path_quad_to(), and skip_ws().

Referenced by novasvg::Path::parse().

◆ path_quad_to()

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.

This function adds a quadratic Bézier curve segment from the current point to the specified end point, using the given control point. This is equivalent to the Q command in SVG path syntax.

Parameters
pathA pointer to a path_t object.
x1The x-coordinate of the control point.
y1The y-coordinate of the control point.
x2The x-coordinate of the end point of the curve.
y2The y-coordinate of the end point of the curve.
Examples
/home/runner/work/novasvg/novasvg/include/novasvg/detail/render/render.h.

Definition at line 109 of file path.h.

References path_cubic_to(), and path_get_current_point().

Referenced by canvas_quad_to(), path_parse(), and novasvg::Path::quadTo().

◆ path_reference()

path_t * novasvg::render::path_reference ( path_t *  path)

Increases the reference count of a path object.

Parameters
pathA pointer to a path_t object.
Returns
A pointer to the same path_t object.
Examples
/home/runner/work/novasvg/novasvg/include/novasvg/detail/render/render.h.

Definition at line 55 of file path.h.

References novasvg_increment_reference.

◆ path_reserve()

void novasvg::render::path_reserve ( path_t *  path,
int  count 
)

Reserves space for path elements.

Reserves space for a specified number of elements in the path. This helps optimize memory allocation for future path operations.

Parameters
pathA pointer to a path_t object.
countThe number of path elements to reserve space for.
Examples
/home/runner/work/novasvg/novasvg/include/novasvg/detail/render/render.h.

Definition at line 238 of file path.h.

References novasvg::render::path::elements, and novasvg_array_ensure.

Referenced by path_add_arc(), path_add_ellipse(), path_add_rect(), path_add_round_rect(), path_clone_dashed(), and path_clone_flatten().

◆ path_reset()

void novasvg::render::path_reset ( path_t *  path)

Resets the path.

Clears all path data, effectively resetting the path_t object to its initial state.

Parameters
pathA pointer to a path_t object.
Examples
/home/runner/work/novasvg/novasvg/include/novasvg/detail/render/render.h.

Definition at line 243 of file path.h.

References novasvg::render::path::elements, novasvg_array_clear, NOVASVG_EMPTY_POINT, novasvg::render::path::num_contours, novasvg::render::path::num_curves, novasvg::render::path::num_points, and novasvg::render::path::start_point.

Referenced by canvas_new_path(), novasvg::Path::parse(), and novasvg::Path::reset().

◆ path_transform()

void novasvg::render::path_transform ( path_t *  path,
const matrix_t *  matrix 
)

Applies a transformation matrix to the path.

Transforms the entire path using the provided transformation matrix.

Parameters
pathA pointer to a path_t object.
matrixA pointer to a matrix_t object.
Examples
/home/runner/work/novasvg/novasvg/include/novasvg/detail/render/render.h.

Definition at line 361 of file path.h.

References novasvg::render::path_element::command, novasvg::render::path::data, novasvg::render::path::elements, novasvg::render::path_element::header, novasvg::render::path_element::length, matrix_map_point(), NOVASVG_PATH_COMMAND_CLOSE, NOVASVG_PATH_COMMAND_CUBIC_TO, NOVASVG_PATH_COMMAND_LINE_TO, NOVASVG_PATH_COMMAND_MOVE_TO, and novasvg::render::path::size.

◆ path_traverse()

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.

Parameters
pathA pointer to a path_t object.
traverse_funcThe callback function to be called for each element of the path.
closureUser-defined data passed to the callback.
Examples
/home/runner/work/novasvg/novasvg/include/novasvg/detail/render/render.h.

Definition at line 417 of file path.h.

References NOVASVG_PATH_COMMAND_CLOSE, NOVASVG_PATH_COMMAND_CUBIC_TO, NOVASVG_PATH_COMMAND_LINE_TO, NOVASVG_PATH_COMMAND_MOVE_TO, path_iterator_has_next(), path_iterator_init(), and path_iterator_next().

Referenced by path_extents(), path_traverse_dashed(), and path_traverse_flatten().

◆ path_traverse_dashed()

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.

Parameters
pathA pointer to a path_t object.
offsetThe starting offset into the dash pattern.
dashesAn array of dash lengths.
ndashesThe number of elements in the dashes array.
traverse_funcThe callback function to be called for each element of the path.
closureUser-defined data passed to the callback.
Examples
/home/runner/work/novasvg/novasvg/include/novasvg/detail/render/render.h.

Definition at line 584 of file path.h.

References novasvg::render::dasher_t::closure, novasvg::render::dasher_t::current_point, dash_traverse_func(), novasvg::render::dasher_t::dashes, novasvg::render::dasher_t::index, novasvg::render::dasher_t::ndashes, NOVASVG_EMPTY_POINT, path_traverse(), path_traverse_flatten(), novasvg::render::dasher_t::phase, novasvg::render::dasher_t::start_index, novasvg::render::dasher_t::start_phase, novasvg::render::dasher_t::start_toggle, novasvg::render::dasher_t::toggle, and novasvg::render::dasher_t::traverse_func.

Referenced by path_clone_dashed().

◆ path_traverse_flatten()

void novasvg::render::path_traverse_flatten ( const path_t *  path,
path_traverse_func_t  traverse_func,
void *  closure 
)

◆ premultiply_argb()

NOVASVG_INLINE uint32_t novasvg::render::premultiply_argb ( uint32_t  color)

Definition at line 73 of file utils.h.

References novasvg_alpha, novasvg_blue, novasvg_green, and novasvg_red.

Referenced by surface_clear().

◆ premultiply_color_with_opacity()

NOVASVG_INLINE uint32_t novasvg::render::premultiply_color_with_opacity ( const color_t *  color,
float  opacity 
)

◆ rasterize()

◆ render_version()

int novasvg::render::render_version ( void  )

Gets the version of the novasvg rendering library.

Returns
An integer representing the version of the novasvg rendering library.
Examples
/home/runner/work/novasvg/novasvg/include/novasvg/detail/render/render.h.

Definition at line 9 of file canvas.h.

References NOVASVG_RENDER_VERSION.

◆ render_version_string()

const char * novasvg::render::render_version_string ( void  )

Gets the version of the novasvg rendering library as a string.

Returns
A string representing the version of the novasvg rendering library.
Examples
/home/runner/work/novasvg/novasvg/include/novasvg/detail/render/render.h.

Definition at line 14 of file canvas.h.

References NOVASVG_RENDER_VERSION_STRING.

◆ skip_css_unit()

NOVASVG_INLINE void novasvg::render::skip_css_unit ( const char **  begin,
const char *  end,
float *  number 
)

Definition at line 236 of file utils.h.

Referenced by parse_matrix_parameters().

◆ skip_delim()

NOVASVG_INLINE bool novasvg::render::skip_delim ( const char **  begin,
const char *  end,
const char  delim 
)

◆ skip_string()

NOVASVG_INLINE bool novasvg::render::skip_string ( const char **  begin,
const char *  end,
const char *  data 
)

Definition at line 158 of file utils.h.

Referenced by matrix_parse().

◆ skip_ws()

NOVASVG_INLINE bool novasvg::render::skip_ws ( const char **  begin,
const char *  end 
)

Definition at line 174 of file utils.h.

References NOVASVG_IS_WS.

Referenced by color_parse(), matrix_parse(), path_parse(), skip_ws_and_delim(), and skip_ws_or_delim().

◆ skip_ws_and_comma()

NOVASVG_INLINE bool novasvg::render::skip_ws_and_comma ( const char **  begin,
const char *  end 
)

Definition at line 198 of file utils.h.

References skip_ws_and_delim().

Referenced by color_parse().

◆ skip_ws_and_delim()

NOVASVG_INLINE bool novasvg::render::skip_ws_and_delim ( const char **  begin,
const char *  end,
char  delim 
)

Definition at line 183 of file utils.h.

References skip_delim(), and skip_ws().

Referenced by color_parse(), parse_matrix_parameters(), and skip_ws_and_comma().

◆ skip_ws_or_comma()

NOVASVG_INLINE bool novasvg::render::skip_ws_or_comma ( const char **  begin,
const char *  end,
bool *  has_comma 
)

◆ skip_ws_or_delim()

NOVASVG_INLINE bool novasvg::render::skip_ws_or_delim ( const char **  begin,
const char *  end,
char  delim,
bool *  has_delim 
)

Definition at line 203 of file utils.h.

References skip_delim(), and skip_ws().

Referenced by skip_ws_or_comma().

◆ span_buffer_contains()

◆ span_buffer_copy()

◆ span_buffer_destroy()

NOVASVG_INLINE void novasvg::render::span_buffer_destroy ( span_buffer_t *  span_buffer)

Definition at line 48 of file rasterize.h.

References novasvg_array_destroy, and novasvg::render::span_buffer_t::spans.

Referenced by canvas_destroy(), and state_destroy().

◆ span_buffer_extents()

◆ span_buffer_init()

NOVASVG_INLINE void novasvg::render::span_buffer_init ( span_buffer_t *  span_buffer)

◆ span_buffer_init_rect()

◆ span_buffer_intersect()

◆ span_buffer_reset()

◆ span_buffer_update_extents()

◆ spans_generation_callback()

NOVASVG_INLINE void novasvg::render::spans_generation_callback ( int  count,
const PVG_FT_Span *  spans,
void *  user 
)

Definition at line 377 of file rasterize.h.

References novasvg_array_append_data, and novasvg::render::span_buffer_t::spans.

Referenced by rasterize().

◆ split_bezier()

◆ state_copy()

◆ state_create()

◆ state_destroy()

◆ state_reset()

◆ surface_clear()

NOVASVG_INLINE void novasvg::render::surface_clear ( surface_t *  surface,
const color_t *  color 
)

Clears the entire surface with the specified color.

Parameters
surfacePointer to the target surface.
colorPointer to the color used for clearing.
Examples
/home/runner/work/novasvg/novasvg/include/novasvg/detail/render/render.h.

Definition at line 7958 of file surface.h.

References color_to_argb32(), novasvg::render::surface::data, novasvg::render::surface::height, memfill32(), premultiply_argb(), novasvg::render::surface::stride, and novasvg::render::surface::width.

Referenced by novasvg::Bitmap::clear().

◆ surface_create()

NOVASVG_INLINE surface_t * novasvg::render::surface_create ( int  width,
int  height 
)

Creates a new image surface with the specified dimensions.

Parameters
widthThe width of the surface in pixels.
heightThe height of the surface in pixels.
Returns
A pointer to the newly created surface_t object.
Examples
/home/runner/work/novasvg/novasvg/include/novasvg/detail/render/render.h.

Definition at line 7753 of file surface.h.

References novasvg::render::surface::data, novasvg::render::surface::height, and novasvg::render::surface::stride.

◆ surface_create_for_data()

NOVASVG_INLINE surface_t * novasvg::render::surface_create_for_data ( unsigned char *  data,
int  width,
int  height,
int  stride 
)

Creates an image surface using existing pixel data.

Parameters
dataPointer to the pixel data.
widthThe width of the surface in pixels.
heightThe height of the surface in pixels.
strideThe number of bytes per row in the pixel data.
Returns
A pointer to the newly created surface_t object.
Examples
/home/runner/work/novasvg/novasvg/include/novasvg/detail/render/render.h.

Definition at line 7761 of file surface.h.

References novasvg::render::surface::data, novasvg::render::surface::height, novasvg_init_reference, novasvg::render::surface::stride, and novasvg::render::surface::width.

◆ surface_destroy()

NOVASVG_INLINE void novasvg::render::surface_destroy ( surface_t *  surface)

Decrements the reference count and destroys the surface if the count reaches zero.

Parameters
surfacePointer to the surface_t object .
Examples
/home/runner/work/novasvg/novasvg/include/novasvg/detail/render/render.h.

Definition at line 7926 of file surface.h.

References novasvg_destroy_reference.

Referenced by canvas_destroy(), paint_destroy(), and novasvg::Bitmap::~Bitmap().

◆ surface_get_data()

NOVASVG_INLINE unsigned char * novasvg::render::surface_get_data ( const surface_t *  surface)

Gets the pixel data of the surface.

Parameters
surfacePointer to the surface_t object.
Returns
Pointer to the pixel data.
Examples
/home/runner/work/novasvg/novasvg/include/novasvg/detail/render/render.h.

Definition at line 7938 of file surface.h.

References novasvg::render::surface::data.

Referenced by novasvg::Bitmap::convertToRGBA(), and novasvg::Bitmap::data().

◆ surface_get_height()

NOVASVG_INLINE int novasvg::render::surface_get_height ( const surface_t *  surface)

Gets the height of the surface.

Parameters
surfacePointer to the surface_t object.
Returns
Height of the surface in pixels.
Examples
/home/runner/work/novasvg/novasvg/include/novasvg/detail/render/render.h.

Definition at line 7948 of file surface.h.

References novasvg::render::surface::height.

Referenced by novasvg::Bitmap::convertToRGBA(), and novasvg::Bitmap::height().

◆ surface_get_reference_count()

NOVASVG_INLINE int novasvg::render::surface_get_reference_count ( const surface_t *  surface)

Gets the current reference count of a surface.

Parameters
surfacePointer to the surface_t object.
Returns
The reference count of the surface.
Examples
/home/runner/work/novasvg/novasvg/include/novasvg/detail/render/render.h.

Definition at line 7933 of file surface.h.

References novasvg_get_reference_count.

◆ surface_get_stride()

NOVASVG_INLINE int novasvg::render::surface_get_stride ( const surface_t *  surface)

Gets the stride of the surface.

Parameters
surfacePointer to the surface_t object.
Returns
Number of bytes per row.
Examples
/home/runner/work/novasvg/novasvg/include/novasvg/detail/render/render.h.

Definition at line 7953 of file surface.h.

References novasvg::render::surface::stride.

Referenced by novasvg::Bitmap::convertToRGBA(), and novasvg::Bitmap::stride().

◆ surface_get_width()

NOVASVG_INLINE int novasvg::render::surface_get_width ( const surface_t *  surface)

Gets the width of the surface.

Parameters
surfacePointer to the surface_t object.
Returns
Width of the surface in pixels.
Examples
/home/runner/work/novasvg/novasvg/include/novasvg/detail/render/render.h.

Definition at line 7943 of file surface.h.

References novasvg::render::surface::width.

Referenced by novasvg::Bitmap::convertToRGBA(), and novasvg::Bitmap::width().

◆ surface_load_from_image_base64()

NOVASVG_INLINE surface_t * novasvg::render::surface_load_from_image_base64 ( const char *  data,
int  length 
)

Loads an image surface from base64-encoded data.

Parameters
dataPointer to the base64-encoded image data.
lengthLength of the data in bytes, or -1 if null-terminated.
Returns
Pointer to the surface, or NULL on failure.
Examples
/home/runner/work/novasvg/novasvg/include/novasvg/detail/render/render.h.

Definition at line 7909 of file surface.h.

References base64_decode(), and surface_load_from_image_data().

Referenced by novasvg::loadImageResource().

◆ surface_load_from_image_data()

NOVASVG_INLINE surface_t * novasvg::render::surface_load_from_image_data ( const void *  data,
int  length 
)

Loads an image surface from raw image data.

Parameters
dataPointer to the image data.
lengthLength of the data in bytes.
Returns
Pointer to the surface, or NULL on failure.
Examples
/home/runner/work/novasvg/novasvg/include/novasvg/detail/render/render.h.

Definition at line 7790 of file surface.h.

References STBI_rgb_alpha.

Referenced by surface_load_from_image_base64().

◆ surface_load_from_image_file()

NOVASVG_INLINE surface_t * novasvg::render::surface_load_from_image_file ( const char *  filename)

Loads an image surface from a file.

Parameters
filenamePath to the image file.
Returns
Pointer to the surface, or NULL on failure.
Examples
/home/runner/work/novasvg/novasvg/include/novasvg/detail/render/render.h.

Definition at line 7781 of file surface.h.

References STBI_rgb_alpha.

Referenced by novasvg::loadImageResource().

◆ surface_reference()

NOVASVG_INLINE surface_t * novasvg::render::surface_reference ( surface_t *  surface)

Increments the reference count for a surface.

Parameters
surfacePointer to the surface_t object.
Returns
Pointer to the surface_t object.
Examples
/home/runner/work/novasvg/novasvg/include/novasvg/detail/render/render.h.

Definition at line 7920 of file surface.h.

References novasvg_increment_reference.

Referenced by canvas_create(), and paint_create_texture().

◆ text_iterator_has_next()

bool novasvg::render::text_iterator_has_next ( const text_iterator_t *  it)

Checks if there are more code points to iterate.

Parameters
itPointer to the text iterator.
Returns
true if more code points are available; otherwise, false.
Examples
/home/runner/work/novasvg/novasvg/include/novasvg/detail/render/render.h.

Definition at line 5041 of file font.h.

References novasvg::render::text_iterator::index, and novasvg::render::text_iterator::length.

Referenced by canvas_add_text(), font_face_apply_ligature(), font_face_text_extents(), and novasvg::Font::glyphBoxes().

◆ text_iterator_init()

void novasvg::render::text_iterator_init ( text_iterator_t *  it,
const void *  text,
int  length,
text_encoding_t  encoding 
)

Initializes a text iterator.

Parameters
itPointer to the text iterator.
textPointer to the text data.
lengthLength of the text data, or -1 if the data is null-terminated.
encodingEncoding of the text data.
Examples
/home/runner/work/novasvg/novasvg/include/novasvg/detail/render/render.h.

Definition at line 5031 of file font.h.

References novasvg::render::text_iterator::encoding, novasvg::render::text_iterator::index, novasvg::render::text_iterator::length, novasvg::render::text_iterator::text, and text.

Referenced by canvas_add_text(), font_face_text_extents(), and novasvg::Font::glyphBoxes().

◆ text_iterator_next()

Variable Documentation

◆ composition_solid_table

NOVASVG_INLINE const composition_solid_function_t novasvg::render::composition_solid_table[]
Initial value:
= {
composition_solid_blend_mode<NOVASVG_OPERATOR_MULTIPLY>,
composition_solid_blend_mode<NOVASVG_OPERATOR_SCREEN>,
composition_solid_blend_mode<NOVASVG_OPERATOR_DARKEN>,
composition_solid_blend_mode<NOVASVG_OPERATOR_LIGHTEN>,
composition_solid_blend_mode<NOVASVG_OPERATOR_DIFFERENCE>,
composition_solid_blend_mode<NOVASVG_OPERATOR_EXCLUSION>
}
NOVASVG_INLINE void composition_solid_destination_over(uint32_t *dest, int length, uint32_t color, uint32_t const_alpha)
Definition blend.h:351
NOVASVG_INLINE void composition_solid_destination(uint32_t *dest, int length, uint32_t color, uint32_t const_alpha)
Definition blend.h:337
NOVASVG_INLINE void composition_solid_source_atop(uint32_t *dest, int length, uint32_t color, uint32_t const_alpha)
Definition blend.h:413
NOVASVG_INLINE void composition_solid_source_out(uint32_t *dest, int length, uint32_t color, uint32_t const_alpha)
Definition blend.h:387
NOVASVG_INLINE void composition_solid_destination_out(uint32_t *dest, int length, uint32_t color, uint32_t const_alpha)
Definition blend.h:403
NOVASVG_INLINE void composition_solid_destination_atop(uint32_t *dest, int length, uint32_t color, uint32_t const_alpha)
Definition blend.h:424
NOVASVG_INLINE void composition_solid_source(uint32_t *dest, int length, uint32_t color, uint32_t const_alpha)
Definition blend.h:324
NOVASVG_INLINE void composition_solid_clear(uint32_t *dest, int length, uint32_t color, uint32_t const_alpha)
Definition blend.h:312
NOVASVG_INLINE void composition_solid_source_in(uint32_t *dest, int length, uint32_t color, uint32_t const_alpha)
Definition blend.h:361
NOVASVG_INLINE void composition_solid_destination_in(uint32_t *dest, int length, uint32_t color, uint32_t const_alpha)
Definition blend.h:377
NOVASVG_INLINE void composition_solid_xor(uint32_t *dest, int length, uint32_t color, uint32_t const_alpha)
Definition blend.h:438
NOVASVG_INLINE void composition_solid_source_over(uint32_t *dest, int length, uint32_t color, uint32_t const_alpha)
Definition blend.h:341

Definition at line 521 of file blend.h.

Referenced by blend_solid().

◆ composition_table

NOVASVG_INLINE const composition_function_t novasvg::render::composition_table[]
Initial value:
= {
composition_blend_mode<NOVASVG_OPERATOR_MULTIPLY>,
composition_blend_mode<NOVASVG_OPERATOR_SCREEN>,
composition_blend_mode<NOVASVG_OPERATOR_DARKEN>,
composition_blend_mode<NOVASVG_OPERATOR_LIGHTEN>,
composition_blend_mode<NOVASVG_OPERATOR_DIFFERENCE>,
composition_blend_mode<NOVASVG_OPERATOR_EXCLUSION>
}
NOVASVG_INLINE void composition_source_in(uint32_t *dest, int length, const uint32_t *src, uint32_t const_alpha)
Definition blend.h:605
NOVASVG_INLINE void composition_destination_atop(uint32_t *dest, int length, const uint32_t *src, uint32_t const_alpha)
Definition blend.h:684
NOVASVG_INLINE void composition_source(uint32_t *dest, int length, const uint32_t *src, uint32_t const_alpha)
Definition blend.h:554
NOVASVG_INLINE void composition_source_over(uint32_t *dest, int length, const uint32_t *src, uint32_t const_alpha)
Definition blend.h:570
NOVASVG_INLINE void composition_destination_in(uint32_t *dest, int length, const uint32_t *src, uint32_t const_alpha)
Definition blend.h:621
NOVASVG_INLINE void composition_destination_over(uint32_t *dest, int length, const uint32_t *src, uint32_t const_alpha)
Definition blend.h:589
NOVASVG_INLINE void composition_source_out(uint32_t *dest, int length, const uint32_t *src, uint32_t const_alpha)
Definition blend.h:636
NOVASVG_INLINE void composition_xor(uint32_t *dest, int length, const uint32_t *src, uint32_t const_alpha)
Definition blend.h:703
NOVASVG_INLINE void composition_source_atop(uint32_t *dest, int length, const uint32_t *src, uint32_t const_alpha)
Definition blend.h:667
NOVASVG_INLINE void composition_clear(uint32_t *dest, int length, const uint32_t *src, uint32_t const_alpha)
Definition blend.h:542
NOVASVG_INLINE void composition_destination_out(uint32_t *dest, int length, const uint32_t *src, uint32_t const_alpha)
Definition blend.h:652
NOVASVG_INLINE void composition_destination(uint32_t *dest, int length, const uint32_t *src, uint32_t const_alpha)
Definition blend.h:566

Definition at line 722 of file blend.h.

Referenced by blend_linear_gradient(), blend_radial_gradient(), blend_transformed_argb(), blend_transformed_bilinear_tiled_argb(), blend_transformed_tiled_argb(), blend_untransformed_argb(), and blend_untransformed_tiled_argb().