Expand description
Node-graph composable brush engine.
Re-exports§
pub use node::BrushNodeRegistration;
Modules§
- builtin_
brushes - Built-in brushes shipped with the application.
- bundle
.darkly-brushbundle format — ZIP archive containing a JSON envelope and an optional pre-baked thumbnail.- checkpoint_
ring - Ring buffer of GPU texture checkpoints for partial stroke re-render.
- composite_
pipeline - Brush commit composite pipeline — the scratch → layer blit with shader-side Porter-Duff source-over against a canvas-copy background.
- curve_
math - Natural cubic spline with precomputed LUT.
- eval
- Brush graph evaluation runtime.
- gpu_
context - GPU context bundle passed to brush node evaluators during
execute_gpuandrender_cursor_preview_pipeline. - import
- Import parsers for third-party brush formats.
- interpolation
- Interpolation of
PaintInformationbetween pen samples. - library
- In-memory brush library with optional filesystem backing.
- node
- Brush-flavoured wrapper around the generic
NodeRegistration. - nodes
- paint_
info - Pen input data and stroke vector storage.
- paint_
target_ ext - Brush extensions on
GpuPaintTarget. - pipeline
- Central brush pipeline registry, plumbing pipelines, and shared infra.
- portable
- Portable, human-friendly text representation of a brush graph.
- preview_
renderer - Full-stroke brush preview renderer.
- save_
points - Per-dab save points for O(1) stroke rewind.
- scratch
- Scratch — the writable stroke scratch and its read-mirror sibling.
- spacing
- Distance-based dab spacing.
- stabilizer
- Stroke stabilizer — retroactive stroke reshaping with zero lag.
- stabilizers
- state
- Brush state shared across every engine in a
DarklySession. - stroke_
buffer - Stroke buffer — the per-stroke GPU resources that survive between pen events.
- stroke_
engine - Stroke engine — bridges pen input events to the brush node graph.
- wgsl
- Framework for compiling brush graphs to a single WGSL fragment shader.
- wire
- Brush-domain wire types and scalar values.
Structs§
- Brush
Node Registry - HashMap-backed registry of all brush node types.
Constants§
- DAB_
REFERENCE_ SIZE - Reference dab dimension (width = height), in canvas pixels — the
UI/UX convention that defines what
brush size = 1.0means in canvas-pixel terms. Used by:
Functions§
- compile_
from_ json - Deserialize a brush graph from JSON and compile it.
- compile_
graph - Compile any brush graph into a ready-to-run runner.
- default_
graph - Build the default brush graph: pressure-sensitive disc through the
compiled
paintterminal. Same shape as Round inbuiltin_brushes—pen → paint_color → shape (sine, amplitude 0) → stamp → paint— minus the per-brush configuration closure (no exposed softness, no flow wire). - default_
runner - Compile the default brush graph into a ready-to-run runner.
- find_
terminal - Convenience over
crate::nodegraph::Graph::find_terminalfor brush graphs: builds a freshBrushNodeRegistryand delegates. Use this from any graph-only call site (benches, tests, the WASM bridge) where threading the registry through would be noise. - registry
- Process-global brush-node registry. Built once on first access; every
subsequent caller borrows the same
&'static BrushNodeRegistry. The 20-plus formerBrushNodeRegistry::new()sites all funnel through here now, so node metadata is materialized once per process instead of per graph compile / per-brush-builder. - reset_
exposed_ scrubs - Reset every exposed input port on every node back to its registration default. This produces a “canonical” view of the graph that’s independent of any user-facing scrubs (size, opacity, hardness, etc.).
- validate_
graph_ json - Validate a brush graph from JSON without compiling.