| Crates.io | wizdraw |
| lib.rs | wizdraw |
| version | 2.2.0 |
| created_at | 2022-07-02 09:33:16.947431+00 |
| updated_at | 2025-04-05 09:48:03.892444+00 |
| description | Portable crate to fill and stroke composite bezier curves (paths) |
| homepage | |
| repository | https://github.com/NathanRoyer/wizdraw |
| max_upload_size | |
| id | 617715 |
| size | 101,424 |
wizdraw - Portable crate to fill and stroke composite bezier curves (paths)
All operations are done on an offscreen canvas.
The CPU implementation is always available and performs OK.
f32simd: include the SIMD canvas implementationgles2: include the OpenGL ES 2.0 canvas implementationcontour: include path stroking codeshapes: include basic shape generation codeBy default, this crate doesn't use SIMD because a nightly toolchain is required for that.
let myrtle = Color::new(255, 100, 100, 255);
let texture = Texture::SolidColor(myrtle);
let oval = [
CubicBezier {
c1: Point::new(50.0, 250.0),
c2: Point::new(50.0, 50.0),
c3: Point::new(450.0, 50.0),
c4: Point::new(450.0, 250.0),
},
CubicBezier {
c1: Point::new(450.0, 250.0),
c2: Point::new(450.0, 450.0),
c3: Point::new(50.0, 450.0),
c4: Point::new(50.0, 250.0),
},
];
let mut canvas = wizdraw::cpu::Canvas::new(500, 500);
canvas.fill_cbc(&oval, &texture, false, SsaaConfig::X4);
// retrieve a framebuffer
let pixels = canvas.pixels();
Check out the cpu example to generate this image:
