Skip to content

Commit

Permalink
Merge pull request #1253 from robyoung/issue-1252-add-doc-to-ImageBuffer
Browse files Browse the repository at this point in the history
Direct user to DynamicImage for converting
  • Loading branch information
HeroicKatora committed Jun 5, 2020
2 parents 2276d72 + 1face8f commit c38ee98
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions src/buffer.rs
Expand Up @@ -416,6 +416,8 @@ where
/// [`RgbImage`]: type.RgbImage.html
/// [`GrayImage`]: type.GrayImage.html
///
/// To convert between images of different Pixel types use [`DynamicImage`]: enum.DynamicImage.html
///
/// ## Examples
///
/// Create a simple canvas and paint a small cross.
Expand Down Expand Up @@ -449,6 +451,15 @@ where
///
/// image::imageops::overlay(&mut img, &on_top, 128, 128);
/// ```
///
/// Convert an RgbaImage to a GrayImage.
///
/// ```no_run
/// use image::{open, DynamicImage};
///
/// let rgba = open("path/to/some.png").unwrap().into_rgba();
/// let gray = DynamicImage::ImageRgba8(rgba).into_luma();
/// ```
#[derive(Debug, Hash, PartialEq, Eq)]
pub struct ImageBuffer<P: Pixel, Container> {
width: u32,
Expand Down

0 comments on commit c38ee98

Please sign in to comment.