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
-
ImageMap()
-
-
copyright()
- IBM Copyright statement
-
getBoundsOfIndex(int)
- Returns the bounding rectangle for the region with the index given.
-
getColorMapImage()
- Returns the current color map image as an Image object
-
getColorMapImagePixels()
- Returns the dimensions and pixels of the color map image
-
getColorOfIndex(int)
- Returns the RGB color value for the given index
-
getCutawayImage()
- Returns the current cutaway image as an Image object
-
getCutawayImagePixels()
- Returns the dimensions and pixels of the cutaway image
-
getDisplayImage()
- Returns the current display image as an Image object
-
getDisplayImagePixels()
- Returns an array of pixels representing the RGB values of the display image
-
getImageMapColorAtPixel(int, int)
- Returns the color of the pixel (x,y) from the color map image
-
getIndexAtPoint(int, int)
- Returns the color index of the pixel at (x,y) in the color map image
-
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
-
setCutawayImage(Image)
- Sets the cutaway image Image object and stores the pixels and dimensions in the cutawayImagePixels
object
-
setDisplayImage(Image)
- Sets the display image Image object and stores the pixels in the displayImagePixels array
ImageMap
public ImageMap()
copyright
public static String copyright()
- IBM Copyright statement
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
getColorMapImage
public Image getColorMapImage()
- Returns the current color map image as an Image object
- Returns:
- The color map image
getColorMapImagePixels
public PixelList getColorMapImagePixels()
- Returns the dimensions and pixels of the color map image
- Returns:
- PixelList object for the color map image
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
getCutawayImage
public Image getCutawayImage()
- Returns the current cutaway image as an Image object
- Returns:
- The cutaway image
getCutawayImagePixels
public PixelList getCutawayImagePixels()
- Returns the dimensions and pixels of the cutaway image
- Returns:
- PixelList object for the cutaway image
getDisplayImage
public Image getDisplayImage()
- Returns the current display image as an Image object
- Returns:
- The display image
getDisplayImagePixels
public int[] getDisplayImagePixels()
- Returns an array of pixels representing the RGB values of the display image
- Returns:
- Array of RGB values
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
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
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
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
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