|
EchoPoint 1.0 |
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object echopoint.image.ImageKit
A utility to class to help with ImageReference manipulation
Field Summary | |
static java.awt.MediaTracker |
imageMediaTracker
You can use this object as an valid MediaTracker |
static java.awt.Component |
imageObserver
You can use this object as an valid ImageObserver |
Method Summary | |
static java.awt.image.BufferedImage |
copyImage(java.awt.Image srcImage)
This method will return copy a source Image and return a new BufferedImage. |
static nextapp.echo.ImageReference |
createImageRef(nextapp.echo.Color background,
int width,
int height)
Creates an ImageReference that is width * height in dimensions and has the specified background color. |
static java.awt.Image |
enlargeImageSpliceHoriz(java.awt.Image srcImage,
int y,
int newH)
Called to enlarge an image by splicing it horizontally (along the Y axis) at y and filling the new section with a 1 pixel sample at y This method will only enlarge the image. |
static java.awt.Image |
enlargeImageSpliceVert(java.awt.Image srcImage,
int x,
int newW)
Called to enlarge an image by splicing it vertically (along the X axis) at x and filling the new section with a 1 pixel sample at x This method will only enlarge the image. |
static java.awt.Image |
flipImage(java.awt.Image srcImage)
This method flips the source image through the horizontal plane, eg. the top become the bottom. |
static nextapp.echo.ImageReference |
getColoredImageRef(nextapp.echo.Color backgroundColor,
int width,
int height)
Returns an ImageReference that is width * height in dimensions with the specified background color. |
static java.awt.image.ColorModel |
getColorModel(java.awt.Image srcImage)
This method will return the ColorModel of an Image. |
static nextapp.echo.ImageReference |
getTransparentImageRef(int width,
int height)
Returns an transparent ImageReference that is width * height in dimensions |
static boolean |
hasAlphaChannel(java.awt.Image srcImage)
This method returns true if the provided Image has an alpha channel |
static java.awt.Image |
loadCachedImage(java.lang.String imageFileName)
Loads an image file from disk and returns an java.awt.Image, which is then cached. |
static java.awt.Image |
loadCachedImage(java.lang.String imageFileName,
int width,
int height)
Loads an image file from disk and returns an java.awt.Image, which is then cached. |
static java.awt.Image |
loadCachedImage(java.net.URL imageUrl)
Loads an image file from disk and returns an java.awt.Image, which is then cached. |
static java.awt.Image |
loadCachedImage(java.net.URL imageUrl,
int width,
int height)
Loads an image file from disk and returns an java.awt.Image, which is then cached. |
static java.awt.Image |
loadCachedResourceImage(java.lang.String imageResourceName)
Loads an image file from a named Java resource and returns an java.awt.Image which is then cached. |
static java.awt.Image |
loadCachedResourceImage(java.lang.String imageResourceName,
int width,
int height)
Loads an image file from a named Java resource and returns an java.awt.Image which is then cached. |
static java.awt.Image |
loadImage(java.lang.String imageFileName)
Loads an image file from disk and returns an java.awt.Image. |
static java.awt.Image |
loadImage(java.lang.String imageFileName,
int width,
int height)
Loads an image file from disk and returns an java.awt.Image. |
static java.awt.Image |
loadImage(java.net.URL imageUrl)
Loads an image file from disk and returns an java.awt.Image. |
static java.awt.Image |
loadImage(java.net.URL imageUrl,
int width,
int height)
Loads an image file from disk and returns an java.awt.Image. |
static java.awt.Image |
loadResourceImage(java.lang.String imageResourceName)
Loads an image file from a named Java resource and returns an java.awt.Image. |
static java.awt.Image |
loadResourceImage(java.lang.String imageResourceName,
int width,
int height)
Loads an image file from a named Java resource and returns an java.awt.Image. |
static java.awt.image.BufferedImage |
makeBufferedImage(java.awt.Image srcImage)
Returns a BufferedImage, that is same as the original java.awt.Image. |
static java.awt.image.BufferedImage |
makeBufferedImage(java.awt.Image srcImage,
int width,
int height)
Returns a BufferedImage, that is same as the original java.awt.Image. |
static java.awt.image.BufferedImage |
makeBufferedImage(java.awt.Image srcImage,
int width,
int height,
int imageType)
Returns a BufferedImage, that is same as the original java.awt.Image, scaled to width and height. |
static java.awt.Image |
makeImageColorTransparent(java.awt.Image srcImage,
nextapp.echo.Color markerColor)
This will change the image so that any occurence of the specified color is fully transparent, ie has an alpha value of 0. |
static java.awt.Image |
makeImageColorTransparent(java.awt.Image srcImage,
nextapp.echo.Color markerColor,
int alpha)
This will change the image so that any occurence of the specified color is changed to have an alpha value of 'alpha'; This method works inline on the provided image. |
static java.awt.image.BufferedImage |
makeImageGreyScale(java.awt.Image srcImage)
|
static java.awt.Image |
mirrowImage(java.awt.Image srcImage)
This method mirrows the source image through the vertical plane, eg. the left become the right. |
static java.text.AttributedString |
readSerializedAttributedString(java.io.ObjectInputStream in)
Reads in a serialized AttributeString and restores all Serializable objects contained within it. |
static java.awt.Image |
readSerializedImage(java.io.ObjectInputStream in)
Reads an image in from a serilisation stream. |
static java.awt.Image |
rotateImage(java.awt.Image srcImage)
This method roteates the source image through the horizontal and vertical plane. |
static java.awt.Image |
swapImageColors(java.awt.Image srcImage,
nextapp.echo.Color srcColor,
nextapp.echo.Color destColor)
This will change all occurences of srcColor to destColor in the image. |
static boolean |
waitForImage(java.awt.Image srcImage)
Waits for an Image to be loaded by using a MediaTracker internally. |
static void |
writeSerializedAttributedString(java.io.ObjectOutputStream out,
java.text.AttributedString as)
Writes an AttributedString to an object output stream and saves all Serializable obejcts contained within it. |
static void |
writeSerializedImage(java.io.ObjectOutputStream out,
java.awt.Image srcImage)
Writes an Image out to a serialisation stream. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
public static final java.awt.Component imageObserver
public static final java.awt.MediaTracker imageMediaTracker
Method Detail |
public static nextapp.echo.ImageReference createImageRef(nextapp.echo.Color background, int width, int height)
public static nextapp.echo.ImageReference getTransparentImageRef(int width, int height)
public static nextapp.echo.ImageReference getColoredImageRef(nextapp.echo.Color backgroundColor, int width, int height)
public static java.awt.image.BufferedImage copyImage(java.awt.Image srcImage)
This differs from makeBufferedImage() in that it gauruntees to make a new copy of the image data whereas makeBufferedImage() will return the same object if its already a BufferedImage.
srcImage
- the source Image
public static java.awt.Image loadImage(java.lang.String imageFileName)
imageFileName
- - the image file to be loaded
public static java.awt.Image loadCachedImage(java.lang.String imageFileName)
imageFileName
- - the image file to be loaded
public static java.awt.Image loadImage(java.lang.String imageFileName, int width, int height)
imageFileName
- - the image file to be loadedwidth
- - the width of the new imageheight
- - the height of the new image
public static java.awt.Image loadCachedImage(java.lang.String imageFileName, int width, int height)
imageFileName
- - the image file to be loadedwidth
- - the width of the new imageheight
- - the height of the new image
public static java.awt.Image loadImage(java.net.URL imageUrl)
imageUrl
- - the image URL to be loaded
public static java.awt.Image loadCachedImage(java.net.URL imageUrl)
imageUrl
- - the image URL to be loaded
public static java.awt.Image loadImage(java.net.URL imageUrl, int width, int height)
imageUrl
- - the image URL to be loadedwidth
- - the width of the new imageheight
- - the height of the new image
public static java.awt.Image loadCachedImage(java.net.URL imageUrl, int width, int height)
imageUrl
- - the image URL to be loadedwidth
- - the width of the new imageheight
- - the height of the new image
public static java.awt.Image loadResourceImage(java.lang.String imageResourceName)
imageResourceName
- - the image resource to be loaded
public static java.awt.Image loadCachedResourceImage(java.lang.String imageResourceName)
imageResourceName
- - the image resource to be loaded
public static java.awt.Image loadResourceImage(java.lang.String imageResourceName, int width, int height)
imageResourceName
- - the image resource to be loadedwidth
- - the width of the new imageheight
- - the height of the new image
public static java.awt.Image loadCachedResourceImage(java.lang.String imageResourceName, int width, int height)
imageResourceName
- - the image resource to be loadedwidth
- - the width of the new imageheight
- - the height of the new image
public static java.awt.image.BufferedImage makeBufferedImage(java.awt.Image srcImage)
The image type will be BufferedImage.TYPE_INT_ARGB if it has an alpha channel other wise it will be BufferedImage.TYPE_INT_RGB
srcImage
- Image - the image to be converted
public static java.awt.image.BufferedImage makeBufferedImage(java.awt.Image srcImage, int width, int height)
The image type will be BufferedImage.TYPE_INT_ARGB if it has an alpha channel other wise it will be BufferedImage.TYPE_INT_RGB type will be BufferedImage.TYPE_INT_ARGB.
The image will be scaled to the width/height dimensions.
srcImage
- - the image to be convertedwidth
- - the width of the new imageheight
- - the height of the new image
public static java.awt.image.BufferedImage makeBufferedImage(java.awt.Image srcImage, int width, int height, int imageType)
srcImage
- - the image to be convertedwidth
- - the width of the new imageheight
- - the height of the new imageimageType
- - can be on of BufferedImage types such as BufferedImage.TYPE_INT_ARGB
public static java.awt.image.ColorModel getColorModel(java.awt.Image srcImage)
srcImage
- the source Image
public static boolean hasAlphaChannel(java.awt.Image srcImage)
srcImage
- - the image to check for an alpha channel
public static java.awt.Image swapImageColors(java.awt.Image srcImage, nextapp.echo.Color srcColor, nextapp.echo.Color destColor)
This method works inline on the provided image. It does NOT make a copy of the source image.
srcImage
- - the image to be transformedsrcColor
- - the source colordestColor
- - the dest color
public static java.awt.Image makeImageColorTransparent(java.awt.Image srcImage, nextapp.echo.Color markerColor)
This method works inline on the provided image. It does NOT make a copy of the source image.
srcImage
- - the image to be transformedmarkerColor
- - the color to be made transparent
public static java.awt.Image makeImageColorTransparent(java.awt.Image srcImage, nextapp.echo.Color markerColor, int alpha)
This method works inline on the provided image. It does NOT make a copy of the source image.
srcImage
- - the image to be transformedmarkerColor
- - the color to be made transparentalpha
- - an alpha value between 0 and 255
public static java.awt.image.BufferedImage makeImageGreyScale(java.awt.Image srcImage)
public static java.text.AttributedString readSerializedAttributedString(java.io.ObjectInputStream in) throws java.io.IOException, java.lang.ClassNotFoundException
in
-
java.io.IOException
java.lang.ClassNotFoundException
public static java.awt.Image readSerializedImage(java.io.ObjectInputStream in) throws java.io.IOException, java.lang.ClassNotFoundException
writeSerializedImage
method.
Most of the code was taken from the Echo AwtImageReference, so kudos to
NextApp.
in
-
java.io.IOException
java.lang.ClassNotFoundException
public static boolean waitForImage(java.awt.Image srcImage)
srcImage
- - the source Image
public static void writeSerializedAttributedString(java.io.ObjectOutputStream out, java.text.AttributedString as) throws java.io.IOException
out
- as
-
java.io.IOException
public static void writeSerializedImage(java.io.ObjectOutputStream out, java.awt.Image srcImage) throws java.io.IOException
out
- the object output streamsrcImage
- - the source Image
java.io.IOException
- if need bepublic static java.awt.Image mirrowImage(java.awt.Image srcImage)
srcImage
- the source Image
public static java.awt.Image flipImage(java.awt.Image srcImage)
srcImage
- the source Image
public static java.awt.Image rotateImage(java.awt.Image srcImage)
srcImage
- the source Image
public static java.awt.Image enlargeImageSpliceVert(java.awt.Image srcImage, int x, int newW)
This method will only enlarge the image. If the new width is less than or equal to the current width, then the srcImage is returned.
srcImage
- - the source Imagex
- - the position to splice atnewW
- - the new width of the image
public static java.awt.Image enlargeImageSpliceHoriz(java.awt.Image srcImage, int y, int newH)
This method will only enlarge the image. If the new height is less than or equal to the current height, then the srcImage is returned.
srcImage
- - the source Imagey
- - the position to splice atnewH
- - the new height of the image
|
EchoPoint 1.0 |
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |