196 lines
No EOL
15 KiB
HTML
196 lines
No EOL
15 KiB
HTML
<!DOCTYPE html>
|
||
<html lang="en">
|
||
<head>
|
||
<meta charset="utf-8">
|
||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||
<meta name="generator" content="rustdoc">
|
||
<meta name="description" content="API documentation for the Rust `Options` struct in crate `oxipng`.">
|
||
<meta name="keywords" content="rust, rustlang, rust-lang, Options">
|
||
|
||
<title>oxipng::Options - Rust</title>
|
||
|
||
<link rel="stylesheet" type="text/css" href="../rustdoc.css">
|
||
<link rel="stylesheet" type="text/css" href="../main.css">
|
||
|
||
|
||
|
||
</head>
|
||
<body class="rustdoc">
|
||
<!--[if lte IE 8]>
|
||
<div class="warning">
|
||
This old browser is unsupported and will most likely display funky
|
||
things.
|
||
</div>
|
||
<![endif]-->
|
||
|
||
|
||
|
||
<nav class="sidebar">
|
||
|
||
<p class='location'><a href='index.html'>oxipng</a></p><script>window.sidebarCurrent = {name: 'Options', ty: 'struct', relpath: ''};</script><script defer src="sidebar-items.js"></script>
|
||
</nav>
|
||
|
||
<nav class="sub">
|
||
<form class="search-form js-only">
|
||
<div class="search-container">
|
||
<input class="search-input" name="search"
|
||
autocomplete="off"
|
||
placeholder="Click or press ‘S’ to search, ‘?’ for more options…"
|
||
type="search">
|
||
</div>
|
||
</form>
|
||
</nav>
|
||
|
||
<section id='main' class="content struct">
|
||
<h1 class='fqn'><span class='in-band'>Struct <a href='index.html'>oxipng</a>::<wbr><a class='struct' href=''>Options</a></span><span class='out-of-band'><span id='render-detail'>
|
||
<a id="toggle-all-docs" href="javascript:void(0)" title="collapse all docs">
|
||
[<span class='inner'>−</span>]
|
||
</a>
|
||
</span><a id='src-759' class='srclink' href='../src/oxipng/src/lib.rs.html.html#21-77' title='goto source code'>[src]</a></span></h1>
|
||
<pre class='rust struct'>pub struct Options {
|
||
pub backup: <a class='primitive' href='https://doc.rust-lang.org/nightly/std/primitive.bool.html'>bool</a>,
|
||
pub out_file: <a class='struct' href='https://doc.rust-lang.org/nightly/std/path/struct.PathBuf.html' title='std::path::PathBuf'>PathBuf</a>,
|
||
pub out_dir: <a class='enum' href='https://doc.rust-lang.org/nightly/core/option/enum.Option.html' title='core::option::Option'>Option</a><<a class='struct' href='https://doc.rust-lang.org/nightly/std/path/struct.PathBuf.html' title='std::path::PathBuf'>PathBuf</a>>,
|
||
pub stdout: <a class='primitive' href='https://doc.rust-lang.org/nightly/std/primitive.bool.html'>bool</a>,
|
||
pub fix_errors: <a class='primitive' href='https://doc.rust-lang.org/nightly/std/primitive.bool.html'>bool</a>,
|
||
pub pretend: <a class='primitive' href='https://doc.rust-lang.org/nightly/std/primitive.bool.html'>bool</a>,
|
||
pub recursive: <a class='primitive' href='https://doc.rust-lang.org/nightly/std/primitive.bool.html'>bool</a>,
|
||
pub clobber: <a class='primitive' href='https://doc.rust-lang.org/nightly/std/primitive.bool.html'>bool</a>,
|
||
pub create: <a class='primitive' href='https://doc.rust-lang.org/nightly/std/primitive.bool.html'>bool</a>,
|
||
pub force: <a class='primitive' href='https://doc.rust-lang.org/nightly/std/primitive.bool.html'>bool</a>,
|
||
pub preserve_attrs: <a class='primitive' href='https://doc.rust-lang.org/nightly/std/primitive.bool.html'>bool</a>,
|
||
pub verbosity: <a class='enum' href='https://doc.rust-lang.org/nightly/core/option/enum.Option.html' title='core::option::Option'>Option</a><<a class='primitive' href='https://doc.rust-lang.org/nightly/std/primitive.u8.html'>u8</a>>,
|
||
pub filter: <a class='struct' href='https://doc.rust-lang.org/nightly/std/collections/hash/set/struct.HashSet.html' title='std::collections::hash::set::HashSet'>HashSet</a><<a class='primitive' href='https://doc.rust-lang.org/nightly/std/primitive.u8.html'>u8</a>>,
|
||
pub interlace: <a class='enum' href='https://doc.rust-lang.org/nightly/core/option/enum.Option.html' title='core::option::Option'>Option</a><<a class='primitive' href='https://doc.rust-lang.org/nightly/std/primitive.u8.html'>u8</a>>,
|
||
pub compression: <a class='struct' href='https://doc.rust-lang.org/nightly/std/collections/hash/set/struct.HashSet.html' title='std::collections::hash::set::HashSet'>HashSet</a><<a class='primitive' href='https://doc.rust-lang.org/nightly/std/primitive.u8.html'>u8</a>>,
|
||
pub memory: <a class='struct' href='https://doc.rust-lang.org/nightly/std/collections/hash/set/struct.HashSet.html' title='std::collections::hash::set::HashSet'>HashSet</a><<a class='primitive' href='https://doc.rust-lang.org/nightly/std/primitive.u8.html'>u8</a>>,
|
||
pub strategies: <a class='struct' href='https://doc.rust-lang.org/nightly/std/collections/hash/set/struct.HashSet.html' title='std::collections::hash::set::HashSet'>HashSet</a><<a class='primitive' href='https://doc.rust-lang.org/nightly/std/primitive.u8.html'>u8</a>>,
|
||
pub window: <a class='primitive' href='https://doc.rust-lang.org/nightly/std/primitive.u8.html'>u8</a>,
|
||
pub bit_depth_reduction: <a class='primitive' href='https://doc.rust-lang.org/nightly/std/primitive.bool.html'>bool</a>,
|
||
pub color_type_reduction: <a class='primitive' href='https://doc.rust-lang.org/nightly/std/primitive.bool.html'>bool</a>,
|
||
pub palette_reduction: <a class='primitive' href='https://doc.rust-lang.org/nightly/std/primitive.bool.html'>bool</a>,
|
||
pub idat_recoding: <a class='primitive' href='https://doc.rust-lang.org/nightly/std/primitive.bool.html'>bool</a>,
|
||
pub strip: <a class='enum' href='../oxipng/png/enum.Headers.html' title='oxipng::png::Headers'>Headers</a>,
|
||
pub use_heuristics: <a class='primitive' href='https://doc.rust-lang.org/nightly/std/primitive.bool.html'>bool</a>,
|
||
}</pre><div class='docblock'><p>Options controlling the output of the <code>optimize</code> function</p>
|
||
</div><h2 class='fields'>Fields</h2>
|
||
<table><tr class='stab '>
|
||
<td id='structfield.backup'><code>backup</code></td><td><div class='docblock'><p>Whether the input file should be backed up before writing the output</p>
|
||
</div></td></tr><tr class='stab '>
|
||
<td id='structfield.out_file'><code>out_file</code></td><td><div class='docblock'><p>Path to write the output file to</p>
|
||
</div></td></tr><tr class='stab '>
|
||
<td id='structfield.out_dir'><code>out_dir</code></td><td><div class='docblock'><p>Used only in CLI interface</p>
|
||
</div></td></tr><tr class='stab '>
|
||
<td id='structfield.stdout'><code>stdout</code></td><td><div class='docblock'><p>Write to stdout instead of a file</p>
|
||
</div></td></tr><tr class='stab '>
|
||
<td id='structfield.fix_errors'><code>fix_errors</code></td><td><div class='docblock'><p>Attempt to fix errors when decoding the input file</p>
|
||
</div></td></tr><tr class='stab '>
|
||
<td id='structfield.pretend'><code>pretend</code></td><td><div class='docblock'><p>Don't actually write any output, just calculate the best results</p>
|
||
</div></td></tr><tr class='stab '>
|
||
<td id='structfield.recursive'><code>recursive</code></td><td><div class='docblock'><p>Used only in CLI interface</p>
|
||
</div></td></tr><tr class='stab '>
|
||
<td id='structfield.clobber'><code>clobber</code></td><td><div class='docblock'><p>Overwrite existing output files</p>
|
||
</div></td></tr><tr class='stab '>
|
||
<td id='structfield.create'><code>create</code></td><td><div class='docblock'><p>Create new output files if they don't exist</p>
|
||
</div></td></tr><tr class='stab '>
|
||
<td id='structfield.force'><code>force</code></td><td><div class='docblock'><p>Write to output even if there was no improvement in compression</p>
|
||
</div></td></tr><tr class='stab '>
|
||
<td id='structfield.preserve_attrs'><code>preserve_attrs</code></td><td><div class='docblock'><p>Ensure the output file has the same permissions as the input file</p>
|
||
</div></td></tr><tr class='stab '>
|
||
<td id='structfield.verbosity'><code>verbosity</code></td><td><div class='docblock'><p>How verbose the console logging should be (<code>None</code> for quiet, <code>Some(0)</code> for normal, <code>Some(1)</code> for verbose)</p>
|
||
</div></td></tr><tr class='stab '>
|
||
<td id='structfield.filter'><code>filter</code></td><td><div class='docblock'><p>Which filters to try on the file (0-5)</p>
|
||
</div></td></tr><tr class='stab '>
|
||
<td id='structfield.interlace'><code>interlace</code></td><td><div class='docblock'><p>Whether to change the interlacing type of the file
|
||
<code>None</code> will not change the current interlacing type
|
||
<code>Some(x)</code> will change the file to interlacing mode <code>x</code></p>
|
||
</div></td></tr><tr class='stab '>
|
||
<td id='structfield.compression'><code>compression</code></td><td><div class='docblock'><p>Which zlib compression levels to try on the file (1-9)</p>
|
||
</div></td></tr><tr class='stab '>
|
||
<td id='structfield.memory'><code>memory</code></td><td><div class='docblock'><p>Which zlib memory levels to try on the file (1-9)</p>
|
||
</div></td></tr><tr class='stab '>
|
||
<td id='structfield.strategies'><code>strategies</code></td><td><div class='docblock'><p>Which zlib compression strategies to try on the file (0-3)</p>
|
||
</div></td></tr><tr class='stab '>
|
||
<td id='structfield.window'><code>window</code></td><td><div class='docblock'><p>Window size to use when compressing the file, as <code>2^window</code> bytes
|
||
Doesn't affect compression but may affect speed and memory usage
|
||
15 is recommended default, 8-15 are valid values</p>
|
||
</div></td></tr><tr class='stab '>
|
||
<td id='structfield.bit_depth_reduction'><code>bit_depth_reduction</code></td><td><div class='docblock'><p>Whether to attempt bit depth reduction</p>
|
||
</div></td></tr><tr class='stab '>
|
||
<td id='structfield.color_type_reduction'><code>color_type_reduction</code></td><td><div class='docblock'><p>Whether to attempt color type reduction</p>
|
||
</div></td></tr><tr class='stab '>
|
||
<td id='structfield.palette_reduction'><code>palette_reduction</code></td><td><div class='docblock'><p>Whether to attempt palette reduction</p>
|
||
</div></td></tr><tr class='stab '>
|
||
<td id='structfield.idat_recoding'><code>idat_recoding</code></td><td><div class='docblock'><p>Whether to perform IDAT recoding
|
||
If any type of reduction is performed, IDAT recoding will be performed
|
||
regardless of this setting</p>
|
||
</div></td></tr><tr class='stab '>
|
||
<td id='structfield.strip'><code>strip</code></td><td><div class='docblock'><p>Which headers to strip from the PNG file, if any</p>
|
||
</div></td></tr><tr class='stab '>
|
||
<td id='structfield.use_heuristics'><code>use_heuristics</code></td><td><div class='docblock'><p>Whether to use heuristics to pick the best filter and compression
|
||
Intended for use with <code>-o 1</code> from the CLI interface</p>
|
||
</div></td></tr></table><h2 id='implementations'>Trait Implementations</h2><h3 id='derived_implementations'>Derived Implementations </h3><h3 class='impl'><code>impl <a class='trait' href='https://doc.rust-lang.org/nightly/core/fmt/trait.Debug.html' title='core::fmt::Debug'>Debug</a> for <a class='struct' href='../oxipng/struct.Options.html' title='oxipng::Options'>Options</a></code></h3><div class='impl-items'><h4 id='method.fmt' class='method'><code>fn <a href='https://doc.rust-lang.org/nightly/core/fmt/trait.Debug.html#method.fmt' class='fnname'>fmt</a>(&self, __arg_0: &mut <a class='struct' href='https://doc.rust-lang.org/nightly/core/fmt/struct.Formatter.html' title='core::fmt::Formatter'>Formatter</a>) -> <a class='type' href='https://doc.rust-lang.org/nightly/core/fmt/type.Result.html' title='core::fmt::Result'>Result</a></code></h4>
|
||
</div><h3 class='impl'><code>impl <a class='trait' href='https://doc.rust-lang.org/nightly/core/clone/trait.Clone.html' title='core::clone::Clone'>Clone</a> for <a class='struct' href='../oxipng/struct.Options.html' title='oxipng::Options'>Options</a></code></h3><div class='impl-items'><h4 id='method.clone' class='method'><code>fn <a href='https://doc.rust-lang.org/nightly/core/clone/trait.Clone.html#method.clone' class='fnname'>clone</a>(&self) -> <a class='struct' href='../oxipng/struct.Options.html' title='oxipng::Options'>Options</a></code></h4>
|
||
<h4 id='method.clone_from' class='method'><span class="since">1.0.0</span><code>fn <a href='https://doc.rust-lang.org/nightly/core/clone/trait.Clone.html#method.clone_from' class='fnname'>clone_from</a>(&mut self, source: &Self)</code></h4>
|
||
</div></section>
|
||
<section id='search' class="content hidden"></section>
|
||
|
||
<section class="footer"></section>
|
||
|
||
<aside id="help" class="hidden">
|
||
<div>
|
||
<h1 class="hidden">Help</h1>
|
||
|
||
<div class="shortcuts">
|
||
<h2>Keyboard Shortcuts</h2>
|
||
|
||
<dl>
|
||
<dt>?</dt>
|
||
<dd>Show this help dialog</dd>
|
||
<dt>S</dt>
|
||
<dd>Focus the search field</dd>
|
||
<dt>⇤</dt>
|
||
<dd>Move up in search results</dd>
|
||
<dt>⇥</dt>
|
||
<dd>Move down in search results</dd>
|
||
<dt>⏎</dt>
|
||
<dd>Go to active search result</dd>
|
||
</dl>
|
||
</div>
|
||
|
||
<div class="infos">
|
||
<h2>Search Tricks</h2>
|
||
|
||
<p>
|
||
Prefix searches with a type followed by a colon (e.g.
|
||
<code>fn:</code>) to restrict the search to a given type.
|
||
</p>
|
||
|
||
<p>
|
||
Accepted types are: <code>fn</code>, <code>mod</code>,
|
||
<code>struct</code>, <code>enum</code>,
|
||
<code>trait</code>, <code>type</code>, <code>macro</code>,
|
||
and <code>const</code>.
|
||
</p>
|
||
|
||
<p>
|
||
Search functions by type signature (e.g.
|
||
<code>vec -> usize</code> or <code>* -> vec</code>)
|
||
</p>
|
||
</div>
|
||
</div>
|
||
</aside>
|
||
|
||
|
||
|
||
<script>
|
||
window.rootPath = "../";
|
||
window.currentCrate = "oxipng";
|
||
window.playgroundUrl = "";
|
||
</script>
|
||
<script src="../jquery.js"></script>
|
||
<script src="../main.js"></script>
|
||
|
||
<script defer src="../search-index.js"></script>
|
||
</body>
|
||
</html> |