Hierarchy

  • CanvasAdapter

Implemented by

Methods

  • Creates a canvas object

    Parameters

    • width: number
    • height: number

    Returns any

  • Creates an Image object to be used in the context.drawImage function

    Parameters

    • data: string | Buffer | Uint8Array | Blob
    • contentType: string

    Returns Promise<GeoPackageImage>

  • Creates an ImageData object

    Parameters

    • width: any
    • height: any

    Returns ImageData

  • Performs any cleanup needed for the specified canvas. The canvas should not be used after calling this function.

    Parameters

    • canvas: any

    Returns any

  • Draws text centered at the location specified in the canvas rendering context

    Parameters

    • context: any
    • text: string
    • location: number[]
    • fontFace: string
    • fontSize: number
    • fontColor: string

    Returns void

  • Returns the width of the text in the given font face and font size

    Parameters

    • context: any
    • fontFace: string
    • fontSize: number
    • text: string

    Returns number

  • Draw content of fromCanvas into the toContext

    Parameters

    • fromCanvas: any
    • toContext: any

    Returns void

  • Converts the contents drawn in a canvas to a byte array

    Parameters

    • canvas: any
    • imageFormat: ImageType
    • Optional compressionQuality: number

    Returns Promise<Uint8Array>

  • Converts the canvas to a base64 data url in the format specified

    Parameters

    • canvas: any
    • format: string
    • Optional quality: number

      0 to 1

    Returns Promise<string>

  • Writes the image to a buffer

    Parameters

    • image: GeoPackageImage
    • imageFormat: ImageType
    • compressionQuality: number

      a Number between 0 and 1 indicating the image quality to be used when creating images using file formats that support lossy compression (such as jpg)

    Returns Promise<Uint8Array>

Generated using TypeDoc