The Image class represents generic image data

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

    • bitsPerPixel: number

      Number of bits per single pixel

    • byteWidth: number

      Total number of bytes per image line

    • 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

bitsPerPixel: number

Number of bits per single pixel

byteWidth: number

Total number of bytes per image line

channels: number

Amount of Image channels

colorMode: ColorMode = ColorMode.BGR

An images color mode, defaults to ColorMode.BGR

data: Buffer

Generic Image data

height: number

Image height in pixels

id: string

Image identifier

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

Type declaration

  • scaleX: number
  • scaleY: number
width: number

Image width in pixels

Accessors

Methods

  • fromRGBData creates an Image from provided RGB data

    Parameters

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

    Returns Image

Generated using TypeDoc