|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectj2d.ImageSaveUtils
public class ImageSaveUtils
Nested Class Summary | |
---|---|
static class |
ImageSaveUtils.ImageUtilException
|
Field Summary | |
---|---|
static java.lang.String |
BMP
|
static float[] |
CIRCLE_3
|
static int |
EDGES_FREICHEN
|
static int |
EDGES_PREWITT
|
static int |
EDGES_ROBERTS
|
static int |
EDGES_SOBEL
|
static java.util.Map<java.lang.String,java.lang.String> |
fileStoreOpts
|
static java.lang.String |
FPX
|
static float[] |
FREICHEN_H
|
static float[] |
FREICHEN_V
|
static java.lang.String |
GIF
|
static java.lang.String |
JPEG
|
static java.lang.String |
JPG
|
static java.lang.String |
PNG
|
static java.lang.String |
PNM
|
static float[] |
PREWITT_H
|
static float[] |
PREWITT_V
|
static float[] |
RECTANGLE_3x9
|
static float[] |
RECTANGLE_9x3
|
static float[] |
ROBERTS_H
|
static float[] |
ROBERTS_V
|
static float[] |
SOBEL_H
|
static float[] |
SOBEL_V
|
static float[] |
SQUARE_3
|
static java.lang.String[] |
supportedFormats
|
static java.lang.String |
TIF
|
static java.lang.String |
TIFF
|
Constructor Summary | |
---|---|
ImageSaveUtils()
|
Method Summary | |
---|---|
static javax.media.jai.PlanarImage |
close(javax.media.jai.PlanarImage image,
float[] data,
int width,
int height)
|
static javax.media.jai.PlanarImage |
detectEdges(javax.media.jai.PlanarImage image,
int method)
|
static javax.media.jai.PlanarImage |
detectFCEdges(javax.media.jai.PlanarImage image)
Applies a Frei-Chen edge detection algorithm. |
static javax.media.jai.PlanarImage |
dilate(javax.media.jai.PlanarImage image,
float[] data,
int width,
int height)
|
static javax.media.jai.PlanarImage |
drawLine(javax.media.jai.PlanarImage image,
int startx,
int starty,
int width,
int height)
|
static javax.media.jai.PlanarImage |
erode(javax.media.jai.PlanarImage image,
float[] data,
int width,
int height)
|
static javax.media.jai.PlanarImage |
grayscale(javax.media.jai.PlanarImage image)
Converts an image to a grayscale image. |
static javax.media.jai.PlanarImage |
loadImage(java.io.File file)
Attempts to load an image from the specified file. |
static javax.media.jai.PlanarImage |
loadImage(java.io.InputStream is)
Attempts to load an image from the provided InputStream. |
static javax.media.jai.PlanarImage |
newImage(javax.media.jai.PlanarImage src,
int width,
int height,
boolean black)
|
static javax.media.jai.PlanarImage |
open(javax.media.jai.PlanarImage image,
float[] data,
int width,
int height)
|
static javax.media.jai.PlanarImage |
pureBW(javax.media.jai.PlanarImage source)
|
static void |
saveImage(javax.media.jai.PlanarImage image,
java.io.OutputStream os)
Writes the provided image to an output stream as a JPEG image. |
static void |
saveImage(javax.media.jai.PlanarImage image,
java.io.OutputStream os,
java.lang.String format)
Writes the provided image to an output stream. |
static java.lang.String |
saveImage(java.lang.String name,
java.io.File dir,
javax.media.jai.PlanarImage image,
java.lang.String format)
Saves the provided image. |
static javax.media.jai.PlanarImage |
scaleImage(javax.media.jai.PlanarImage image,
float factor,
javax.media.jai.Interpolation interp)
Scales an image by the specified factor optionally using the provided interpolation algorithm. |
static javax.media.jai.PlanarImage |
scaleImage(javax.media.jai.PlanarImage image,
int maxX,
int maxY,
boolean enlarge,
javax.media.jai.Interpolation interp)
Scales the provided image to fit within the maximum x, y coordinates specified. |
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final java.lang.String TIF
public static final java.lang.String TIFF
public static final java.lang.String BMP
public static final java.lang.String FPX
public static final java.lang.String GIF
public static final java.lang.String JPEG
public static final java.lang.String JPG
public static final java.lang.String PNG
public static final java.lang.String PNM
public static final java.lang.String[] supportedFormats
public static final java.util.Map<java.lang.String,java.lang.String> fileStoreOpts
public static final int EDGES_SOBEL
public static final int EDGES_ROBERTS
public static final int EDGES_PREWITT
public static final int EDGES_FREICHEN
public static final float[] SOBEL_H
public static final float[] SOBEL_V
public static final float[] ROBERTS_H
public static final float[] ROBERTS_V
public static final float[] PREWITT_H
public static final float[] PREWITT_V
public static final float[] FREICHEN_H
public static final float[] FREICHEN_V
public static final float[] SQUARE_3
public static final float[] CIRCLE_3
public static final float[] RECTANGLE_9x3
public static final float[] RECTANGLE_3x9
Constructor Detail |
---|
public ImageSaveUtils()
Method Detail |
---|
public static javax.media.jai.PlanarImage loadImage(java.io.File file)
file
- An File containing the image data.
public static javax.media.jai.PlanarImage loadImage(java.io.InputStream is)
is
- An InputStream containing the image data.
public static java.lang.String saveImage(java.lang.String name, java.io.File dir, javax.media.jai.PlanarImage image, java.lang.String format) throws ImageSaveUtils.ImageUtilException
name
- The name of the image (without the file extension).dir
- The directory in which the image is to be saved.image
- The image to be saved.format
- The format in which the image is to be saved. This must
be one of the formats specified by
ImageUtils.supportedFormats.
ImageSaveUtils.ImageUtilException
public static void saveImage(javax.media.jai.PlanarImage image, java.io.OutputStream os, java.lang.String format) throws ImageSaveUtils.ImageUtilException
image
- The image to be written.os
- The output stream to which the image will be written.format
- The format in which the image is to be saved. This must
a format specified by ImageUtils.supportedFormats.
ImageSaveUtils.ImageUtilException
public static void saveImage(javax.media.jai.PlanarImage image, java.io.OutputStream os) throws ImageSaveUtils.ImageUtilException
image
- The image to be written.os
- The output stream to which the image will be written.
ImageSaveUtils.ImageUtilException
public static javax.media.jai.PlanarImage scaleImage(javax.media.jai.PlanarImage image, float factor, javax.media.jai.Interpolation interp)
image
- The image to be scaled.factor
- The factor by which to scale the image.interp
- (optional) The interpolation algorithm to be used. If
this is null, a default interpolation algorithm will be applied.
public static javax.media.jai.PlanarImage scaleImage(javax.media.jai.PlanarImage image, int maxX, int maxY, boolean enlarge, javax.media.jai.Interpolation interp)
image
- The image to be scaled.maxX
- The maximum number of pixels in the x direction.maxY
- The maximum number of pixels in the y direction.enlarge
- flag indicating whether to increase the image size if it
is already smaller than the the provided x, y coordinates.interp
- (optional) The interpolation algorithm to be used. If
this is null, a default interpolation algorithm will be applied.
public static javax.media.jai.PlanarImage grayscale(javax.media.jai.PlanarImage image)
image
- The image to be converted.
public static javax.media.jai.PlanarImage detectFCEdges(javax.media.jai.PlanarImage image)
image
- The image to convert.
public static javax.media.jai.PlanarImage detectEdges(javax.media.jai.PlanarImage image, int method)
public static javax.media.jai.PlanarImage dilate(javax.media.jai.PlanarImage image, float[] data, int width, int height)
public static javax.media.jai.PlanarImage erode(javax.media.jai.PlanarImage image, float[] data, int width, int height)
public static javax.media.jai.PlanarImage open(javax.media.jai.PlanarImage image, float[] data, int width, int height)
public static javax.media.jai.PlanarImage close(javax.media.jai.PlanarImage image, float[] data, int width, int height)
public static javax.media.jai.PlanarImage drawLine(javax.media.jai.PlanarImage image, int startx, int starty, int width, int height)
public static javax.media.jai.PlanarImage pureBW(javax.media.jai.PlanarImage source)
public static javax.media.jai.PlanarImage newImage(javax.media.jai.PlanarImage src, int width, int height, boolean black)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |