From 32438ce25f69de99d2523b98237f62cfa90890d7 Mon Sep 17 00:00:00 2001 From: cashmere Date: Tue, 28 Jul 2026 20:14:51 +0200 Subject: feat: port domain crates to Rust (session 1 complete) All green: cargo test --workspace (~300 tests, 0 failures). - timeline (45): placement, resize/ripple, split, snap, retime, audio separation, scene helpers - animation (73): bezier solver, channel sampling, keyframe ops, split/clamp/clone, param definitions - commands (9): Command trait, BatchCommand, history, 19 concrete commands, freeze-frame port 1:1 - audio (22): audible collection, range mixing, mastering limiter, rms/peak buckets - text (19): cosmic-text layout/measure/raster, backgrounds, decorations - graphics (52): full CSS gradient parser, tiny-skia raster, 4 shape definitions - effect-defs (16): blur definition, registry, pass resolution - mask-defs (19): all 9 mask renderers via tiny-skia - renderer (6): node model + scene builder port - desktop: GPUI projects screen wired to ProjectStore - scene: factory (web defaults: v32, Main Track, 1920x1080, 30fps) --- rust/crates/graphics/src/lib.rs | 31 +++++++++++++++++++++++++++++++ 1 file changed, 31 insertions(+) (limited to 'rust/crates/graphics/src/lib.rs') diff --git a/rust/crates/graphics/src/lib.rs b/rust/crates/graphics/src/lib.rs index 8b137891..3261959b 100644 --- a/rust/crates/graphics/src/lib.rs +++ b/rust/crates/graphics/src/lib.rs @@ -1 +1,32 @@ +pub mod color; +pub mod definitions; +pub mod error; +pub mod gradient; +pub mod params; +pub mod registry; +pub mod stroke; +pub mod types; +pub use color::{Rgba, hsl_to_rgb, is_transparent, named_color, parse_color_to_rgb, parse_css_color}; +pub use definitions::{ + ELLIPSE_GRAPHIC_DEFINITION, POLYGON_GRAPHIC_DEFINITION, RECTANGLE_GRAPHIC_DEFINITION, + STAR_GRAPHIC_DEFINITION, STROKE_ALIGN_PARAM, StrokeAlign, default_graphic_definitions, +}; +pub use error::GraphicsError; +pub use gradient::{ + BackgroundLayer, Color, ColorStop, Distance, GradientAst, GradientKind, GradientOrientation, + GradientParseError, LinearOrientation, NormalizedColorStop, Position, RadialOrientation, + Shape, ShapeKind, ShapeStyle, color_to_string, draw_css_background, is_gradient_layer, + normalize_color_stops, parse_background_layers, parse_gradient, split_css_layers, +}; +pub use params::{ParamDefinition, ParamGroup, SelectOption, build_default_param_values}; +pub use registry::{ + GraphicsRegistry, build_default_graphic_instance, get_graphic_definition, graphics_registry, + render_graphic, render_graphic_rgba8, resolve_graphic_params, +}; +pub use scene::params::{ParamValue, ParamValues}; +pub use stroke::apply_aligned_stroke; +pub use types::{ + DEFAULT_GRAPHIC_SOURCE_SIZE, GraphicDefinition, GraphicInstance, GraphicRenderContext, + param_number, param_string, +}; -- cgit v1.3.1