com.pearsoneduc.ip.op
Class GreyMapOp

java.lang.Object
  |
  +--com.pearsoneduc.ip.op.StandardGreyOp
        |
        +--com.pearsoneduc.ip.op.GreyMapOp
Direct Known Subclasses:
EqualiseOp, ExpOp, InvertOp, LinearOp, LogOp, SquareRootOp, ThresholdOp

public abstract class GreyMapOp
extends StandardGreyOp

Performs arbitrary mapping of grey levels in a BufferedImage, using a look-up table. The image must be an 8-bit greyscale image.

This is an abstract class; concrete subclasses must implement the method computeMapping(), which generates data for the lookup table.

Version:
2.1 [1999/07/23]
Author:
Nick Efford

Field Summary
protected  byte[] table
          Lookup table data.
 
Constructor Summary
GreyMapOp()
           
 
Method Summary
 void computeMapping()
          Computes a mapping of grey level that maps 0 onto 0 and 255 onto 255.
abstract  void computeMapping(int low, int high)
          Computes a mapping of grey level with upper and lower limits.
 java.awt.image.BufferedImage filter(java.awt.image.BufferedImage src, java.awt.image.BufferedImage dest)
          Performs mapping of grey levels in an image.
 int getTableEntry(int i)
          Retrieves a lookup table entry.
protected  void setTableEntry(int i, int value)
          Modifies a lookup table entry.
 
Methods inherited from class com.pearsoneduc.ip.op.StandardGreyOp
checkImage, createCompatibleDestImage, getBounds2D, getPoint2D, getRenderingHints
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

table

protected byte[] table
Lookup table data.
Constructor Detail

GreyMapOp

public GreyMapOp()
Method Detail

getTableEntry

public int getTableEntry(int i)
Retrieves a lookup table entry.
Parameters:
i - index into the lookup table
Returns:
value stored at the specified index.

setTableEntry

protected void setTableEntry(int i,
                             int value)
Modifies a lookup table entry.
Parameters:
i - index into the lookup table
value - value to be stored at the specified index (forced to be in the range 0-255 if necessary)

computeMapping

public abstract void computeMapping(int low,
                                    int high)
Computes a mapping of grey level with upper and lower limits.
Parameters:
low - lower limit, mapping onto 0
high - upper limit, mapping onto 255

computeMapping

public void computeMapping()
Computes a mapping of grey level that maps 0 onto 0 and 255 onto 255.

filter

public java.awt.image.BufferedImage filter(java.awt.image.BufferedImage src,
                                           java.awt.image.BufferedImage dest)
Performs mapping of grey levels in an image.
Parameters:
src - source image
dest - destination image, or null
Returns:
the mapped image.
Overrides:
filter in class StandardGreyOp