Options
All
  • Public
  • Public/Protected
  • All
Menu

Class Converter

Hierarchy

  • Converter

Index

Constructors

Accessors

Methods

  • constructImageData(image: Blob | File, arrayBuffer?: ArrayBuffer): Promise<{ arrayBuffer: ArrayBuffer; imageData: { format: string; size: number; filename?: string } }>
  • Convert the given image to an ArrayBuffer and return the image data.

    Parameters

    • image: Blob | File

      The image to convert.

    • Optional arrayBuffer: ArrayBuffer

      Optional: The ArrayBuffer of the image, if it was already converted.

    Returns Promise<{ arrayBuffer: ArrayBuffer; imageData: { format: string; size: number; filename?: string } }>

  • convertToArrayBuffer(input: ArrayBuffer | Blob | File | (() => Promise<ArrayBuffer>) | (() => Promise<Blob>)): Promise<ArrayBuffer>
  • Convert the given input to an ArrayBuffer.

    Parameters

    • input: ArrayBuffer | Blob | File | (() => Promise<ArrayBuffer>) | (() => Promise<Blob>)

    Returns Promise<ArrayBuffer>

  • convertToBlob(input: ArrayBuffer | Blob | File | (() => Promise<ArrayBuffer>) | (() => Promise<Blob>)): Promise<Blob>
  • Convert the given input to a Blob.

    Parameters

    • input: ArrayBuffer | Blob | File | (() => Promise<ArrayBuffer>) | (() => Promise<Blob>)

    Returns Promise<Blob>

  • dataURLtoBlob(dataURL: string): { arrayBuffer: ArrayBufferLike; blob: Blob }
  • Converts a data URL to a Blob object.

    Parameters

    • dataURL: string

    Returns { arrayBuffer: ArrayBufferLike; blob: Blob }

    • arrayBuffer: ArrayBufferLike
    • blob: Blob
  • processSVG(blob: Blob): Promise<HTMLImageElement>
  • Parameters

    • blob: Blob

    Returns Promise<HTMLImageElement>

  • responseToImage(response: HttpResponse<{ blob: Blob; buffer: ArrayBuffer }>): Promise<HTMLImageElement>
  • Parameters

    • response: HttpResponse<{ blob: Blob; buffer: ArrayBuffer }>

    Returns Promise<HTMLImageElement>

  • toAlpha(color: unknown): number
  • Parameters

    • color: unknown

    Returns number

  • toColorArray(color: unknown): number[]
  • Parameters

    • color: unknown

    Returns number[]

  • toHex8Color(color: unknown, defColorString?: string): string
  • Parameters

    • color: unknown
    • Optional defColorString: string

    Returns string

  • toHexColor(color: unknown, defColorString?: string): string
  • This color converter is mostly left 'as-is' from viewer v2. I didn't want to break something that works.

    Parameters

    • color: unknown
    • Optional defColorString: string

    Returns string

  • toThreeJsColorInput(color: unknown): string
  • Parameters

    • color: unknown

    Returns string

  • toVec3(point: vec3 | { x: number; y: number; z: number } | { X: number; Y: number; Z: number }): vec3
  • Parameters

    • point: vec3 | { x: number; y: number; z: number } | { X: number; Y: number; Z: number }

    Returns vec3