|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
public interface ImgProcessor
An image processor (short ImgProcesor) represent an object with the ability to manipulate image data. The image data is passed as InputStream. The edited image data is encoded at least in JPEG or TIFF and passed as OutputStream. There are two modes how the processor work. The first mode is when you want to perform only one image operation. So you can use the methods which has input and output parameter. The second mode is when you want to perform several image operation on the same image like "scale, encode, scale, encode,...". So first you have to load the image into the processor and then you can perform any image operation.
| Method Summary | |
|---|---|
void |
encode(InputStream input,
OutputStream output,
int encoder)
Change the format of an image. |
Dimension |
getCurrentSize()
Returns the size of the edited image. |
Dimension |
getImageSize(InputStream input)
Returns the size of the image which is passed as InputStream. |
float |
getJpegQuality()
Return the JPEG quality setting of the image processor. |
Dimension |
getOrigSize()
Returns the original image size of the image currently loades in the processor. |
float |
getScaleFactor()
Returns the scale factor used for the accomplished scale operation. |
boolean |
hasCorrectTileSize()
Check if an image loaded into the processor has the correct tile size. |
void |
jpegEncode(OutputStream output)
Encode the loaded image as a JPEG image to a given OutputStream. |
void |
loadImage(InputStream input)
Loads an image into the processor. |
void |
resize(InputStream input,
int newWidth,
int newHeight,
OutputStream output)
Scales the image to fit into the new width and height in due proportion and encode it depending on the encoder setting of the ImgProcessor. |
void |
resize(int newWidth,
int newHeight)
Scales the image to fit into the new width and height in due proportion. |
void |
resizeFitHeight(InputStream input,
int newHeight,
OutputStream output)
Scales the image to the new height and encode it depending on the encoder setting of the ImgProcessor. |
void |
resizeFitHeight(int newHeight)
Scales the image to the new height in due proportion. |
void |
resizeFitWidth(InputStream input,
int newWidth,
OutputStream output)
Scales the image to the new width in due proportion and encode it depending on the encoder setting of the ImgProcessor. |
void |
resizeFitWidth(int newWidth)
Scales the image to the new width in due proportion. |
void |
scale(float scaleFactor)
Scales the image with the given scale factor in due proportion. |
void |
scale(InputStream input,
float scaleFactor,
OutputStream output)
Scales the image with the given scale factor in due proportion and encode it depending on the encoder setting of the ImgProcessor. |
void |
scaleROI(InputStream input,
int xTopPos,
int yTopPos,
int boundWidth,
int boundHeight,
float scaleFactor,
OutputStream output)
Scales the image with the given scale factor in due proportion cut off a region of interest and encode it depending on the encoder setting of the ImgProcessor. |
void |
scaleROI(int xTopPos,
int yTopPos,
int boundWidth,
int boundHeight,
float scaleFactor)
Scales the image with the given scale factor in due proportion cut off a region of interest and encode it depending on the encoder setting of the ImgProcessor. |
void |
setJpegQuality(float jpegQuality)
Set the JPEG quality of the image processor. |
void |
setTileSize(int tileWidth,
int tileHeight)
Set the tile width and height for a TIFF image, which is used in the encoding process. |
void |
tiffEncode(OutputStream output)
Encode the loaded image as a TIFF image to a given OutputStream. |
void |
useEncoder(int encoder)
Set which encoder to use in the encoding process. |
| Method Detail |
|---|
void resizeFitWidth(InputStream input,
int newWidth,
OutputStream output)
input - the image data as InputStreamnewWidth - the new widthoutput - the scaled and encoded image as OutputStream
void resizeFitHeight(InputStream input,
int newHeight,
OutputStream output)
input - the image data as InputStreamnewHeight - the new heightoutput - the scaled and encoded image as OutputStream
void resize(InputStream input,
int newWidth,
int newHeight,
OutputStream output)
input - the image data as InputStreamnewWidth - the new width to fit innewHeight - the new height to fit inoutput - the scaled and encoded image as OutputStream
void scale(InputStream input,
float scaleFactor,
OutputStream output)
input - the image data as InputStreamscaleFactor - the scale factor for width and heightoutput - the scaled and encoded image as OutputStream
void scaleROI(InputStream input,
int xTopPos,
int yTopPos,
int boundWidth,
int boundHeight,
float scaleFactor,
OutputStream output)
input - the image data as InputStreamxTopPos - the x-coordinate of the top left position of the region of
interestyTopPos - the y-coordinate of the top left position of the region of
interestboundWidth - the width of the region of interestboundHeight - the height of the region of interestscaleFactor - the scale factor for width and height of the imageoutput - the scaled and encoded region of interest as OutputStreamfloat getScaleFactor()
float getJpegQuality()
void setJpegQuality(float jpegQuality)
jpegQuality - the float value of the JPEG quality
void setTileSize(int tileWidth,
int tileHeight)
tileWidth - tileHeight -
void useEncoder(int encoder)
throws Exception
encoder - the encoder should be a static field variable of the impleming
class e.g. ImplementedClass.JPEG
Exception - if you enter a number which is not in the encoder list
void encode(InputStream input,
OutputStream output,
int encoder)
throws Exception
input - the image data as InputStreamoutput - the image in a new formatencoder - the encoder should be a static field variable of the impleming
class e.g. ImplementedClass.JPEG
Exception - if you enter a number which is not in the encoder list
Dimension getOrigSize()
throws Exception
Exception - if no image is loaded in the processor
Dimension getCurrentSize()
throws Exception
Exception - if no image is loaded in the processorDimension getImageSize(InputStream input)
input - the image data as InputStream
void loadImage(InputStream input)
input - the image data as InputStream
boolean hasCorrectTileSize()
throws Exception
Exception - if no image is loaded in the processor
void resizeFitWidth(int newWidth)
throws Exception
newWidth - the new width
Exception - if no image is loaded in the processor
void resizeFitHeight(int newHeight)
throws Exception
newHeight - the new height
Exception - if no image is loaded in the processor
void resize(int newWidth,
int newHeight)
throws Exception
newWidth - new width to fit innewHeight - new height to fit in
Exception - if no image is loaded in the processor
void scale(float scaleFactor)
throws Exception
scaleFactor - the scale factor for width and height of the image
Exception - if no image is loaded in the processor
void scaleROI(int xTopPos,
int yTopPos,
int boundWidth,
int boundHeight,
float scaleFactor)
throws Exception
xTopPos - the x-coordinate of the top left position of the region of
interestyTopPos - the y-coordinate of the top left position of the region of
interestboundWidth - the width of the region of interestboundHeight - the height of the region of interestscaleFactor - the scale factor for width and height of the image
Exception - if no image is loaded in the processor
void jpegEncode(OutputStream output)
throws Exception
output - the encoded image
Exception - if no image is loaded in the processor
void tiffEncode(OutputStream output)
throws Exception
output - the encodes image
Exception - if no image is loaded in the processor
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||