Constructors
constructor
- new File(name: string, _mat: Mat): File
Methods
asArrayBuffer
- asArrayBuffer(format?: string): Promise<ArrayBuffer>
-
Parameters
-
Default value format: string = this.getExtension()
Returns Promise<ArrayBuffer>
asBase64
- asBase64(format?: string): Promise<string>
-
Parameters
-
Default value format: string = this.getExtension()
Returns Promise<string>
asHTMLImageData
- asHTMLImageData(): ImageData
asImageData
- asImageData(): CVImageData
clone
- clone(name?: string): File
-
Parameters
-
Default value name: string = this.name
getMimeType
- getMimeType(): undefined | string
-
Returns undefined
|
string
remove
- remove(deleteMat?: boolean): this
-
Parameters
-
Default value deleteMat: boolean = true
Returns this
show
- show(el: HTMLElement): this
size
-
Returns object
-
height: number
-
width: number
write
- write(path?: string, format?: string): Promise<this>
-
Parameters
-
Default value path: string = this.name
-
Default value format: string = this.getExtension()
Returns Promise<this>
Static Private _buildName
- _buildName(name: string | undefined): string
-
Parameters
Returns string
Static asPath
- asPath(f: string | File): string
-
Parameters
Returns string
Static fileType
- fileType(a: ArrayBuffer): undefined | FileTypeResult
-
Parameters
Returns undefined
|
FileTypeResult
Static fromArrayBuffer
- fromArrayBuffer(buffer: ArrayBuffer, name?: undefined | string): Promise<File>
-
Parameters
-
buffer: ArrayBuffer
-
Optional name: undefined | string
Returns Promise<File>
Static fromArrayBufferView
- fromArrayBufferView(a: ArrayBufferView, name?: undefined | string): Promise<File>
-
Parameters
-
a: ArrayBufferView
-
Optional name: undefined | string
Returns Promise<File>
Static fromBase64
- fromBase64(base64: string, name?: undefined | string): Promise<File>
-
Parameters
-
base64: string
-
Optional name: undefined | string
Returns Promise<File>
Static fromCanvas
- fromCanvas(el: HTMLElement | string): File
Static fromData
- fromData(data: CVImageData, name?: undefined | string): File
-
Parameters
-
data: CVImageData
-
Optional name: undefined | string
Static fromDataUrl
- fromDataUrl(dataUrl: string, name?: undefined | string): Promise<File>
-
Parameters
-
dataUrl: string
-
Optional name: undefined | string
Returns Promise<File>
Static fromFile
- fromFile(path: string, name?: string): Promise<File>
-
Parameters
-
path: string
-
Default value name: string = basename(path)
Returns Promise<File>
Static fromHtmlFileInputElement
- fromHtmlFileInputElement(el: HTMLInputElement): Promise<File[]>
-
Parameters
Returns Promise<File[]>
Static fromMat
- fromMat(mat: Mat, name?: undefined | string): File
-
Parameters
-
-
Optional name: undefined | string
Static fromUrl
- fromUrl(url: string, o?: RequestInit & object): Promise<File>
-
Parameters
-
url: string
-
Default value o: RequestInit & object = {}
Returns Promise<File>
Static getBufferFileName
- getBufferFileName(a: ArrayBuffer): string
-
Parameters
Returns string
Static getBufferFileType
- getBufferFileType(a: ArrayBuffer): FileTypeResult
-
Parameters
Returns FileTypeResult
Static isFile
-
Parameters
Returns boolean
Static resolve
- resolve(files: string | File | undefined | (undefined | string | File)[]): Promise<File[]>
-
Parameters
-
files: string | File | undefined | (undefined | string | File)[]
Returns Promise<File[]>
Static resolveOne
- resolveOne(files: string | File | undefined | (undefined | string | File)[]): Promise<undefined | File>
-
Parameters
-
files: string | File | undefined | (undefined | string | File)[]
Returns Promise<undefined | File>
A thin layer on top of cv.Mat with lots of utilities to load, write, encode, etc.