Skip to content

Commit cfdf9fe

Browse files
committed
(#87) Image API docs
1 parent 9b06ccc commit cfdf9fe

File tree

1 file changed

+14
-0
lines changed

1 file changed

+14
-0
lines changed

Diff for: lib/image.class.ts

+14
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,15 @@
1+
/**
2+
* The {@link Image} class represents generic image data
3+
*/
14
export class Image {
5+
/**
6+
* {@link Image} class constructor
7+
* @param width {@link Image} width in pixels
8+
* @param height {@link Image} height in pixels
9+
* @param data Generic {@link Image} data
10+
* @param channels Amount of {@link Image} channels
11+
* @param pixelDensity Object containing scale info to work with e.g. Retina display data where the reported display size and pixel size differ (Default: {scaleX: 1.0, scaleY: 1.0})
12+
*/
213
constructor(
314
public readonly width: number,
415
public readonly height: number,
@@ -14,6 +25,9 @@ export class Image {
1425
}
1526
}
1627

28+
/**
29+
* {@link hasAlphaChannel} return true if an {@link Image} has an additional (fourth) alpha channel
30+
*/
1731
public get hasAlphaChannel() {
1832
return this.channels > 3;
1933
}

0 commit comments

Comments
 (0)