net.sf.image4j.codec.bmp
Class InfoHeader

java.lang.Object
  extended by net.sf.image4j.codec.bmp.InfoHeader

public class InfoHeader
extends java.lang.Object

Represents a bitmap InfoHeader structure, which provides header information.

Author:
Ian McDonagh

Field Summary
 int iColorsImportant
          Number of important colours (0 = all).
 int iColorsUsed
          Number of colours actually used in the bitmap.
 int iCompression
          The compression type, which should be one of the following: BI_RGB - no compression BI_RLE8 - 8-bit RLE compression BI_RLE4 - 4-bit RLE compression
 int iHeight
          The height in pixels of the bitmap represented by this InfoHeader.
 int iImageSize
          The compressed size of the image in bytes, or 0 if iCompression is 0.
 int iNumColors
          Calculated number of colours, based on the colour depth specified by sBitCount.
 int iSize
          The size of this InfoHeader structure in bytes.
 int iWidth
          The width in pixels of the bitmap represented by this InfoHeader.
 int iXpixelsPerM
          Horizontal resolution in pixels/m.
 int iYpixelsPerM
          Vertical resolution in pixels/m.
 short sBitCount
          The bit count, which represents the colour depth (bits per pixel).
 short sPlanes
          The number of planes, which should always be 1.
 
Constructor Summary
InfoHeader()
          Creates an InfoHeader with default values.
InfoHeader(InfoHeader source)
          Creates a copy of the source InfoHeader.
InfoHeader(LittleEndianInputStream in)
          Creates an InfoHeader structure from the source input.
InfoHeader(LittleEndianInputStream in, int infoSize)
           
 
Method Summary
protected  void init(LittleEndianInputStream in, int infoSize)
           
 void write(LittleEndianOutputStream out)
          Writes the InfoHeader structure to output
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

iSize

public int iSize
The size of this InfoHeader structure in bytes.


iWidth

public int iWidth
The width in pixels of the bitmap represented by this InfoHeader.


iHeight

public int iHeight
The height in pixels of the bitmap represented by this InfoHeader.


sPlanes

public short sPlanes
The number of planes, which should always be 1.


sBitCount

public short sBitCount
The bit count, which represents the colour depth (bits per pixel). This should be either 1, 4, 8, 24 or 32.


iCompression

public int iCompression
The compression type, which should be one of the following:


iImageSize

public int iImageSize
The compressed size of the image in bytes, or 0 if iCompression is 0.


iXpixelsPerM

public int iXpixelsPerM
Horizontal resolution in pixels/m.


iYpixelsPerM

public int iYpixelsPerM
Vertical resolution in pixels/m.


iColorsUsed

public int iColorsUsed
Number of colours actually used in the bitmap.


iColorsImportant

public int iColorsImportant
Number of important colours (0 = all).


iNumColors

public int iNumColors
Calculated number of colours, based on the colour depth specified by sBitCount.

Constructor Detail

InfoHeader

public InfoHeader(LittleEndianInputStream in)
           throws java.io.IOException
Creates an InfoHeader structure from the source input.

Parameters:
in - the source input
Throws:
java.io.IOException - if an error occurs

InfoHeader

public InfoHeader(LittleEndianInputStream in,
                  int infoSize)
           throws java.io.IOException
Throws:
java.io.IOException
Since:
0.6

InfoHeader

public InfoHeader()
Creates an InfoHeader with default values.


InfoHeader

public InfoHeader(InfoHeader source)
Creates a copy of the source InfoHeader.

Parameters:
source - the source to copy
Method Detail

init

protected void init(LittleEndianInputStream in,
                    int infoSize)
             throws java.io.IOException
Throws:
java.io.IOException
Since:
0.6

write

public void write(LittleEndianOutputStream out)
           throws java.io.IOException
Writes the InfoHeader structure to output

Parameters:
out - the output to which the structure will be written
Throws:
java.io.IOException - if an error occurs