Expand description
PNG decode/encode and load functions, console log macros, argument parsing from javascript input to inner-crate rust types and other utility functions.
Structs§
Functions§
- build_
algorithm - Attempts to parse a
&String
to aBlendAlgorithm
. Returns the enum variant if it suceeds. Otherwise it returns aPConvertError
. - build_
params - Attempts to build a vector of blending operations and extra parameters.
One pair per blending operation. Returns a
PConvertError
if it fails parsing. - encode_
file - Receives png buffer data and encodes it as a
File
with specifiedCompressionType
andFilterType
. - encode_
image_ data - Receives png buffer data and encodes it as an
ImageData
object with specifiedCompressionType
andFilterType
. - get_
compression_ type - Retrieves the
image::codecs::png::CompressionType
value from theHashMap<String, JSONValue>
map if it exists. Otherwise it returns the default value:CompressionType::Fast
. - get_
filter_ type - Retrieves the
image::codecs::png::FilterType
value from theHashMap<String, JSONValue>
map if it exists. Otherwise it returns the default value:FilterType::NoFilter
. - load_
png - Receives a
File
and returns the decoded PNG byte buffer. - log
- log_
benchmark - Logs one line (algorithm, compression, filter, blend time, read time, write time)
of the benchmarks table to the browser console (with
console.log
). - log_
benchmark_ header - Logs the header/column names of the benchmarks table to the browser
console (with
console.log
). - node_
read_ file_ async - Rust Future from nodejs
fs.readFile
Promise (awaitable in node). - node_
read_ file_ sync - Wrapper function for nodejs
fs.readFileSync
. - node_
require - node_
write_ file_ sync - Wrapper function for nodejs
fs.writeFileSync
.