Home Reference Source Test
public class | source

PNGFileMixins

Extends:

BaseStorage → PNGFileMixins

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:

NameTypeAttributeDescription
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:

NameTypeAttributeDescription
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:

NameTypeAttributeDescription
filePath String
imgBuffer Array | ArrayBuffer

Return:

Promise

Array content promiser