The first thing the HGP does is to completely read in the binary starfield image and store it in memory. The program also creates a blank grayscale image that will serve as the in memory hyperspace image, i.e. HI. It is the HI that will actually have the star streaks painted on it. The HI is the same size as the input binary starfield image except that it has an extra 40 pixel wide boarder completely around it so that the streaks can extend beyond the edge of the actual resulting image. This boarder will eventually be shaved off when the HI is actually written out to the disk.
The next step in the process is having the HGP identify the locations and sizes of all the stars in the binary starfield input image. This image processing task is not as easy as you might think. We humans are very visual creatures and we can process an image almost instantly because we process the whole image at once. We automatically see all the edges making up all the shapes in the scene being viewed. But computers can only look at things one pixel at a time so it is much more difficult for the machine to identify individual items in an image. Our task is somewhat simplified though because our image is only made up of pixels that can either be black or white.
Before we proceed, I made several assumptions that made the coding simpler. Assumption one is that for all the following discussion, we are going to be working in quadrant one of the 2D X-Y coordinate system. That means that increasing X axis values go to the right and increasing Y axis values go vertically up. Assumption two is that no star will overlap the pixel that represents the hyperspace jump point location on the input image. This will prevent undefined line segments from being specified. Assumption three is that no minimum bounding rectangle, i.e. MBR, of any two stars will overlap or even touch each other. This will prevent the HGP from thinking that two stars that are very close to each other are actually the same star. See the below diagram.