public class BMPReader extends Object implements JImageReader
Currently unsupported .bmps by format are:
Supported bit depths/compression
The test case provides granular examples of precisely what is supported, as well as what is not yet supported.
Modifier and Type | Class and Description |
---|---|
class |
BMPReader.Palette
Class that represents the palette for a bitmap file.
|
Modifier and Type | Field and Description |
---|---|
static int |
BITFIELDS |
static int |
COLORSPACE_CALIBRATED_RGB |
static int |
COLORSPACE_DEVICE_DEPENDENT_CYMK |
static int |
COLORSPACE_DEVICE_DEPENDENT_RGB |
static int |
NONE |
static int |
OS2_2_BMP |
static int |
RLE_4BIT |
static int |
RLE_8BIT |
static short |
TYPE_WIN1 |
static short |
TYPE_WIN234 |
static int |
WINDOWS_2_BMP |
static int |
WINDOWS_3_BMP |
static int |
WINDOWS_95_BMP |
static int |
WINDOWS_NT_ALPHA_BMP |
static int |
WINDOWS_NT_BMP |
Modifier and Type | Method and Description |
---|---|
void |
createBitmapFilter(BufferedImage image)
Creates a bitmap from the image.
|
void |
createBufferedImage() |
void |
createRawData()
Creates raw binary data for the image portion of the file
|
void |
exportFile(String fileName) |
void |
exportImage(BufferedImage image,
String fileName) |
int |
getBitsPerPixel() |
int |
getHeight()
Returns the image's height.
|
BufferedImage |
getImage()
Returns the image that the reader has imported.
|
String |
getMetadataSummary()
Returns a summary of the image's metadata.
|
Color[] |
getPaletteColors()
Returns the colors in the BMP's palette.
|
int |
getPaletteIndexAt(int x,
int y)
Returns the color's palette index.
|
int |
getPaletteSize() |
int |
getWidth()
Returns the image's width.
|
void |
parse() |
void |
processFile()
Processes the file supplied at initialization, and stores the image in the reader.
|
void |
processFile(boolean createImage)
Allows us to process the file and not create an image.
|
void |
readFile() |
String |
toString() |
public static final int WINDOWS_2_BMP
public static final int WINDOWS_3_BMP
public static final int WINDOWS_NT_BMP
public static final int WINDOWS_NT_ALPHA_BMP
public static final int OS2_2_BMP
public static final int WINDOWS_95_BMP
public static final short TYPE_WIN1
public static final short TYPE_WIN234
public static final int NONE
public static final int RLE_8BIT
public static final int RLE_4BIT
public static final int BITFIELDS
public static final int COLORSPACE_CALIBRATED_RGB
public static final int COLORSPACE_DEVICE_DEPENDENT_RGB
public static final int COLORSPACE_DEVICE_DEPENDENT_CYMK
public BMPReader()
public BMPReader(String string)
public void processFile(boolean createImage)
createImage
- Whether the BufferedImage should be created.public void processFile() throws UnsupportedVariantException
JImageReader
processFile
in interface JImageReader
UnsupportedVariantException
- If the supplied file is a variant of the reader's format that is not supported.public void readFile()
public void parse() throws UnsupportedVariantException
UnsupportedVariantException
public void createBufferedImage()
public BufferedImage getImage()
JImageReader
getImage
in interface JImageReader
public int getWidth()
JImageReader
getWidth
in interface JImageReader
public int getHeight()
JImageReader
getHeight
in interface JImageReader
public void createBitmapFilter(BufferedImage image)
image
- The AWT BufferedImage that will be converted to a bitmap.public void createRawData()
public void exportFile(String fileName)
public void exportImage(BufferedImage image, String fileName)
public int getPaletteSize()
public Color[] getPaletteColors()
public int getPaletteIndexAt(int x, int y)
x
- - Color's x coordinatey
- - Color's y coordinatepublic int getBitsPerPixel()
public String getMetadataSummary()
JImageReader
getMetadataSummary
in interface JImageReader
Copyright © 2020. All rights reserved.