BufferStripAlpha

Trait BufferStripAlpha 

Source
pub trait BufferStripAlpha<Pmut, ContainerMut>
where Pmut: Pixel, ContainerMut: DerefMut<Target = [Pmut::Subpixel]> + AsMut<[<Pmut as Pixel>::Subpixel]>,
{ // Required method fn strip_alpha(&mut self) -> Result<(), Error>; }

Required Methods§

Source

fn strip_alpha(&mut self) -> Result<(), Error>

Remove this images alpha channel by setting it to the maximum value for every pixel.

Does not modify the underlying type.

§Errors

NoAlphaChannel: self does not have an alpha channel

§Examples
use image::open;
use image_blend::{BufferStripAlpha};

// Load an image and remove its alpha channel
let mut img2_dynamic = open("test_data/2.png").unwrap();
let mut img2_buffer = img2_dynamic.to_rgba16();
img2_buffer.strip_alpha().unwrap();
img2_buffer.save("tests_out/doctest_buffer_stripalpha_result.png").unwrap();

Implementations on Foreign Types§

Source§

impl<Pmut, ContainerMut> BufferStripAlpha<Pmut, ContainerMut> for ImageBuffer<Pmut, ContainerMut>
where Pmut: Pixel, ContainerMut: DerefMut<Target = [Pmut::Subpixel]> + AsMut<[<Pmut as Pixel>::Subpixel]>,

Source§

fn strip_alpha(&mut self) -> Result<(), Error>

Implementors§