net.sf.image4j.codec.ico
Class IconEntry

java.lang.Object
  extended by net.sf.image4j.codec.ico.IconEntry

public class IconEntry
extends java.lang.Object

Represents an IconEntry structure, which contains information about an ICO image.

Author:
Ian McDonagh

Field Summary
 int bColorCount
          The number of colours, calculated from sBitCount.
 int bHeight
          The height of the icon image in pixels.
 byte bReserved
          Unused.
 int bWidth
          The width of the icon image in pixels.
 int iFileOffset
          Position in file where the InfoHeader starts.
 int iSizeInBytes
          Size of ICO data, which should be the size of (InfoHeader + AND bitmap + XOR bitmap).
 short sBitCount
          Colour depth in bits per pixel.
 short sPlanes
          Number of planes, which should always be 1.
 
Constructor Summary
IconEntry()
          Creates and IconEntry structure with default values.
IconEntry(LittleEndianInputStream in)
          Creates an IconEntry structure from the source input
 
Method Summary
 java.lang.String toString()
          A string representation of this IconEntry structure.
 void write(LittleEndianOutputStream out)
          Writes the IconEntry structure to output
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

bWidth

public int bWidth
The width of the icon image in pixels. 0 specifies a width of 256 pixels.


bHeight

public int bHeight
The height of the icon image in pixels. 0 specifies a height of 256 pixels.


bColorCount

public int bColorCount
The number of colours, calculated from sBitCount. 0 specifies a colour count of >= 256.


bReserved

public byte bReserved
Unused. Should always be 0.


sPlanes

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


sBitCount

public short sBitCount
Colour depth in bits per pixel.


iSizeInBytes

public int iSizeInBytes
Size of ICO data, which should be the size of (InfoHeader + AND bitmap + XOR bitmap).


iFileOffset

public int iFileOffset
Position in file where the InfoHeader starts.

Constructor Detail

IconEntry

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

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

IconEntry

public IconEntry()
Creates and IconEntry structure with default values.

Method Detail

toString

public java.lang.String toString()
A string representation of this IconEntry structure.

Overrides:
toString in class java.lang.Object

write

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

Parameters:
out - the output
Throws:
java.io.IOException - if an error occurs