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

RawImageData

Implements:

  • ImageData

A container for raw RGBA image data.

Static Method Summary

Static Public Methods
public static

from(image: ImageData | Image): RawImageData

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 RGBA 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(image: ImageData | Image): RawImageData source

Creates a new image data container.

Params:

NameTypeAttributeDescription
image ImageData | Image

An image or plain 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 RGBA 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.