Options
All
  • Public
  • Public/Protected
  • All
Menu

Class containing a set of static utilities functions to dump data from a canvas

Hierarchy

  • DumpTools

Index

Constructors

Methods

  • Dispose(): void
  • Dispose the dump tools associated resources

    Returns void

  • DumpData(width: number, height: number, data: ArrayBufferView, successCallback?: ((data: string | ArrayBuffer) => void), mimeType?: string, fileName?: string, invertY?: boolean, toArrayBuffer?: boolean, quality?: number): void
  • Dumps an array buffer

    Parameters

    • width: number

      defines the rendering width

    • height: number

      defines the rendering height

    • data: ArrayBufferView

      the data array

    • Optional successCallback: ((data: string | ArrayBuffer) => void)

      defines the callback triggered once the data are available

        • (data: string | ArrayBuffer): void
        • Parameters

          • data: string | ArrayBuffer

          Returns void

    • Optional mimeType: string

      defines the mime type of the result

    • Optional fileName: string

      defines the filename to download. If present, the result will automatically be downloaded

    • Optional invertY: boolean

      true to invert the picture in the Y dimension

    • Optional toArrayBuffer: boolean

      true to convert the data to an ArrayBuffer (encoded as mimeType) instead of a base64 string

    • Optional quality: number

      The quality of the image if lossy mimeType is used (e.g. image/jpeg, image/webp). See HTMLCanvasElement.toBlob()'s quality parameter.

    Returns void

  • DumpDataAsync(width: number, height: number, data: ArrayBufferView, mimeType?: string, fileName?: string, invertY?: boolean, toArrayBuffer?: boolean, quality?: number): Promise<string | ArrayBuffer>
  • Dumps an array buffer

    Parameters

    • width: number

      defines the rendering width

    • height: number

      defines the rendering height

    • data: ArrayBufferView

      the data array

    • Optional mimeType: string

      defines the mime type of the result

    • Optional fileName: string

      defines the filename to download. If present, the result will automatically be downloaded

    • Optional invertY: boolean

      true to invert the picture in the Y dimension

    • Optional toArrayBuffer: boolean

      true to convert the data to an ArrayBuffer (encoded as mimeType) instead of a base64 string

    • Optional quality: number

      The quality of the image if lossy mimeType is used (e.g. image/jpeg, image/webp). See HTMLCanvasElement.toBlob()'s quality parameter.

    Returns Promise<string | ArrayBuffer>

    a promise that resolve to the final data

  • DumpFramebuffer(width: number, height: number, engine: Engine, successCallback?: ((data: string) => void), mimeType?: string, fileName?: string, quality?: number): Promise<void>
  • Dumps the current bound framebuffer

    Parameters

    • width: number

      defines the rendering width

    • height: number

      defines the rendering height

    • engine: Engine

      defines the hosting engine

    • Optional successCallback: ((data: string) => void)

      defines the callback triggered once the data are available

        • (data: string): void
        • Parameters

          • data: string

          Returns void

    • Optional mimeType: string

      defines the mime type of the result

    • Optional fileName: string

      defines the filename to download. If present, the result will automatically be downloaded

    • Optional quality: number

      The quality of the image if lossy mimeType is used (e.g. image/jpeg, image/webp). See HTMLCanvasElement.toBlob()'s quality parameter.

    Returns Promise<void>

    a void promise

Legend

  • Constructor
  • Property
  • Method
  • Inherited constructor
  • Inherited property
  • Inherited method
  • Property
  • Method
  • Static method

Settings

Theme