-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathgrayscale.js
65 lines (64 loc) · 1.26 KB
/
grayscale.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
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
module.exports = {
name: "grayscale",
ns: "jsfeat",
async: true,
description: "Grayscale",
phrases: {
active: "Applying grayscale"
},
ports: {
input: {
src: {
title: "Source",
type: "ImageData"
},
dest: {
title: "Destination",
async: true,
type: "function",
fn: function __DEST__(data, source, state, input, $, output, jsfeat) {
var r = function() {
jsfeat.imgproc.grayscale($.src.data, $.width, $.height, $.dest, $.code)
output({
out: $.write('dest', $.dest),
imageData: $.write('src', $.src)
});
}.call(this);
return {
state: state,
return: r
};
}
},
width: {
title: "Width",
type: "number"
},
height: {
title: "Height",
type: "number"
},
code: {
title: "Code",
type: "number",
required: false
}
},
output: {
out: {
title: "Out",
type: "function"
},
imageData: {
title: "Image Data",
type: "ImageData"
}
}
},
dependencies: {
npm: {
jsfeat: require('jsfeat')
}
},
state: {}
}