Struct footile::Raster [] [src]

pub struct Raster { /* 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)
 .move_to(16f32, 48f32)
 .line_to(32f32, 0f32)
 .line_to(-16f32, -32f32)
 .close()
 .stroke();
r.composite(p.mask(), [208u8, 255u8, 208u8]);

Methods

impl Raster
[src]

[src]

Create a new raster image.

  • width Width in pixels.
  • height Height in pixels.

[src]

Clear all pixels.

[src]

Composite a color with a mask.

  • mask Mask for compositing.
  • clr RGB color.

[src]

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

  • filename Name of file to write.