|
|||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--image | +--BinaryFast
Class BinaryFast is a representation of a binary image storing the foreground and background edge pixels in hash tables for efficiency.
Field Summary | |
static int |
background
Background is black. |
java.util.HashSet |
backgroundEdgePixels
The hash set storing positions of background edge pixels as Points. |
static int |
foreground
Foreground is white. |
java.util.HashSet |
foregroundEdgePixels
The hash set storing positions of foreground edge pixels as Points. |
int |
h
Height of the image. |
int[][] |
pixels
The 2D array of all pixels. |
int |
s
Size of the image (w*h), number of pixels. |
int |
w
Width of the image. |
Fields inherited from class image |
height,
width |
Constructor Summary | |
BinaryFast()
|
|
BinaryFast(BinaryFast oldBinary)
|
|
BinaryFast(image oldimage)
Constructor taking an image and converting it to a BinaryFast image |
|
BinaryFast(int[][] p,
int width,
int height)
Constructor taking a 2D array of pixel values. |
Method Summary | |
void |
addPixel(java.awt.Point p)
Adds a foreground pixel to the 2D array by setting its value to foreground. |
int[] |
convertToArray()
Converts the 2D array into a 1D array of pixel values. |
void |
convertToPixels(java.util.HashSet pix)
Adds the pixels from a hash set to the 2D array of pixels. |
void |
generateBackgroundEdgeFromForegroundEdge()
Generates the background edge hash set from the foreground edge hash set and the 2D array of pixels. |
void |
generateForegroundEdge()
Generates the foreground edge hash set from the 2D array of pixels. |
void |
generateForegroundEdgeFromBackgroundEdge()
Generates the foreground edge hash set from the background edge hash set and the 2D array of pixels. |
void |
generatePixels(java.util.HashSet pix)
Generates a new 2D array of pixels from a hash set of foreground pixels. |
int[] |
getValues()
Returns the int [] values of the Binary Fast image |
void |
removePixel(java.awt.Point p)
Removes a foreground pixel from the 2D array by setting its value to background. |
Methods inherited from class image |
getHeight,
getWidth |
Methods inherited from class java.lang.Object |
clone,
equals,
finalize,
getClass,
hashCode,
notify,
notifyAll,
toString,
wait,
wait,
wait |
Field Detail |
public static final int background
public static final int foreground
public int w
public int h
public int s
public int[][] pixels
public java.util.HashSet foregroundEdgePixels
public java.util.HashSet backgroundEdgePixels
Constructor Detail |
public BinaryFast(image oldimage)
public BinaryFast(int[][] p, int width, int height)
p
- The 2D array of pixel values.width
- The width of the image.height
- The height of the image.public BinaryFast()
public BinaryFast(BinaryFast oldBinary)
Method Detail |
public void removePixel(java.awt.Point p)
p
- The point to be removed.public void addPixel(java.awt.Point p)
p
- The point to be added.public int[] convertToArray()
public void generatePixels(java.util.HashSet pix)
pix
- The hash set of foreground pixels.public void convertToPixels(java.util.HashSet pix)
pix
- The hash set of foreground pixels to be added.public void generateForegroundEdge()
public void generateBackgroundEdgeFromForegroundEdge()
public void generateForegroundEdgeFromBackgroundEdge()
public int[] getValues()
|
|||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |