Struct footile::Raster
[−]
[src]
pub struct Raster { pub width: u32, pub height: u32, // some fields omitted }
A raster image to composite plot output.
Example
use footile::{PlotterBuilder, Raster}; let mut p = PlotterBuilder::new().build(); let mut r = Raster::new(p.width(), p.height()); p.pen_width(5f32, false) .move_to(16f32, 48f32) .line_to(32f32, 0f32) .line_to(-16f32, -32f32) .close() .stroke(); r.composite(p.mask(), [208u8, 255u8, 208u8]);
Fields
width: u32
height: u32
Methods
impl Raster
[src]
fn new(width: u32, height: u32) -> Raster
[src]
Create a new raster image.
width
Width in pixels.height
Height in pixels.
fn clear(&mut self)
[src]
Clear all pixels.
fn composite(&mut self, mask: &Mask, clr: [u8; 3])
[src]
Composite a color with a mask.
mask
Mask for compositing.clr
RGB color.
fn write_png(&self, filename: &str) -> Result<()>
[src]
Write the raster to a PNG (portable network graphics) file.
filename
Name of file to write.