edu.washington.biostr.sig.volume.colors
Class ColorTransformTable

java.lang.Object
  extended by edu.washington.biostr.sig.volume.colors.ColorTransformTable

public class ColorTransformTable
extends Object

Provide a lookup table for transforming ints that hold RGB to new ints that hold RGB values. It is by default sparse and unspecified values are unchanged.

Version:
1.1
Author:
Eider Moore

Field Summary
static int NO_COLOR
           
 
Constructor Summary
ColorTransformTable()
          Create a blank table, unspecified values are unchanged.
 
Method Summary
 void add(int originalColor, int targetColor)
          Add an entry to the table
 int get(int originalColor)
          Look up originalColor and return the entry in the table or originalColor if non specified.
 void setDefault(int value)
          Set the default return value.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

NO_COLOR

public static final int NO_COLOR
See Also:
Constant Field Values
Constructor Detail

ColorTransformTable

public ColorTransformTable()
Create a blank table, unspecified values are unchanged.

Method Detail

setDefault

public void setDefault(int value)
Set the default return value. "1" is used to denote that the original value should be returned (-1 is important because it is opaque white and 0 is completely transparent black. Completely transparent, almost black blue is probably less used than those other 2 candidates).

Parameters:
value -

add

public void add(int originalColor,
                int targetColor)
Add an entry to the table

Parameters:
originalColor - The original RGB color.
targetColor - The new RGB color.

get

public int get(int originalColor)
Look up originalColor and return the entry in the table or originalColor if non specified.

Parameters:
originalColor -
Returns:
The target color in the table or originalColor if non specified.


Copyright © 2006 University of Washington. All Rights Reserved.