Expand description
§Wassily Core
Core rendering infrastructure for the wassily generative art library. This crate provides the fundamental building blocks for creating generative art: canvas management, shape building, point utilities, and mathematical operations.
§Key Components
Canvas: The drawing surface that manages scaling and outputShape: A builder for creating geometric shapes with fills and strokespoints: 2D point utilities and operationsutil: Mathematical utilities and helper functions
§Quick Start
use wassily_core::*;
use tiny_skia::Color;
let mut canvas = Canvas::new(400, 400);
canvas.fill(Color::from_rgba8(255, 255, 255, 255)); // White background
// Draw a blue circle
Shape::new()
.circle(center(400, 400), 50.0)
.fill_color(Color::from_rgba8(0, 0, 255, 255))
.draw(&mut canvas);
canvas.save_png("output.png");§Features
- High-Quality Rendering: Built on tiny-skia for precise vector graphics
- Scalable Output: Create images at any resolution using scale factors
- Shape Builder: Fluent API for creating complex geometric shapes
- Multiple Formats: Save as PNG, JPEG, and other image formats
- Mathematical Utilities: Point operations, transformations, and more
§Architecture
This crate is designed to be the foundation layer for more specialized wassily crates. It provides low-level primitives that other crates build upon for colors, noise, effects, and advanced algorithms.
Re-exports§
Modules§
Structs§
- Color
- An RGBA color value, holding four floating point components.
- Paint
- Controls how a shape should be painted.
- Path
Builder - A path builder.
- Pixmap
- A container that owns premultiplied RGBA pixels.
- Premultiplied
Color U8 - A 32-bit premultiplied RGBA color value.
- Rect
- A rectangle defined by left, top, right and bottom edges.
- Stroke
- Stroke properties.
- Transform
- An affine transformation matrix.