public class BMPDecoder
extends java.lang.Object
构造器和说明 |
---|
BMPDecoder(java.io.InputStream in)
Creates a new instance of BMPDecoder and reads the BMP data from the source.
|
限定符和类型 | 方法和说明 |
---|---|
java.awt.image.BufferedImage |
getBufferedImage()
The decoded image read from the source input.
|
InfoHeader |
getInfoHeader()
The InfoHeader structure, which provides information about the BMP data.
|
static java.awt.image.BufferedImage |
read(java.io.File file)
Reads and decodes BMP data from the source file.
|
static java.awt.image.BufferedImage |
read(InfoHeader infoHeader,
LittleEndianInputStream lis)
Reads the BMP data from the given InputStream using the information
contained in the InfoHeader.
|
static java.awt.image.BufferedImage |
read(InfoHeader infoHeader,
LittleEndianInputStream lis,
ColorEntry[] colorTable)
Reads the BMP data from the given InputStream using the information
contained in the InfoHeader.
|
static java.awt.image.BufferedImage |
read(java.io.InputStream in)
Reads and decodes BMP data from the source input.
|
static java.awt.image.BufferedImage |
read1(InfoHeader infoHeader,
LittleEndianInputStream lis,
ColorEntry[] colorTable)
Reads 1-bit uncompressed bitmap raster data, which may be monochrome depending on the
palette entries in colorTable.
|
static java.awt.image.BufferedImage |
read24(InfoHeader infoHeader,
LittleEndianInputStream lis)
Reads 24-bit uncompressed bitmap raster data.
|
static java.awt.image.BufferedImage |
read32(InfoHeader infoHeader,
LittleEndianInputStream lis)
Reads 32-bit uncompressed bitmap raster data, with transparency.
|
static java.awt.image.BufferedImage |
read4(InfoHeader infoHeader,
LittleEndianInputStream lis,
ColorEntry[] colorTable)
Reads 4-bit uncompressed bitmap raster data, which is interpreted based on the colours
specified in the palette.
|
static java.awt.image.BufferedImage |
read8(InfoHeader infoHeader,
LittleEndianInputStream lis,
ColorEntry[] colorTable)
Reads 8-bit uncompressed bitmap raster data, which is interpreted based on the colours
specified in the palette.
|
static ColorEntry[] |
readColorTable(InfoHeader infoHeader,
LittleEndianInputStream lis)
Reads the ColorEntry table from the given InputStream using
the information contained in the given infoHeader.
|
static BMPImage |
readExt(java.io.File file)
Reads and decodes BMP data from the source file, together with metadata.
|
static BMPImage |
readExt(java.io.InputStream in)
Reads and decodes BMP data from the source input, together with metadata.
|
static InfoHeader |
readInfoHeader(LittleEndianInputStream lis)
Reads the BMP info header structure from the given InputStream.
|
static InfoHeader |
readInfoHeader(LittleEndianInputStream lis,
int infoSize) |
public BMPDecoder(java.io.InputStream in) throws java.io.IOException
in
- the source InputStream from which to read the BMP datajava.io.IOException
- if an error occurspublic InfoHeader getInfoHeader()
public java.awt.image.BufferedImage getBufferedImage()
public static InfoHeader readInfoHeader(LittleEndianInputStream lis) throws java.io.IOException
lis
- the InputStream to readjava.io.IOException
- if an error occurredpublic static InfoHeader readInfoHeader(LittleEndianInputStream lis, int infoSize) throws java.io.IOException
java.io.IOException
public static java.awt.image.BufferedImage read(InfoHeader infoHeader, LittleEndianInputStream lis) throws java.io.IOException
lis
- the source inputinfoHeader
- an InfoHeader that was read by a call to
readInfoHeader()
.java.io.IOException
- if an error occurspublic static java.awt.image.BufferedImage read(InfoHeader infoHeader, LittleEndianInputStream lis, ColorEntry[] colorTable) throws java.io.IOException
colorTable
- ColorEntry array containing paletteinfoHeader
- an InfoHeader that was read by a call to
readInfoHeader()
.lis
- the source inputjava.io.IOException
- if any error occurspublic static ColorEntry[] readColorTable(InfoHeader infoHeader, LittleEndianInputStream lis) throws java.io.IOException
infoHeader
- the InfoHeader structure, which was read using
readInfoHeader()
lis
- the InputStream to readjava.io.IOException
- if an error occurspublic static java.awt.image.BufferedImage read1(InfoHeader infoHeader, LittleEndianInputStream lis, ColorEntry[] colorTable) throws java.io.IOException
infoHeader
- the InfoHeader structure, which was read using
readInfoHeader()
lis
- the source inputcolorTable
- ColorEntry array specifying the palette, which
must not be null.java.io.IOException
- if an error occurspublic static java.awt.image.BufferedImage read4(InfoHeader infoHeader, LittleEndianInputStream lis, ColorEntry[] colorTable) throws java.io.IOException
infoHeader
- the InfoHeader structure, which was read using
readInfoHeader()
lis
- the source inputcolorTable
- ColorEntry array specifying the palette, which
must not be null.java.io.IOException
- if an error occurspublic static java.awt.image.BufferedImage read8(InfoHeader infoHeader, LittleEndianInputStream lis, ColorEntry[] colorTable) throws java.io.IOException
infoHeader
- the InfoHeader structure, which was read using
readInfoHeader()
lis
- the source inputcolorTable
- ColorEntry array specifying the palette, which
must not be null.java.io.IOException
- if an error occurspublic static java.awt.image.BufferedImage read24(InfoHeader infoHeader, LittleEndianInputStream lis) throws java.io.IOException
lis
- the source inputinfoHeader
- the InfoHeader structure, which was read using
readInfoHeader()
java.io.IOException
- if an error occurspublic static java.awt.image.BufferedImage read32(InfoHeader infoHeader, LittleEndianInputStream lis) throws java.io.IOException
lis
- the source inputinfoHeader
- the InfoHeader structure, which was read using
readInfoHeader()
java.io.IOException
- if an error occurspublic static java.awt.image.BufferedImage read(java.io.File file) throws java.io.IOException
file
- the source filejava.io.IOException
- if an error occurspublic static java.awt.image.BufferedImage read(java.io.InputStream in) throws java.io.IOException
in
- the source inputjava.io.IOException
- if an error occurspublic static BMPImage readExt(java.io.File file) throws java.io.IOException
file
- the source filejava.io.IOException
- if an error occurspublic static BMPImage readExt(java.io.InputStream in) throws java.io.IOException
in
- the source inputjava.io.IOException
- if an error occurs