|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectwjhk.jupload2.filedata.helper.ImageHelper
public class ImageHelper
Class that contains various utilities about picture, mainly about picture transformation.
| Field Summary | |
|---|---|
private java.lang.Boolean |
hasToTransformPicture
hasToTransformPicture indicates whether the picture should be transformed. |
private int |
maxHeight
Maximum height for the current transformation |
private int |
maxWidth
Maximum width for the current transformation |
private int |
nbPixelsRead
Indicates the number of pixels that have been read. |
private int |
nbPixelsTotal
Defines the number of pixel for the current picture. |
private PictureFileData |
pictureFileData
The PictureFileData that this helper will have to help. |
private int |
progressBarBaseValue
The value that has the progress bar when starting to load the picture. |
private int |
quarterRotation
Current rotation of the picture: 0 to 3. |
private double |
scale
Current scaling factor. |
private int |
scaledNonRotatedHeight
Same as scaledNonRotatedWidth |
private int |
scaledNonRotatedWidth
Width of picture, after rescaling but without rotation. |
private int |
scaledRotatedHeight
Same as scaledRotatedWidth, for the height. |
private int |
scaledRotatedWidth
Width of picture, after rescaling and rotation. |
(package private) PictureUploadPolicy |
uploadPolicy
The current upload policy must be a PictureUploadPolicy |
| Fields inherited from interface java.awt.image.ImageObserver |
|---|
ABORT, ALLBITS, ERROR, FRAMEBITS, HEIGHT, PROPERTIES, SOMEBITS, WIDTH |
| Constructor Summary | |
|---|---|
ImageHelper(PictureUploadPolicy uploadPolicy,
PictureFileData pictureFileData,
int targetMaxWidth,
int targetMaxHeight,
int quarterRotation)
Standard constructor. |
|
| Method Summary | |
|---|---|
java.awt.image.BufferedImage |
getBufferedImage(boolean highquality,
java.awt.image.BufferedImage sourceBufferedImage)
This function resizes the picture, if necessary, according to the maxWidth and maxHeight, given to the ImageHelper constructor. |
boolean |
hasToTransformPicture()
This function indicate if the picture has to be modified. |
boolean |
imageUpdate(java.awt.Image img,
int infoflags,
int x,
int y,
int width,
int height)
Implementation of the ImageObserver interface. |
private void |
initScale()
Intialization of scale factor, for the current picture state. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
private java.lang.Boolean hasToTransformPicture
private PictureFileData pictureFileData
PictureFileData that this helper will have to help.
private int quarterRotation
PictureFileDataprivate int maxWidth
private int maxHeight
private int nbPixelsTotal
getBufferedImage(boolean, BufferedImage),
imageUpdate(Image, int, int, int, int, int)private int nbPixelsRead
nbPixelsTotal,
imageUpdate(Image, int, int, int, int, int)private int scaledNonRotatedWidth
initScale()private int scaledNonRotatedHeight
scaledNonRotatedWidth
private int progressBarBaseValue
imageUpdate(Image, int, int, int, int, int) method will add
from 0 to 100, to indicate progress with a percentage value of picture
loading.
private double scale
initScale()private int scaledRotatedWidth
initScale()private int scaledRotatedHeight
scaledRotatedWidth, for the height.
PictureUploadPolicy uploadPolicy
PictureUploadPolicy
| Constructor Detail |
|---|
public ImageHelper(PictureUploadPolicy uploadPolicy,
PictureFileData pictureFileData,
int targetMaxWidth,
int targetMaxHeight,
int quarterRotation)
uploadPolicy - The current upload policypictureFileData - The picture file data to helptargetMaxWidth - targetMaxHeight - quarterRotation - Current quarter rotation (from 0 to 3)| Method Detail |
|---|
private void initScale()
public boolean hasToTransformPicture()
throws JUploadException
JUploadException - Contains any exception that could be thrown in
this method
public java.awt.image.BufferedImage getBufferedImage(boolean highquality,
java.awt.image.BufferedImage sourceBufferedImage)
throws JUploadException
highquality - (added by David Gnedt): if set to true, the
BufferedImage.getScaledInstance() is called. This generates
better image, but consumes more CPU.sourceBufferedImage - The image to resize or rotate or both or no
tranformation...
JUploadException - Contains any exception thrown from within this
method.
public boolean imageUpdate(java.awt.Image img,
int infoflags,
int x,
int y,
int width,
int height)
imageUpdate in interface java.awt.image.ImageObserverimg - infoflags - x - y - width - height -
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||