Struct footile::Raster

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

A raster image.

Example

use footile::{Color,PathBuilder,Plotter,Raster};
let path = PathBuilder::new().pen_width(5f32)
                       .move_to(16f32, 48f32)
                       .line_to(32f32, 0f32)
                       .line_to(-16f32, -32f32)
                       .close().build();
let mut p = Plotter::new(100, 100);
let mut r = Raster::new(p.width(), p.height());
p.stroke(&path);
r.color_over(p.mask(), Color::rgb(208, 255, 208));

Implementations

Create a new raster image.

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

Clear all pixels.

Composite a color with a mask, using “over”.

  • mask Mask for compositing.
  • clr Color to composite.

Write the raster 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.