[][src]Struct footile::Mask

pub struct Mask { /* fields omitted */ }

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

impl Send for Mask

impl Sync for Mask

Blanket Implementations

impl<T> From for T
[src]

impl<T, U> Into for T where
    U: From<T>, 
[src]

impl<T, U> TryFrom for T where
    T: From<U>, 
[src]

type Error = !

🔬 This is a nightly-only experimental API. (try_from)

The type returned in the event of a conversion error.

impl<T> Borrow for T where
    T: ?Sized
[src]

impl<T> BorrowMut for T where
    T: ?Sized
[src]

impl<T, U> TryInto for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

🔬 This is a nightly-only experimental API. (try_from)

The type returned in the event of a conversion error.

impl<T> Any for T where
    T: 'static + ?Sized
[src]