Struct oxipng::Options[][src]

pub struct Options {
    pub backup: bool,
    pub fix_errors: bool,
    pub pretend: bool,
    pub clobber: bool,
    pub create: bool,
    pub force: bool,
    pub preserve_attrs: bool,
    pub verbosity: Option<u8>,
    pub filter: HashSet<u8>,
    pub interlace: Option<u8>,
    pub compression: HashSet<u8>,
    pub strategies: HashSet<u8>,
    pub window: u8,
    pub alphas: HashSet<AlphaOptim>,
    pub bit_depth_reduction: bool,
    pub color_type_reduction: bool,
    pub palette_reduction: bool,
    pub idat_recoding: bool,
    pub strip: Headers,
    pub deflate: Deflaters,
    pub use_heuristics: bool,
    pub threads: usize,
    pub timeout: Option<Duration>,
    // some fields omitted
}

Options controlling the output of the optimize function

Fields

Whether the input file should be backed up before writing the output.

Default: false

Attempt to fix errors when decoding the input file rather than returning an Err.

Default: false

Don't actually write any output, just calculate the best results.

Default: false

Overwrite existing output files.

Default: true

Create new output files if they don't exist.

Default: true

Write to output even if there was no improvement in compression.

Default: false

Ensure the output file has the same permissions as the input file.

Default: false

How verbose the console logging should be (None for quiet, Some(0) for normal, Some(1) for verbose)

Default: Some(0)

Which filters to try on the file (0-5)

Default: 0,5

Whether to change the interlacing type of the file.

None will not change the current interlacing type.

Some(x) will change the file to interlacing mode x.

Default: None

Which zlib compression levels to try on the file (1-9)

Default: 9

Which zlib compression strategies to try on the file (0-3)

Default: 0-3

Window size to use when compressing the file, as 2^window bytes.

Doesn't affect compression but may affect speed and memory usage. 8-15 are valid values.

Default: 15

Alpha filtering strategies to use

Whether to attempt bit depth reduction

Default: true

Whether to attempt color type reduction

Default: true

Whether to attempt palette reduction

Default: true

Whether to perform IDAT recoding

If any type of reduction is performed, IDAT recoding will be performed regardless of this setting

Default: true

Which headers to strip from the PNG file, if any

Default: None

Which DEFLATE algorithm to use

Default: Zlib

Whether to use heuristics to pick the best filter and compression

Intended for use with -o 1 from the CLI interface

Default: false

Number of threads to use

Default: 1.5x CPU cores, rounded down

Maximum amount of time to spend on optimizations. Further potential optimizations are skipped if the timeout is exceeded.

Methods

impl Options
[src]

Trait Implementations

impl Clone for Options
[src]

Returns a copy of the value. Read more

Performs copy-assignment from source. Read more

impl Debug for Options
[src]

Formats the value using the given formatter. Read more

impl Default for Options
[src]

Returns the "default value" for a type. Read more

Auto Trait Implementations

impl Send for Options

impl Sync for Options