The Image class represents generic image data

Hierarchy

  • Image

Constructors

  • Image class constructor

    Parameters

    • width: number

      Image width in pixels

    • height: number

      Image height in pixels

    • data: Buffer

      Generic Image data

    • channels: number

      Amount of Image channels

    • id: string

      Image identifier

    • colorMode: ColorMode = ColorMode.BGR

      An images color mode, defaults to ColorMode.BGR

    • pixelDensity: { scaleX: number; scaleY: number } = ...

      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})

      • scaleX: number
      • scaleY: number

    Returns Image

Properties

channels: number
colorMode: ColorMode = ColorMode.BGR
data: Buffer
height: number
id: string
pixelDensity: { scaleX: number; scaleY: number } = ...

Type declaration

  • scaleX: number
  • scaleY: number
width: number

Accessors

Methods

  • fromRGBData creates an Image from provided RGB data

    Parameters

    • width: number
    • height: number
    • data: Buffer
    • channels: number
    • id: string

    Returns Image