|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object edu.uci.ics.jung.visualization.FourPassImageShaper
public class FourPassImageShaper
Provides factory methods that, given a BufferedImage, an Image, or the fileName of an image, will return a java.awt.Shape that is the contiguous traced outline of the opaque part of the image. This could be used to define an image for use in a Vertex, where the shape used for picking and edge-arrow placement follows the opaque part of an image that has a transparent background. The methods try to detect lines in order to minimize points in the path
Constructor Summary | |
---|---|
FourPassImageShaper()
|
Method Summary | |
---|---|
static Shape |
getShape(BufferedImage image)
|
static Shape |
getShape(BufferedImage image,
int max)
Given an image, possibly with a transparent background, return the Shape of the opaque part of the image If the image is larger than max in either direction, scale the image down to max-by-max, do the trace (on fewer points) then scale the resulting shape back up to the size of the original image. |
static Shape |
getShape(Image image)
Given an image, possibly with a transparent background, return the Shape of the opaque part of the image |
static Shape |
getShape(Image image,
int max)
|
static Shape |
getShape(String fileName)
given the fileName of an image, possibly with a transparent background, return the Shape of the opaque part of the image |
static Shape |
getShape(String fileName,
int max)
|
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public FourPassImageShaper()
Method Detail |
---|
public static Shape getShape(String fileName)
fileName
- name of the image, loaded from the classpath
public static Shape getShape(String fileName, int max)
public static Shape getShape(Image image)
image
-
public static Shape getShape(Image image, int max)
public static Shape getShape(BufferedImage image, int max)
image
- the image to tracemax
- used to restrict number of points in the resulting shape
public static Shape getShape(BufferedImage image)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |