Hello.
I am hoping someone can give me some advice.
I need to read in a file, a bitmap image, and make a negative of that file, saving it somewhere new.
Now, reading in the file, and saving it are no problem. I just don't know how to head with the bitmap. I have a bitmap header file with Windows BMP file definitions for OpenGL.
Do I need to take the following code, using it in my program to change each picel to a zero?
I guess to do that I need to read in an instance of BITMAPINFOHEADER?Code:typedef struct /**** BMP file info structure ****/
{
unsigned int biSize; /* Size of info header */
int biWidth; /* Width of image */
int biHeight; /* Height of image */
unsigned short biPlanes; /* Number of color planes */
unsigned short biBitCount; /* Number of bits per pixel */
unsigned int biCompression; /* Type of compression to use */
unsigned int biSizeImage; /* Size of image data */
int biXPelsPerMeter; /* X pixels per meter */
int biYPelsPerMeter; /* Y pixels per meter */
unsigned int biClrUsed; /* Number of colors used */
unsigned int biClrImportant; /* Number of important colors */
} BITMAPINFOHEADER;
I really want to understand how to do this, but if someone could give me some advice, that would be fantastic.
Thanks in advance.
Seán