TV-Browser 2.7.5 API

webplugin.aclib.image.ico
Class BitmapDescriptor

java.lang.Object
  extended by webplugin.aclib.image.ico.BitmapDescriptor

public class BitmapDescriptor
extends Object

ICO file entry descriptor. Describes an embedded bitmap, and points to the header/bitmap pair. I found that the descriptor often "lies" about size, number of colors etc., hence the bitmap header should be used for reference.

Author:
© Christian Treber, ct@ctreber.com

Constructor Summary
BitmapDescriptor(AbstractDecoder pDec)
          Read the descriptor with the decoder (16 Bytes in total).
 
Method Summary
 AbstractBitmap getBitmap()
          Bitmap this descriptor refers to.
 int getBPP()
          Bits per pixel.
 int getBPPRaw()
          The original bits per pixel count.
 int getColorCount()
          The actual color count.
 int getColorCountRaw()
          The original color count (note "0" means "256").
 BitmapHeader getHeader()
          The header of the bitmap this descriptor refers to.
 int getHeight()
          Bitmap height.
 Image getImageIndexed()
          Image with indexed colors.
 Image getImageRGB()
          Image with ARGB colors.
 BitmapMask getMask()
          The mask of the bitmap this descriptor refers to.
 long getOffset()
          Offset of header in ICO file.
 int getPlanes()
          Number of planes ("1" for bitmaps, as far as I know).
 int getReserved()
          Reserved value in the descriptor.
 long getSize()
          Hm - the size of the header and bitmap maybe?
 int getWidth()
          Bitmap width.
(package private)  void setBitmap(AbstractBitmap pBitmap)
           
(package private)  void setHeader(BitmapHeader pHeader)
           
 String toString()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

BitmapDescriptor

public BitmapDescriptor(AbstractDecoder pDec)
                 throws IOException
Read the descriptor with the decoder (16 Bytes in total).

Parameters:
pDec - The decoder.
Throws:
IOException
Method Detail

toString

public String toString()
Overrides:
toString in class Object
Returns:
Provides some information on the descriptor.

getImageIndexed

public Image getImageIndexed()
Image with indexed colors. Returns null if an indexed image can't be created (like, from an RGB icon - color mapping and dithering is a bit much for the time being). Transparency information that might be present in the ICO file is lost. See getImageRGB().

Returns:
Image.

getBPP

public int getBPP()
Bits per pixel. If the bit count of the entry is 0, the bit count of the header is returned. See getBPPRaw().

Returns:
Bits per pixel (fudged).

getBPPRaw

public int getBPPRaw()
The original bits per pixel count. See getBPP().

Returns:
Bits per pixel (raw).

getImageRGB

public Image getImageRGB()
Image with ARGB colors. This method works for indexed color and RGB ICO files. Transparency information that might be present in the ICO is used. See getImageIndexed().

Returns:
Image created from the bitmap.

getColorCountRaw

public int getColorCountRaw()
The original color count (note "0" means "256"). See getColorCount().

Returns:
Color count (raw).

getColorCount

public int getColorCount()
The actual color count. See getColorCountRaw().

Returns:
Color count (cooked).

getHeight

public int getHeight()
Bitmap height.

Returns:
Height.

getOffset

public long getOffset()
Offset of header in ICO file.

Returns:
Offset.

getPlanes

public int getPlanes()
Number of planes ("1" for bitmaps, as far as I know).

Returns:
Planes.

getReserved

public int getReserved()
Reserved value in the descriptor.

Returns:
Reserved value.

getSize

public long getSize()
Hm - the size of the header and bitmap maybe?

Returns:
Size.

getWidth

public int getWidth()
Bitmap width.

Returns:
Width.

getHeader

public BitmapHeader getHeader()
The header of the bitmap this descriptor refers to.

Returns:
Header.

setHeader

void setHeader(BitmapHeader pHeader)
Parameters:
pHeader -

getMask

public BitmapMask getMask()
The mask of the bitmap this descriptor refers to. Null for RGB bitmaps.

Returns:
Mask.

getBitmap

public AbstractBitmap getBitmap()
Bitmap this descriptor refers to.

Returns:
Bitmap.

setBitmap

void setBitmap(AbstractBitmap pBitmap)

TV-Browser 2.7.5 API

TV-Browser 2.7.5, Copyright (C) 04-2003 Martin Oberhauser (martin@tvbrowser.org)