Rasterization is the process of converting points to discrete pixels.
- The simplest scan-conversion algorithm for line segments
∆y = m∆x
→∆y = m
for (ix=x1; ix <= x2; ix++) {
y += m;
write_pixel(x, round(y), line_color);
}
plotLine(x0,y0, x1,y1)
dx = x1 - x0
dy = y1 - y0
D = 2*dy - dx
y = y0
for x from x0 to x1
plot(x,y)
if D > 0
y = y + 1
D = D - 2*dx
end if
D = D + 2*dy