All Packages Class Hierarchy This Package Previous Next Index
Class com.ibm.eou.swingimageregionselector.BaseEmphasisFilter
java.lang.Object
|
+----java.awt.image.ImageFilter
|
+----java.awt.image.RGBImageFilter
|
+----com.ibm.eou.swingimageregionselector.BaseEmphasisFilter
- public abstract class BaseEmphasisFilter
- extends RGBImageFilter
This is the base class which all filters that apply the emphasis on the display image should sub-class.
This is a java.awt.image.RGBImageFilter with some support methods to provide the filter with the
information it needs to correctly filter the image.
Whenever a new color map or cutaway image is loaded the pixel information for the image is sent to the
filter and stored so the filter knows which pixels will require filtering and which color to set them to if
cutaway emphasis is selected. When a new region is to be filtered setSearchColor is called to tell the
filter which color pixels to look for in the color map image.
The standard filtering method, filterRGB, is used to decide which pixels are to be filtered. This method
currently selects those pixels with the required search color in the color map image so if new filters
require different pixels to be filtered then this method should be overridden. The actual operation of
changing the RGB value of a pixel is handled by the abstract method filterPixel which should return
the new RGB value given the old one along with its (x,y) position. No decision as to whether the pixel in
filterPixel is to be changed should be made within this method - as the decision is made in filterRGB and
filterPixel is only called when the pixel is to be changed.
ImageRegionSelector version 1.0 does not support pluggable emphasis filters. Therefore this information is only for
reference as it is not possible to create your own extensions to the BaseEmphasisFilter and use them in the
ImageRegionSelector.
-
BaseEmphasisFilter()
- BaseEmphasisFilter constructor
-
copyright()
- IBM Copyright statement
-
filterPixel(int, int, int)
- Abstract method that should be implemented by classes subclassing BaseEmphasisFilter.
-
filterRGB(int, int, int)
- This method is called for each pixel in the image to be filtered in order to decide whether the RGB value
of this pixel should be changed.
-
setColorMapPixels(PixelList)
- Stores away the RGB values of the color map image
-
setCutawayPixels(PixelList)
- Stores away the RGB values of the cutaway image
-
setOffset(int, int)
- Sets the filter starting point within the color map and cutaway images as only the required rectangle of the
display image is filtered
-
setSearchColor(int)
- Sets the color to look for in the color map image
BaseEmphasisFilter
public BaseEmphasisFilter()
- BaseEmphasisFilter constructor
copyright
public static String copyright()
- IBM Copyright statement
filterPixel
public abstract int filterPixel(int x,
int y,
int rgb)
- Abstract method that should be implemented by classes subclassing BaseEmphasisFilter. This method
is simply used to to convert the pixel at (x,y) with RGB value rgb to a new RGB value, which is returned
- Parameters:
- x - x co-ordinate of the pixel
- y - y co-ordinate of the pixel
- rgb - current RGB value of the pixel
- Returns:
- New RGB value for this pixel
filterRGB
public int filterRGB(int x,
int y,
int rgb)
- This method is called for each pixel in the image to be filtered in order to decide whether the RGB value
of this pixel should be changed. If this is the case the abstract method filterPixel is called to actually
change the RGB value
- Parameters:
- x - x co-ordinate of the pixel
- y - y co-ordinate of the pixel
- rgb - Current RGB value of the pixel
- Returns:
- The new RGB value for the pixel
- Overrides:
- filterRGB in class RGBImageFilter
setColorMapPixels
public void setColorMapPixels(PixelList pl)
- Stores away the RGB values of the color map image
- Parameters:
- pl - Pixel and dimension data for the color map image
setCutawayPixels
public void setCutawayPixels(PixelList pl)
- Stores away the RGB values of the cutaway image
- Parameters:
- pl - Pixel and dimension data for the cutaway image
setOffset
public void setOffset(int x,
int y)
- Sets the filter starting point within the color map and cutaway images as only the required rectangle of the
display image is filtered
- Parameters:
- x - x co-ordinate of starting point within the image
- y - y co-ordinate of starting point within the image
setSearchColor
public void setSearchColor(int color)
- Sets the color to look for in the color map image
- Parameters:
- color - Search color
All Packages Class Hierarchy This Package Previous Next Index