Skip to main content

pdf/object/types/
graphicsstate.rs

1use super::prelude::*;
2
3#[derive(Object, ObjectWrite, DeepClone, Debug, DataSize, Copy, Clone)]
4pub enum LineCap {
5    Butt = 0,
6    Round = 1,
7    Square = 2,
8}
9#[derive(Object, ObjectWrite, DeepClone, Debug, DataSize, Copy, Clone)]
10pub enum LineJoin {
11    Miter = 0,
12    Round = 1,
13    Bevel = 2,
14}
15
16#[derive(Object, ObjectWrite, DeepClone, Debug, DataSize, Clone)]
17#[pdf(Type = "ExtGState?")]
18/// `ExtGState`
19pub struct GraphicsStateParameters {
20    #[pdf(key = "LW")]
21    pub line_width: Option<f32>,
22
23    #[pdf(key = "LC")]
24    pub line_cap: Option<LineCap>,
25
26    #[pdf(key = "LJ")]
27    pub line_join: Option<LineJoin>,
28
29    #[pdf(key = "ML")]
30    pub miter_limit: Option<f32>,
31
32    #[pdf(key = "D")]
33    pub dash_pattern: Option<Vec<Primitive>>,
34
35    #[pdf(key = "RI")]
36    pub rendering_intent: Option<Name>,
37
38    #[pdf(key = "OP")]
39    pub overprint: Option<bool>,
40
41    #[pdf(key = "op")]
42    pub overprint_fill: Option<bool>,
43
44    #[pdf(key = "OPM")]
45    pub overprint_mode: Option<i32>,
46
47    #[pdf(key = "Font")]
48    pub font: Option<(Ref<Font>, f32)>,
49
50    // BG
51    // BG2
52    // UCR
53    // UCR2
54    // TR
55    // TR2
56    // HT
57    // FL
58    // SM
59    // SA
60    #[pdf(key = "BM")]
61    pub blend_mode: Option<Primitive>,
62
63    #[pdf(key = "SMask")]
64    pub smask: Option<Primitive>,
65
66    #[pdf(key = "CA")]
67    pub stroke_alpha: Option<f32>,
68
69    #[pdf(key = "ca")]
70    pub fill_alpha: Option<f32>,
71
72    #[pdf(key = "AIS")]
73    pub alpha_is_shape: Option<bool>,
74
75    #[pdf(key = "TK")]
76    pub text_knockout: Option<bool>,
77
78    #[pdf(other)]
79    _other: Dictionary,
80}