danger.ui
Class IntBitmap

java.lang.Object
  extended by danger.ui.Bitmap
      extended by danger.ui.IntBitmap


public class IntBitmap
extends Bitmap

It's like a Bitmap, but the pixel data is an int[]. Fantastic.


Nested Class Summary
 
Nested classes/interfaces inherited from class danger.ui.Bitmap
Bitmap.FromResource
 
Field Summary
 
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
IntBitmap(int[] pixels, int width, int height, int colorspace, int transparentColor, int paletteSize)
          Construct an instance with int[] pixel data.
IntBitmap(IntBitmap src)
           
 
Method Summary
 int[] getInts()
          Returns a reference to the pixel array for this bitmap
 int getPoint(int x, int y)
          Returns the 32-bit ARGB color of an individual pixel.
 void setInts(int[] pixels)
          Set the pixels of this bitmap from the array passed in.
 void setTransparentColor(int color)
          Directly set the transparent color for this bitmap.
 
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, setTransparentColorRGB, toString
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

IntBitmap

public IntBitmap(int[] pixels,
                 int width,
                 int height,
                 int colorspace,
                 int transparentColor,
                 int paletteSize)
Construct an instance with int[] 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 bitmap
height - >= 0; the height of the bitmap
colorspace - the colorspace; see ColorSpace
transparentColor - what color ought to be considered "transparent" when drawing the bitmap; use -1 if there is to be no transparency
paletteSize - 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

IntBitmap

public IntBitmap(IntBitmap src)
Method Detail

setInts

public void setInts(int[] 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:
getInts()

getInts

public int[] getInts()
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:
setInts(int[])

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 pixel
y - the y coordinate of the pixel
Returns:
the color of the pixel in 32-bit ARGB format

setTransparentColor

public void setTransparentColor(int color)
Description copied from class: Bitmap
Directly set the transparent color for this bitmap. No processing is done on the given color. It is installed as is.

Overrides:
setTransparentColor in class Bitmap
Parameters:
color - A colorspace dependent integer to use as the transparent color.