arsd.bmp

Basic .bmp file format implementation for arsd.color.MemoryImage. Compare with arsd.png basic functionality.

Members

Functions

readBmp
MemoryImage readBmp(string filename)

Reads a .bmp file from the given filename

readBmp
MemoryImage readBmp(ubyte[] data, bool lookForFileHeader, bool hackAround64BitLongs, bool hasAndMask)

Reads a bitmap out of an in-memory array of data. For example, from the data returned from std.file.read.

readBmpIndirect
MemoryImage readBmpIndirect(void delegate(void*, size_t) fread, bool lookForFileHeader, bool hackAround64BitLongs, bool hasAndMask)

Reads using a delegate to read instead of assuming a direct file. View the source of readBmp's overloads for fairly simple examples of how you can use it

writeBmp
void writeBmp(MemoryImage img, string filename)

Writes the img out to filename, in .bmp format. Writes TrueColorImage out as a 24 bmp and IndexedImage out as an 8 bit bmp. Drops transparency information.

writeBmpIndirect
void writeBmpIndirect(MemoryImage img, void delegate(ubyte) fwrite, bool prependFileHeader)

Writes a bitmap file to a delegate, byte by byte, with data from the given image.

Meta