-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathpapyrus.proto
executable file
·137 lines (121 loc) · 3.16 KB
/
papyrus.proto
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
127
128
129
130
131
132
133
134
135
136
137
message Page {
optional Background background = 1;
optional Layer layer = 3;
}
message Background {
enum Type {
RuledPaper = 1;
QuadPaper = 2;
Blank = 3;
PDF = 4;
Papyr = 5;
}
required Type type = 1;
optional float width = 4;
optional float height = 5;
optional uint32 color = 6;
optional RuledPaperBackground ruled_paper_background = 1000;
optional QuadPaperBackground quad_paper_background = 1001;
optional BlankBackground blank_background = 1002;
optional PDFBackground pdf_background = 1003;
optional PapyrBackground papyr_background = 1004;
}
message RuledPaperBackground {
// TODO
}
message QuadPaperBackground {
// TODO
}
message BlankBackground {
// Empty
}
message PDFBackground {
// TODO
}
message PapyrBackground {
// Empty
}
message Layer {
repeated Item item = 1;
optional RectF bounds = 2;
}
message Rect {
optional int32 left = 1;
optional int32 right = 2;
optional int32 top = 3;
optional int32 bottom = 4;
}
message RectF {
optional float left = 1;
optional float right = 2;
optional float top = 3;
optional float bottom = 4;
}
message Item {
enum Type {
Stroke = 1;
Shape = 2;
Text = 3;
Image = 4;
}
required Type type = 1;
optional Stroke stroke = 1000;
optional Shape shape = 1001;
optional Text text = 1002;
optional Image image = 1003;
}
message Stroke {
enum StrokeType {
Normal = 1;
Line = 2;
Highlight = 3;
Smooth = 4;
}
optional uint32 color = 1;
optional float weight = 2;
optional Point reference_point = 3;
repeated Point point = 4;
optional RectF bounds = 5;
optional StrokeType stroke_type = 6;
optional RectF fitted_bounds = 7;
}
message Point {
optional float x = 1;
optional float y = 2;
optional float pressure = 3;
}
message Shape {
enum ShapeType {
Ellipse = 1;
}
required ShapeType type = 1;
optional Ellipse ellipse = 1000;
}
message Ellipse {
optional int32 color = 1;
optional float weight = 2;
optional float center_x = 3;
optional float center_y = 4;
optional float radius_x = 5;
optional float radius_y = 6;
optional RectF bounds = 7;
optional RectF oval = 8;
optional float start_angle = 9;
optional float sweep_angle = 10;
}
message Text {
optional string text = 1;
optional uint32 color = 2;
optional float weight = 3;
optional RectF bounds = 4;
optional int32 version = 5;
}
message Image {
optional string id = 1;
optional string image_hash = 2;
optional RectF bounds = 3;
optional bool flip_x = 4;
optional bool flip_y = 5;
optional Rect crop_bounds = 6;
optional int32 rotation = 7;
}