pub struct Edge {
pub x: F26Dot6,
pub x_increment: F26Dot6,
pub direction: i8,
pub y_max: i32,
pub y_min: i32,
}Expand description
One edge, infinite possibilities
An edge is more than just a line—it’s a promise. It promises that for every scanline it crosses, it knows exactly where to be. We store both its current position and its slope, making rasterization a simple march down the screen.
Fields§
§x: F26Dot6Where we are right now (X position at current scanline)
x_increment: F26Dot6How we move each step down (slope in X per scanline)
direction: i8Which way we’re going (upward fills vs downward carves)
y_max: i32The last scanline where we matter (inclusive)
y_min: i32The first scanline where we appear (inclusive)
Implementations§
Source§impl Edge
impl Edge
Sourcepub fn new(x1: F26Dot6, y1: F26Dot6, x2: F26Dot6, y2: F26Dot6) -> Option<Self>
pub fn new(x1: F26Dot6, y1: F26Dot6, x2: F26Dot6, y2: F26Dot6) -> Option<Self>
Birth of an edge: two points become a rasterization warrior
We transform any two points into a scan-ready edge. Horizontal edges get discarded (they don’t cross scanlines), and everything else gets sorted so we always scan from top to bottom. The result is an edge that knows its purpose from the moment it’s created.
§The Point Partnership
x1, y1- Where the edge begins its journeyx2, y2- Where the edge completes its mission
§Returns
A battle-ready edge, or None if the points refuse to cooperate
Trait Implementations§
impl Copy for Edge
impl Eq for Edge
impl StructuralPartialEq for Edge
Auto Trait Implementations§
impl Freeze for Edge
impl RefUnwindSafe for Edge
impl Send for Edge
impl Sync for Edge
impl Unpin for Edge
impl UnsafeUnpin for Edge
impl UnwindSafe for Edge
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.