- Preparing search index...
- The search index is not available
feng3d
Methods
arrayBufferToBlob
- arrayBufferToBlob(arrayBuffer: ArrayBuffer): Blob
-
Returns Blob
arrayBufferToDataURL
- arrayBufferToDataURL(arrayBuffer: ArrayBuffer): Promise<string>
-
Returns Promise<string>
arrayBufferToImage
- arrayBufferToImage(arrayBuffer: ArrayBuffer): Promise<HTMLImageElement>
-
Returns Promise<HTMLImageElement>
arrayBufferToObject
- arrayBufferToObject(arrayBuffer: ArrayBuffer): Promise<any>
-
Returns Promise<any>
arrayBufferToString
- arrayBufferToString(arrayBuffer: ArrayBuffer): Promise<string>
-
Returns Promise<string>
arrayBufferToUint8
- arrayBufferToUint8(arrayBuffer: ArrayBuffer): Uint8Array
-
Returns Uint8Array
arrayToArrayBuffer
- arrayToArrayBuffer(array: number[]): ArrayBuffer
-
Returns ArrayBuffer
blobToArrayBuffer
- blobToArrayBuffer(blob: Blob): Promise<ArrayBuffer>
-
Returns Promise<ArrayBuffer>
blobToDataURL
- blobToDataURL(blob: Blob): Promise<string>
-
Returns Promise<string>
blobToText
- blobToText(blob: Blob): Promise<string>
-
Returns Promise<string>
canvasToDataURL
- canvasToDataURL(canvas: HTMLCanvasElement, type?: "png" | "jpeg", quality?: number): string
-
Parameters
-
canvas: HTMLCanvasElement
-
type: "png" | "jpeg" = 'png'
-
quality: number = 1
Returns string
canvasToImage
- canvasToImage(canvas: HTMLCanvasElement, type?: "png" | "jpeg", quality?: number): Promise<HTMLImageElement>
-
Parameters
-
canvas: HTMLCanvasElement
-
type: "png" | "jpeg" = 'png'
-
quality: number = 1
Returns Promise<HTMLImageElement>
dataURLToArrayBuffer
- dataURLToArrayBuffer(dataurl: string): Promise<ArrayBuffer>
-
Returns Promise<ArrayBuffer>
dataURLToImage
- dataURLToImage(dataurl: string): Promise<HTMLImageElement>
-
Returns Promise<HTMLImageElement>
dataURLtoBlob
- dataURLtoBlob(dataurl: string): Blob
-
Returns Blob
imageDataToCanvas
- imageDataToCanvas(imageData: ImageData): HTMLCanvasElement
-
Returns HTMLCanvasElement
imageDataToDataURL
- imageDataToDataURL(imageData: ImageData, quality?: number): string
-
Parameters
-
imageData: ImageData
-
quality: number = 1
Returns string
imageToArrayBuffer
- imageToArrayBuffer(img: HTMLImageElement): Promise<ArrayBuffer>
-
Returns Promise<ArrayBuffer>
imageToCanvas
- imageToCanvas(img: HTMLImageElement): HTMLCanvasElement
-
Returns HTMLCanvasElement
imageToDataURL
- imageToDataURL(img: HTMLImageElement, quality?: number): string
-
Parameters
-
img: HTMLImageElement
-
quality: number = 1
Returns string
imagedataToImage
- imagedataToImage(imageData: ImageData, quality?: number): Promise<HTMLImageElement>
-
Parameters
-
imageData: ImageData
-
quality: number = 1
Returns Promise<HTMLImageElement>
stringToArrayBuffer
- stringToArrayBuffer(str: string): ArrayBuffer
-
Returns ArrayBuffer
stringToUint8Array
- stringToUint8Array(str: string): Uint8Array
-
Returns Uint8Array
uint8ArrayToArray
- uint8ArrayToArray(u8a: Uint8Array): number[]
-
Returns number[]
uint8ArrayToString
- uint8ArrayToString(arr: Uint8Array): string
-
Returns string
uint8ToArrayBuffer
- uint8ToArrayBuffer(uint8Array: Uint8Array): ArrayBuffer
-
Returns ArrayBuffer
数据类型转换 TypeArray、ArrayBuffer、Blob、File、DataURL、canvas的相互转换
See
http://blog.csdn.net/yinwhm12/article/details/73482904