Okay, I was given a picture in bitmap format and a very brief explanation on seekp and seekg. And was told to write a program. I am supposed to make overwrite the image as its own negative and output in binary.
I don't know where to even start, I know basic file operations for text files, but this is a bit out of my league. Can I get a logical guide please, or an explanation to get me started? On the following list I astericked what I sorta have coded until know and might be doing correctly.
Ask the user for an input file name * read the input file, * determine the file size * determine the offset (where the pixels start) * determine the width of pixels determine the height of pixels For each scan line, for each pixel in that line, read the pixel (the red, green, and blue values) and convert it to its negative and replace the original pixel
1. is easy.
2. I know I have to loop, but don't know how to get my numbers for the loop. should I open file in binary mode?
3. I am supposing that with sizeof() I can do it.
4. Supposing that with ios::beg I can figure that out.
7. using seek I just have to get and put 255 - color