org.jSyncManager.API.Tools.PalmDataTypes.Bitmaps
Class Bitmap
java.lang.Objectorg.jSyncManager.API.Tools.PalmDataTypes.Bitmaps.Bitmap
public class Bitmap
extends java.lang.Object
An image in Palm TBMP format. A Bitmap holds the raw TBMP data and exposes meta information such as width, height,
bits per pixel, and compression type.
Bitmap(File file)- Constructs a Bitmap from a File.
|
Bitmap(InputStream in)- Constructs a Bitmap from an InputStream.
|
Bitmap(byte[] data)- Constructs a TBMP from a byte array.
|
FLAG_COMPRESSED
public static final int FLAG_COMPRESSED
FLAG_DIRECT_COLOR
public static final int FLAG_DIRECT_COLOR
FLAG_HAS_COLOR_TABLE
public static final int FLAG_HAS_COLOR_TABLE
FLAG_TRANSPARENCY
public static final int FLAG_TRANSPARENCY
PACKBITS_COMPRESSION
public static final int PACKBITS_COMPRESSION
RLE_COMPRESSION
public static final int RLE_COMPRESSION
SCANLINE_COMPRESSION
public static final int SCANLINE_COMPRESSION
Bitmap
public Bitmap(File file)
throws IOException Constructs a Bitmap from a File.
file - The File to read the TBMP data from.
Bitmap
public Bitmap(InputStream in)
throws IOException Constructs a Bitmap from an InputStream.
Note that the InputStream is read completely.
in - The InputStream to read the TBMP data from.
Bitmap
public Bitmap(byte[] data)
Constructs a TBMP from a byte array.
data - The raw TBMP data.
getBitDepth
public int getBitDepth()
- The bits per pixel.
1, 2, 4 bpp: 2, 4, 16 shades of gray respectively
8, 16 bpp: 256, 65536 colors respectively
getBytesPerRow
public int getBytesPerRow()
- The number of bytes per row. The number of bytes per row is the (bitDepth/8) * width, rounded above
to an even number. (The padding byte contains no image data.)
getCompressionType
public int getCompressionType()
- The type of compression used in the bitmap.
0 = scanline
1 = RLE
2 = packbits
getHeight
public int getHeight()
- The height in pixels of this bitmap.
getSize
public int getSize()
- The size in bytes of this Bitmap.
getTransparencyIndex
public int getTransparencyIndex()
- The index of the transparent color in this bitmap.
getUncompressedSize
public int getUncompressedSize()
getVersion
public int getVersion()
- The version number of the bitmap.
0 = Palm OS 1
1 = Palm OS 3 ( adds scanline compression)
2 = Palm OS 3.5 (adds RLE compression and transparency)
3 = Palm OS 4 (adds packbits compression)
getWidth
public int getWidth()
- The width in pixels of this bitmap.
hasColorTable
public boolean hasColorTable()
- A boolean indicating if the bitmap has a color lookup table. A color lookup table is used only in
8-bit bitmap.
isCompressed
public boolean isCompressed()
- A boolean indicating if the bitmap is compressed through scanline, run-length, or packbits encoding.
isDirectColor
public boolean isDirectColor()
- A boolean indicating if the bitmap uses a direct color model. A direct color model is used only in
16-bit bitmaps.
isTransparent
public boolean isTransparent()
- A boolean indicating if the bitmap has a transparent color.
toByteArray
public byte[] toByteArray()
- A byte array containing the raw TBMP data.