-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.html
113 lines (102 loc) · 4.47 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
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8" />
<meta name="description" content="Digital Image Process with HTML5 canvas, by 徐迅 Dalston Xu, http://xuxun.me" />
<title>Larva Lenna | Digital Image Process with HTML5 canvas</title>
<link rel="stylesheet" type="text/css" href="css/index.css" />
<!-- Google Analytics -->
<script>
(function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){
(i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),
m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m)
})(window,document,'script','//www.google-analytics.com/analytics.js','ga');
ga('create', 'UA-29870437-1', 'xuxun.me');
ga('require', 'displayfeatures');
ga('send', 'pageview');
</script>
<script>
// collect error infos
window.onerror = function(message, url, line) {
if (!url) return;
var msg = {};
//记录客户端环境
var ua = window.navigator.userAgent;
//只记录message里的message属性就好了,
//错误信息可能会比较晦涩,有些信息完全无用,应酌情过滤
msg.message = message.message;
msg.url = url;
msg.line = line;
//msg.page = window.location.href;
var s = [];
//将错误信息转换成字符串
for(var key in msg){
s.push(key + '=' + msg[key]);
}
s = s.join('&');
// category,action,label
ga('send', 'event', 'error:'+ ua , window.location.href, s);
//window.console.log("Error Sended to GA");
}
</script>
<!-- End Google Analytics -->
</head>
<body>
<noscript><img src="images/Lenna.png" alt="Lenna" title="Lenna"/></noscript>
<canvas id="canvas" width="256" height="256"></canvas>
<form id="section_action" onclick="return false;">
<fieldset>
<legend>灰度变换 / Gray Scale </legend>
<button id="reverseRGB">确认黑化</button>
<button id="grayscaleBtn">确认灰化</button>
<button id="disableGaoNeng">高能预警</button>
</fieldset>
<fieldset>
<legend>彩色变换 / Color</legend>
<div id="fillColor" class="buttonWithInput">
<input type="text" id="colorInput" placeholder="eg: #fff520" />
<button id="fillColorBtn">确认色化</button>
</div>
<div id="filter_brightness" class="buttonWithInput">
<input type="text" id="filter_brightnessInput" placeholder="Numeric Brightness Value" />
<button id="filter_brightnessBtn">要有光</button>
</div>
</fieldset>
<fieldset>
<legend>图像变换 / Image</legend>
<div id="drawImage" class="buttonWithInput">
<input type="text" id="drawImageInput" placeholder="eg: images/xiaobai.jpg" />
<button id="drawImageBtn">加载图片</button>
<button id="loadLocalImageBtn">本地图片</button>
<button id="loadLennaImageBtn">Lenna</button>
</div>
</fieldset>
<fieldset>
<legend>简单滤波器 / Basic Filter</legend>
<div id="filter_threshold_0_1" class="buttonWithInput">
<input type="text" id="filter_threshold_0_1Input" placeholder="Grayscale Threshold" />
<button id="filter_threshold_0_1Btn">阈值-黑白</button>
</div>
</fieldset>
<fieldset>
<legend>卷积滤波器 / Convoling Filter</legend>
<div id="filter_convolvingFilter" class="buttonWithInput">
<input type="text" id="filter_convolvingFilterInput" placeholder="w,w,w,w,w,w,w,w" />
<button id="filter_convolvingFilterBtn">DIY滤波</button>
<button id="filter_convolvingSharpenBtn">锐化滤波</button>
<button id="filter_convolvingBlurBtn">平滑滤波</button>
</div>
</fieldset>
<fieldset>
<legend>频域滤波器 / Frequency Filter</legend>
<div id="FFT" class="buttonWithInput">
<button id="FFTBtn">FFT</button>
<button id="IFFTBtn">IFFT</button>
</div>
</fieldset>
</form>
<script src="js/utils.js"></script>
<script src="lib/fft.js"></script>
<script src="js/index.js"></script>
</body>
</html>