|
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.BitmapData
Represents the bitmap data loaded from a bitmap file.
Field Summary | |
protected int[] |
m_aPalette
The palette of the bitmap (if paletted color bitmap) or null if no palette available. |
protected int[] |
m_aPixels
The pixel data array. |
protected int |
m_height
The bitmap height. |
protected int |
m_keyColorBlue
The bitmap keycolor blue value. |
protected int |
m_keyColorGreen
The bitmap keycolor green value. |
protected int |
m_keyColorRed
The bitmap keycolor red value. |
protected int |
m_numBlueBits
The number of bits used to represent the blue component in a pixel. |
protected int |
m_numGreenBits
The number of bits used to represent the green component in a pixel. |
protected int |
m_numRedBits
The number of bits used to represent the red component in a pixel. |
protected int |
m_pitch
The number of pixels you need to travel to step one pixel down. |
protected int |
m_width
The bitmap width. |
static int |
NOT_USED
The value of any key color component if it is not used. |
Constructor Summary | |
BitmapData(int[] aPixels,
int width,
int height,
int pitch)
Constructs a bitmap data object that has the given parameters. |
|
BitmapData(int[] aPixels,
int width,
int height,
int pitch,
int[] aPalette)
Constructs a bitmap data object that has the given parameters. |
|
BitmapData(int[] aPixels,
int width,
int height,
int pitch,
int keyColorRed,
int keyColorGreen,
int keyColorBlue)
Constructs a bitmap data object that has the given parameters. |
|
BitmapData(int[] aPixels,
int width,
int height,
int pitch,
int keyColorRed,
int keyColorGreen,
int keyColorBlue,
int[] aPalette)
Constructs a bitmap data object that has the given parameters. |
Method Summary | |
BitmapData |
getCopy()
Returns a copy of the bitmap data. |
int |
getHeight()
Returns the height of the bitmap. |
int |
getKeyColorBlue()
Returns the red component of the keycolor. |
int |
getKeyColorGreen()
Returns the red component of the keycolor. |
int |
getKeyColorRed()
Returns the red component of the keycolor. |
int |
getNumBlueBits()
Returns the number of bits used for the red component in a pixel. |
int |
getNumGreenBits()
Returns the number of bits used for the red component in a pixel. |
int |
getNumRedBits()
Returns the number of bits used for the red component in a pixel. |
int[] |
getPalette()
Returns the palette array in the default color format. |
int |
getPitch()
Returns the number of pixels that needs to be travelled in the pixel array in order to step one pixel down in the bitmap. |
int[] |
getPixels()
Returns the pixel data array in the default color format. |
private BitmapData |
getRectData(int srcX,
int srcY,
int srcWidth,
int srcHeight)
Returns the given rectangle of the bitmap data. |
int |
getWidth()
Returns the width of the bitmap. |
boolean |
isKeyColourInUse()
Returns whether this bitmap data uses the keycolor or not. |
boolean |
isPaletted()
Returns whether this image data uses a palette or not. |
void |
setColourBits(int numRedBits,
int numGreenBits,
int numBlueBits)
Sets the colour bits (the number of bits used for each colour). |
Methods inherited from class java.lang.Object |
|
Field Detail |
public static final int NOT_USED
protected int[] m_aPixels
protected int m_width
protected int m_height
protected int m_pitch
protected int m_numRedBits
protected int m_numGreenBits
protected int m_numBlueBits
protected int m_keyColorRed
protected int m_keyColorGreen
protected int m_keyColorBlue
protected int[] m_aPalette
Constructor Detail |
public BitmapData(int[] aPixels, int width, int height, int pitch)
aPixels
- The pixels in default colour format.width
- The width of the bitmap.height
- The height of the bitmap.pitch
- The number of pixels to step one pixel downwards.public BitmapData(int[] aPixels, int width, int height, int pitch, int keyColorRed, int keyColorGreen, int keyColorBlue)
aPixels
- The pixels in default colour format.width
- The width of the bitmap.height
- The height of the bitmap.pitch
- The number of pixels to step one pixel downwards.keyColorRed
- The alpha key colours red component value.keyColorGreen
- The alpha key colours green component value.keyColorBlue
- The alpha key colours blue component value.aPalette
- The palette array (in default RGB format).public BitmapData(int[] aPixels, int width, int height, int pitch, int[] aPalette)
aPixels
- The pixels in default colour format.width
- The width of the bitmap.height
- The height of the bitmap.pitch
- The number of pixels to step one pixel downwards.aPalette
- The palette array (in default RGB format).public BitmapData(int[] aPixels, int width, int height, int pitch, int keyColorRed, int keyColorGreen, int keyColorBlue, int[] aPalette)
aPixels
- The pixels in default colour format.width
- The width of the bitmap.height
- The height of the bitmap.pitch
- The number of pixels to step one pixel downwards.keyColorRed
- The alpha key colours red component value.keyColorGreen
- The alpha key colours green component value.keyColorBlue
- The alpha key colours blue component value.aPalette
- The palette array (in default RGB format).Method Detail |
public int[] getPixels()
public int getNumRedBits()
public int getNumGreenBits()
public int getNumBlueBits()
public void setColourBits(int numRedBits, int numGreenBits, int numBlueBits)
numRedBits
- The number of bits used for the red colour.numGreenBits
- The number of bits used for the green colour.numBlueBits
- The number of bits used for the blue colour.public final boolean isPaletted()
public int[] getPalette()
public int getWidth()
public int getPitch()
public int getHeight()
public int getKeyColorRed()
public int getKeyColorGreen()
public int getKeyColorBlue()
public boolean isKeyColourInUse()
public BitmapData getCopy()
private BitmapData getRectData(int srcX, int srcY, int srcWidth, int srcHeight)
|
GF4J 0.9.4 Beta | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |