Methods
Static
adapterInitialized
- adapterInitialized(): boolean
-
Returns boolean
Static
checkCanvasAdapter
- checkCanvasAdapter(): void
-
Returns void
Static
create
- create(width: any, height: any): HTMLCanvasElement
-
Returns HTMLCanvasElement
Static
createImage
- createImage(data: string | Buffer | Uint8Array, contentType?: string): Promise<GeoPackageImage>
-
Parameters
-
data: string | Buffer | Uint8Array
-
contentType: string = 'image/png'
Static
createImageData
- createImageData(width: any, height: any): ImageData
-
Returns ImageData
Static
disposeCanvas
- disposeCanvas(canvas: any): void
-
Returns void
Static
drawText
- drawText(context: CanvasRenderingContext2D, text: string, location: number[], fontFace: string, fontSize: number, fontColor: string): void
-
Parameters
-
context: CanvasRenderingContext2D
-
text: string
-
location: number[]
-
fontFace: string
-
fontSize: number
-
fontColor: string
Returns void
Static
initializeAdapter
- initializeAdapter(): Promise<void>
-
Returns Promise<void>
Static
measureText
- measureText(context: CanvasRenderingContext2D, fontFace: string, fontSize: number, text: string): number
-
Parameters
-
context: CanvasRenderingContext2D
-
fontFace: string
-
fontSize: number
-
text: string
Returns number
Static
mergeCanvas
- mergeCanvas(fromCanvas: any, toContext: any): void
-
Parameters
-
fromCanvas: any
-
toContext: any
Returns void
Static
registerCanvasAdapter
- registerCanvasAdapter(adapter: (new () => CanvasAdapter)): void
-
Returns void
Static
scaleImageToDimensions
- scaleImageToDimensions(image: GeoPackageImage, scaledWidth: number, scaledHeight: number): Promise<GeoPackageImage>
-
Parameters
-
-
scaledWidth: number
-
scaledHeight: number
Static
toBytes
- toBytes(canvas: any, imageFormat?: ImageType, compressionQuality?: number): Promise<Uint8Array>
-
Parameters
-
canvas: any
-
imageFormat: ImageType = ImageType.PNG
-
Optional
compressionQuality: number
Returns Promise<Uint8Array>
Static
toDataURL
- toDataURL(canvas: any, format?: string, quality?: number): Promise<string>
-
Parameters
-
canvas: any
-
format: string = 'image/png'
-
Optional
quality: number
Returns Promise<string>
Static
writeImageToBytes
- writeImageToBytes(image: GeoPackageImage, imageFormat: ImageType, compressionQuality: number): Promise<Uint8Array>
-
Parameters
-
-
-
compressionQuality: number
Returns Promise<Uint8Array>
Canvas Wrapper Class for interacting with HTMLCanvas and CanvasKit