1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
//! dotmax - High-performance terminal braille rendering
//!
//!
//! This library provides braille-based rendering capabilities for terminal applications,
//! enabling images, animations, and graphics in any terminal environment.
//!
//! # Getting Started
//!
//! Create a braille grid and manipulate individual dots:
//!
//! ```
//! use dotmax::BrailleGrid;
//!
//! // Create an 80×24 braille grid (typical terminal size)
//! let mut grid = BrailleGrid::new(80, 24).unwrap();
//!
//! // Set individual dots using pixel coordinates
//! // Grid is 80×24 cells = 160×96 dots (2×4 dots per cell)
//! grid.set_dot(0, 0).unwrap(); // Top-left dot of first cell
//! grid.set_dot(1, 0).unwrap(); // Top-right dot of first cell
//!
//! // Query dimensions
//! let (width, height) = grid.dimensions();
//! ```
//!
//! # Logging
//!
//! Dotmax uses the [`tracing`](https://docs.rs/tracing) crate for structured logging.
//! The library does **not** initialize a tracing subscriber - your application must
//! do this if you want to see log output.
//!
//! To enable logging in your application:
//!
//! ```no_run
//! use tracing_subscriber;
//!
//! // Initialize the tracing subscriber (do this once at startup)
//! tracing_subscriber::fmt()
//! .with_max_level(tracing::Level::DEBUG)
//! .init();
//!
//! // Now dotmax operations will emit trace events
//! use dotmax::BrailleGrid;
//! let grid = BrailleGrid::new(80, 24).unwrap(); // Logs: "Creating BrailleGrid: 80×24"
//! ```
//!
//! **Log Levels:**
//! - `ERROR`: Operation failures (e.g., out-of-bounds errors)
//! - `WARN`: Degraded operation (e.g., terminal lacks Unicode support)
//! - `INFO`: Major operations (grid creation, rendering)
//! - `DEBUG`: Detailed flow (resize, color changes)
//! - `TRACE`: Hot path internals (not used by default for performance)
//!
//! For more information, see the [tracing documentation](https://docs.rs/tracing).
//!
//! # Thread Safety
//!
//! All types in dotmax are `Send` and `Sync` where possible:
//!
//! - [`BrailleGrid`]: `Send + Sync` (can be shared across threads)
//! - [`Color`]: `Send + Sync + Copy` (trivially thread-safe)
//! - [`ColorScheme`]: `Send + Sync` (immutable after creation)
//! - [`DotmaxError`]: `Send + Sync` (can be propagated across threads)
//! - [`TerminalRenderer`]: `Send` but **not** `Sync` (owns terminal handle)
//!
//! For concurrent rendering, create one [`TerminalRenderer`] per thread or use
//! a mutex to serialize access. [`BrailleGrid`] buffers can be prepared in
//! parallel and then rendered sequentially.
//!
//! # License
//!
//! Licensed under either of:
//! - MIT license ([LICENSE-MIT](../LICENSE-MIT) or <http://opensource.org/licenses/MIT>)
//! - Apache License, Version 2.0 ([LICENSE-APACHE](../LICENSE-APACHE) or <http://www.apache.org/licenses/LICENSE-2.0>)
//!
//! at your option.
// Core modules (Epic 2)
// Utility modules (Epic 5)
// Re-export public types for convenience
pub use DotmaxError;
pub use ;
pub use ;
// Re-export color capability detection (Epic 5)
pub use ;
// Re-export color scheme types (Epic 5, Story 5.3)
pub use ;
// Re-export color scheme builder (Epic 5, Story 5.4)
pub use ColorSchemeBuilder;
// Re-export color application functions (Epic 5, Story 5.5)
pub use ;
// Re-export animation types (Epic 6, Stories 6.1, 6.2, 6.3, 6.4, 6.5)
pub use ;
/// Convenience type alias for Results using `DotmaxError`
///
/// This allows writing `dotmax::Result<T>` instead of `Result<T, DotmaxError>`
/// in applications using this library.
pub type Result<T> = Result;
// Feature modules (Epic 3+): image, primitives, density, color, animation
// Media format detection and routing (Epic 9)
// Drawing primitives (Epic 4)
// Character density rendering (Epic 4)
// Color conversion (Epic 5)
// Animation & frame management (Epic 6)