Class

Img

Img()

An image

Constructor

new Img()

Constructor

View Source Image.js, line 6

Members

number

static Status

Status
Properties:
Name Type Description
Unload number
Loading number
Loaded number

View Source Image.js, line 116

Methods

create(width, height, datanullable)

Create a new image
Parameters:
Name Type Attributes Default Description
width number Image's width
height number Image's height
data Uint8Array <nullable>
null An array with pixels (r, g, b, a)

View Source Image.js, line 75

getData() → {Image|Uint8Array}

Get Image's data

View Source Image.js, line 97

A native Image object or an array depending method use to load the image
Image | Uint8Array

getSize() → {Array.<number>}

Get image's dimensions

View Source Image.js, line 88

Image's width and height in pixel
Array.<number>

isReady() → {boolean}

Indicates if the image is ready to be use

View Source Image.js, line 106

True if image is ready, otherwise false
boolean

loadFromFile(path)

Load image from a file
Parameters:
Name Type Description
path string Path to the image file

View Source Image.js, line 57