Skip to main content

wisp/
lib.rs

1//! `wisp` — 2D scene graph + filter chain on `wgpu`.
2//!
3//! Pixi-shaped public API for compositing recorded screen content. See
4//! `_docs/recorder-features-and-render-api.md` for the design surface and
5//! `_docs/milestone-0-renderer.md` for the build plan.
6//!
7//! # Module map
8//!
9//! - [`application`] — `Application`, `AppConfig`, `Stage` (root context).
10//! - [`scene`] — `Container`, `Sprite`, `Graphics`, `Text`, `Mesh`, transforms, clip masks.
11//! - [`texture`] — `Texture`, `VideoTexture`, `RenderTexture`.
12//! - [`filter`] — `Filter` trait + built-in filters (blur, drop shadow, motion blur, color matrix).
13//! - [`render`] — internal renderer, batcher, pipeline cache, filter pass orchestrator.
14//! - [`math`] — re-exports from `glam` plus `Rect`.
15//! - [`color`] — `Color` (RGBA f32).
16//! - [`blend`] — `BlendMode`.
17
18pub mod application;
19pub mod blend;
20pub mod color;
21pub mod filter;
22pub mod math;
23pub mod recording;
24pub mod render;
25pub mod scene;
26pub mod text;
27pub mod texture;
28
29mod error;
30
31/// Public façade for path types + boolean ops (M-BOOL track).
32///
33/// The implementation lives under `crate::scene::path`; this module
34/// re-exports the surface so external consumers write
35/// `use wisp::path::{Path, PathBuilder}` and `use wisp::path::boolean`
36/// — matching the M-BOOL ticket spec without leaking the internal
37/// `scene::*` module layout.
38pub mod path {
39    pub use crate::scene::path::boolean;
40    pub use crate::scene::path::{Path, PathBuilder, PathCommand};
41}
42
43// Re-export wgpu so downstream crates (wisp-chart, etc.) can name
44// wgpu types like `TextureFormat` without depending on wgpu directly
45// — keeps wgpu's major version pinned in one place.
46pub use wgpu;
47
48pub use blend::BlendMode;
49pub use color::Color;
50pub use error::Error;
51pub use filter::{
52    BlurFilter, ColorMatrixFilter, DropShadowFilter, Filter, FilterContext, MotionBlurFilter,
53};
54pub use math::{Mat3, Mat4, Rect, Vec2, Vec3, Vec4};
55pub use render::mask_combine::MaskCombineOp;
56pub use scene::{
57    BlurStrength, Callout, Container, DimOutside, DimStrength, Fill, FlexText, Font, Graphics,
58    Highlight, MaskShape, Mesh, Node, NodeId, Path, PathBuilder, PathCommand, PrivacyBlur, Sprite,
59    Stage, Stroke, Text, Transform, Vector, VectorShape, VectorStroke,
60};
61pub use text::{
62    AtlasGlyphInstance, AtlasTextEngine, AtlasTextLayout, FlexibleTextEngine, FlexibleTextLayout,
63    FlexibleTextRenderer, TextTextureCache, TextTextureKey, TextTexturePipeline, WispFontHandle,
64    WispFontStyle, WispFontWeight, WispText, WispTextAlign, WispTextEngine, WispTextLayout,
65    WispTextMetrics, WispTextRenderer, WispTextStyle,
66};
67pub use texture::Texture;
68pub use texture::render_texture::RenderTexture;
69pub use texture::video_texture::VideoTexture;
70
71/// Convenience alias for `Result<T, wisp::Error>`.
72pub type Result<T> = core::result::Result<T, Error>;