Struct footile::Mask

source ·
pub struct Mask { /* private fields */ }
Expand description

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(10f32, 10f32)
                       .line_to(90f32, 90f32)
                       .build();
let mut p = Plotter::new(100, 100);
p.stroke(&path);
let m = p.mask();

Implementations

Get pixel slice

Write the mask to a PGM (portable gray map) file.

  • filename Name of file to write.

Write the mask to a PNG (portable network graphics) file.

  • filename Name of file to write.

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more
Immutably borrows from an owned value. Read more
Mutably borrows from an owned value. Read more

Returns the argument unchanged.

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

The type returned in the event of a conversion error.
Performs the conversion.
The type returned in the event of a conversion error.
Performs the conversion.