|
GF4J 0.9.4 Beta | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--gameframe.graphics.BitmapFile
Represents Windows Bitmap (BMP) file and has utility methods for loading a Windows Bitmap file and returning its bitmap data.
Field Summary | |
private static int[] |
mStatic_aBitmask
Bitmask array used to read the monochrome bitmaps |
private static int |
RGB_ONLY_MASK
Bitmask that can be used to handle only the RGB part of the colours. |
Constructor Summary | |
BitmapFile()
|
Method Summary | |
private static void |
fillBuffer(java.io.InputStream inStream,
byte[] aBuffer)
Fills (to full capacity) the given buffer from the given input stream. |
boolean |
imageUpdate(java.awt.Image img,
int infoflags,
int x,
int y,
int width,
int height)
The image observer method that gets updated when an image is loading. |
static BitmapData |
loadBMP(java.io.InputStream inStream,
java.lang.String strFileName,
boolean fEnableAlpha)
Handles the loading of the bitmap from the given input stream. |
static BitmapData |
loadBMP(java.io.InputStream inStream,
java.lang.String strFileName,
byte alphakeyRed,
byte alphakeyGreen,
byte alphakeyBlue)
Handles the loading of the bitmap from the given input stream. |
static BitmapData |
loadBMP(java.lang.String strFileName,
boolean fEnableAlpha)
Loads the given file containing a Windows BMP formatted bitmap and returns an object containing the raw pixel data and the dimensions of the loaded bitmap. |
static BitmapData |
loadBMP(java.lang.String strFileName,
byte red,
byte green,
byte blue)
Loads the given file containing a Windows BMP formatted bitmap and returns an object containing the raw pixel data and the dimensions of the loaded bitmap. |
static BitmapData |
loadBMPURL(java.lang.String strFileName,
boolean fEnableAlpha)
Loads the file at the given URL containing a Windows BMP formatted bitmap and returns an object containing the raw pixel data and the dimensions of the loaded bitmap. |
static BitmapData |
loadBMPURL(java.lang.String strFileName,
byte red,
byte green,
byte blue)
Loads the file at the given URL containing a Windows BMP formatted bitmap and returns an object containing the raw pixel data and the dimensions of the loaded bitmap. |
private static byte |
mapFromPixelToPalette(int pixel,
int[] aPalette)
Maps the pixel value to the value in the palette |
private static void |
save24Bit(java.io.OutputStream outStream,
BitmapData bitmapData)
Saves the bitmap to the outputstream in 8-bit BMP format. |
private static void |
save8Bit(java.io.OutputStream outStream,
BitmapData bitmapData)
Saves the bitmap and palette data to the outputstream in 8-bit BMP format. |
static void |
saveBMP(java.lang.String strFileName,
BitmapData bitmapData)
Saves the given bitmap to a Windows BMP formatted file. |
Methods inherited from class java.lang.Object |
|
Field Detail |
private static final int[] mStatic_aBitmask
private static final int RGB_ONLY_MASK
Constructor Detail |
public BitmapFile()
Method Detail |
public boolean imageUpdate(java.awt.Image img, int infoflags, int x, int y, int width, int height)
public static void saveBMP(java.lang.String strFileName, BitmapData bitmapData) throws GameFrameException
strFileName
- The name of the file to save to.bitmapData
- The bitmap data (width, height and raw pixel data).private static final void save8Bit(java.io.OutputStream outStream, BitmapData bitmapData) throws java.io.IOException
outStream
- The stream to write to.bitmapData
- The bitmap data to be written.private static final void save24Bit(java.io.OutputStream outStream, BitmapData bitmapData) throws java.io.IOException
outStream
- The stream to write to.bitmapData
- The bitmap data to be written.private static final byte mapFromPixelToPalette(int pixel, int[] aPalette)
public static final BitmapData loadBMPURL(java.lang.String strFileName, boolean fEnableAlpha) throws java.io.FileNotFoundException, GameFrameException
strFileName
- The name of the file to load.fEnableAlpha
- True if bitmap is to be loaded as alpha bitmap.public static final BitmapData loadBMPURL(java.lang.String strFileName, byte red, byte green, byte blue) throws java.io.FileNotFoundException, GameFrameException
strFileName
- The name of the file to load.red
- The red key color intensity value (in range 0x00-0xFF).green
- The green key color intensity value (in range 0x00-0xFF).blue
- The blue key color intensity value (in range 0x00-0xFF).public static final BitmapData loadBMP(java.lang.String strFileName, boolean fEnableAlpha) throws java.io.FileNotFoundException, GameFrameException
strFileName
- The name of the file to load.fEnableAlpha
- True if bitmap is to be loaded as alpha bitmap.public static final BitmapData loadBMP(java.lang.String strFileName, byte red, byte green, byte blue) throws java.io.FileNotFoundException, GameFrameException
strFileName
- The name of the file to load.red
- The red key color intensity value (in range 0x00-0xFF).green
- The green key color intensity value (in range 0x00-0xFF).blue
- The blue key color intensity value (in range 0x00-0xFF).public static final BitmapData loadBMP(java.io.InputStream inStream, java.lang.String strFileName, boolean fEnableAlpha) throws java.io.FileNotFoundException, GameFrameException
inStream
- The input stream to load from.strFileName
- The filename used in error texts.fEnableAlpha
- Flag indicating if key color should be used or not.public static final BitmapData loadBMP(java.io.InputStream inStream, java.lang.String strFileName, byte alphakeyRed, byte alphakeyGreen, byte alphakeyBlue) throws java.io.FileNotFoundException, GameFrameException
inStream
- The input stream to load from.strFileName
- The filename used in error texts.alphakeyRed
- The red alpha key value (in range 0x00-0xFF).alphakeyGreen
- The green alpha key value (in range 0x00-0xFF).alphakeyBlue
- The blue alpha key value (in range 0x00-0xFF).private static final void fillBuffer(java.io.InputStream inStream, byte[] aBuffer) throws java.io.IOException
inStream
- The input sream to read the data from.aBuffer
- The buffer that is filled with the read data.
|
GF4J 0.9.4 Beta | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |