import PNGFileMixins from 'causal-net/packages/causality-storage/src/PNGFile.mixins.js'
PNGFileMixins
Extends:
This LevelJSMixins class provide mixins for handle read/write/fetch png content
Method Summary
Public Methods | ||
public |
async fetchPNGFile(url: Url , filePath: String ): Promise fetch PNG file, transform to get raw pixel data and save to file at the filePath |
|
public |
async readPNGFile(filePath: String ): Promise Read PNG pixel data given the file path |
|
public |
async writePNGFile(filePath: String , imgBuffer: Array | ArrayBuffer ): Promise write raw pixel data as Array to file at filePath |
Public Methods
public async fetchPNGFile(url: Url , filePath: String ): Promise source
fetch PNG file, transform to get raw pixel data and save to file at the filePath
Params:
Name | Type | Attribute | Description |
url | Url | url for png file |
|
filePath | String | file name to save content |
Return:
Promise | Array content promiser |
public async readPNGFile(filePath: String ): Promise source
Read PNG pixel data given the file path
Params:
Name | Type | Attribute | Description |
filePath | String | full file path |
Return:
Promise | Array content promiser |
public async writePNGFile(filePath: String , imgBuffer: Array | ArrayBuffer ): Promise source
write raw pixel data as Array to file at filePath
Params:
Name | Type | Attribute | Description |
filePath | String | ||
imgBuffer | Array | ArrayBuffer |
Return:
Promise | Array content promiser |