-
Notifications
You must be signed in to change notification settings - Fork 30
/
Copy pathindex.html
97 lines (90 loc) · 2.89 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
<!DOCTYPE HTML>
<html lang="en">
<head>
<title>BitmapData.js</title>
<meta charset="utf-8">
<link rel="stylesheet" href="css/global.css" type="text/css" />
<script type="text/javascript" src="js/Point.js"></script>
<script type="text/javascript" src="js/Rectangle.js"></script>
<script type="text/javascript" src="js/Matrix.js"></script>
<script type="text/javascript" src="js/BitmapData.js"></script>
<script>
function init(){
bmd = document.getElementById("canvas").bitmapData;
for (var i = 0; i<100; i++) {
for (var j = 0; j<300; j++) {
var d = Math.pow(i-50, 2) + Math.pow(j-150, 2);
var r = Math.sin(Math.sqrt(d) * 10 * Math.PI/180);
var color = 100 + 100 * r << 16;
bmd.setPixel( i, j, color );
}
}
bmd.copyChannel(bmd,
bmd.rect,
new Point(100, 0),
BitmapDataChannel.RED,
BitmapDataChannel.GREEN);
bmd.copyChannel(bmd,
bmd.rect,
new Point(200, 0),
BitmapDataChannel.RED,
BitmapDataChannel.BLUE);
};
</script>
</head>
<body onload="init();">
<div id="container">
<div id="header">
<div id="title">BitmapData.js</div>
<div id="git"><a href="https://github.com/pnitsch/BitmapData.js">github</a></div>
<div id="description">
<p>HTML5 Canvas API implementation of the AS3 BitmapData class.</p>
</div>
</div>
<div class="break"><img src="res/break.gif"></div>
<div id="example-container">
<div id="example">
<canvas id="canvas" width="300" height="300"></canvas>
</div>
<div id="code">
<pre>bmd = document.getElementById("canvas").bitmapData;
for (var i = 0; i<100; i++) {
for (var j = 0; j<300; j++) {
var d = Math.pow(i-50, 2) + Math.pow(j-150, 2);
var r = Math.sin(Math.sqrt(d) * 10 * Math.PI/180);
var color = 100 + 100 * r << 16;
bmd.setPixel( i, j, color );
}
}
bmd.copyChannel(bmd,
bmd.rect,
new Point(100, 0),
BitmapDataChannel.RED,
BitmapDataChannel.GREEN);
bmd.copyChannel(bmd,
bmd.rect,
new Point(200, 0),
BitmapDataChannel.RED,
BitmapDataChannel.BLUE);</pre>
</div>
</div>
<div class="break"><img src="res/break.gif"></div>
<div id="example-links">
<div id="examples-title">Examples:</div>
<div id="links">
<ul>
<li><a href="channels.html">BitmapDataChannel example</a></li>
<li><a href="blendmodes.html">Blendmodes example</a></li>
<li><a href="colorMatrixFilter.html">ColorMatrixFilter example</a></li>
<li><a href="colorTransform.html">ColorTransform example</a></li>
<li><a href="noise.html">Perlin Noise example</a></li>
<li><a href="plasma.html">Plasma example</a></li>
<li><a href="rotozoomer.html">Rotozoomer example</a></li>
<li><a href="threshold.html">Threshold example</a></li>
<li><a href="gpu.html">GPU example (experimental, requires WebGL)</a></li>
</ul>
</div>
</div>
</div>
</body>
</html>