Ada
A 2D Shapes pixel rendering library in rust. Supported shapes are:
- Line2D
- Rectangle2D
- Ellipse2D
- Polygon2D
- Bezier2D [Both quadratic and cubic]
No use of unsafe blocks. #![forbid(unsafe_code)]
is also declared at crate level.
Usage
Add this to Cargo.toml
file:
[]
= "0.2.0"
Example code:
use ;
const WIDTH: usize = 512;
const HEIGHT: usize = 512;
// create a pixel buffer for RGBA values
let mut buffer = vec!;
// create canvas
let mut canvas = new.unwrap;
// draw line
draw_line2d;
// draw rectangle
draw_rect2d; // hollow
draw_rect2d_filled; // filled
You can find more examples for all shapes in examples
folder. To run an example:
cargo run --example draw_hollow
Contributing
Please feel free to open any issues or pull requests.
License
This is under Apache 2.0 License.