Module Bmp
val check_header : string -> Images.header
Checks the file header
val load : string -> Images.load_option list -> Images.t
Loads a bmp image.
val save : string -> Images.save_option list -> Images.t -> unit
Save an image in bmp format file.
type bmp
=
{
bmpFileHeader : bitmapfileheader;
Bytes <0 14<
bmpInfoHeader : bitmapinfoheader;
Bytes <14 54<
bmpRgbQuad : Images.rgb array;
Bytes <54 ...
bmpBytes : bytes;
Bytes <bfOffBits ...
}
The Caml representation of a bmp bit map image. Fields are Caml values, the decoded versions of raw data in the file.
Structure of bitmaps files on disk :
- BITMAPFILEHEADER : bytes 0 to 14 excluded
- BITMAPINFOHEADER : bytes 14 to 54 excluded
- RGBQUAD
: color map
- BYTES
: bit map
and bitmapfileheader
=
{
bfType : int;
Bytes <0 2<
bfSize : int;
Bytes <2 6<
bfReserved1 : int;
Bytes <6 8<
bfReserved2 : int;
Bytes <8 10<
bfOffBits : int;
Bytes <10 14<
}
and bitmapinfoheader
=
{
biSize : int;
Bytes <14 18<
biWidth : int;
Bytes <18 22<
biHeight : int;
Bytes <22 26<
biPlanes : int;
Bytes <26 28<
biBitCount : bibitcount;
Bytes <28 30<
biCompression : bicompression;
Bytes <30 34<
biSizeImage : int;
Bytes <34 38<
biXPelsPerMeter : int;
Bytes <38 42<
biYPelsPerMeter : int;
Bytes <42 46<
biClrUsed : int;
Bytes <46 50<
biClrImportant : int;
Bytes <50 54<
}
and bicompression
=
and bibitcount
=