Skip to main content

PixelSink

Trait PixelSink 

Source
pub trait PixelSink {
    // Required method
    fn put(&mut self, idx: usize, color: u32, dist: f32);
}
Expand description

Per-pixel output target for the DDA renderer.

Abstracts “where does a ray hit go” so the traversal core stays free of framebuffer mechanics. The production impl is RasterSink (raw fb/zb pointers); tests use a recording sink. Only hits are reported — misses (sky) leave the destination untouched, matching the caller-pre-fills-sky convention.

Required Methods§

Source

fn put(&mut self, idx: usize, color: u32, dist: f32)

Record a ray hit at framebuffer index idx (py * pitch + px) with packed ARGB color and perpendicular dist (smaller = closer).

Dyn Compatibility§

This trait is dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§