danger.ui
Class ShortBitmap
java.lang.Object
danger.ui.Bitmap
danger.ui.ShortBitmap
public class ShortBitmap
- extends Bitmap
A Bitmap class that uses short[] to hold its pixel data.
| Fields inherited from class danger.ui.Bitmap |
COMPOSE_ALPHA, COPYBITS_ALPHA, COPYBITS_ALPHA_MASK, COPYBITS_CLAMP_TRANSPARENCY, COPYBITS_FLAGS_MASK, COPYBITS_INTERPOLATED, COPYBITS_INVERTED, COPYBITS_NORMAL_BLIT, COPYBITS_SRCOVER, COPYBITS_SRCOVER_TRANS, DONT_PRESERVE_TRANSPARENCY, NO_COMPOSE_ALPHA, PALETTE_BGR16, PALETTE_BGR16_ALPHA, PALETTE_BGR16_OFFSET, PALETTE_FLAGS_MASK, PALETTE_NONE, PALETTE_RGB16_LE, PALETTE_RGB16_LE_ALPHA, PALETTE_RGB16_LE_OFFSET, PALETTE_SIZE_MASK, PRESERVE_TRANSPARENCY |
|
Constructor Summary |
ShortBitmap(short[] pixels,
int width,
int height,
int colorspace,
int transparentColor,
int paletteSize)
Construct an instance with short[] pixel data. |
ShortBitmap(ShortBitmap src)
|
|
Method Summary |
int |
getPoint(int x,
int y)
Returns the 32-bit ARGB color of an individual pixel. |
short[] |
getShorts()
Returns a reference to the pixel array for this bitmap |
void |
setShorts(short[] pixels)
Set the pixels of this bitmap from the array passed in. |
| Methods inherited from class danger.ui.Bitmap |
canDrawInverted, cloneAndFlipX, cloneAndFlipY, convertToScreenColorSpace, convertToScreenColorSpace, convertToScreenColorSpace, convertToScreenColorSpace, copy, copy, copy, copyBits, copyBits, copyBitsInterpolated, copyBitsTo, copyInterpolated, copyRotated, copyScaled, createOptimalBitmap, createPen, createPen, flatten, flipX, flipY, getColorSpace, getFlattenedSize, getHeight, getPalette, getPaletteFlags, getPaletteOffset, getPaletteSize, getPixels, getPoint, getStride, getTransparentColor, getTransparentColorRGB, getWidth, isGrayscale, mirror, newFromEncodedData, newFromFlattenedData, newFromJPEGData, newFromPNGData, replaceColor, replacePaletteColor, replacePaletteColors, rotateBy, scaleTo, setPalette, setPixels, setTo, setTransparentColor, setTransparentColorRGB, toString |
ShortBitmap
public ShortBitmap(short[] pixels,
int width,
int height,
int colorspace,
int transparentColor,
int paletteSize)
- Construct an instance with short[] pixel data.
- Parameters:
pixels - null-ok; the pixels of the bitmap, or null
if the bitmap is to be initially blank; if non-null then
the pixels become shared (modifying the original array affects the
constructed instance)width - >= 0; the width of the bitmapheight - >= 0; the height of the bitmapcolorspace - the colorspace; see ColorSpacetransparentColor - what color ought to be considered "transparent"
when drawing the bitmap; use -1 if there is to be no
transparencypaletteSize - the number of colors in the palette; if >=
0, then the palette is located just past the end of the pixel
data per se in pixels
ShortBitmap
public ShortBitmap(ShortBitmap src)
getShorts
public short[] getShorts()
- Returns a reference to the pixel array for this bitmap
- Returns:
- a reference to the pixel array for this bitmap
- Since:
- 4.0
- See Also:
getShorts()
setShorts
public void setShorts(short[] pixels)
- Set the pixels of this bitmap from the array passed in.
- Parameters:
pixels - the new pixel array for this bitmap- Since:
- 4.0
- See Also:
getShorts()
getPoint
public int getPoint(int x,
int y)
- Description copied from class:
Bitmap
- Returns the 32-bit ARGB color of an individual pixel.
- Overrides:
getPoint in class Bitmap
- Parameters:
x - the x coordinate of the pixely - the y coordinate of the pixel
- Returns:
- the color of the pixel in 32-bit ARGB format