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
// cuadra
//
//! ## Layout
//!
//! Several primitives are defined for `Position`, `Size` and their combination
//! as a `Zone`.
//!
//! Types have 8, 16, 32 and 64 bit sizes implementations, and they are limited
//! to values of just half the range of an equivalent bit-size signed integer,
//! leaving 1/4th of the range for positive values.
//!
//! Positions can have negative values, while Sizes can only be positive.
//!
//! For example, a [`Position8`] can hold values between `-64,-64` and `63,63`,
//! while a [`Size16`] can have values of between `1,1` and `16_383,16_383`.
//!
//! The non-negative range from 0 to the clamped maximum is always 1/4th of the
//! primitive's maximum.
//! This allows to have a safety margin around which allows to move the biggest
//! size to the furthest position, and still be able to represent all its points
//! with the same inner bit-size.
//!
//! The following diagram shows the example range of values of a [`Position8`],
//! around the inner centered square, with the outer safety margin around it,
//! and the maximum positive clamped size filled with `+`.
//! ```diagram
//! -128,127 0,127 127,127
//! .-----|-----|-----|-----ยท
//! | |
//! | -64,63 63,63 |
//! | .-----------. --
//! | | |+++++| |
//! | | |+++++| |
//! -128,0 -- |----0,0----| -- 127,0
//! | | | | |
//! | | | | |
//! | .-----------. --
//! | -64,-64 63,-64 |
//! | |
//! .-----|-----|-----|-----.
//! -128,-128 0,-128 127,-128
//! ```
//
pub use ;
pub use ;
pub use ;
pub use ;