not connected to this, but i wish i would find a c code example on how to draw a line with a width, without antialias while only setting each pixel once. this seems to be a real hard problem.
pascal not C but you should be able to translate it pretty easy.
Alternative is bresenham then for each point iterate a span in the minor axis.