final class BMPImageLoader extends ImageLoaderImpl
Modifier and Type | Class and Description |
---|---|
private static interface |
BMPImageLoader.BitConverter |
Modifier and Type | Field and Description |
---|---|
(package private) static int |
BFH_SIZE |
(package private) int |
bfOffBits |
(package private) int |
bfSize |
(package private) byte[] |
bgra_palette |
(package private) BitmapInfoHeader |
bih |
(package private) int[] |
bitMasks |
(package private) int[] |
bitOffsets |
(package private) static short |
BM |
(package private) LEInputStream |
data |
formatDescription, lastPercentDone, listeners
Constructor and Description |
---|
BMPImageLoader(java.io.InputStream input) |
Modifier and Type | Method and Description |
---|---|
(package private) static void |
BGRtoRGB(byte[] data,
int pos,
int size) |
(package private) static boolean |
checkDisjointMasks(int m1,
int m2,
int m3) |
private static byte |
convertFrom5To8Bit(int i,
int mask,
int offset) |
private static byte |
convertFromXTo8Bit(int i,
int mask,
int offset) |
void |
dispose()
Disposes of any resources (such as native libraries) held by this loader.
|
private static int |
getByte(byte[] buf,
int pos) |
private static int |
getDWord(byte[] buf,
int pos) |
private static int |
getWord(byte[] buf,
int pos) |
(package private) static boolean |
isPow2Minus1(int i) |
ImageFrame |
load(int imageIndex,
int width,
int height,
boolean preserveAspectRatio,
boolean smooth)
Loads the image at a given index in an image stream.
|
private void |
parseBitfields() |
private void |
read16Bit(byte[] image,
int rowLength,
int hght,
BMPImageLoader.BitConverter converter) |
private void |
read24Bit(byte[] image,
int rowLength,
int hght) |
private void |
read32BitBF(byte[] image,
int rowLength,
int hght) |
private void |
read32BitRGB(byte[] image,
int rowLength,
int hght) |
private void |
readHeader() |
private void |
readPackedBits(byte[] image,
int rowLength,
int hght) |
private void |
readRLE(byte[] image,
int rowLength,
int hght,
boolean isRLE4) |
private int |
setRGBFromPalette(byte[] image,
int dstOffset,
int index) |
addListener, emitWarning, getFormatDescription, removeListener, updateImageMetadata, updateImageProgress
static final short BM
static final int BFH_SIZE
final LEInputStream data
int bfSize
int bfOffBits
byte[] bgra_palette
BitmapInfoHeader bih
int[] bitMasks
int[] bitOffsets
BMPImageLoader(java.io.InputStream input) throws java.io.IOException
java.io.IOException
private void readHeader() throws java.io.IOException
java.io.IOException
private void parseBitfields() throws java.io.IOException
java.io.IOException
static boolean checkDisjointMasks(int m1, int m2, int m3)
static boolean isPow2Minus1(int i)
public void dispose()
ImageLoader
private void readRLE(byte[] image, int rowLength, int hght, boolean isRLE4) throws java.io.IOException
java.io.IOException
private int setRGBFromPalette(byte[] image, int dstOffset, int index)
private void readPackedBits(byte[] image, int rowLength, int hght) throws java.io.IOException
java.io.IOException
private static int getDWord(byte[] buf, int pos)
private static int getWord(byte[] buf, int pos)
private static int getByte(byte[] buf, int pos)
private static byte convertFrom5To8Bit(int i, int mask, int offset)
private static byte convertFromXTo8Bit(int i, int mask, int offset)
private void read16Bit(byte[] image, int rowLength, int hght, BMPImageLoader.BitConverter converter) throws java.io.IOException
java.io.IOException
private void read32BitRGB(byte[] image, int rowLength, int hght) throws java.io.IOException
java.io.IOException
private void read32BitBF(byte[] image, int rowLength, int hght) throws java.io.IOException
java.io.IOException
private void read24Bit(byte[] image, int rowLength, int hght) throws java.io.IOException
java.io.IOException
static void BGRtoRGB(byte[] data, int pos, int size)
public ImageFrame load(int imageIndex, int width, int height, boolean preserveAspectRatio, boolean smooth) throws java.io.IOException
ImageLoader
null
will be returned.imageIndex
- the zero-relative index of the image to load.width
- the desired image width. If non-positive,
an IllegalArgumentException
will be thrown.height
- the desired image height. If non-positive,
an IllegalArgumentException
will be thrown.preserveAspectRatio
- whether to preserve the width-to-height ratio
of the image.smooth
- whether to use a smooth downscaling algorithm.null
on error.java.io.IOException