The instructions that were given to me were very vague and I'm completely lost on what I'm supposed to do. Need some help. I'll try to explain and hopefully someone can help me.
I need to generate a ppm file of specified a width and height when you set color of the pixel (i,j) with the value col as in:
float col = float (((i & 0x08) == 0) ^ ((j & 0x08) == 0));
you may want to use the following structure for RGB color:
struct RGB {
float r;
float g;
float b;
};
Each element in the array is in the range of [0.0, 1.0] and must be converted to [0, 255] before writing to the file.
This is about as much information as I have. I really just lost on what he actually wants me to do. This may be enough information for someone more experienced but not for me. Can someone elaborate on this. Also, what the hell does that first formula/code snippet do?
I still dont what the i and j are or what the formula is for or how to generate the values to write to the 2d array of RGB!?!?