TV-Browser 2.7.5 API

webplugin.aclib.image.ico
Class AbstractBitmapIndexed

java.lang.Object
  extended by webplugin.aclib.image.ico.AbstractBitmap
      extended by webplugin.aclib.image.ico.AbstractBitmapIndexed
Direct Known Subclasses:
BitmapIndexed1BPP, BitmapIndexed4BPP, BitmapIndexed8BPP

public abstract class AbstractBitmapIndexed
extends AbstractBitmap

Parent class for indexed bitmaps (1, 4, and 8 bits per pixel). The value of a pixel refers to an entry in the color palette. The bitmap has a mask which is a 1 BPP bitmap specifiying whether a pixel is transparent or opaque.

Author:
© Christian Treber, ct@ctreber.com

Field Summary
protected  int[] _pixels
          The pixel values.
 
Fields inherited from class webplugin.aclib.image.ico.AbstractBitmap
_descriptor
 
Constructor Summary
AbstractBitmapIndexed(BitmapDescriptor pDescriptor)
          Create a bitmap with a color table and a mask.
 
Method Summary
 BufferedImage createImageIndexed()
           
 BufferedImage createImageRGB()
          Create an RGB image rendition of this bitmap.
protected static int getBytesPerScanLine(int pWidth, int pBPP)
          Return bytes per scan line rounded up to the next 4 byte boundary.
 Color getColor(int pIndex)
          Get the color for the specified color palette index.
 Color getColor(int pXPos, int pYPos)
          Get the color for the specified point.
 int getPaletteIndex(int pXPos, int pYPos)
          Index into the color palette for the specified point.
(package private)  void read(AbstractDecoder pDec)
          Needed to be replaced for indexed images because they contain a color palette and a mask which needs to be read as well.
(package private) abstract  void readBitmap(AbstractDecoder pDec)
          This functions is needed b/c all classes read the bitmap, but not always a color table and a mask.
 
Methods inherited from class webplugin.aclib.image.ico.AbstractBitmap
getColorCount, getDescriptor, getHeight, getWidth, setDescriptor, toString
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

_pixels

protected int[] _pixels
The pixel values. The value refers to an entry in the color palette.

Constructor Detail

AbstractBitmapIndexed

public AbstractBitmapIndexed(BitmapDescriptor pDescriptor)
Create a bitmap with a color table and a mask.

Parameters:
pDescriptor - The descriptor.
Method Detail

read

void read(AbstractDecoder pDec)
    throws IOException
Needed to be replaced for indexed images because they contain a color palette and a mask which needs to be read as well.

Specified by:
read in class AbstractBitmap
Parameters:
pDec - The decoder.
Throws:
IOException

readBitmap

abstract void readBitmap(AbstractDecoder pDec)
                  throws IOException
This functions is needed b/c all classes read the bitmap, but not always a color table and a mask.

Parameters:
pDec - The decoder.
Throws:
IOException

getBytesPerScanLine

protected static int getBytesPerScanLine(int pWidth,
                                         int pBPP)
Return bytes per scan line rounded up to the next 4 byte boundary.

Parameters:
pWidth - The image width.
pBPP - Bytes per pixel.
Returns:
Bytes per scan line rounded up to the next 4 byte boundar.

createImageIndexed

public BufferedImage createImageIndexed()
Returns:
BufferedImage (palette) created from the indexed bitmap.

createImageRGB

public BufferedImage createImageRGB()
Description copied from class: AbstractBitmap
Create an RGB image rendition of this bitmap.

Specified by:
createImageRGB in class AbstractBitmap
Returns:
BufferedImage (ARGB) from the indexed bitmap.

getColor

public Color getColor(int pXPos,
                      int pYPos)
Get the color for the specified point.

Parameters:
pXPos - The x position.
pYPos - The y position.
Returns:
Color of the selected point.

getPaletteIndex

public int getPaletteIndex(int pXPos,
                           int pYPos)
Index into the color palette for the specified point.

Parameters:
pXPos - The x position.
pYPos - The y position.
Returns:
Palette index for pixel x, y

getColor

public Color getColor(int pIndex)
Get the color for the specified color palette index.

Parameters:
pIndex - of the color requested.
Returns:
Requested color.

TV-Browser 2.7.5 API

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