-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.html
126 lines (110 loc) · 5.77 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
<!DOCTYPE html>
<html>
<head>
<meta charset='utf-8'>
<meta http-equiv="X-UA-Compatible" content="chrome=1">
<link rel="stylesheet" type="text/css" href="stylesheets/stylesheet.css" media="screen" />
<link rel="stylesheet" type="text/css" href="stylesheets/pygment_trac.css" media="screen" />
<title>Fish-eye by victusfate</title>
</head>
<body>
<header>
<div class="container">
<h1>Fish-eye</h1>
image processing for visual fisheye effect
<a href="https://github.com/victusfate/fish-eye/zipball/master" class="btn">Download as .zip</a>
<a href="https://github.com/victusfate/fish-eye/tarball/master" class="btn">Download as .tar.gz</a>
<a href="https://github.com/victusfate/fish-eye" class="btn btn-github"><span class="icon"></span>View on GitHub</a>
</div>
</header>
<!-- <div class="container">
<section id="main_content">
-->
<div style="position:relative; float:left; width:100%;">
<img src="BobRoss.jpg" style="float:left; padding: 20px; width:45%;" />
<canvas id="screen" width="640px" height = "360px" style="position:relative; float:left; padding: 20px; width:45%;">
<h1>This application requires a HTML5 compliant browser.</h1>
</canvas>
</div>
<div style="position:relative; left: 20px; font-size:16px;float:left;">
<script type="text/javascript">
function updateform() {
var theta,rad, origX, origY;
xrad = $('#slider-xrad').val();
yrad = $('#slider-yrad').val();
origX = $('#slider-origX').val();
origY = $('#slider-origY').val();
$('#xradv').html(xrad);
$('#yradv').html(yrad);
$('#origXv').html(origX);
$('#origYv').html(origY);
console.log('xrad,yrad',xrad,yrad," origX " + origX + " origY " + origY );
window.fisheye('screen', xrad, yrad, origX, origY );
return false;
}
</script>
<form id="colorForm" onsubmit="return window.updateform();">
<div style="float:right; margin: -10px 10px 0px 0px;">
<br/>
This is a demo for applying the fisheye effect:<br/>
xbend:<div id="xradv">1</div><input id="slider-xrad" name="slider" type="range" value="1" min="0" max="10" step=".1" />
ybend:<div id="yradv">1</div><input id="slider-yrad" name="slider" type="range" value="1" min="0" max="10" step=".1" />
origX:<div id="origXv">1</div><input id="slider-origX" name="slider" type="range" value="100" min="0" max="1000" step="1" />
origY:<div id="origYv">1</div><input id="slider-origY" name="slider" type="range" value="100" min="0" max="1000" step="1" />
<button onclick="" type="submit" class="mygrad">submit</button>
</div>
</form>
</div>
<script src="http://code.jquery.com/jquery-1.9.1.min.js"></script>
<script src="http://code.jquery.com/jquery-migrate-1.1.0.min.js"></script>
<link rel="stylesheet" href="http://code.jquery.com/ui/1.10.1/themes/base/jquery-ui.css" />
<script src="http://code.jquery.com/ui/1.10.1/jquery-ui.js"></script>
<!-- <link rel="stylesheet" href="http://code.jquery.com/mobile/1.1.1/jquery.mobile-1.1.1.min.css" />
<script src="http://code.jquery.com/mobile/1.1.1/jquery.mobile-1.1.1.min.js"></script>
-->
<script type='text/javascript'>
!window.jQuery &&
document.write('<script src="js/jquery-1.9.1.min.js"><\/script>') &&
document.write('<script src="js/jquery-migrate-1.1.0.min.js"><\/script>');
</script>
<script type='text/javascript' src="http://jashkenas.github.com/coffee-script/extras/coffee-script.js"></script>
<script>
!window.CoffeeScript && document.write('<script src="js/coffee-script.js"><\/script>');
</script>
<script type="text/coffeescript">
$ ->
window.bob = new Image();
window.bob.onload = (evt) ->
console.log 'window width,height',window.bob.width,window.bob.height
width = window.bob.width
height = window.bob.height
canvas = document.getElementById("screen")
if canvas.getContext
canvas.width = width
canvas.height = height
ctx = canvas.getContext("2d")
ctx.drawImage window.bob, 0, 0
$('#slider-xrad').val 1
$('#slider-yrad').val 1
$('#slider-origX').val width/2
$('#slider-origX').attr('max',''+width)
$('#slider-origY').val height/2
$('#slider-origY').attr('max',''+height)
updateform()
window.bob.src = "BobRoss.jpg"
$( "#slider-xrad" ).bind "change", (event, ui) ->
updateform()
$( "#slider-yrad" ).bind "change", (event, ui) ->
updateform()
$( "#slider-origX" ).bind "change", (event, ui) ->
updateform()
$( "#slider-origY" ).bind "change", (event, ui) ->
updateform()
</script>
<script type="text/javascript" src="js/fisheye.js"></script>
<!-- <script type="text/coffeescript" src="src/fisheye.coffee"></script> -->
<!-- </section>
</container>
-->
</body>
</html>