-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathgetImageData.js
61 lines (61 loc) · 1.49 KB
/
getImageData.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
module.exports = {
name: "getImageData",
ns: "canvas",
title: "Get Image Data",
description: "Get Image Data",
phrases: {
active: "Getting image data"
},
ports: {
input: {
context: {
title: "Context",
type: "CanvasRenderingContext2D"
},
sx: {
title: "Sx",
type: "number",
description: "The x coordinate of the upper left corner of the rectangle from which the ImageData will be extracted."
},
sy: {
title: "Sy",
type: "number",
description: "The y coordinate of the upper left corner of the rectangle from which the ImageData will be extracted."
},
sw: {
title: "Sw",
type: "number",
description: "The width of the rectangle from which the ImageData will be extracted."
},
sh: {
title: "Sh",
type: "number",
description: "The height of the rectangle from which the ImageData will be extracted."
}
},
output: {
context: {
title: "Context",
type: "CanvasRenderingContext2D"
},
out: {
title: "ImageData",
type: "ImageData"
}
}
},
fn: function getImageData(input, $, output, state, done, cb, on) {
var r = function() {
output({
context: $.get('context'),
out: $.create($.context.getImageData($.sx, $.sy, $.sw, $.sh))
});
}.call(this);
return {
output: output,
state: state,
on: on,
return: r
};
}
}