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
use crate::{
canvas::rough::{Op, OpSet, RoughOptions},
Point,
};
mod dashed;
mod dot;
mod hachure;
mod hatch;
mod scanline_hachure;
mod zigzag;
mod zigzag_line;
pub(crate) use dashed::DashedFiller;
pub(crate) use dot::DotFiller;
pub(crate) use hachure::HachureFiller;
pub(crate) use hatch::HatchFiller;
pub(crate) use scanline_hachure::*;
pub(crate) use zigzag::ZigZagFiller;
pub(crate) use zigzag_line::ZigZagLineFiller;
pub struct Line<T> {
pub start: Point<T>,
pub end: Point<T>,
}
pub trait PatternFiller {
fn fill_polygon(&self, points: Vec<Point<f64>>, options: &RoughOptions) -> OpSet;
}
pub trait RenderHelper {
fn rand_offset(&self, x: f64, options: &RoughOptions) -> f64;
fn rand_offset_with_range(&self, min: f64, max: f64, options: &RoughOptions) -> f64;
fn ellipse(&self, x: f64, y: f64, width: f64, height: f64, options: &RoughOptions) -> OpSet;
fn double_line_ops(&self, x1: f64, y1: f64, x2: f64, y2: f64, options: &RoughOptions) -> Vec<Op>;
}
pub fn get_filler(options: &RoughOptions, helper: impl RenderHelper) -> Box<dyn PatternFiller> {
unimplemented!()
}