Classes | Public Types | Public Member Functions | Static Public Member Functions | Protected Member Functions
imagen::iBMP Class Reference

Reads / writes Microsoft Windows Bitmap files. More...

#include <iBMP.h>

Inheritance diagram for imagen::iBMP:
imagen::iAbstractImage

List of all members.

Classes

struct  BITMAPCOREHEADER
 Bitmap Core Header (Microsoft Windows 2.x)
struct  BITMAPFILEHEADER
 Bitmap File Header.
struct  BITMAPINFOHEADER
 Bitmap Info Header (Microsoft Windows 3.x)
struct  BITMAPV4HEADER
 Bitmap Version 4 Header (Microsoft Windows 95)
struct  BITMAPV5HEADER
 Bitmap Version 5 Header (Microsoft Windows 98+)

Public Types

enum  BMPCompressFmt {
  BI_RGB = 0, BI_RLE8 = 1, BI_RLE4 = 2, BI_BITFIELDS = 3,
  BI_JPEG = 4, BI_PNG = 5
}
enum  BMPRenderingIntent { RI_COLORIMETRIC = 0, RI_BUSINESS = 1, RI_GRAPHICS = 2, RI_IMAGES = 3 }
enum  BMPColorSpace { CS_CALIBRATED_RGB = 0, CS_sRGB = 1, CS_CMYK = 2 }

Public Member Functions

 iBMP ()
 Constructs a null image.
 iBMP (const iBMP &img)
 Copy constructor.
 iBMP (const iAbstractImage &img)
 iAbstractImage copy constructor.
 iBMP (int w, int h, iImageFormat f)
 Constructs an image with the given size and format.
 iBMP (Iubyte *d, int w, int h, iImageFormat f, int b)
 Constructs an image using an existing memory buffer.
 iBMP (const char *filename)
 Loads a BMP image file from disk.
 iBMP (Iubyte *buf, int len)
 Loads a BMP image from an existing memory buffer.
 iBMP (iDataStream *s)
 Loads a BMP image using an existing data stream.
 ~iBMP ()
 Destructor.
void clear ()
 Detaches this image from the image data and resets all data members to their initial values.
bool isFormatSupported (iImageFormat fmt) const
 Checks whether or not a given image color format is supported by this image type.
iBMPoperator= (const iBMP &img)
iBMPoperator= (const iAbstractImage &img)

Static Public Member Functions

static bool isValid (iDataStream *s)

Protected Member Functions

void init ()
bool loadImage ()
bool saveImage ()

Detailed Description

Reads / writes Microsoft Windows Bitmap files.

Extensions:
.bmp and .dib

Image types:
Indexed and truecolor

Pixel Depths:
1-bit, 4-bit, 8-bit, 16-bit, 24-bit, and 32-bit

TODO:
Read/write 1-bit and 4-bit images.
Read/write support for all compression types.

This class focuses on the Microsoft Windows Bitmap file and does not have any specific support for OS/2 bitmaps, although it might be able to read some of them.


Member Enumeration Documentation

Enumerator:
BI_RGB 
BI_RLE8 
BI_RLE4 
BI_BITFIELDS 
BI_JPEG 
BI_PNG 
Enumerator:
RI_COLORIMETRIC 
RI_BUSINESS 
RI_GRAPHICS 
RI_IMAGES 
Enumerator:
CS_CALIBRATED_RGB 
CS_sRGB 
CS_CMYK 

Constructor & Destructor Documentation

Constructs a null image.

imagen::iBMP::iBMP ( const iBMP img)

Copy constructor.

This copies all image attributes, and attaches itself to img's shared data.

iAbstractImage copy constructor.

imagen::iBMP::iBMP ( int  w,
int  h,
iImageFormat  f 
)

Constructs an image with the given size and format.

The image data will be allocated, but not initialized.

Parameters:
w: Image width.
h: Image height.
f: Image format.
imagen::iBMP::iBMP ( Iubyte d,
int  w,
int  h,
iImageFormat  f,
int  b 
)

Constructs an image using an existing memory buffer.

The memory buffer will not be deleted at destruction.

See also:
loadData()
imagen::iBMP::iBMP ( const char *  filename)

Loads a BMP image file from disk.

See also:
load( const char *filename )
imagen::iBMP::iBMP ( Iubyte buf,
int  len 
)

Loads a BMP image from an existing memory buffer.

See also:
load( Iubyte *buf, int len )

Loads a BMP image using an existing data stream.

See also:
load( iDataStream *s )

Destructor.


Member Function Documentation

void imagen::iBMP::clear ( ) [virtual]

Detaches this image from the image data and resets all data members to their initial values.

Reimplemented from imagen::iAbstractImage.

bool imagen::iBMP::isFormatSupported ( iImageFormat  fmt) const [virtual]

Checks whether or not a given image color format is supported by this image type.

Returns:
True if the format is supported, else false.

Implements imagen::iAbstractImage.

static bool imagen::iBMP::isValid ( iDataStream s) [static]
iBMP& imagen::iBMP::operator= ( const iBMP img)
iBMP& imagen::iBMP::operator= ( const iAbstractImage img)

Reimplemented from imagen::iAbstractImage.

void imagen::iBMP::init ( ) [protected]

Reimplemented from imagen::iAbstractImage.

bool imagen::iBMP::loadImage ( ) [protected, virtual]
bool imagen::iBMP::saveImage ( ) [protected, virtual]

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