Skip to main content

Crate hephaestus

Crate hephaestus 

Source
Expand description

hephaestus — backend-agnostic 2D scene renderer for data visualization.

The public API is the scene::SceneBuilder trait (what plot code calls) plus the backend::Renderer trait (what produces pixels). Backends slot in behind cargo features; the initial backend is Vello (GPU compute via wgpu).

The intersection of Vello and Blend2D capabilities defines the public surface: no conic Beziers, no stroke alignment, no exotic blend modes, no filter effects. Backend-specific extensions are not exposed.

Re-exports§

pub use blend::BlendMode;
pub use blend::Compose;
pub use blend::Mix;
pub use brush::Sampling;
pub use color::lerp_color;
pub use color::rgb;
pub use color::rgb8;
pub use color::rgba;
pub use color::ColorSpace;
pub use layout::Axis;
pub use layout::Cell;
pub use layout::CellId;
pub use layout::Extent;
pub use layout::Grid;
pub use layout::Inset;
pub use layout::Layout;
pub use layout::Measure;
pub use layout::Placement;
pub use layout::Respect;
pub use layout::Track;
pub use layout::WidthHint;
pub use linetype::LinetypeStep;
pub use mesh::Mesh;
pub use path::FillRule;
pub use pick::PickId;
pub use primitives::annular_wedge;
pub use primitives::arc;
pub use primitives::circle;
pub use primitives::clip_polyline;
pub use primitives::ellipse;
pub use primitives::offset_polygon;
pub use primitives::path_to_rings;
pub use primitives::polygon;
pub use primitives::polyline;
pub use primitives::rect;
pub use primitives::regular_polygon;
pub use primitives::regular_polygon_vertices;
pub use primitives::round_corners;
pub use primitives::round_path_corners;
pub use primitives::rounded_rect;
pub use primitives::segment;
pub use primitives::wedge;
pub use primitives::ArcLengthWalker;
pub use primitives::ArcSample;
pub use primitives::CornerRounding;
pub use primitives::EndClip;
pub use primitives::PolygonOptions;
pub use primitives::PolylineOptions;
pub use primitives::PolylineSampler;
pub use primitives::RibbonOptions;
pub use primitives::TrailingPolicy;
pub use scene::Font;
pub use scene::Glyph;
pub use scene::GlyphRun;
pub use scene::SceneBuilder;
pub use shape::Shape;
pub use shape::ShapeRegistry;
pub use shape::ShapeStyle;
pub use style_vocab::HAlign;
pub use style_vocab::Length;
pub use style_vocab::Margin;
pub use style_vocab::Palette;
pub use style_vocab::ThemeColor;
pub use style_vocab::VAlign;
pub use backend::BackendError;
pub use backend::Renderer;
pub use backend::WgpuRenderer;vello-hybrid or vello
pub use wgpu;vello-hybrid or vello

Modules§

backend
Backend trait and error types.
blend
Blend modes. Restricted to the intersection of Vello and Blend2D.
brush
Brushes — what fills/strokes paint with. Solid colors, gradients, and image patterns. Re-exports peniko types; Sampling is restricted to the modes both Vello and Blend2D support natively.
color
Color types. Re-exports peniko::Color (which itself wraps the color crate) and provides a couple of ergonomic constructors.
composition
High-level plot composition layout.
documentdocument-read or document-write
Plot documents — capture a PlotComposition to a self-contained byte string and rebuild it elsewhere.
geometry
Geometry primitives. Re-exports from kurbo through our own module path so downstream code never references kurbo:: directly.
imagejpeg or png or tiff or webp
Raster image writers.
layout
Layout: compose n×m grids recursively, solve to a flat map of cell-id → pixel rectangle.
linetype
Linetype patterns and the arc-length walk that renders them.
mesh
2D triangle meshes with per-vertex colour.
path
Path representation. Path is kurbo::BezPath, which natively supports moveto/lineto/quadto/curveto/closepath (no conic Beziers — intentional, to match the Vello ∩ Blend2D intersection).
pick
Hit-testing primitives.
plot
High-level, plot-centric API layered on top of the low-level SceneBuilder + composition surfaces. The architecture is shaped so new geoms / scales / projections drop in additively.
pngpng
PNG writer.
primitives
Compound 2D primitives that sit at the boundary between the low- and high-level scene APIs.
scales
Scale primitives — values, ranges, transforms, scale-type kinds, and tick / break algorithms — as plain enums + free functions.
scene
Backend-agnostic scene authoring.
shape
Named shape glyphs for scatterplot markers and line endpoint terminators.
stroke
Stroke parameters. Re-exports kurbo::{Cap, Join, Stroke}.
style_vocab
Shared styling vocabulary — the small value types that both the plot theme and the text layer express visual quantities in.
text
Text shaping and layout backed by parley.
windowwindow, or WebAssembly and canvas, or WebAssembly and webgl
Live window presentation.

Structs§

Affine
A 2D affine transform.
Path
A Bézier path.
Point
A 2D point.
Rect
A rectangle.
Size
A 2D size.
Stroke
The visual style of a stroke.
Vec2
A 2D vector.

Enums§

Brush
Describes the color content of a filled or stroked shape.

Type Aliases§

Color
A convenient alias for the color type used for Brush.