forked from node-migrator-bot/camelot
-
Notifications
You must be signed in to change notification settings - Fork 0
/
test.js
49 lines (43 loc) · 944 Bytes
/
test.js
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
var Camelot = require('./camelot.js'), uuid = require('node-uuid');
var camelot = new Camelot( {
'rotate' : '180',
'flip' : 'v'
});
var focus = 10;
var brightness = -128;
camelot.on('frame', function (image) {
console.log('frame received!');
var name = uuid();
require('fs').writeFile('/tmp/' + name + '.png', image, function (err) {
if (err)
throw err;
console.log('saved!');
});
focus += 10;
brightness += 10;
camelot.update( {
'title' : name,
'controls' : {
'focus' : focus,
'brightness' : brightness
}
});
});
camelot.on('error', function (error) {
console.log("error", error);
});
camelot.grab( {
'title' : 'Camelot',
'font' : 'Arial:24',
'frequency' : 1,
'controls' : {
'focus' : 'auto'
}
});
// camelot.update( {
// 'title' : 'toto'
// });
/*
* , 'banner' : {'position': 'top', 'color': '#00000000', 'line': '#ffffffff'},
* 'text-color' : '#ffffffff',
*/