wassily_core/lib.rs
1//! # Wassily Core
2//!
3//! Core rendering infrastructure for the wassily generative art library.
4//! This crate provides the fundamental building blocks for creating generative art:
5//! canvas management, shape building, point utilities, and mathematical operations.
6//!
7//! ## Key Components
8//!
9//! - **[`Canvas`]**: The drawing surface that manages scaling and output
10//! - **[`Shape`]**: A builder for creating geometric shapes with fills and strokes
11//! - **[`points`]**: 2D point utilities and operations
12//! - **[`util`]**: Mathematical utilities and helper functions
13//!
14//! ## Quick Start
15//!
16//! ```no_run
17//! use wassily_core::*;
18//! use tiny_skia::Color;
19//!
20//! let mut canvas = Canvas::new(400, 400);
21//! canvas.fill(Color::from_rgba8(255, 255, 255, 255)); // White background
22//!
23//! // Draw a blue circle
24//! Shape::new()
25//! .circle(center(400, 400), 50.0)
26//! .fill_color(Color::from_rgba8(0, 0, 255, 255))
27//! .draw(&mut canvas);
28//!
29//! canvas.save_png("output.png");
30//! ```
31//!
32//! ## Features
33//!
34//! - **High-Quality Rendering**: Built on tiny-skia for precise vector graphics
35//! - **Scalable Output**: Create images at any resolution using scale factors
36//! - **Shape Builder**: Fluent API for creating complex geometric shapes
37//! - **Multiple Formats**: Save as PNG, JPEG, and other image formats
38//! - **Mathematical Utilities**: Point operations, transformations, and more
39//!
40//! ## Architecture
41//!
42//! This crate is designed to be the foundation layer for more specialized wassily crates.
43//! It provides low-level primitives that other crates build upon for colors, noise,
44//! effects, and advanced algorithms.
45
46pub mod canvas;
47pub mod points;
48pub mod shape;
49pub mod util;
50
51// Re-export key types and traits for convenience
52pub use canvas::*;
53pub use points::*;
54pub use shape::*;
55pub use util::*;
56
57// Re-export commonly used external types
58pub use tiny_skia::{
59 Color, Paint, PathBuilder, Pixmap, PremultipliedColorU8, Rect, Stroke, Transform,
60};