Line segment rasterization with pixel-perfect clipping.