|
JAC project AOPSYS CEDRIC & LIP6 labs |
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--org.objectweb.jac.util.Thumbnail
This class creates thumbnails from bigger images. Useful to have a preview of a photo for example.
Constructor Summary | |
Thumbnail()
|
Method Summary | |
static void |
createThumb(byte[] data,
int thumbWidth,
int thumbHeight,
int quality,
OutputStream out)
Create a reduced jpeg version of an image. |
static void |
createThumb(Image image,
int thumbWidth,
int thumbHeight,
int quality,
OutputStream out)
Create a scaled jpeg of an image. |
static byte[] |
createThumbArray(byte[] data,
int thumbWidth,
int thumbHeight,
int quality)
Create a reduced jpeg version of an image. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
public Thumbnail()
Method Detail |
public static byte[] createThumbArray(byte[] data, int thumbWidth, int thumbHeight, int quality) throws Exception
data
- raw data of the imagethumbWidth
- maximum width of the reduced imagethumbHeight
- maximum heigth of the reduced imagequality
- jpeg quality of the reduced image
Exception
public static void createThumb(byte[] data, int thumbWidth, int thumbHeight, int quality, OutputStream out) throws Exception
data
- raw data of the imagethumbWidth
- maximum width of the reduced imagethumbHeight
- maximum heigth of the reduced imagequality
- jpeg quality of the reduced imageout
- produce a reduced jpeg image if the image represented
by data is bigger than the maximum dimensions of the reduced
image, otherwise data is written to this stream
Exception
public static void createThumb(Image image, int thumbWidth, int thumbHeight, int quality, OutputStream out) throws Exception
If image is smaller than thumbWidth x thumbHeight, it will be magnified, otherwise it will be scaled down.
image
- the image to reducethumbWidth
- the maximum width of the thumbnailthumbHeight
- the maximum heigth of the thumbnailquality
- the jpeg quality ot the thumbnailout
- a stream where the thumbnail data is written to
Exception
|
Contact JAC development team: Renaud Pawlak Lionel Seinturier Laurent Martelli |
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |