|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectucar.unidata.ui.ImageUtils
public class ImageUtils
Provides a set of image manipulation utilities
| Field Summary | |
|---|---|
static boolean |
debug
debug flag |
| Constructor Summary | |
|---|---|
ImageUtils()
|
|
| Method Summary | |
|---|---|
static BufferedImage |
clip(BufferedImage image,
int[] ul,
int[] lr)
Clip the image |
static String |
convertImageTo(String file,
String newType)
Convert an image to a new type |
static JEditorPane |
getEditor(JEditorPane editor,
String html,
int width,
Color transparentColor,
Font font)
_more_ |
static JEditorPane |
getEditor(String html,
int width,
Color transparentColor,
Font font)
_more_ |
static Image |
getImage(Component component)
Get the screen image from the component |
static Image |
getImage(JEditorPane editor,
Color transparentColor)
_more_ |
static Image |
getImageFile(String file)
Read in the image from the given filename or url |
static Image |
gridImages(List images,
int space,
Color bg,
int columns)
Merge images |
static boolean |
hasAlpha(Image image)
Check to see if the image has alpha |
static boolean |
isImage(String file)
|
static void |
main(String[] args)
Read in the image. |
static BufferedImage |
makeColorTransparent(Image im,
Color c)
Make a color in the image transparent |
static BufferedImage |
makeColorTransparent(Image im,
int[] redRange,
int[] greenRange,
int[] blueRange)
Set the colors taht are within the given red, green and blue ranges to be transparent. |
static BufferedImage |
matte(BufferedImage image,
int top,
int bottom,
int left,
int right,
Color bg)
Add a matte border around the image |
static Image |
mergeImages(List images,
int space,
Color bg)
Merge images |
static Point |
parsePoint(String s,
Rectangle r)
Parse the string specification of a point with respect to the rectangle. |
static Image |
readImage(String imagePath)
Read and image |
static Image |
renderHtml(String html,
int width,
Color transparentColor,
Font font)
_more_ |
static Image |
resize(Image image,
int width,
int height)
Resize an image |
static BufferedImage |
toBufferedImage(Image image)
This method returns a buffered image with the contents of an image |
static BufferedImage |
toBufferedImage(Image image,
int type)
Create a BufferedImage from the given image |
static Point |
toPoint(Point2D p)
convenience to convert to a Point |
static Image |
waitOnImage(Image image)
Wait until it is loaded in. |
static void |
writeAvi(List imageFiles,
double frameRateInFPS,
File outFile)
Write an AVI file |
static boolean |
writeImage(JDialog window,
String file)
Make a screen capture of the window. |
static boolean |
writeImage(JFrame window,
String file)
Make a screen capture of the window. |
static void |
writeImageToFile(Component component,
String saveFile)
Take a screen snapshot of the component. |
static void |
writeImageToFile(Image image,
String saveFile)
Write a Buffered image to a file |
static void |
writeImageToFile(Image image,
String saveFile,
float quality)
Write a Buffered image to a file at a particular quality |
static void |
writeImageToFile(Image image,
String saveFile,
OutputStream os,
float quality)
|
static void |
writePDF(OutputStream out,
JComponent comp)
_more_ |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
public static boolean debug
| Constructor Detail |
|---|
public ImageUtils()
| Method Detail |
|---|
public static BufferedImage matte(BufferedImage image,
int top,
int bottom,
int left,
int right,
Color bg)
image - The imagetop - top spacebottom - bottom spaceleft - left spaceright - right spacebg - Background color
public static BufferedImage clip(BufferedImage image,
int[] ul,
int[] lr)
image - The imageul - upper leftlr - lower right
public static Image readImage(String imagePath)
imagePath - the path to the image
public static Image waitOnImage(Image image)
image - the image
public static BufferedImage makeColorTransparent(Image im,
Color c)
im - imagec - the color to make transparent
public static BufferedImage makeColorTransparent(Image im,
int[] redRange,
int[] greenRange,
int[] blueRange)
im - The imageredRange - red rangegreenRange - green rangeblueRange - blue range
public static Point toPoint(Point2D p)
p - point
public static Point parsePoint(String s,
Rectangle r)
ul um ur ml mm mr ll lm lrWhere u=upper,m=middle,l=lower r=right,l=left
s - Stirng specr - Reference rect
public static BufferedImage toBufferedImage(Image image)
image - the image
public static Image mergeImages(List images,
int space,
Color bg)
images - list of imagesspace - space between imagesbg - background color
public static Image gridImages(List images,
int space,
Color bg,
int columns)
images - list of imagesspace - space between imagesbg - background color
public static BufferedImage toBufferedImage(Image image,
int type)
image - The imagetype - BufferedImage type
public static boolean hasAlpha(Image image)
image - the image
public static Image getImage(Component component)
throws Exception
component - The component.
Exception
public static void writeImageToFile(Image image,
String saveFile)
throws Exception
image - image to writesaveFile - file to write to
Exception - problem writing file
public static String convertImageTo(String file,
String newType)
file - image filenewType - new image type
public static void writeImageToFile(Image image,
String saveFile,
float quality)
throws Exception
image - image to writesaveFile - file to write toquality - image quality (if supported)
Exception - problem writing file
public static void writeImageToFile(Image image,
String saveFile,
OutputStream os,
float quality)
throws Exception
Exceptionpublic static boolean isImage(String file)
public static boolean writeImage(JDialog window,
String file)
throws Exception
window - The windowfile - The file
Exception
public static boolean writeImage(JFrame window,
String file)
throws Exception
window - The windowfile - The file
Exception
public static void writeImageToFile(Component component,
String saveFile)
throws Exception
component - The component.saveFile - The file.
Exception
public static void writeAvi(List imageFiles,
double frameRateInFPS,
File outFile)
throws IOException
imageFiles - list of filesframeRateInFPS - frame rateoutFile - output file
IOException - problem writing AVI
public static Image resize(Image image,
int width,
int height)
image - the imagewidth - new widthheight - new height
public static Image getImage(JEditorPane editor,
Color transparentColor)
throws Exception
editor - _more_transparentColor - _more_
Exception - _more_
public static Image renderHtml(String html,
int width,
Color transparentColor,
Font font)
throws Exception
html - _more_width - _more_transparentColor - _more_font - _more_
Exception - _more_
public static JEditorPane getEditor(String html,
int width,
Color transparentColor,
Font font)
throws Exception
html - _more_width - _more_transparentColor - _more_font - _more_
Exception - _more_
public static JEditorPane getEditor(JEditorPane editor,
String html,
int width,
Color transparentColor,
Font font)
throws Exception
editor - _more_html - _more_width - _more_transparentColor - _more_font - _more_
Exception - _more_
public static void writePDF(OutputStream out,
JComponent comp)
throws IOException
out - _more_comp - _more_
IOException - _more_
public static void main(String[] args)
throws Exception
args - args
Exception - problem with this
public static Image getImageFile(String file)
throws Exception
file - File or url
Exception - On badness
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||