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
//! Denise's software rasteriser.
//!
//! Rectangles, rounded rectangles, circles, arcs, stars, lines, image blitting,
//! rectangular clipping and source-over alpha blending, straight into a
//! [`denise::Frame`]. No GPU, no
//! path builder, no allocator: this crate needs neither `std` nor `alloc`, and
//! every operation writes through a borrowed slice the caller already owns.
//!
//! ```no_run
//! # use denise::{Color, Frame, Rect, Point};
//! # use denise_render::Canvas;
//! # fn draw(frame: &mut Frame<'_>, damage: &[Rect]) {
//! let mut canvas = Canvas::new(frame);
//! for region in damage {
//! // Everything inside this borrow is confined to `region`.
//! let mut c = canvas.with_clip(*region);
//! c.clear(Color::from_rgb888(0x1E1E2E));
//! c.fill_rounded_rect(Rect::new(40, 40, 200, 64), 12, Color::rgba(255, 255, 255, 32));
//! c.draw_line(Point::new(40, 120), Point::new(240, 121), Color::WHITE);
//! // A 70% progress ring. Angles are binary turns: 0 is twelve o'clock,
//! // clockwise positive, no radians and no floats anywhere.
//! c.stroke_arc(Point::new(300, 90), 40, 8, 0, 70 * denise_render::TURN / 100, Color::WHITE);
//! }
//! # }
//! ```
//!
//! # No floating point
//!
//! The rasteriser is integer throughout, including anti-aliasing coverage. That
//! avoids a `libm` dependency on `no_std` targets and keeps output bit-identical
//! between x86 and ARM, so the reference tests mean the same thing on a developer's
//! desktop and on the Pi.
//!
//! # No `unsafe`
//!
//! Deliberately, for now. Bounds checks are hoisted by working through row slices
//! rather than indexing pixel by pixel. If the benches ever show that costing real
//! time, that is the evidence needed to justify unchecked access — not before.
// Public for its documentation rather than its contents: the module holds only
// `impl Canvas`, so its page carries no items -- but it is where the
// premultiplied source format is explained, and a private module renders
// nowhere at all.
pub use MAX_ICON_VERTICES;
pub use TURN;
pub use Paint;
pub use ;
pub use Mask;
pub use BitmapFont;
pub use ;
/// Compiles the examples in this crate's README, so they cannot drift from the API
/// they claim to demonstrate. Never built except under `cargo test --doc`.
;