-
Notifications
You must be signed in to change notification settings - Fork 15
Expand file tree
/
Copy pathImageData.java
More file actions
42 lines (36 loc) · 934 Bytes
/
ImageData.java
File metadata and controls
42 lines (36 loc) · 934 Bytes
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
package snap.webapi;
/**
* This class is a wrapper for Web API ImageData (https://developer.mozilla.org/en-US/docs/Web/API/ImageData).
*/
public class ImageData extends JSProxy {
/**
* Constructor.
*/
public ImageData(Object imageDataJS)
{
super(imageDataJS);
}
/**
* Constructor.
*/
public ImageData(short[] shortsArray, int aWidth, int aHeight)
{
super(WebEnv.get().newImageDataJSForRgbaArrayAndWidthAndHeight(shortsArray, aWidth, aHeight));
}
/**
* Returns ImageData.width.
*/
public int getWidth() { return getMemberInt("width"); }
/**
* Returns ImageData.width.
*/
public int getHeight() { return getMemberInt("height"); }
/**
* Returns ImageData.width.
*/
public Uint8ClampedArray getData()
{
Object arrayJS = getMember("data");
return new Uint8ClampedArray(arrayJS);
}
}