public class ImageShapeUtils extends Object
Constructor and Description |
---|
ImageShapeUtils() |
Modifier and Type | Method and Description |
---|---|
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)
Given the fileName of an image, possibly with a transparent
background, return the Shape of the opaque part of the image
|
public static Shape getShape(String fileName)
fileName
- name of the image, loaded from the classpathpublic static Shape getShape(String fileName, int max)
fileName
- name of the image, loaded from the classpathmax
- the maximum dimension of the traced shapegetShape(Image, int)
public static Shape getShape(Image image)
image
- the image whose shape is to be returnedpublic static Shape getShape(BufferedImage image, int max)
image
- the image to tracemax
- used to restrict number of points in the resulting shapeCopyright © 2015. All rights reserved.