Bitmap

  1. Consider the Bitmap File Format, which consists of a 14-byte header and a 40-byte information header.
  2. We may define a struct to assist us handling the header:
    
       struct bitmap_file_header
       {
          unsigned short type;
          unsigned int   size;
          unsigned short reserved1;
          unsigned short reserved2;
          unsigned int   off_bits;
       };
    
    
  3. We may define another struct to assist us handling the information header
    
       struct bitmap_information_header
       {
          unsigned int   size;
          unsigned int   width;
          unsigned int   height;
          unsigned short planes;
          unsigned short bit_count;
          unsigned int   compression;
          unsigned int   size_image;
          unsigned int   x_pels_per_meter;
          unsigned int   y_pels_per_meter;
          unsigned int   clr_used;
          unsigned int   clr_important;
       };