All Packages  Class Hierarchy  This Package  Previous  Next  Index

Class com.ibm.eou.toolkit.graphics.ImageManipulator

java.lang.Object
   |
   +----com.ibm.eou.toolkit.graphics.ImageManipulator

public class ImageManipulator
extends Object
This class provides several useful manipulation functions for use on Images.


Variable Index

 o ANTICLOCKWISE_90
Rotation constant for 90 degree anti-clockwise rotation.
 o CLOCKWISE_90
Rotation constant for 90 degree clockwise rotation.
 o COLUMNS
Flow method constant for creating columns of images.
 o CYCLE
Flow method constant for creating cycling images in a chessboard type pattern.
 o FLOW_HORIZONTAL
Flow method constant for flowing images horizontally.
 o FLOW_VERTICAL
Flow method constant for flowing images vertically.
 o LEFT_TO_RIGHT
Reflection constant for left to right reflection.
 o NO_REFLECTION
Reflection constant for no reflection.
 o NO_ROTATION
Rotation constant for 0 degree rotation.
 o ROTATE_180
Rotation constant for 180 degree rotation.
 o ROWS
Flow method constant for creating rows of images.
 o TOP_TO_BOTTOM
Reflection constant for top to bottom reflection.
 o TOPLEFT_TO_BOTTOMRIGHT
Reflection constant for top left to bottom right reflection.
 o TOPRIGHT_TO_BOTTOMLEFT
Reflection constant for top right to bottom left reflection.

Method Index

 o copyright()
Copyright method to ensure that short copyright string appears in class file.
 o createColorExchangedImage(Image, Color, Color)
Return a version of the supplied Image where replacementColor has been substituted for originalColor throughout.
 o createColorExchangedImage(Image, Color, Color, int, Region)
Return a version of the supplied Image where replacementColor has been substituted for all colors whose Red, Green and Blue components are all within the given tolerance of the originalColor.
 o createDeformedImage(Image, Deformation)
Create an image by applying a deformation to the given image.
 o createDeformedImage(Image, Deformation, int)
Create an image by applying a deformation to the given image.
 o createDeformedImages(Image, Deformation, int, int, double, double)
Create a sequence of images by applying a deformation to the given image through a range of deformation factors.
 o createReflectedImage(Image, int)
Return a version of the supplied Image reflected along the axis specified.
 o createRepeatedImage(Image, int, int)
Return an image consisting of repeated copies of the source image.
 o createRepeatedImage(Image[], int, int, int)
Return an image consisting of composed repeated copies of the source images.
 o createRotatedImage(Image)
Return a version of the supplied Image rotated by 90 degrees clockwise.
 o createRotatedImage(Image, int)
Return a version of the supplied Image rotated by the amount specified.
 o createSubsetImage(Image, int, int, int, int)
Return an image which contains a copy of a subset of the given image.
 o createSubsetImages(Image, int)
Split an image into the given number of pieces, each the height of the original image and sharing the total width evenly.
 o createTransparentImage(Image, Color)
Return a version of the supplied Image with all pixels of the supplied Color set to be transparent.
 o createTransparentImage(Image, Color, int, int, Region)
Return a version of the supplied Image with all pixels of the supplied Color within the specified Region set to the specified alpha value, using the tolerance value provided.
 o createTransparentImage(Image, int)
Return a version of the supplied Image with the given alpha value applied to every pixel in that Image.
 o createTransparentImage(Image, int, Region)
Return a version of the supplied Image with the given alpha value applied to every pixel within the specified Region of the specified Image.
 o renderDeformedImage(Graphics, int, int, Image, Deformation, int, int, long, double, double)
Progressively render an image deformation, from the given starting factor to the given end factor, with the specified number of frames and delay in milliseconds between each frame.
 o renderDeformedImage(Graphics, int, int, Image, DissolveDeformation, int, long, double, double)
Progressively render a dissolve image deformation, from the given starting factor to the given end factor.
 o renderRepeatedImage(Graphics, Image, int, int, int, int)
Draw repeated copies of the source image onto the supplied Graphics at the position specified.
 o renderRepeatedImage(Graphics, Image[], int, int, int, int, int)
Draws repeated copies of the source images onto the supplied Graphics.

Variables

 o NO_ROTATION
 public static final int NO_ROTATION
Rotation constant for 0 degree rotation.

 o CLOCKWISE_90
 public static final int CLOCKWISE_90
Rotation constant for 90 degree clockwise rotation.

 o ANTICLOCKWISE_90
 public static final int ANTICLOCKWISE_90
Rotation constant for 90 degree anti-clockwise rotation.

 o ROTATE_180
 public static final int ROTATE_180
Rotation constant for 180 degree rotation.

 o NO_REFLECTION
 public static final int NO_REFLECTION
Reflection constant for no reflection.

 o TOP_TO_BOTTOM
 public static final int TOP_TO_BOTTOM
Reflection constant for top to bottom reflection.

 o LEFT_TO_RIGHT
 public static final int LEFT_TO_RIGHT
Reflection constant for left to right reflection.

 o TOPLEFT_TO_BOTTOMRIGHT
 public static final int TOPLEFT_TO_BOTTOMRIGHT
Reflection constant for top left to bottom right reflection.

 o TOPRIGHT_TO_BOTTOMLEFT
 public static final int TOPRIGHT_TO_BOTTOMLEFT
Reflection constant for top right to bottom left reflection.

 o FLOW_HORIZONTAL
 public static final int FLOW_HORIZONTAL
Flow method constant for flowing images horizontally.

 o FLOW_VERTICAL
 public static final int FLOW_VERTICAL
Flow method constant for flowing images vertically.

 o ROWS
 public static final int ROWS
Flow method constant for creating rows of images.

 o COLUMNS
 public static final int COLUMNS
Flow method constant for creating columns of images.

 o CYCLE
 public static final int CYCLE
Flow method constant for creating cycling images in a chessboard type pattern.

Methods

 o copyright
 public static String copyright()
Copyright method to ensure that short copyright string appears in class file.

 o createReflectedImage
 public static Image createReflectedImage(Image source,
                                          int axis)
Return a version of the supplied Image reflected along the axis specified.

 o createColorExchangedImage
 public static Image createColorExchangedImage(Image source,
                                               Color originalColor,
                                               Color replacementColor)
Return a version of the supplied Image where replacementColor has been substituted for originalColor throughout.

 o createColorExchangedImage
 public static Image createColorExchangedImage(Image source,
                                               Color originalColor,
                                               Color replacementColor,
                                               int tolerance,
                                               Region region)
Return a version of the supplied Image where replacementColor has been substituted for all colors whose Red, Green and Blue components are all within the given tolerance of the originalColor. The tolerance may be in the range 0 (only exact matches will be substituted) and 255 (all colors will be substituted)

 o createTransparentImage
 public static Image createTransparentImage(Image source,
                                            int alpha)
Return a version of the supplied Image with the given alpha value applied to every pixel in that Image.

 o createTransparentImage
 public static Image createTransparentImage(Image source,
                                            int alpha,
                                            Region region)
Return a version of the supplied Image with the given alpha value applied to every pixel within the specified Region of the specified Image.

 o createTransparentImage
 public static Image createTransparentImage(Image source,
                                            Color transparentColor)
Return a version of the supplied Image with all pixels of the supplied Color set to be transparent.

 o createTransparentImage
 public static Image createTransparentImage(Image source,
                                            Color transparentColor,
                                            int alpha,
                                            int tolerance,
                                            Region region)
Return a version of the supplied Image with all pixels of the supplied Color within the specified Region set to the specified alpha value, using the tolerance value provided.

 o createRotatedImage
 public static Image createRotatedImage(Image source)
Return a version of the supplied Image rotated by 90 degrees clockwise.

 o createRotatedImage
 public static Image createRotatedImage(Image source,
                                        int rotation)
Return a version of the supplied Image rotated by the amount specified.

See Also:
NO_ROTATION, CLOCKWISE_90, ANTICLOCKWISE_90, ROTATE_180
 o createSubsetImages
 public static Image[] createSubsetImages(Image img,
                                          int fragments)
Split an image into the given number of pieces, each the height of the original image and sharing the total width evenly.

 o createSubsetImage
 public static Image createSubsetImage(Image src,
                                       int x,
                                       int y,
                                       int w,
                                       int h)
Return an image which contains a copy of a subset of the given image.

 o createRepeatedImage
 public static Image createRepeatedImage(Image srcImageArray[],
                                         int xCopies,
                                         int yCopies,
                                         int flowMethod)
Return an image consisting of composed repeated copies of the source images. The flowMethod parameter controls how the images are deployed.

Parameters:
srcImageArray - an array of images to be tiled
xCopies - the number of cells across to fill
yCopies - the number of cells down to fill
flowMethod - one of the flow method constants
See Also:
ROWS, COLUMNS, CYCLE, FLOW_HORIZONTAL, FLOW_VERTICAL
 o renderRepeatedImage
 public static void renderRepeatedImage(Graphics g,
                                        Image srcImage,
                                        int xCopies,
                                        int yCopies,
                                        int x,
                                        int y)
Draw repeated copies of the source image onto the supplied Graphics at the position specified.

Parameters:
g - is the Graphics on which to draw the result
srcImage - an array of images to be tiled
xCopies - the number of cells across to fill
yCopies - the number of cells down to fill
x - the x position at which to draw the result
y - the y position at which to draw the result
 o createRepeatedImage
 public static Image createRepeatedImage(Image srcImage,
                                         int xCopies,
                                         int yCopies)
Return an image consisting of repeated copies of the source image.

Parameters:
srcImage - an image to tile
xCopies - the number of cells across to fill
yCopies - the number of cells down to fill
 o renderRepeatedImage
 public static void renderRepeatedImage(Graphics g,
                                        Image srcImageArray[],
                                        int xCopies,
                                        int yCopies,
                                        int x,
                                        int y,
                                        int flowMethod)
Draws repeated copies of the source images onto the supplied Graphics. at the position specified. The flowMethod parameter controls how the images are deployed.

Parameters:
g - the Graphics on which to draw the result
srcImageArray - an array of images to be tiled
xCopies - the number of cells across to fill
yCopies - the number of cells down to fill
x - the x position at which to draw the result
y - the y position at which to draw the result
flowMethod - one of the flow method constants
See Also:
ROWS, COLUMNS, CYCLE, FLOW_HORIZONTAL, FLOW_VERTICAL
 o createDeformedImage
 public static Image createDeformedImage(Image image,
                                         Deformation deformation)
Create an image by applying a deformation to the given image.

 o createDeformedImage
 public static Image createDeformedImage(Image image,
                                         Deformation deformation,
                                         int background)
Create an image by applying a deformation to the given image. Pixels left empty under the deformation are colored with the specified background color.

 o createDeformedImages
 public static Image[] createDeformedImages(Image image,
                                            Deformation deformation,
                                            int background,
                                            int frames,
                                            double startFactor,
                                            double endFactor)
Create a sequence of images by applying a deformation to the given image through a range of deformation factors.

 o renderDeformedImage
 public static void renderDeformedImage(Graphics g,
                                        int x,
                                        int y,
                                        Image image,
                                        Deformation deformation,
                                        int background,
                                        int frames,
                                        long frameInterval,
                                        double startFactor,
                                        double endFactor)
Progressively render an image deformation, from the given starting factor to the given end factor, with the specified number of frames and delay in milliseconds between each frame.

 o renderDeformedImage
 public static void renderDeformedImage(Graphics g,
                                        int x,
                                        int y,
                                        Image image,
                                        DissolveDeformation deformation,
                                        int background,
                                        long frameInterval,
                                        double startFactor,
                                        double endFactor)
Progressively render a dissolve image deformation, from the given starting factor to the given end factor. This method exploits the progressive nature of a dissolve deformation to achieve good effeciency.


All Packages  Class Hierarchy  This Package  Previous  Next  Index