|
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.engines.msjava4x.CPixelConverter
Implementation of an pixel converter that converts arrays containing bitmap data from one pixel format to another.
Field Summary | |
private int |
m_alphaMask
The alpha mask. |
private int |
m_alphaMaskBeginIdx
The alpha mask beginning index. |
private int |
m_blueMask
The blue mask. |
private int |
m_blueMaskBeginIdx
The blue mask beginning index. |
private int |
m_greenMask
The green mask. |
private int |
m_greenMaskBeginIdx
The green mask beginning index. |
private int |
m_numAlphaMaskBits
The alpha mask bit count. |
private int |
m_numBlueMaskBits
The blue mask bit count. |
private int |
m_numGreenMaskBits
The green mask bit count. |
private int |
m_numRedMaskBits
The red mask bit count. |
private int |
m_redMask
The red mask. |
private int |
m_redMaskBeginIdx
The red mask beginning index. |
Constructor Summary | |
CPixelConverter(com.ms.directX.DDPixelFormat pixelFormat)
Constructs a pixel converter that converts between the given format and the Java native 0xAARRGGBB format. |
|
CPixelConverter(int alphaMask,
int redMask,
int greenMask,
int blueMask)
Constructs a pixel converter that converts between the given format and the Java native 0xAARRGGBB format. |
Method Summary | |
void |
convertFromJavaNative(int[] aiPixels)
Converts pixels in Java native format to the pixel format given in the constructor. |
void |
convertToJavaNative(int[] aiPixels)
Converts pixels in the pixel format given in the constructor to Java native format. |
(package private) static int |
getIntensity(int pixelValue,
int mask)
Maps the given pixel value with the given mask to an 8-bit color intensity value. |
private int |
getMaskBeginIdx(int mask)
Calculates the beginning index of the given mask. |
private int |
getMaskBits(int mask)
Calculates the number of bits in the given mask. |
int |
getNumBlueBits()
Returns the number of bits used to represent the blue component. |
int |
getNumGreenBits()
Returns the number of bits used to represent the green component. |
int |
getNumRedBits()
Returns the number of bits used to represent the red component. |
(package private) static int |
getPixelValue(int colorIntensity,
int mask)
Maps the given value (0x00-0xFF) to the given mask. |
Methods inherited from class java.lang.Object |
|
Field Detail |
private int m_alphaMask
private int m_redMask
private int m_greenMask
private int m_blueMask
private int m_alphaMaskBeginIdx
private int m_redMaskBeginIdx
private int m_greenMaskBeginIdx
private int m_blueMaskBeginIdx
private int m_numAlphaMaskBits
private int m_numRedMaskBits
private int m_numGreenMaskBits
private int m_numBlueMaskBits
Constructor Detail |
public CPixelConverter(com.ms.directX.DDPixelFormat pixelFormat)
pixelFormat
- The DirectDraw pixel format.public CPixelConverter(int alphaMask, int redMask, int greenMask, int blueMask)
alphaMask
- The alpha value mask.redMask
- The red value mask.greenMask
- The green value mask.blueMask
- The blue value mask.Method Detail |
public int getNumRedBits()
public int getNumGreenBits()
public int getNumBlueBits()
public void convertToJavaNative(int[] aiPixels)
aiPixels
- The pixels in original format, changed to Java native.public void convertFromJavaNative(int[] aiPixels)
aiPixels
- The pixels in Java native, changed to original format.private final int getMaskBeginIdx(int mask)
mask
- The bitmask whose beginning is calculated.private final int getMaskBits(int mask)
mask
- The bitmask whose bits are counted.static final int getPixelValue(int colorIntensity, int mask)
colorIntensity
- The value of a color intensity.mask
- The mask for the specific color.static int getIntensity(int pixelValue, int mask)
pixelValue
- The pixel.mask
- The mask of the color component we want to extract
|
GF4J 0.9.4 Beta | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |