-
Notifications
You must be signed in to change notification settings - Fork 16
/
Copy pathindex.html
334 lines (324 loc) · 12 KB
/
index.html
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
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<meta http-equiv="X-UA-Compatible" content="IE=edge" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>Image Lab</title>
<!-- blockly package -->
<script src="./node_modules/blockly/blockly_compressed.js"></script>
<script src="./node_modules/blockly/blocks_compressed.js"></script>
<script src="./node_modules/blockly/msg/en.js"></script>
<!-- plugins used for improving blockly interaction -->
<script src="./node_modules/@blockly/continuous-toolbox/dist/index.js"></script>
<script src="./node_modules/@blockly/field-slider/dist/index.js"></script>
<script src="./node_modules/@blockly/plugin-workspace-search/dist/index.js"></script>
<!-- this library is responsible for setting the guide screens -->
<script src="./node_modules/intro.js/intro.js"></script>
<link rel="stylesheet" href="./node_modules/intro.js/introjs.css" />
<link
rel="stylesheet"
href="./node_modules/intro.js/themes/introjs-modern.css"
/>
<!-- responsible for changing colors of selected category -->
<script src="category-selection-style.js"></script>
<!-- color palette -->
<script>
Blockly.HSV_SATURATION = 0.8; // 0 (inclusive) to 1 (exclusive), defaulting to 0.45
Blockly.HSV_VALUE = 0.8; // 0 (inclusive) to 1 (exclusive), defaulting to 0.65
</script>
<!-- icons library and styles of html elements-->
<link
rel="stylesheet"
href="./node_modules/@mdi/font/css/materialdesignicons.min.css"
/>
<link rel="stylesheet" href="./styles/style.css" />
</head>
<body>
<!-- Table of navbar images and icons -->
<table>
<tr>
<td>
<img
src="./assets/logos/Image Lab icon.png"
style="height: 40px; vertical-align: sub"
/>
<img src="./assets/logos/Image Lab word.png" style="height: 30px" />
<span
class="mdi mdi-information"
style="font-size: 20px; vertical-align: top; color: #bb1010"
></span>
<span class="mdi mdi-file-plus-outline"></span>
<span class="mdi mdi-folder-open-outline"></span>
<!-- toggling themes spans -->
<span class="toggle"></span>
<span class="wave"></span>
</td>
<td style="text-align: end; vertical-align: top; width: 20px">
<span
class="mdi mdi-help-circle"
style="font-size: 20px; color: #bb1010"
></span>
</td>
</tr>
</table>
<!-- That table has all panes in it divided into 2 columns:
1- Workspace and information panes.
2- Preview and properties panes.
-->
<table>
<tr>
<td style="width: 80vw; vertical-align: top">
<div class="playground-pane">
<!--div indicates workspace that blocks will be dropped in -->
<div
id="blocklyDiv"
style="height: 75vh; width: auto; min-width: 700px"
>
<xml id="toolbox" style="display: none">
<category
css-icon="customIcon mdi mdi-cog"
name="Basic"
colour="#5ba58c"
>
<block type="basic_readimage"></block>
<block type="basic_writeimage"></block>
<block type="browse_file"></block>
<block type="browse_folder"></block>
</category>
<category
css-icon="customIcon mdi mdi-format-rotate-90"
name="Geometric"
colour="#a5745b"
>
<block type="geometric_reflectimage"></block>
<block type="geometric_rotateimage"></block>
<block type="geometric_affineimage"></block>
<block type="geometric_scaleimage"></block>
</category>
<category
css-icon="customIcon mdi mdi-palette"
name="Convertions"
colour="#a55b80"
>
<block type="imageconvertions_grayimage"></block>
<block type="imageconvertions_colormaps"></block>
<block type="imageconvertions_graytobinary"></block>
<block type="imageconvertions_colortobinary"></block>
</category>
<category
css-icon="customIcon mdi mdi-shape"
name="Drawing"
colour="#5b67a5"
>
<block type="drawingoperations_drawline"></block>
<block type="drawingoperations_drawellipse"></block>
<block type="drawingoperations_drawarrowline"></block>
<block type="drawingoperations_drawtext"></block>
<block type="drawingoperations_drawcircle"></block>
<block type="drawingoperations_drawrectangle"></block>
</category>
<category
css-icon="customIcon mdi mdi-blur"
name="Blurring"
colour="#9fa55b"
>
<block type="blurring_applyblur"></block>
<block type="blurring_applygaussianblur"></block>
<block type="blurring_applymedianblur"></block>
</category>
<category
css-icon="customIcon mdi mdi-filter"
name="Filtering"
colour="#5ba55b"
>
<block type="filtering_bilateral"></block>
<block type="filtering_pyramidup"></block>
<block type="filtering_boxfilter"></block>
<block type="filtering_pyramiddown"></block>
<block type="filtering_erosion"></block>
<block type="filtering_dilation"></block>
<block type="filtering_morphological"></block>
</category>
<category
css-icon="customIcon mdi mdi-border-none"
name="Thresholding"
colour="#745ba5"
>
<block type="thresholding_applyborders"></block>
<block type="border_for_all"></block>
<block type="border_each_side"></block>
<block type="thresholding_adaptivethreshold"></block>
<block type="thresholding_applythreshold"></block>
</category>
<category
css-icon="customIcon mdi mdi-image-auto-adjust"
name="Sobel Derivatives"
colour="#a55b80"
>
<block type="sobelderivatives_soblederivate"></block>
<block type="sobelderivatives_scharrderivate"></block>
</category>
<category
css-icon="customIcon mdi mdi-image-move"
name="Transformation"
colour="#5b80a5"
>
<block type="transformation_distance"></block>
<block type="transformation_laplacian"></block>
</category>
</xml>
</div>
</div>
<div class="information-pane" id="information-pane">
<p style="font-size: 15px; margin-top: 5px" id="operator_name">
Operation name
</p>
<p
style="font-size: 13px; line-height: 2px"
id="operator_description"
>
here is the operation description
</p>
</div>
</td>
<td style="vertical-align: top">
<div class="preview-pane" style="padding-top: 2px">
<table>
<tr>
<td
style="
display: flex;
flex-direction: row;
justify-content: space-around;
align-items: flex-start;
"
>
<span
onclick="executeProcess()"
accesskey="r"
title="Run(Alt+R)"
class="mdi mdi-play-circle-outline"
style="
font-size: 30px;
color: #367930;
vertical-align: super;
"
></span>
<span
onclick="undo()"
title="Undo"
class="mdi mdi-undo"
style="
font-size: 30px;
color: #000000;
vertical-align: super;
"
></span>
<span
onclick="redo()"
title="Redo"
class="mdi mdi-redo"
style="
font-size: 30px;
color: #000000;
vertical-align: super;
"
></span>
<span
onclick="downloadImage()"
title="Download"
class="mdi mdi-download"
style="
font-size: 30px;
color: #000000;
vertical-align: super;
"
></span>
<p style="margin-bottom: 0px; margin-top: 8px">Preview</p>
<span
class="mdi mdi-replay"
onclick="resetWorkspace()"
style="
font-size: 30px;
color: #bb1010;
vertical-align: super;
"
></span>
</td>
</tr>
</table>
<hr class="hr" style="margin-top: 0px" />
<div class="image-preview-div" style="position: absolute">
<canvas id="image-preview" src="" />
</div>
<div
style="
display: flex;
flex-direction: column;
position: absolute;
margin-left: 290px;
margin-top: 190px;
"
>
<span
class="mdi mdi-plus-circle-outline"
type="button"
onclick="zoomin()"
style="font-size: 30px"
></span>
<span
class="mdi mdi-minus-circle-outline"
type="button"
onclick="zoomout()"
style="font-size: 30px"
></span>
</div>
</div>
<div class="download-button">
<span
onclick="downloadImage()"
title="Download"
class="mdi mdi-download preview-pane"
style="
font-size: 30px;
color: #000000;
"
>
</span>
</div>
<div class="properties-pane">
<p style="margin-top: 2px; margin-bottom: 0px">Properties</p>
<hr class="hr" />
</div>
</td>
</tr>
</table>
<!-- Note: ordering of files is important -->
<script src="titlebar-menubar.js"></script>
<script src="imagelab-blocks.js"></script>
<script src="browse-blocks-functions.js"></script>
<script src="workspace.js"></script>
<script src="themes-toggle.js"></script>
<!-- <script src="guide.js"></script> -->
<!-- file selector for browse blocks for read/write image -->
<img id="input-image" style="display: none" />
<input
type="file"
id="inputImage"
name="avatar"
accept=".jpg , .png"
style="display: none"
onchange="loadFile()"
/>
<input
style="display: none"
id="outputDirectory"
type="file"
webkitdirectory
directory
multiple
onchange="setDirectory()"
/>
</body>
</html>