dotmax/primitives/mod.rs
1//! Drawing primitives for braille graphics.
2//!
3//! This module provides geometric drawing capabilities using industry-standard algorithms:
4//! - Lines: Bresenham's line algorithm (integer-only, all octants)
5//! - Circles: Bresenham's circle algorithm (midpoint circle, 8-way symmetry)
6//! - Rectangles: Outline, filled, and thick border variants
7//! - Polygons: Outline and filled from arbitrary vertex lists
8//!
9//! All primitives operate on `BrailleGrid` using dot coordinates (not cell coordinates).
10//! Grid is `width*2 × height*4` dots where each cell is 2×4 dots.
11//!
12//! # Examples
13//!
14//! ```
15//! use dotmax::{BrailleGrid, primitives::{draw_line, draw_circle, shapes::draw_rectangle}};
16//!
17//! let mut grid = BrailleGrid::new(80, 24)?; // 160×96 dots
18//! draw_line(&mut grid, 0, 0, 159, 95)?; // Diagonal line
19//! draw_circle(&mut grid, 80, 48, 30)?; // Circle at center
20//! draw_rectangle(&mut grid, 10, 10, 50, 30)?; // Rectangle
21//! # Ok::<(), dotmax::DotmaxError>(())
22//! ```
23
24pub mod circle;
25pub mod line;
26pub mod shapes;
27
28pub use circle::{draw_circle, draw_circle_colored, draw_circle_filled, draw_circle_thick};
29pub use line::{draw_line, draw_line_colored, draw_line_thick};
30pub use shapes::{
31 draw_polygon, draw_polygon_colored, draw_polygon_filled, draw_rectangle,
32 draw_rectangle_colored, draw_rectangle_filled, draw_rectangle_thick,
33};