[][src]Crate rsvg_internals

The implementation of librsvg

The implementation of librsvg is in the rsvg_internals crate. It is not a public crate; instead, it exports the primitives necessary to implement librsvg's public APIs, both the C and Rust APIs. It has the XML and CSS parsing code, the SVG element definitions and tree of elements, and all the drawing logic.

Some interesting parts of rsvg_internals:

Re-exports

pub use crate::rect::IRect;
pub use crate::rect::Rect;
pub use crate::surface_utils::iterators::Pixels;
pub use crate::surface_utils::shared_surface::SharedImageSurface;
pub use crate::surface_utils::shared_surface::SurfaceType;
pub use crate::surface_utils::CairoARGB;
pub use crate::surface_utils::Pixel;

Modules

allowed_url

Determine which URLs are allowed for loading.

angle

CSS angle values.

aspect_ratio

Handling of preserveAspectRatio values.

bbox

Bounding boxes that know their coordinate space.

color

CSS color values.

cond

Conditional processing attributes: requiredExtensions, requiredFeatures, systemLanguage.

coord_units

userSpaceOnUse or objectBoundingBox values.

css

Representation of CSS types, and the CSS parsing and matching engine.

dasharray

Parser for the stroke-dasharray property.

document

Main SVG document structure.

dpi

Resolution for rendering (dots per inch = DPI).

drawing_ctx

The main context structure which drives the drawing process.

element

SVG Elements.

error

Error types.

filter

The filter element.

filters

Entry point for the CSS filters infrastructure.

float_eq_cairo

Utilities to compare floating-point numbers.

font_props

CSS font properties.

gradient

Gradient paint servers; the linearGradient and radialGradient elements.

handle

Toplevel handle for a loaded SVG document.

image

The image element.

io

Utilities to acquire streams and data from from URLs.

iri

CSS funciri values.

length

CSS length values.

limits

Processing limits to mitigate malicious SVGs.

log

Utilities for logging messages from the library.

marker

The marker element, and geometry computations for markers.

node

Tree nodes, the representation of SVG elements.

number_list

CSS number-list values.

paint_server

SVG paint servers.

parsers

The Parse trait for CSS properties, and utilities for parsers.

path_builder

Representation of Bézier paths.

path_parser

Parser for SVG path data.

pattern

The pattern element.

properties

CSS properties, specified values, computed values.

property_bag

Iterate among libxml2's arrays of XML attribute/value.

property_defs

Definitions for CSS property types.

property_macros

Macros to define CSS properties.

rect

Types for rectangles.

shapes

Basic SVG shapes: the path, polygon, polyline, line, rect, circle, ellipse elements.

space

Processing of the xml:space attribute.

structure

Structural elements in SVG: the g, switch, svg, use, symbol, clip_path, mask, link elements.

style

The style element.

surface_utils

Various utilities for working with Cairo image surfaces.

text

Text elements: text, tspan, tref.

transform

Handling of transform values.

unit_interval

Type for values in the [0.0, 1.0] range.

util

Miscellaneous utilities.

viewbox

Parser for the viewBox attribute.

xml

The main XML parser.

xml2

Hand-written binding to the very minimal part of libxml2 that we need.

xml2_load

Glue between the libxml2 API and our xml parser module.

Macros

assert_approx_eq_cairo
borrow_element_as
coord_units

Creates a newtype around CoordUnits, with a default value.

is_element_of_type
make_property

Generates a type for a CSS property.

rsvg_log

Structs

Dpi
Handle

Main handle to an SVG document.

IntrinsicDimensions

Intrinsic dimensions of an SVG document fragment: its width, height, viewBox attributes.

Length

A CSS length value.

LoadOptions

Loading options for SVG documents.

RsvgLength

A CSS length value.

ViewBox

Newtype around a Rect, used to represent the viewBox attribute.

Enums

Color

A value.

DefsLookupErrorKind

Errors returned when looking up a resource by URL reference.

HrefError

Errors returned when creating an Href out of a string

LengthUnit

Units for length values.

LoadingError

Errors that can happen while loading an SVG document.

RenderingError

Errors that can happen while rendering or measuring an SVG document.

Traits

Parse

Trait to parse values using cssparser::Parser.