[−][src]Struct footile::Mask
A Mask is an image with only an 8-bit alpha channel.
It can be obtained from a Plotter after plotting. A Raster can be composited with a Mask.
Example
use footile::{PathBuilder,Plotter}; let path = PathBuilder::new() .move_to(10.0, 10.0) .line_to(90.0, 90.0) .build(); let mut p = Plotter::new(100, 100); let mask = p.stroke(&path);
Methods
impl Mask
[src]
pub fn pixels(&self) -> &[u8]
[src]
Get pixel slice
pub fn write_pgm(&self, filename: &str) -> Result<()>
[src]
Write the mask to a PGM (portable gray map) file.
filename
Name of file to write.
pub fn write_png(&self, filename: &str) -> Result<()>
[src]
Write the mask to a PNG (portable network graphics) file.
filename
Name of file to write.
Auto Trait Implementations
Blanket Implementations
impl<T, U> Into for T where
U: From<T>,
[src]
U: From<T>,
impl<T> From for T
[src]
impl<T, U> TryFrom for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T> Borrow for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T, U> TryInto for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,
type Error = <U as TryFrom<T>>::Error
The type returned in the event of a conversion error.
fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>
[src]
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,