public interface ImageProcessor extends Application.Module
| Modifier and Type | Interface and Description |
|---|---|
static class |
ImageProcessor.CropRectangle
Holds the coordinates that we use to crop an image.
|
static class |
ImageProcessor.Dimensions
The size of a rectangular image, in pixels.
|
static class |
ImageProcessor.ImageProcessorException
A problem with the image.
|
Application.Component.LifecycleState| Modifier and Type | Field and Description |
|---|---|
static int |
MINIMUM_CROP_SIZE
We won't let you crop to smaller than this many pixels wide or high.
|
| Modifier and Type | Method and Description |
|---|---|
InputStream |
cropAndScale(InputStream image,
ImageProcessor.CropRectangle crop,
ImageProcessor.Dimensions limits)
Create a new image from a portion of the supplied image, and reduce to
fit a limiting size.
|
ImageProcessor.Dimensions |
getDimensions(InputStream image)
How big is the image contained in this stream?
|
shutdown, startupstatic final int MINIMUM_CROP_SIZE
ImageProcessor.Dimensions getDimensions(InputStream image) throws ImageProcessor.ImageProcessorException, IOException
image - The image stream. This method will not close it.ImageProcessor.ImageProcessorException - if the stream does not contain a valid image.IOException - if the stream cannot be read.InputStream cropAndScale(InputStream image, ImageProcessor.CropRectangle crop, ImageProcessor.Dimensions limits) throws ImageProcessor.ImageProcessorException, IOException
image - The image stream. This method will not close it.crop - x and y determine the upper left corner of the crop area.
height and width determine the size of the crop area.limits - The resulting image will be reduced as necessary to fit within
these dimensions.ImageProcessor.ImageProcessorException - If the image is smaller than the minimum crop size, or if
there is another problem cropping the image.IOException - if the image stream cannot be read.Copyright © 2016. All rights reserved.