summaryrefslogtreecommitdiffstats
path: root/src/frontier.rs
blob: 2c6f43a345d1a86f6a81c8a9495decf4f9a01eeb (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
//! Frontiers on which to place pixels.

use crate::color::Rgb8;

/// A frontier of pixels.
pub trait Frontier {
    /// The width of the image.
    fn width(&self) -> u32;

    /// The height of the image.
    fn height(&self) -> u32;

    /// The number of pixels currently on the frontier.
    fn len(&self) -> usize;

    /// Place the given color on the frontier, and return its position.
    fn place(&mut self, rgb8: Rgb8) -> Option<(u32, u32)>;
}