rough_vello/lib.rs
1// This crate is entirely safe
2#![forbid(unsafe_code)]
3// Ensures that `pub` means published in the public API.
4// This property is useful for reasoning about breaking API changes.
5#![deny(unreachable_pub)]
6
7//!
8//! This crate is an adapter crate between [roughr](https://github.com/orhanbalci/rough-rs/main/roughr) and
9//! [vello](https://github.com/linebender/vello) crates. Converts from roughr drawing
10//! primitives to vello's Scene types. Also has convenience traits for drawing onto vello scenes. For more detailed
11//! information you can check roughr crate.
12//!
13//! Below examples are output of [rough_vello](https://github.com/orhanbalci/rough-rs/tree/main/rough_vello) adapter.
14//!
15//! ## 📦 Cargo.toml
16//!
17//! ```toml
18//! [dependencies]
19//! rough_vello = "0.1"
20//! ```
21//!
22//! ## 🔧 Example
23//!
24//! ### Rust Logo
25//!
26//! ```ignore
27//! use rough_vello::VelloGenerator;
28//! use vello::Scene;
29//! use palette::Srgba;
30//! use roughr::core::{FillStyle, OptionsBuilder};
31//!
32//! let options = OptionsBuilder::default()
33//! .stroke(Srgba::from_components((114u8, 87u8, 82u8, 255u8)).into_format())
34//! .fill(Srgba::from_components((254u8, 246u8, 201u8, 255)).into_format())
35//! .fill_style(FillStyle::Hachure)
36//! .fill_weight(1.0)
37//! .bowing(0.8)
38//! .build()
39//! .unwrap();
40//!
41//! let generator = VelloGenerator::new(options);
42//! let rust_logo_svg_path = "..."; // SVG path data for the Rust logo
43//! let rust_logo_drawing = generator.path::<f32>(rust_logo_svg_path);
44//!
45//! let mut scene = Scene::new();
46//! rust_logo_drawing.draw(&mut scene);
47//! ```
48//!
49//! ### 🖨️ Output Rust Logo
50//! 
51//!
52//! ## Filler Implementation Status
53//! - [x] Hachure
54//! - [x] Zigzag
55//! - [x] Cross-Hatch
56//! - [x] Dots
57//! - [x] Dashed
58//! - [x] Zigzag-Line
59//!
60//! ## 🔭 Examples
61//!
62//! For more examples have a look at the
63//! [examples](https://github.com/orhanbalci/rough-rs/tree/main/rough_vello/examples) folder.
64//!
65//! ## 🔌 Integration
66//!
67//! ### Bevy Integration
68//!
69//! For Bevy game engine integration, you can use [bevy_vello](https://github.com/linebender/bevy_vello) which provides a Bevy plugin for vello. This allows you to render `rough_vello` drawings directly in your Bevy applications by converting the vello Scene to Bevy-compatible rendering.
70//!
71//! ```toml
72//! [dependencies]
73//! rough_vello = "0.1"
74//! bevy_vello = "0.1" # Check latest version
75//! bevy = "0.14" # Or latest compatible version
76//! ```
77
78pub mod vello_generator;
79pub use vello_generator::*;