hayro_interpret/
device.rs1use crate::Paint;
2use crate::StrokeProps;
3use crate::font::Glyph;
4use crate::soft_mask::SoftMask;
5use crate::{ClipPath, FillRule};
6use crate::{LumaData, RgbData};
7use kurbo::{Affine, BezPath};
8
9pub trait Device<'a> {
11 fn stroke_path(
13 &mut self,
14 path: &BezPath,
15 transform: Affine,
16 paint: &Paint<'a>,
17 stroke_props: &StrokeProps,
18 );
19 fn set_soft_mask(&mut self, mask: Option<SoftMask<'a>>);
22 fn fill_path(
24 &mut self,
25 path: &BezPath,
26 transform: Affine,
27 paint: &Paint<'a>,
28 fill_rule: FillRule,
29 );
30 fn push_clip_path(&mut self, clip_path: &ClipPath);
32 fn push_transparency_group(&mut self, opacity: f32, mask: Option<SoftMask<'a>>);
34 fn fill_glyph(
36 &mut self,
37 glyph: &Glyph<'a>,
38 transform: Affine,
39 glyph_transform: Affine,
40 paint: &Paint<'a>,
41 );
42 fn stroke_glyph(
44 &mut self,
45 glyph: &Glyph<'a>,
46 transform: Affine,
47 glyph_transform: Affine,
48 paint: &Paint<'a>,
49 stroke_props: &StrokeProps,
50 );
51 fn draw_rgba_image(&mut self, image: RgbData, transform: Affine, alpha: Option<LumaData>);
53 fn draw_stencil_image(&mut self, stencil: LumaData, transform: Affine, paint: &Paint<'a>);
55 fn pop_clip_path(&mut self);
57 fn pop_transparency_group(&mut self);
59}