ImageData

@native @JSGlobal @JSType
class ImageData extends Object

The ImageData interface represents the underlying pixel data of an area of a <canvas> element. It is created using creators on the CanvasRenderingContext2D object associated with the canvas createImageData() and getImageData()). It can also be used to set a part of the canvas (like with putImageData()).

class Object
trait Any
class Object
trait Matchable
class Any

Value members

Constructors

def this(data: Uint8ClampedArray, width: Int)

Create an ImageData instance from an array of pixel data and a width.

Create an ImageData instance from an array of pixel data and a width.

Value parameters:
data

pixel data

width

width in pixels

def this(data: Uint8ClampedArray, width: Int, height: Int)

Create an ImageData instance from an array of pixel data, width, and height.

Create an ImageData instance from an array of pixel data, width, and height.

Value parameters:
data

pixel data

height

height in pixels

width

width in pixels

def this(width: Int, height: Int)

Create a blank ImageData instance from specified width and height.

Create a blank ImageData instance from specified width and height.

Value parameters:
height

height in pixels

width

width in pixels

def this(width: Int, height: Int, settings: ImageDataSettings)

Create a blank ImageData instance from specified width, height, and settings object.

Create a blank ImageData instance from specified width, height, and settings object.

Value parameters:
height

height in pixels

settings

image settings

width

width in pixels

def this(data: Uint8ClampedArray, width: Int, height: Int, settings: ImageDataSettings)

Create a blank ImageData instance from specified pixel data, width, height, and settings object.

Create a blank ImageData instance from specified pixel data, width, height, and settings object.

Value parameters:
data

pixel data

height

height in pixels

settings

image settings

width

width in pixels

Concrete methods

def data: Uint8ClampedArray

Is a Uint8ClampedArray representing a one-dimensional array containing the data in the RGBA order, with integer values between 0 and 255 (included).

Is a Uint8ClampedArray representing a one-dimensional array containing the data in the RGBA order, with integer values between 0 and 255 (included).

def height: Int

Is an unsigned long representing the actual height, in pixels, of the ImageData.

Is an unsigned long representing the actual height, in pixels, of the ImageData.

def width: Int

Is an unsigned long representing the actual width, in pixels, of the ImageData.

Is an unsigned long representing the actual width, in pixels, of the ImageData.

Inherited methods

def hasOwnProperty(v: String): Boolean
Inherited from:
Object
def isPrototypeOf(v: Object): Boolean
Inherited from:
Object
def propertyIsEnumerable(v: String): Boolean
Inherited from:
Object
def toLocaleString(): String
Inherited from:
Object
def valueOf(): Any
Inherited from:
Object