All Packages  Class Hierarchy  This Package  Previous  Next  Index

Class com.ibm.eou.swingimageregionselector.ImageMap

java.lang.Object
   |
   +----com.ibm.eou.swingimageregionselector.ImageMap

public class ImageMap
extends Object
Used as a storage area for the display, color map and cutaway images
Contains supporting methods to get useful information about the color map image in order to filter the display image - such as getIndexAtPoint to get the index of the region at a specific pixel and getImageMapColorAtPixel to get the color of a pixel in the color map image
Also contains methods to return arrays of RGB pixel values for the three images


Constructor Index

 o ImageMap()

Method Index

 o copyright()
IBM Copyright statement
 o getBoundsOfIndex(int)
Returns the bounding rectangle for the region with the index given.
 o getColorMapImage()
Returns the current color map image as an Image object
 o getColorMapImagePixels()
Returns the dimensions and pixels of the color map image
 o getColorOfIndex(int)
Returns the RGB color value for the given index
 o getCutawayImage()
Returns the current cutaway image as an Image object
 o getCutawayImagePixels()
Returns the dimensions and pixels of the cutaway image
 o getDisplayImage()
Returns the current display image as an Image object
 o getDisplayImagePixels()
Returns an array of pixels representing the RGB values of the display image
 o getImageMapColorAtPixel(int, int)
Returns the color of the pixel (x,y) from the color map image
 o getIndexAtPoint(int, int)
Returns the color index of the pixel at (x,y) in the color map image
 o setColorMapImage(Image)
Sets the color map image Image object, stores the pixels and dimensions in the colorMapImagePixels object and calls setColorMapBounds to create the array of bounding rectangles for the regions
 o setCutawayImage(Image)
Sets the cutaway image Image object and stores the pixels and dimensions in the cutawayImagePixels object
 o setDisplayImage(Image)
Sets the display image Image object and stores the pixels in the displayImagePixels array

Constructors

 o ImageMap
 public ImageMap()

Methods

 o copyright
 public static String copyright()
IBM Copyright statement

 o getBoundsOfIndex
 public Rectangle getBoundsOfIndex(int index)
Returns the bounding rectangle for the region with the index given. The bounding rectangle is the smallest rectangle which contains all the pixels of a given color map index in the color map image

Parameters:
index - index of the region for which the bounding rectangle is required
Returns:
The corresponding bounding rectangle, or null if the index has no rectangle defined
 o getColorMapImage
 public Image getColorMapImage()
Returns the current color map image as an Image object

Returns:
The color map image
 o getColorMapImagePixels
 public PixelList getColorMapImagePixels()
Returns the dimensions and pixels of the color map image

Returns:
PixelList object for the color map image
 o getColorOfIndex
 public int getColorOfIndex(int index)
Returns the RGB color value for the given index

Parameters:
index - index for which the color is required
Returns:
RGB value of the color, or zero if the index is invalid
 o getCutawayImage
 public Image getCutawayImage()
Returns the current cutaway image as an Image object

Returns:
The cutaway image
 o getCutawayImagePixels
 public PixelList getCutawayImagePixels()
Returns the dimensions and pixels of the cutaway image

Returns:
PixelList object for the cutaway image
 o getDisplayImage
 public Image getDisplayImage()
Returns the current display image as an Image object

Returns:
The display image
 o getDisplayImagePixels
 public int[] getDisplayImagePixels()
Returns an array of pixels representing the RGB values of the display image

Returns:
Array of RGB values
 o getImageMapColorAtPixel
 public int getImageMapColorAtPixel(int x,
                                    int y)
Returns the color of the pixel (x,y) from the color map image

Parameters:
x - x co-ordinate of pixel
y - y co-ordinate of pixel
Returns:
The color of pixel at (x,y) if (x,y) is within the bounds of the image - returns zero otherwise
 o getIndexAtPoint
 public int getIndexAtPoint(int x,
                            int y)
Returns the color index of the pixel at (x,y) in the color map image

Parameters:
x - x co-ordinate of pixel
y - y co-ordinate of pixel
Returns:
The index of the pixel at (x,y) if (x,y) is within the bounds of the image - returns -1 otherwise
 o setColorMapImage
 public void setColorMapImage(Image newValue)
Sets the color map image Image object, stores the pixels and dimensions in the colorMapImagePixels object and calls setColorMapBounds to create the array of bounding rectangles for the regions

Parameters:
newValue - New color map image
 o setCutawayImage
 public void setCutawayImage(Image newValue)
Sets the cutaway image Image object and stores the pixels and dimensions in the cutawayImagePixels object

Parameters:
newValue - New cutaway image
 o setDisplayImage
 public void setDisplayImage(Image newValue)
Sets the display image Image object and stores the pixels in the displayImagePixels array

Parameters:
newValue - New display image

All Packages  Class Hierarchy  This Package  Previous  Next  Index