Leptonica  1.82.0
Image processing and image analysis suite
BMP_FileHeader Struct Reference

#include <bmp.h>

Data Fields

l_uint8 bfType [2]
 
l_uint8 bfSize [4]
 
l_uint8 bfReserved1 [2]
 
l_uint8 bfReserved2 [2]
 
l_uint8 bfOffBits [4]
 

Detailed Description

BMP file header

Notes: (1) The bfSize field is stored as a 32 bit integer and includes the size of the BMP_FileHeader, BMP_InfoHeader, the color table (if any), and the size of the DIB bits. (2) The bfOffBits field is also stored as a 32 bit integer and contains the absolute offset in bytes of the image data in this file. Some bmp files have additional data after the BMP_InfoHeader and before the color table (if it exists). However, enabling reading of these files makes the reader vulnerable to various malware attacks. Therefore we do not read bmp files with extra data, and require that the size of the color table in bytes is offset - sizeof(BMP_FileHeader) - sizeof(BMP_InfoHeader) (3) Use arrays of l_uint8[] to make an endianness agnostic access to the BMP_FileHeader easier.

Definition at line 67 of file bmp.h.

Field Documentation

◆ bfOffBits

l_uint8 BMP_FileHeader::bfOffBits[4]

offset from beginning of file

Definition at line 78 of file bmp.h.

◆ bfReserved1

l_uint8 BMP_FileHeader::bfReserved1[2]

don't care (set to 0)

Definition at line 76 of file bmp.h.

◆ bfReserved2

l_uint8 BMP_FileHeader::bfReserved2[2]

don't care (set to 0)

Definition at line 77 of file bmp.h.

◆ bfSize

l_uint8 BMP_FileHeader::bfSize[4]

length of the file; sizeof(BMP_FileHeader) + sizeof(BMP_InfoHeader) + size of optional extra data + size of color table + size of DIB bits

Definition at line 70 of file bmp.h.

◆ bfType

l_uint8 BMP_FileHeader::bfType[2]

file type; must be "BM"

Definition at line 69 of file bmp.h.

Referenced by pixReadMemBmp().


The documentation for this struct was generated from the following file: