public class Rasterize extends java.lang.Object
LineSegment
into pixels in the
FrameBuffer
's viewport.
This pipeline stage takes a LineSegment
with vertices
in the logical viewport coordinate system and rasterizezs the
line segment into pixels in the FrameBuffer
's viewport.
Notice that we have two uses of the word "viewport",
FrameBuffer
's pixel
array (so its entries have integer coordinates)
This rasterization algorithm is based on
"Fundamentals of Computer Graphics", 3rd Edition, by Peter Shirley, pages 163-165.
Modifier and Type | Field and Description |
---|---|
static boolean |
debug |
Constructor and Description |
---|
Rasterize() |
Modifier and Type | Method and Description |
---|---|
static void |
rasterize(LineSegment ls,
FrameBuffer fb)
Rasterize a
LineSegment into pixels in the
FrameBuffer 's viewport. |
public static boolean debug
public Rasterize()
public static void rasterize(LineSegment ls, FrameBuffer fb)
LineSegment
into pixels in the
FrameBuffer
's viewport.ls
- LineSegment
to rasterize into the FrameBuffer
fb
- FrameBuffer
to hold rasterized pixels