Options
All
  • Public
  • Public/Protected
  • All
Menu

Class PngPong

The core class for any image manipulation. Create an instance of this class with the ArrayBuffer of your original PNG image, then apply your transforms to it. Then execute PngPng.run() to apply those transforms.

export
class

PngPong

Hierarchy

  • PngPong

Index

Constructors

Methods

Constructors

constructor

  • new PngPong(source: ArrayBuffer): PngPong
  • Creates an instance of PngPong.

    memberof

    PngPong

    Parameters

    • source: ArrayBuffer

    Returns PngPong

Methods

onData

  • Add a callback that will be run multiple times as PngPong runs through the image data.

    memberof

    PngPong

    Parameters

    Returns void

onHeader

  • Add a callback to be run when the IHDR chunk of the PNG file has been successfully read. You cannot edit the contents of the IHDR, but can read values out of it.

    memberof

    PngPong

    Parameters

    Returns void

onPalette

  • Add a callback when the image palette has been processed. During this callback you are able to add colors to the palette. If you save the palette variable outside of the callback, you can also use it to later get the index of palette colors while processing data.

    memberof

    PngPong

    Parameters

    Returns void

run

  • run(): void
  • Apply the transforms you've created to the original ArrayBuffer.

    memberof

    PngPong

    Returns void

Generated using TypeDoc