Aw geez, "four color painthead"... now you want me to convert it to CMYK. I'm trying to answer one question at a time
OK, back from the beginning, yes you did get the basic flow of the program right -- it's moving pixel by pixel in the image and printing the RGB values of that pixel. I don't see any need to copy all that data into a "grid" as you mentioned earlier since that can all be done on the fly as the hardware moves. I was just trying to demonstrate how you can walk through an image and look at those pixel values.
I saw in another thread that someone recommended ghostscript, and this really isn't the way to go. Ghostscript is mainly used when the hardware speaks the standard language of Postscript, which nearly all printers do, but that's completely out of scope for us. Similarly, using vector-based printing (like a plotter) as opposed to raster-based printing (like every other printer) would add massive levels of complexity to the problem. I can't even begin to ponder all of the algorithms used to find the path for the printhead and routines necessary to draw something as simple as an arc, much less optimizing either. "floodfills" are completely out of the question. Leave that stuff to the professionals