BMP

Implements *.BMP file handling.

Constructors

this
this()

Creates a blank for loading.

this
this(IImageData imgDat, IPalette pal, BMPVersion vers)

Creates a new bitmap from supplied data.

Members

Enums

BMPVersion
enum BMPVersion

Mostly used during construction of new instances and version changing.

CompressionType
enum CompressionType

Stores compression type identificator.

Functions

getBitdepth
ubyte getBitdepth()
Undocumented in source. Be warned that the author may not have intended to support it.
getPaletteBitdepth
ubyte getPaletteBitdepth()
Undocumented in source. Be warned that the author may not have intended to support it.
getPalettePixelFormat
uint getPalettePixelFormat()
Undocumented in source. Be warned that the author may not have intended to support it.
getPixelFormat
uint getPixelFormat()
Undocumented in source. Be warned that the author may not have intended to support it.
height
uint height()
Undocumented in source. Be warned that the author may not have intended to support it.
isIndexed
bool isIndexed()
Undocumented in source. Be warned that the author may not have intended to support it.
save
void save(F file)

Saves the image into the given file. Only uncompressed bitmaps are supported currently.

width
uint width()
Undocumented in source. Be warned that the author may not have intended to support it.

Static functions

load
BMP load(F file)

Loads an image from a file. Only uncompressed and 8bit RLE are supported.

Static variables

BMPTYPE
enum ushort BMPTYPE;

Defines later versions of the file

WIN1XTYPE
enum ushort WIN1XTYPE;

Defines Windows 1.x files

Structs

Win1xHeader
struct Win1xHeader

Windows 1.x header

Win2xBitmapHeader
struct Win2xBitmapHeader

Bitmap header for Win 2.x

Win3xBitmapHeader
struct Win3xBitmapHeader

Bitmap header for Win 3.x and 4.x

Win4xBitmapHeaderExt
struct Win4xBitmapHeaderExt

Bitmap header extension for Win 4.x

WinBMPHeader
struct WinBMPHeader

Header used in later versions

WinNTBitmapHeaderExt
struct WinNTBitmapHeaderExt

Bitmap header extension for WinNT

Unions

BitmapHeader
union BitmapHeader
Undocumented in source.
Header
union Header
Undocumented in source.
HeaderExt
union HeaderExt
Undocumented in source.

Variables

bitmapHeader
BitmapHeader bitmapHeader;
Undocumented in source.
bitmapHeaderLength
uint bitmapHeaderLength;
Undocumented in source.
fileVersionIndicator
ushort fileVersionIndicator;

Null if Win1x

header
Header header;
Undocumented in source.
headerExt
HeaderExt headerExt;
Undocumented in source.

Inherited Members

From Image

_palette
IPalette _palette;

Contains palette data and information

_imageData
IImageData _imageData;

Contains image data and information.

mod
ubyte mod;

used for fast access of indexes DEPRECATED!

shift
ubyte shift;

used for fast access of indexes DEPRECATED!

width
uint width [@property getter]

Returns the width of the image in pixels.

height
uint height [@property getter]

Returns the height of the image in pixels.

isIndexed
bool isIndexed [@property getter]

Returns true if the image is indexed.

getBitdepth
ubyte getBitdepth [@property getter]

Returns the number of bits used per sample.

getPaletteBitdepth
ubyte getPaletteBitdepth [@property getter]

Returns the number of bits used per colormap entry.

getPixelFormat
uint getPixelFormat [@property getter]

Returns the pixelformat of the image. See enumerator PixelFormat for more info.

getPalettePixelFormat
uint getPalettePixelFormat [@property getter]

Returns the pixelformat of the palette. See enumerator PixelFormat for more info.

backgroundColorIndex
int backgroundColorIndex [@property getter]

Returns the background color index if there's any. Returns -1 if there's no background color, -2 if background color is not indexed.

backgroundColor
ARGB8888 backgroundColor [@property getter]

Returns the background color if there's any, or a default value otherwise.

getBitplanes
ubyte getBitplanes()

Returns the number of planes the image have. Default is one.

palette
IPalette palette()

Returns a palette range, which can be used to read the palette.

imageData
IImageData imageData()

Returns the image data.

readPixel
ARGB8888 readPixel(uint x, uint y)

Reads a single 32bit pixel. If the image is indexed, a color lookup will be done.

readPalette
ARGB8888 readPalette(size_t index)

Looks up the index on the palette, then returns the color value as a 32 bit value.

flipVertical
void flipVertical()

Flips the image on the vertical axis. Useful to set images to the correct top-left screen origin point.

flipHorizontal
void flipHorizontal()

Flips the image on the vertical axis. Useful to set images to the correct top-left screen origin point.

topOrigin
bool topOrigin()

Returns true if the image originates from the top

rightSideOrigin
bool rightSideOrigin()

Returns true if the image originates from the right

Meta