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
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
//! Blending, fill and mask interpretation.
/// Linear-light layer blending, with explicit compositing space.
///
/// Separable modes evaluate straight linear channels with source-over alpha.
/// Extended RGB is not gamut-clipped. Plus instead adds premultiplied RGB and
/// clamps the summed alpha to one. Dodge/Burn retain their formula's intrinsic
/// endpoints and saturation; other modes extend their piecewise formulas without
/// input clipping. Nonseparable modes use hue/saturation/luminosity replacement.
/// Color space used for compositing, independent of stored linear pixels.
/// How closed contours determine the filled interior.
///
/// Recording retains both rules without silently substituting one for
/// the default NonZero rule.
///
/// ```
/// use motion_core::prelude::*;
/// use motion_core::{
/// DisplayList, RasterLimits, ResourcePool, ValidatedDisplayList, MAX_PATH_VERBS,
/// MAX_STROKE_VERBS, MAX_SVG_PATH_BYTES, sample_offsets,
/// };
/// let path = Path2D::from_rect(Rect::new(0.0, 0.0, 10.0, 20.0))?;
/// let fill = path.fill(Color::WHITE);
/// let native = DrawContext::default().record(&fill, ValidationLimits::default())?;
/// assert!(matches!(
/// native[0],
/// DrawCommand::Fill {
/// rule: FillRule::NonZero,
/// ..
/// }
/// ));
/// let even = DrawContext::default().record(
/// &fill.fill_rule(FillRule::EvenOdd),
/// ValidationLimits::default(),
/// )?;
/// assert!(matches!(
/// even[0],
/// DrawCommand::Fill {
/// rule: FillRule::EvenOdd,
/// ..
/// }
/// ));
/// # Ok::<(), motion_core::ValidationError>(())
/// ```
/// How linear-premultiplied content becomes a layer's mask coverage.
///
/// Coverage is computed in the compositing color space and clamped
/// to 0..=1 before optional inversion, without altering working colors.
/// Alpha-zero pixels have zero ordinary coverage, even with hidden extended
/// RGB; inverted modes therefore retain source content at those pixels.