|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectedu.washington.biostr.sig.volume.colors.ColorLookupTable
public class ColorLookupTable
Create an efficient (time, not space) lookup array for translating values from the volume into colors. This precomputes values from ColorSchemes into arrays.
Implementations should be immutable.
| Field Summary | |
|---|---|
protected float |
multiplier
The multiplier is used to convert doubles to ints. |
protected int[] |
ncolors
This stores an array of colors represented by int[]s. |
protected int[] |
pcolors
This stores an array of colors represented by int[]s. |
| Constructor Summary | |
|---|---|
ColorLookupTable(double min,
double max)
Create a scheme for values between min and max. |
|
ColorLookupTable(float multiplier,
double min,
double max)
Create a scheme for values betwenn min and max. |
|
ColorLookupTable(int min,
int max)
Create a scheme for values between min and max. |
|
| Method Summary | |
|---|---|
boolean |
equals(ColorLookupTable other)
Compares two ColorLookupTables based on the requirement that all of each tables instance variables satisfy each of their equals conditions. |
boolean |
equals(Object o)
Dispatch to equals(ColorLookupTable) or return false. |
protected void |
fill(boolean positive,
int low,
int high,
ColorScheme scheme)
Use the scheme to fill the values from low to high. |
protected void |
finish(boolean positive,
int low,
int high,
int defaultValue)
Finish up the arrays by filling all values from low to high with the defaultValue. |
BufferedImage |
generateLegend(boolean positive,
boolean horizontal,
int width,
int height)
Make a legend that can be used to express the range that this table can display. |
AlphaComposite |
getAlphaComposite()
Get the compositing rule for blending this color with an existing image. |
int |
getColor(double value)
Look up the given value and return an ARGB integer. |
double |
getMax()
Get the maximum supported value. |
double |
getMin()
Get the minimum supported value. |
void |
setColor(double value,
int color)
|
void |
setNegative(ColorScheme scheme,
double threshold,
double window)
Set the negative values for this using the specified color scheme with the given threshold and window. |
void |
setPositive(ColorScheme scheme,
double threshold,
double window)
Set the positive values for this using the specified color scheme with the given threshold and window. |
| Methods inherited from class java.lang.Object |
|---|
clone, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
protected int[] pcolors
protected int[] ncolors
protected float multiplier
| Constructor Detail |
|---|
public ColorLookupTable(double min,
double max)
min - The minimum supported value.max - The maximum supported value.
public ColorLookupTable(int min,
int max)
min - The minimum supported value.max - The maximum supported value.
public ColorLookupTable(float multiplier,
double min,
double max)
multiplier - The multiplier is used to convert floating points into indices.min - The minimum supported value.max - The maximum supported value.| Method Detail |
|---|
public int getColor(double value)
value - The value from the volume.
public void setColor(double value,
int color)
protected void fill(boolean positive,
int low,
int high,
ColorScheme scheme)
positive - Whether or not this is positive or negativelow - a value between [0, high]high - a value between [low, color.length)scheme -
protected void finish(boolean positive,
int low,
int high,
int defaultValue)
positive - Whether or not this is positive or negativelow - a value between [0, high]high - a value between [low, color.length)defaultValue -
public void setPositive(ColorScheme scheme,
double threshold,
double window)
scheme - The coloring scheme to usethreshold - The value to use as 0 (values < threshold are treated as 0)window - The width of the colors(values > window + threshold are treated as 1)
IllegalStateException - if this has been set before.
public void setNegative(ColorScheme scheme,
double threshold,
double window)
scheme - The coloring scheme to usethreshold - The value to use as 0 (values > threshold are treated as 0)window - The width of the colors(values < window + threshold are treated as 1)
IllegalStateException - if this has been set before.public AlphaComposite getAlphaComposite()
public boolean equals(Object o)
equals in class Objecto -
public boolean equals(ColorLookupTable other)
other - The other ColorLookupTable for comparison
public double getMax()
public double getMin()
public BufferedImage generateLegend(boolean positive,
boolean horizontal,
int width,
int height)
positive - whether this legend is for positive values.horizontal - Whether this legend is oriented left to right or top to bottomwidth - The width in pixelsheight - The height in pixels
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||