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.
Modifier and Type | Field and Description |
---|---|
protected int[] |
_pixels
The pixel values.
|
_descriptor
Constructor and Description |
---|
AbstractBitmapIndexed(BitmapDescriptor pDescriptor)
Create a bitmap with a color table and a mask.
|
Modifier and Type | Method and Description |
---|---|
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.
|
getColorCount, getDescriptor, getHeight, getWidth, setDescriptor, toString
protected int[] _pixels
public AbstractBitmapIndexed(BitmapDescriptor pDescriptor)
pDescriptor
- The descriptor.void read(AbstractDecoder pDec) throws IOException
read
in class AbstractBitmap
pDec
- The decoder.IOException
abstract void readBitmap(AbstractDecoder pDec) throws IOException
pDec
- The decoder.IOException
protected static int getBytesPerScanLine(int pWidth, int pBPP)
pWidth
- The image width.pBPP
- Bytes per pixel.public BufferedImage createImageIndexed()
public BufferedImage createImageRGB()
AbstractBitmap
createImageRGB
in class AbstractBitmap
public Color getColor(int pXPos, int pYPos)
pXPos
- The x position.pYPos
- The y position.public int getPaletteIndex(int pXPos, int pYPos)
pXPos
- The x position.pYPos
- The y position.public Color getColor(int pIndex)
pIndex
- of the color requested.TV-Browser 2.7.6, Copyright (C) 04-2003 Martin Oberhauser (martin@tvbrowser.org)