Module utils

Source
Expand description

Utility functions for argument parsing from python input to inner-crate rust types.

Functionsยง

build_algorithm
Attempts to parse a &String to a BlendAlgorithm. Returns the enum variant if it succeeds. Otherwise it returns a PyErr.
build_params
Attempts to build a vector of blending operations and extra parameters. One pair per blending operation. Returns a PyErr if it fails parsing.
get_compression_type
Retrieves the image::codecs::png::CompressionType value from the Options map if it exists. Otherwise it returns the default value: CompressionType::Fast.
get_filter_type
Retrieves the image::codecs::png::FilterType value from the Options map if it exists. Otherwise it returns the default value: FilterType::NoFilter.
get_num_threads
Retrieves the number of threads value from the Options map if it exists. Otherwise it returns the default value: 0.