Skip to main content

Crate ezu_paint

Crate ezu_paint 

Source
Expand description

Paint MVT features onto a raster canvas.

Three painting primitives are exposed:

  • paint_polygonstiny-skia solid fill + optional outline + libblur gaussian blur. Fast path for large patches.
  • paint_polygons_dabshokusai scatter-dab fill with world-deterministic jitter (seamless across tile boundaries).
  • paint_lineshokusai::Brush::stroke_to along polylines.

These are the building blocks for the graph nodes in nodes; the host-side glue (PNG encoding, asset loading) lives in host.

All painting happens on a Canvas that optionally wraps a padded buffer (tile_size + 2 * pad). Paint operations work in the padded space; cropping happens at the host boundary.

Re-exports§

pub use brush::BrushDefaults;
pub use dabs::paint_polygons_dabs;
pub use dabs::DabFillStyle;
pub use strokes::paint_lines;
pub use strokes::LineStrokeStyle;

Modules§

brush
Extract paint-friendly defaults from a hokusai Brush.
color_interp
Colour-space stop interpolation (re-exported from ezu-core so the paint nodes and the MapLibre converter share one implementation). Colour-stop interpolation in a selectable colour space.
dabs
Hokusai-backed dab scatter fill.
host
A raster canvas backed by a premultiplied RGBA Pixmap.
legend
Rendering a legend entry’s swatch.
nodes
Node implementations for the graph evaluator. One file per op.
render
Feature filtering and collection helpers shared by feature-source nodes (features).
strokes
Polyline watercolor stroking via hokusai::Brush::stroke_to.

Structs§

Brush
Canvas
RgbaF32
StrokeStyle
Style for a crisp vector stroke (contrast with paint_lines, which is a painterly hokusai brush).
WatercolorStyle
Style for a watercolor polygon layer.

Enums§

PaintError

Functions§

paint_polygons
Paint a collection of MVT polygons onto a fresh transparent layer, blur it, and composite it over canvas (source-over).
paint_strokes
Stroke MVT polylines with a crisp, constant-width tiny-skia line onto a fresh layer, then composite over canvas. Coordinates are MVT tile-local ([0, extent], y-down), scaled to tile size and offset by the pad.