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
&Stringto 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
PConvertErrorif it fails parsing. - encode_
file - Receives png buffer data and encodes it as a
Filewith specifiedCompressionTypeandFilterType. - encode_
image_ data - Receives png buffer data and encodes it as an
ImageDataobject with specifiedCompressionTypeandFilterType. - get_
compression_ type - Retrieves the
image::codecs::png::CompressionTypevalue from theHashMap<String, JSONValue>map if it exists. Otherwise it returns the default value:CompressionType::Fast. - get_
filter_ type - Retrieves the
image::codecs::png::FilterTypevalue from theHashMap<String, JSONValue>map if it exists. Otherwise it returns the default value:FilterType::NoFilter. - load_
png - Receives a
Fileand 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.readFilePromise (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.