Home Reference Source
import {RawImageData} from 'postprocessing'
public class | source

RawImageData

A container for raw image data.

Static Method Summary

Static Public Methods
public static

Creates a new image data container.

Constructor Summary

Public Constructor
public

constructor(width: Number, height: Number, data: Uint8ClampedArray)

Constructs a new image data container.

Member Summary

Public Members
public

The image data.

public

The height of the image.

public

The width of the image.

Method Summary

Public Methods
public

toCanvas(): Canvas

Creates a canvas from this image data.

Static Public Methods

public static from(data: Object): RawImageData source

Creates a new image data container.

Params:

NameTypeAttributeDescription
data Object

Raw image data.

Return:

RawImageData

The image data.

Public Constructors

public constructor(width: Number, height: Number, data: Uint8ClampedArray) source

Constructs a new image data container.

Params:

NameTypeAttributeDescription
width Number
  • optional
  • default: 0

The width of the image.

height Number
  • optional
  • default: 0

The height of the image.

data Uint8ClampedArray
  • optional
  • default: null

The image data.

Public Members

public data: Uint8ClampedArray source

The image data.

public height: Number source

The height of the image.

public width: Number source

The width of the image.

Public Methods

public toCanvas(): Canvas source

Creates a canvas from this image data.

Return:

Canvas

The canvas or null if it couldn't be created.