|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.xenbase.utilities.AdvImageUtil
public class AdvImageUtil
Constructor Summary | |
---|---|
AdvImageUtil()
|
Method Summary | |
---|---|
static java.awt.image.RenderedImage |
convertImageByteArrayToRenderedImage(byte[] b)
Takes a raw byte array and converts it into a JAI RenderedImage that can be used for manipulation (i.e. |
static byte[] |
convertTo(java.lang.String toFormat,
byte[] imgBytes)
Converts images to a limited variety of formats. |
static java.lang.String |
getFileType(byte[] imgBytes)
Determine the image encoding format of the image contained within the passed byte array |
static int |
getHeight(byte[] imgBytes)
Determines the height of an image. |
static int |
getWidth(byte[] imgBytes)
Determines the width of an image. |
static byte[] |
makeImageByteArrayFromRenderedImage(java.awt.image.RenderedImage image)
Converts a JAI rendered image to a byte array image |
static byte[] |
scaleTo(int x,
int y,
byte[] imgBytes)
Scales an image to the exact height and width provided, please note, this process will not preserve the aspect ratio of the image. |
static byte[] |
scaleToFit(int width,
int height,
byte[] imgBytes)
Scales an image to fit the dimensions provided. |
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public AdvImageUtil()
Method Detail |
---|
public static byte[] convertTo(java.lang.String toFormat, byte[] imgBytes) throws java.lang.Exception, java.lang.Error
toFormat
- a string denoting the format you want to convert to 'jpg', 'jpeg', 'png', 'tif', tiff'imgBytes
- the byte array containing the image you want to convert
java.lang.Exception
java.lang.Error
public static java.lang.String getFileType(byte[] imgBytes) throws java.lang.Exception, java.lang.Error
imgBytes
- byte array of the image you want to identify.
java.lang.Exception
java.lang.Error
public static int getHeight(byte[] imgBytes) throws java.lang.Exception, java.lang.Error
imgBytes
- image byte array
java.lang.Exception
java.lang.Error
public static int getWidth(byte[] imgBytes) throws java.lang.Exception, java.lang.Error
imgBytes
- image byte array
java.lang.Exception
java.lang.Error
public static byte[] scaleTo(int x, int y, byte[] imgBytes) throws java.lang.Exception, java.lang.Error
x
- int the width you want the resulting image to be.y
- int the height you want the resulting image to beimgBytes
- the byte array of the image you want to scale
java.lang.Exception
java.lang.Error
public static byte[] scaleToFit(int width, int height, byte[] imgBytes) throws java.lang.Exception, java.lang.Error
width
- the maximum width to scale the image toheight
- the maximum height to scale the image toimgBytes
- the byte array containing the image
java.lang.Exception
java.lang.Error
public static byte[] makeImageByteArrayFromRenderedImage(java.awt.image.RenderedImage image) throws java.lang.Exception, java.lang.Error
image
- JAI Rendered Image
java.lang.Exception
java.lang.Error
public static java.awt.image.RenderedImage convertImageByteArrayToRenderedImage(byte[] b) throws java.lang.Exception, java.lang.Error
byte[]
- b
java.lang.Exception
java.lang.Error
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |