|
|
<!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 `image` crate."><meta name="keywords" content="rust, rustlang, rust-lang, image"><title>image - Rust</title><link rel="stylesheet" type="text/css" href="../normalize.css"><link rel="stylesheet" type="text/css" href="../rustdoc.css" id="mainThemeStyle"><link rel="stylesheet" type="text/css" href="../dark.css"><link rel="stylesheet" type="text/css" href="../light.css" id="themeStyle"><script src="../storage.js"></script><noscript><link rel="stylesheet" href="../noscript.css"></noscript><link rel="shortcut icon" href="../favicon.ico"><style type="text/css">#crate-search{background-image:url("../down-arrow.svg");}</style></head><body class="rustdoc mod"><!--[if lte IE 8]><div class="warning">This old browser is unsupported and will most likely display funky things.</div><![endif]--><nav class="sidebar"><div class="sidebar-menu">☰</div><a href='../image/index.html'><div class='logo-container'><img src='../rust-logo.png' alt='logo'></div></a><p class='location'>Crate image</p><div class="sidebar-elems"><a id='all-types' href='all.html'><p>See all image's items</p></a><div class="block items"><ul><li><a href="#reexports">Re-exports</a></li><li><a href="#modules">Modules</a></li><li><a href="#structs">Structs</a></li><li><a href="#enums">Enums</a></li><li><a href="#traits">Traits</a></li><li><a href="#functions">Functions</a></li><li><a href="#types">Type Definitions</a></li></ul></div><p class='location'></p><script>window.sidebarCurrent = {name: 'image', ty: 'mod', relpath: '../'};</script></div></nav><div class="theme-picker"><button id="theme-picker" aria-label="Pick another theme!"><img src="../brush.svg" width="18" alt="Pick another theme!"></button><div id="theme-choices"></div></div><script src="../theme.js"></script><nav class="sub"><form class="search-form js-only"><div class="search-container"><div><select id="crate-search"><option value="All crates">All crates</option></select><input class="search-input" name="search" autocomplete="off" spellcheck="false" placeholder="Click or press ‘S’ to search, ‘?’ for more options…" type="search"></div><a id="settings-menu" href="../settings.html"><img src="../wheel.svg" width="18" alt="Change settings"></a></div></form></nav><section id="main" class="content"><h1 class='fqn'><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 class='srclink' href='../src/image/lib.rs.html#1-121' title='goto source code'>[src]</a></span><span class='in-band'>Crate <a class="mod" href=''>image</a></span></h1><div class='docblock'><p>This crate provides native rust implementations of
|
|
|
image encoders and decoders and basic image manipulation
|
|
|
functions.</p>
|
|
|
</div><h2 id='reexports' class='section-header'><a href="#reexports">Re-exports</a></h2>
|
|
|
<table><tr><td><code>pub use color::ColorType::<a class="enum" href="../image/enum.ColorType.html" title="enum image::ColorType">Gray</a>;</code></td></tr><tr><td><code>pub use color::ColorType::<a class="enum" href="../image/enum.ColorType.html" title="enum image::ColorType">GrayA</a>;</code></td></tr><tr><td><code>pub use color::ColorType::<a class="enum" href="../image/enum.ColorType.html" title="enum image::ColorType">Palette</a>;</code></td></tr><tr><td><code>pub use color::ColorType::<a class="enum" href="../image/enum.ColorType.html" title="enum image::ColorType">RGB</a>;</code></td></tr><tr><td><code>pub use color::ColorType::<a class="enum" href="../image/enum.ColorType.html" title="enum image::ColorType">RGBA</a>;</code></td></tr><tr><td><code>pub use color::ColorType::<a class="enum" href="../image/enum.ColorType.html" title="enum image::ColorType">BGR</a>;</code></td></tr><tr><td><code>pub use color::ColorType::<a class="enum" href="../image/enum.ColorType.html" title="enum image::ColorType">BGRA</a>;</code></td></tr><tr><td><code>pub use imageops::FilterType::<a class="enum" href="../image/enum.FilterType.html" title="enum image::FilterType">CatmullRom</a>;</code></td></tr><tr><td><code>pub use imageops::FilterType::<a class="enum" href="../image/enum.FilterType.html" title="enum image::FilterType">Gaussian</a>;</code></td></tr><tr><td><code>pub use imageops::FilterType::<a class="enum" href="../image/enum.FilterType.html" title="enum image::FilterType">Lanczos3</a>;</code></td></tr><tr><td><code>pub use imageops::FilterType::<a class="enum" href="../image/enum.FilterType.html" title="enum image::FilterType">Nearest</a>;</code></td></tr><tr><td><code>pub use imageops::FilterType::<a class="enum" href="../image/enum.FilterType.html" title="enum image::FilterType">Triangle</a>;</code></td></tr><tr><td><code>pub use image::ImageFormat::<a class="enum" href="../image/enum.ImageFormat.html" title="enum image::ImageFormat">BMP</a>;</code></td></tr><tr><td><code>pub use image::ImageFormat::<a class="enum" href="../image/enum.ImageFormat.html" title="enum image::ImageFormat">GIF</a>;</code></td></tr><tr><td><code>pub use image::ImageFormat::<a class="enum" href="../image/enum.ImageFormat.html" title="enum image::ImageFormat">ICO</a>;</code></td></tr><tr><td><code>pub use image::ImageFormat::<a class="enum" href="../image/enum.ImageFormat.html" title="enum image::ImageFormat">JPEG</a>;</code></td></tr><tr><td><code>pub use image::ImageFormat::<a class="enum" href="../image/enum.ImageFormat.html" title="enum image::ImageFormat">PNG</a>;</code></td></tr><tr><td><code>pub use image::ImageFormat::<a class="enum" href="../image/enum.ImageFormat.html" title="enum image::ImageFormat">PNM</a>;</code></td></tr><tr><td><code>pub use image::ImageFormat::<a class="enum" href="../image/enum.ImageFormat.html" title="enum image::ImageFormat">WEBP</a>;</code></td></tr><tr><td><code>pub use flat::<a class="struct" href="../image/flat/struct.FlatSamples.html" title="struct image::flat::FlatSamples">FlatSamples</a>;</code></td></tr><tr><td><code>pub use dynimage::DynamicImage::<a class="enum" href="../image/enum.DynamicImage.html" title="enum image::DynamicImage">ImageLuma8</a>;</code></td></tr><tr><td><code>pub use dynimage::DynamicImage::<a class="enum" href="../image/enum.DynamicImage.html" title="enum image::DynamicImage">ImageLumaA8</a>;</code></td></tr><tr><td><code>pub use dynimage::DynamicImage::<a class="enum" href="../image/enum.DynamicImage.html" title="enum image::DynamicImage">ImageRgb8</a>;</code></td></tr><tr><td><code>pub use dynimage::DynamicImage::<a class="enum" href="../image/enum.DynamicImage.html" title="enum image::DynamicImage">ImageRgba8</a>;</code></td></tr><tr><td><code>pub use dynimage::DynamicImage::<a class="enum" href="../image/enum.DynamicImage.html" title="enum image::DynamicImage">ImageBgr8</a>;</code></td></tr><tr><td><code>pub use dynimage::DynamicImage::<a class="enum" href="../image/enum.DynamicImage.html" title="enum image::DynamicImage">ImageBgra8</a>;</code></td></tr></table><h2 id='modules' class='section-header'><a href="#modules">Modules</a></h2>
|
|
|
<table><tr class='module-item'><td><a class="mod" href="bmp/index.html" title='image::bmp mod'>bmp</a></td><td class='docblock-short'><p>Decoding and Encoding of BMP Images</p>
|
|
|
</td></tr><tr class='module-item'><td><a class="mod" href="dxt/index.html" title='image::dxt mod'>dxt</a></td><td class='docblock-short'><p>Decoding of DXT (S3TC) compression</p>
|
|
|
</td></tr><tr class='module-item'><td><a class="mod" href="flat/index.html" title='image::flat mod'>flat</a></td><td class='docblock-short'><p>Image representations for ffi.</p>
|
|
|
</td></tr><tr class='module-item'><td><a class="mod" href="gif/index.html" title='image::gif mod'>gif</a></td><td class='docblock-short'><p>Decoding of GIF Images</p>
|
|
|
</td></tr><tr class='module-item'><td><a class="mod" href="hdr/index.html" title='image::hdr mod'>hdr</a></td><td class='docblock-short'><p>Decoding of Radiance HDR Images</p>
|
|
|
</td></tr><tr class='module-item'><td><a class="mod" href="ico/index.html" title='image::ico mod'>ico</a></td><td class='docblock-short'><p>Decoding and Encoding of ICO files</p>
|
|
|
</td></tr><tr class='module-item'><td><a class="mod" href="imageops/index.html" title='image::imageops mod'>imageops</a></td><td class='docblock-short'><p>Image Processing Functions</p>
|
|
|
</td></tr><tr class='module-item'><td><a class="mod" href="jpeg/index.html" title='image::jpeg mod'>jpeg</a></td><td class='docblock-short'><p>Decoding and Encoding of JPEG Images</p>
|
|
|
</td></tr><tr class='module-item'><td><a class="mod" href="math/index.html" title='image::math mod'>math</a></td><td class='docblock-short'><p>Mathematical helper functions and types.</p>
|
|
|
</td></tr><tr class='module-item'><td><a class="mod" href="png/index.html" title='image::png mod'>png</a></td><td class='docblock-short'><p>Decoding and Encoding of PNG Images</p>
|
|
|
</td></tr><tr class='module-item'><td><a class="mod" href="pnm/index.html" title='image::pnm mod'>pnm</a></td><td class='docblock-short'><p>Decoding of netpbm image formats (pbm, pgm, ppm and pam).</p>
|
|
|
</td></tr><tr class='module-item'><td><a class="mod" href="tga/index.html" title='image::tga mod'>tga</a></td><td class='docblock-short'><p>Decoding of TGA Images</p>
|
|
|
</td></tr><tr class='module-item'><td><a class="mod" href="tiff/index.html" title='image::tiff mod'>tiff</a></td><td class='docblock-short'><p>Decoding and Encoding of TIFF Images</p>
|
|
|
</td></tr><tr class='module-item'><td><a class="mod" href="webp/index.html" title='image::webp mod'>webp</a></td><td class='docblock-short'><p>Decoding of Webp Images</p>
|
|
|
</td></tr></table><h2 id='structs' class='section-header'><a href="#structs">Structs</a></h2>
|
|
|
<table><tr class='module-item'><td><a class="struct" href="struct.Bgr.html" title='image::Bgr struct'>Bgr</a></td><td class='docblock-short'><p>BGR colors</p>
|
|
|
</td></tr><tr class='module-item'><td><a class="struct" href="struct.Bgra.html" title='image::Bgra struct'>Bgra</a></td><td class='docblock-short'><p>BGR colors + alpha channel</p>
|
|
|
</td></tr><tr class='module-item'><td><a class="struct" href="struct.Frame.html" title='image::Frame struct'>Frame</a></td><td class='docblock-short'><p>A single animation frame</p>
|
|
|
</td></tr><tr class='module-item'><td><a class="struct" href="struct.Frames.html" title='image::Frames struct'>Frames</a></td><td class='docblock-short'><p>An implementation dependent iterator, reading the frames as requested</p>
|
|
|
</td></tr><tr class='module-item'><td><a class="struct" href="struct.ImageBuffer.html" title='image::ImageBuffer struct'>ImageBuffer</a></td><td class='docblock-short'><p>Generic image buffer</p>
|
|
|
</td></tr><tr class='module-item'><td><a class="struct" href="struct.Luma.html" title='image::Luma struct'>Luma</a></td><td class='docblock-short'><p>Grayscale colors</p>
|
|
|
</td></tr><tr class='module-item'><td><a class="struct" href="struct.LumaA.html" title='image::LumaA struct'>LumaA</a></td><td class='docblock-short'><p>Grayscale colors + alpha channel</p>
|
|
|
</td></tr><tr class='module-item'><td><a class="struct" href="struct.MutPixels.html" title='image::MutPixels struct'>MutPixels</a></td><td class='docblock-short'><p>Mutable pixel iterator</p>
|
|
|
</td></tr><tr class='module-item'><td><a class="struct" href="struct.Pixels.html" title='image::Pixels struct'>Pixels</a></td><td class='docblock-short'><p>Immutable pixel iterator</p>
|
|
|
</td></tr><tr class='module-item'><td><a class="struct" href="struct.Rgb.html" title='image::Rgb struct'>Rgb</a></td><td class='docblock-short'><p>RGB colors</p>
|
|
|
</td></tr><tr class='module-item'><td><a class="struct" href="struct.Rgba.html" title='image::Rgba struct'>Rgba</a></td><td class='docblock-short'><p>RGB colors + alpha channel</p>
|
|
|
</td></tr><tr class='module-item'><td><a class="struct" href="struct.SubImage.html" title='image::SubImage struct'>SubImage</a></td><td class='docblock-short'><p>A View into another image</p>
|
|
|
</td></tr></table><h2 id='enums' class='section-header'><a href="#enums">Enums</a></h2>
|
|
|
<table><tr class='module-item'><td><a class="enum" href="enum.ColorType.html" title='image::ColorType enum'>ColorType</a></td><td class='docblock-short'><p>An enumeration over supported color types and their bit depths</p>
|
|
|
</td></tr><tr class='module-item'><td><a class="enum" href="enum.DynamicImage.html" title='image::DynamicImage enum'>DynamicImage</a></td><td class='docblock-short'><p>A Dynamic Image</p>
|
|
|
</td></tr><tr class='module-item'><td><a class="enum" href="enum.FilterType.html" title='image::FilterType enum'>FilterType</a></td><td class='docblock-short'><p>Available Sampling Filters</p>
|
|
|
</td></tr><tr class='module-item'><td><a class="enum" href="enum.ImageError.html" title='image::ImageError enum'>ImageError</a></td><td class='docblock-short'><p>An enumeration of Image errors</p>
|
|
|
</td></tr><tr class='module-item'><td><a class="enum" href="enum.ImageFormat.html" title='image::ImageFormat enum'>ImageFormat</a></td><td class='docblock-short'><p>An enumeration of supported image formats.
|
|
|
Not all formats support both encoding and decoding.</p>
|
|
|
</td></tr><tr class='module-item'><td><a class="enum" href="enum.ImageOutputFormat.html" title='image::ImageOutputFormat enum'>ImageOutputFormat</a></td><td class='docblock-short'><p>An enumeration of supported image formats for encoding.</p>
|
|
|
</td></tr></table><h2 id='traits' class='section-header'><a href="#traits">Traits</a></h2>
|
|
|
<table><tr class='module-item'><td><a class="trait" href="trait.AnimationDecoder.html" title='image::AnimationDecoder trait'>AnimationDecoder</a></td><td class='docblock-short'><p>AnimationDecoder trait</p>
|
|
|
</td></tr><tr class='module-item'><td><a class="trait" href="trait.ConvertBuffer.html" title='image::ConvertBuffer trait'>ConvertBuffer</a></td><td class='docblock-short'><p>Provides color conversions for whole image buffers.</p>
|
|
|
</td></tr><tr class='module-item'><td><a class="trait" href="trait.GenericImage.html" title='image::GenericImage trait'>GenericImage</a></td><td class='docblock-short'><p>A trait for manipulating images.</p>
|
|
|
</td></tr><tr class='module-item'><td><a class="trait" href="trait.GenericImageView.html" title='image::GenericImageView trait'>GenericImageView</a></td><td class='docblock-short'><p>Trait to inspect an image.</p>
|
|
|
</td></tr><tr class='module-item'><td><a class="trait" href="trait.ImageDecoder.html" title='image::ImageDecoder trait'>ImageDecoder</a></td><td class='docblock-short'><p>The trait that all decoders implement</p>
|
|
|
</td></tr><tr class='module-item'><td><a class="trait" href="trait.ImageDecoderExt.html" title='image::ImageDecoderExt trait'>ImageDecoderExt</a></td><td class='docblock-short'><p>ImageDecoderExt trait</p>
|
|
|
</td></tr><tr class='module-item'><td><a class="trait" href="trait.Pixel.html" title='image::Pixel trait'>Pixel</a></td><td class='docblock-short'><p>A generalized pixel.</p>
|
|
|
</td></tr><tr class='module-item'><td><a class="trait" href="trait.Primitive.html" title='image::Primitive trait'>Primitive</a></td><td class='docblock-short'><p>Primitive trait from old stdlib</p>
|
|
|
</td></tr></table><h2 id='functions' class='section-header'><a href="#functions">Functions</a></h2>
|
|
|
<table><tr class='module-item'><td><a class="fn" href="fn.Bgr.html" title='image::Bgr fn'>Bgr</a></td><td class='docblock-short'></td></tr><tr class='module-item'><td><a class="fn" href="fn.Bgra.html" title='image::Bgra fn'>Bgra</a></td><td class='docblock-short'></td></tr><tr class='module-item'><td><a class="fn" href="fn.Luma.html" title='image::Luma fn'>Luma</a></td><td class='docblock-short'></td></tr><tr class='module-item'><td><a class="fn" href="fn.LumaA.html" title='image::LumaA fn'>LumaA</a></td><td class='docblock-short'></td></tr><tr class='module-item'><td><a class="fn" href="fn.Rgb.html" title='image::Rgb fn'>Rgb</a></td><td class='docblock-short'></td></tr><tr class='module-item'><td><a class="fn" href="fn.Rgba.html" title='image::Rgba fn'>Rgba</a></td><td class='docblock-short'></td></tr><tr class='module-item'><td><a class="fn" href="fn.guess_format.html" title='image::guess_format fn'>guess_format</a></td><td class='docblock-short'><p>Guess image format from memory block</p>
|
|
|
</td></tr><tr class='module-item'><td><a class="fn" href="fn.load.html" title='image::load fn'>load</a></td><td class='docblock-short'><p>Create a new image from a Reader</p>
|
|
|
</td></tr><tr class='module-item'><td><a class="fn" href="fn.load_from_memory.html" title='image::load_from_memory fn'>load_from_memory</a></td><td class='docblock-short'><p>Create a new image from a byte slice</p>
|
|
|
</td></tr><tr class='module-item'><td><a class="fn" href="fn.load_from_memory_with_format.html" title='image::load_from_memory_with_format fn'>load_from_memory_with_format</a></td><td class='docblock-short'><p>Create a new image from a byte slice</p>
|
|
|
</td></tr><tr class='module-item'><td><a class="fn" href="fn.open.html" title='image::open fn'>open</a></td><td class='docblock-short'><p>Open the image located at the path specified.
|
|
|
The image's format is determined from the path's file extension.</p>
|
|
|
</td></tr><tr class='module-item'><td><a class="fn" href="fn.save_buffer.html" title='image::save_buffer fn'>save_buffer</a></td><td class='docblock-short'><p>Saves the supplied buffer to a file at the path specified.</p>
|
|
|
</td></tr></table><h2 id='types' class='section-header'><a href="#types">Type Definitions</a></h2>
|
|
|
<table><tr class='module-item'><td><a class="type" href="type.GrayAlphaImage.html" title='image::GrayAlphaImage type'>GrayAlphaImage</a></td><td class='docblock-short'><p>Sendable grayscale + alpha channel image buffer</p>
|
|
|
</td></tr><tr class='module-item'><td><a class="type" href="type.GrayImage.html" title='image::GrayImage type'>GrayImage</a></td><td class='docblock-short'><p>Sendable grayscale image buffer</p>
|
|
|
</td></tr><tr class='module-item'><td><a class="type" href="type.ImageResult.html" title='image::ImageResult type'>ImageResult</a></td><td class='docblock-short'><p>Result of an image decoding/encoding process</p>
|
|
|
</td></tr><tr class='module-item'><td><a class="type" href="type.RgbImage.html" title='image::RgbImage type'>RgbImage</a></td><td class='docblock-short'><p>Sendable Rgb image buffer</p>
|
|
|
</td></tr><tr class='module-item'><td><a class="type" href="type.RgbaImage.html" title='image::RgbaImage type'>RgbaImage</a></td><td class='docblock-short'><p>Sendable Rgb + alpha channel image buffer</p>
|
|
|
</td></tr></table></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><kbd>?</kbd></dt><dd>Show this help dialog</dd><dt><kbd>S</kbd></dt><dd>Focus the search field</dd><dt><kbd>↑</kbd></dt><dd>Move up in search results</dd><dt><kbd>↓</kbd></dt><dd>Move down in search results</dd><dt><kbd>↹</kbd></dt><dd>Switch tab</dd><dt><kbd>⏎</kbd></dt><dd>Go to active search result</dd><dt><kbd>+</kbd></dt><dd>Expand all sections</dd><dt><kbd>-</kbd></dt><dd>Collapse all sections</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><p>Search multiple things at once by splitting your query with comma (e.g., <code>str,u8</code> or <code>String,struct:Vec,test</code>)</p></div></div></aside><script>window.rootPath = "../";window.currentCrate = "image";</script><script src="../aliases.js"></script><script src="../main.js"></script><script defer src="../search-index.js"></script></body></html> |