public class Bitmap
extends java.lang.Object
implements java.lang.Iterable<java.lang.Integer>
EWAHCompressedBitmap
to enable us to change bitmap implementations if need be.Constructor and Description |
---|
Bitmap() |
Modifier and Type | Method and Description |
---|---|
Bitmap |
and(Bitmap otherBitmap) |
boolean |
equals(java.lang.Object obj) |
static Bitmap |
fromBytes(byte[] bytes,
int x,
int y,
int width,
int height,
int canvasWidth,
int canvasHeight)
Given an array of raw bytes, convert the bytes into a compressed bitmap
representation with 2D characteristics.
|
int |
hashCode() |
boolean |
intersects(Bitmap otherBitmap) |
java.util.Iterator<java.lang.Integer> |
iterator() |
Bitmap |
or(Bitmap otherBitmap) |
boolean |
set(int bit)
Sets the specified bit(s) in the index.
|
int[] |
toArray() |
Bitmap |
xor(Bitmap otherBitmap) |
public boolean set(int bit)
bit
- bit to set (to 1, 'on', etc.)public boolean intersects(Bitmap otherBitmap)
public int[] toArray()
public static Bitmap fromBytes(byte[] bytes, int x, int y, int width, int height, int canvasWidth, int canvasHeight)
One assumption this method makes is that incoming bytes are word-aligned; that is, the width and height of the bytes being converted must be evenly-divisible by 64.
bytes
- The raw bytes to convertx
- The x-coordinate to begin placing the bytesy
- The y-coordinate to begin placing the byteswidth
- The width of the raw data in the arrayheight
- The height of the raw data in the arraycanvasWidth
- The desired width of the bitmap 'canvas' the bytes
will be placed oncanvasHeight
- The desired height of the bitmap 'canvas' the bytes
will be placed onpublic int hashCode()
hashCode
in class java.lang.Object
public boolean equals(java.lang.Object obj)
equals
in class java.lang.Object
public java.util.Iterator<java.lang.Integer> iterator()
iterator
in interface java.lang.Iterable<java.lang.Integer>