|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
@Role public interface ImageProcessor
Component used to process images.
Method Summary | |
---|---|
boolean |
isMimeTypeSupported(String mimeType)
|
Image |
readImage(InputStream inputStream)
Reads an image from an input stream. |
RenderedImage |
scaleImage(Image image,
int width,
int height)
Scales the given image to the specified dimensions. |
void |
writeImage(RenderedImage image,
String mimeType,
float quality,
OutputStream out)
Encodes the given image to match the specified mime type, if possible, and writes it to the output stream, using the specified compression quality if appropriate. |
Method Detail |
---|
Image readImage(InputStream inputStream) throws IOException
inputStream
- the input stream to read the image from
IOException
- if reading the image failsvoid writeImage(RenderedImage image, String mimeType, float quality, OutputStream out) throws IOException
image
- the image to be written to the output streammimeType
- the image mime type (e.g. (e.g. "image/jpeg" or "image/png")quality
- the compression quality; use this parameter to reduce the size, i.e. the number of bytes, of the
imageout
- the output stream to write the image to
IOException
- if writing the image failsRenderedImage scaleImage(Image image, int width, int height)
image
- the image to be scaledwidth
- the new image widthheight
- the new image height
boolean isMimeTypeSupported(String mimeType)
mimeType
- the mime type to be checked
true
if the given mime type is supported, false
otherwise
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |