I am writing a program to rotate an image. The Image format is Bitmap and according to the http://en.wikipedia.org/wiki/BMP_file_format the rowsize of a bitmap image should be multiple of 4. My input image isn't so and when I write new image to a file, it isn't what it should be. Of course first I read the data part to an array of pixels and after that I rotate that array. If more information is needed, please tell me.
Of course my previous problem had been solved but I don't know why c++ count the size of this structure 56 byte ?
Here is the structure:
struct Bitmap_Header
{
char H_Signature[2];
unsigned int H_Filesize;
int H_Reserved;
unsigned int H_DataOffset;
unsigned int H_Size;
int H_Width;
int H_Height;
short int H_Planes;
short int H_BitCount;
unsigned int H_Compression;
unsigned int H_Imagesize;
int H_XPixelsPerM;
int H_YPixelsPerM;
unsigned int H_ColorsUsed;
unsigned int H_ColorsImportant;
};