public class BMPDecoder extends Object
| 构造器和说明 |
|---|
BMPDecoder(InputStream in)
Creates a new instance of BMPDecoder and reads the BMP data from the source.
|
| 限定符和类型 | 方法和说明 |
|---|---|
BufferedImage |
getBufferedImage()
The decoded image read from the source input.
|
InfoHeader |
getInfoHeader()
The InfoHeader structure, which provides information about the BMP data.
|
static BufferedImage |
read(File file)
Reads and decodes BMP data from the source file.
|
static BufferedImage |
read(InfoHeader infoHeader,
LittleEndianInputStream lis)
Reads the BMP data from the given InputStream using the information
contained in the InfoHeader.
|
static BufferedImage |
read(InfoHeader infoHeader,
LittleEndianInputStream lis,
ColorEntry[] colorTable)
Reads the BMP data from the given InputStream using the information
contained in the InfoHeader.
|
static BufferedImage |
read(InputStream in)
Reads and decodes BMP data from the source input.
|
static 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 BufferedImage |
read24(InfoHeader infoHeader,
LittleEndianInputStream lis)
Reads 24-bit uncompressed bitmap raster data.
|
static BufferedImage |
read32(InfoHeader infoHeader,
LittleEndianInputStream lis)
Reads 32-bit uncompressed bitmap raster data, with transparency.
|
static 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 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(File file)
Reads and decodes BMP data from the source file, together with metadata.
|
static BMPImage |
readExt(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(InputStream in) throws IOException
in - the source InputStream from which to read the BMP dataIOException - if an error occurspublic InfoHeader getInfoHeader()
public BufferedImage getBufferedImage()
public static InfoHeader readInfoHeader(LittleEndianInputStream lis) throws IOException
lis - the InputStream to readIOException - if an error occurredpublic static InfoHeader readInfoHeader(LittleEndianInputStream lis, int infoSize) throws IOException
IOExceptionpublic static BufferedImage read(InfoHeader infoHeader, LittleEndianInputStream lis) throws IOException
lis - the source inputinfoHeader - an InfoHeader that was read by a call to
readInfoHeader().IOException - if an error occurspublic static BufferedImage read(InfoHeader infoHeader, LittleEndianInputStream lis, ColorEntry[] colorTable) throws IOException
colorTable - ColorEntry array containing paletteinfoHeader - an InfoHeader that was read by a call to
readInfoHeader().lis - the source inputIOException - if any error occurspublic static ColorEntry[] readColorTable(InfoHeader infoHeader, LittleEndianInputStream lis) throws IOException
infoHeader - the InfoHeader structure, which was read using
readInfoHeader()lis - the InputStream to readIOException - if an error occurspublic static BufferedImage read1(InfoHeader infoHeader, LittleEndianInputStream lis, ColorEntry[] colorTable) throws IOException
infoHeader - the InfoHeader structure, which was read using
readInfoHeader()lis - the source inputcolorTable - ColorEntry array specifying the palette, which
must not be null.IOException - if an error occurspublic static BufferedImage read4(InfoHeader infoHeader, LittleEndianInputStream lis, ColorEntry[] colorTable) throws IOException
infoHeader - the InfoHeader structure, which was read using
readInfoHeader()lis - the source inputcolorTable - ColorEntry array specifying the palette, which
must not be null.IOException - if an error occurspublic static BufferedImage read8(InfoHeader infoHeader, LittleEndianInputStream lis, ColorEntry[] colorTable) throws IOException
infoHeader - the InfoHeader structure, which was read using
readInfoHeader()lis - the source inputcolorTable - ColorEntry array specifying the palette, which
must not be null.IOException - if an error occurspublic static BufferedImage read24(InfoHeader infoHeader, LittleEndianInputStream lis) throws IOException
lis - the source inputinfoHeader - the InfoHeader structure, which was read using
readInfoHeader()IOException - if an error occurspublic static BufferedImage read32(InfoHeader infoHeader, LittleEndianInputStream lis) throws IOException
lis - the source inputinfoHeader - the InfoHeader structure, which was read using
readInfoHeader()IOException - if an error occurspublic static BufferedImage read(File file) throws IOException
file - the source fileIOException - if an error occurspublic static BufferedImage read(InputStream in) throws IOException
in - the source inputIOException - if an error occurspublic static BMPImage readExt(File file) throws IOException
file - the source fileIOException - if an error occurspublic static BMPImage readExt(InputStream in) throws IOException
in - the source inputIOException - if an error occursCopyright © 2021. All rights reserved.