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
mod closed_thick_segment_iter;
mod distance_iterator;
mod line_join;
mod linear_equation;
mod plane_sector;
mod scanline;
mod styled_scanline;
mod thick_segment;
mod thick_segment_iter;
pub use closed_thick_segment_iter::ClosedThickSegmentIter;
pub use distance_iterator::DistanceIterator;
pub use line_join::{JoinKind, LineJoin};
pub use linear_equation::{LinearEquation, OriginLinearEquation, NORMAL_VECTOR_SCALE};
pub use plane_sector::PlaneSector;
pub use scanline::Scanline;
pub use styled_scanline::StyledScanline;
pub use thick_segment::ThickSegment;
pub use thick_segment_iter::ThickSegmentIter;
use crate::primitives::StrokeAlignment;
#[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd, Hash, Debug)]
pub enum StrokeOffset {
None,
Left,
Right,
}
impl From<StrokeAlignment> for StrokeOffset {
fn from(alignment: StrokeAlignment) -> Self {
match alignment {
StrokeAlignment::Inside => Self::Right,
StrokeAlignment::Outside => Self::Left,
StrokeAlignment::Center => Self::None,
}
}
}
#[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd, Hash, Debug)]
pub enum LineSide {
Left,
Right,
}
impl LineSide {
pub fn swap(self) -> Self {
match self {
Self::Left => Self::Right,
Self::Right => Self::Left,
}
}
}
#[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd, Hash, Debug)]
pub enum PointType {
Stroke,
Fill,
}