|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcs2110.collision.ImageBlocker
public class ImageBlocker
Convert an image into Block objects, and identifies connected components to generate "RigidBody" objects. NOTE: YOU DON'T HAVE TO (or want to!) MODIFY THIS CODE.
Constructor Summary | |
---|---|
ImageBlocker(java.lang.String fileName)
Constructor: an imageblocker for image with name fileName. |
Method Summary | |
---|---|
java.util.ArrayList<Block> |
getBlocks()
Return the nonempty Blocks of the image. |
java.util.ArrayList<java.util.HashSet<Block>> |
getLargeConnectedComponents(double sizeCutoff)
Return a list of the largest connected components. |
static void |
main(java.lang.String[] args)
Program entry point |
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public ImageBlocker(java.lang.String fileName) throws java.io.IOException
fileName
- TGA image filename (RGB, uncompressed) containing rigid image
elements on a white background.
java.io.IOException
- if the Image file cannot be loadedMethod Detail |
---|
public java.util.ArrayList<Block> getBlocks()
public java.util.ArrayList<java.util.HashSet<Block>> getLargeConnectedComponents(double sizeCutoff)
sizeCutoff
- A fraction on [0,1] specifying the cutoff block count for the
components in terms of the largest component size.
public static void main(java.lang.String[] args)
args
- Program arguments
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |