Home Reference Source Test
public class | source

PNGUtils

You can directly use an instance of this class. pNGUtils

This PNGUtils class use pngjs3 for png parsing and transform png data from fetch.

Test:

Constructor Summary

Public Constructor
public

Member Summary

Public Members
public get

CorePNG: *

get pngjs3 instance

public

fs: *

public

png: *

Method Summary

Public Methods
public

async fetchPNG(url: URL ): Promise

fetch and tranform png file to raw array from url

public

async readPNG(filePath: String ): Promise

read and tranform png file to raw array from filepath

public

async writePNG(url: URL ): Promise

write and tranform png file to raw array from filepath

Public Constructors

public constructor() source

Public Members

public get CorePNG: * source

get pngjs3 instance

public fs: * source

public png: * source

Public Methods

public async fetchPNG(url: URL ): Promise source

fetch and tranform png file to raw array from url

Params:

NameTypeAttributeDescription
url URL

url for PNG file

Return:

Promise

data promise - return Array if success or reject with error message

public async readPNG(filePath: String ): Promise source

read and tranform png file to raw array from filepath

Params:

NameTypeAttributeDescription
filePath String

url for PNG file

Return:

Promise

data promise - return Array if success or reject with error message

public async writePNG(url: URL ): Promise source

write and tranform png file to raw array from filepath

Params:

NameTypeAttributeDescription
url URL

url for PNG file

Return:

Promise

data promise - return Array if success or reject with error message