1mod closed_thick_segment_iter;
2mod distance_iterator;
3mod line_join;
4mod linear_equation;
5mod plane_sector;
6mod scanline;
7mod styled_scanline;
8mod thick_segment;
9mod thick_segment_iter;
10
11pub use closed_thick_segment_iter::ClosedThickSegmentIter;
12pub use distance_iterator::DistanceIterator;
13pub use line_join::{JoinKind, LineJoin};
14pub use linear_equation::{LinearEquation, OriginLinearEquation, NORMAL_VECTOR_SCALE};
15pub use plane_sector::PlaneSector;
16pub use scanline::Scanline;
17pub use styled_scanline::StyledScanline;
18pub use thick_segment::ThickSegment;
19pub use thick_segment_iter::ThickSegmentIter;
20
21use crate::primitives::StrokeAlignment;
22
23#[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd, Hash, Debug)]
24#[cfg_attr(feature = "defmt", derive(::defmt::Format))]
25pub enum StrokeOffset {
26 /// Stroke is centered around the line skeleton.
27 None,
28
29 /// Stroke is offset to the left of the line.
30 Left,
31
32 /// Stroke is offset to the right of the line.
33 Right,
34}
35
36impl From<StrokeAlignment> for StrokeOffset {
37 fn from(alignment: StrokeAlignment) -> Self {
38 match alignment {
39 StrokeAlignment::Inside => Self::Right,
40 StrokeAlignment::Outside => Self::Left,
41 StrokeAlignment::Center => Self::None,
42 }
43 }
44}
45
46/// Which side of the center line to draw on.
47///
48/// Imagine standing on `start`, looking ahead to where `end` is. `Left` is to your left, `Right` to
49/// your right.
50#[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd, Hash, Debug)]
51#[cfg_attr(feature = "defmt", derive(::defmt::Format))]
52pub enum LineSide {
53 /// Left side of the line
54 Left,
55
56 /// Right side of the line
57 Right,
58}
59
60impl LineSide {
61 /// Swap side.
62 pub const fn swap(self) -> Self {
63 match self {
64 Self::Left => Self::Right,
65 Self::Right => Self::Left,
66 }
67 }
68}
69
70/// Point type.
71#[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd, Hash, Debug)]
72#[cfg_attr(feature = "defmt", derive(::defmt::Format))]
73pub enum PointType {
74 /// Represents part of the stroke.
75 Stroke,
76
77 /// Represents the interior of the shape.
78 Fill,
79}
80