public class ColorHandler extends Object
Modifier and Type | Field and Description |
---|---|
protected RealType |
blue
Red, green and blue components of images.
|
protected int |
brightness
Brightness and contrast of images.
|
protected int |
colorModel
Color model (RGB_MODEL, HSV_MODEL or COMPOSITE_MODEL).
|
protected ColorPane |
colorPane
Dialog pane for adjusting color settings.
|
protected float[][][] |
colorTables
Color tables.
|
protected int |
contrast
Brightness and contrast of images.
|
protected boolean[] |
fixed
Flags indicating color ranges should not be auto-scaled.
|
protected RealType |
green
Red, green and blue components of images.
|
protected double[] |
hi
Minimum and maximum color range values.
|
protected TransformLink |
link
Associated link between data object and display.
|
protected double[] |
lo
Minimum and maximum color range values.
|
protected static int |
NORMAL_BRIGHTNESS
Starting brightness value.
|
protected static int |
NORMAL_CONTRAST
Starting contrast value.
|
protected static int |
NORMAL_OPACITY
Starting opacity value.
|
protected int |
opacityModel
Transparency model (CONSTANT_ALPHA or CURVED_ALPHA).
|
protected int |
opacityValue
Opacity value.
|
protected RealType |
red
Red, green and blue components of images.
|
Constructor and Description |
---|
ColorHandler(TransformLink link)
Creates a color handler for the given transform link.
|
Modifier and Type | Method and Description |
---|---|
RealType |
getBlue()
Gets RealType mapped to blue.
|
int |
getBrightness()
Gets brightness value.
|
int |
getColorModel()
Gets color model (RGB_MODEL, HSV_MODEL or COMPOSITE_MODEL).
|
ColorPane |
getColorPane()
Gets GUI control pane for this color handler.
|
int |
getContrast()
Gets contrast value.
|
boolean[] |
getFixed()
Gets whether each color mapping has a fixed range.
|
RealType |
getGreen()
Gets RealType mapped to green.
|
double[] |
getHi()
Gets color mapping maximums.
|
TransformLink |
getLink()
Gets associated transform link.
|
double[] |
getLo()
Gets color mapping minimums.
|
ScalarMap[] |
getMaps()
Gets color mappings for this color handler's transform link.
|
int |
getOpacityModel()
Gets opacity model (CONSTANT_ALPHA or CURVED_ALPHA).
|
int |
getOpacityValue()
Gets opacity value.
|
RealType |
getRed()
Gets RealType mapped to red.
|
float[][][] |
getTables()
Gets current color tables.
|
DisplayWindow |
getWindow()
Gets the VisBio display window affected by this color handler.
|
void |
initColors(boolean reset)
Applies color settings to the latest linked data object.
|
void |
initState(ColorHandler handler)
Modifies this object's state to match that of the given object.
|
boolean |
matches(ColorHandler handler)
Tests whether two objects are in equivalent states.
|
void |
reAutoScale()
Recomputes autoscaled color range bounds.
|
void |
refreshPreviewData()
Refreshes preview data from the transform link.
|
void |
restoreState(Element el)
Restores the current state from the given DOM element ("TransformLink").
|
void |
saveState(Element el)
Writes the current state to the given DOM element ("TransformLink").
|
void |
setColors(int brightness,
int contrast,
int colorModel,
RealType red,
RealType green,
RealType blue,
boolean compute)
Updates color settings to those given.
|
void |
setOpacity(int opacityValue,
int opacityModel,
boolean compute)
Sets opacity.
|
void |
setRanges(double[] lo,
double[] hi,
boolean[] fixed)
Updates map ranges to those given.
|
void |
setTables(float[][][] tables)
Updates color tables to those given.
|
void |
showColorDialog()
Displays the color dialog pane onscreen and alters the color scheme as
requested.
|
protected static final int NORMAL_BRIGHTNESS
protected static final int NORMAL_CONTRAST
protected static final int NORMAL_OPACITY
protected TransformLink link
protected ColorPane colorPane
protected int brightness
protected int contrast
protected int opacityValue
protected int opacityModel
protected int colorModel
protected RealType red
protected RealType green
protected RealType blue
protected double[] lo
protected double[] hi
protected boolean[] fixed
protected float[][][] colorTables
public ColorHandler(TransformLink link)
public TransformLink getLink()
public ColorPane getColorPane()
public DisplayWindow getWindow()
public ScalarMap[] getMaps()
public void initColors(boolean reset)
public void refreshPreviewData()
public void showColorDialog()
public void setColors(int brightness, int contrast, int colorModel, RealType red, RealType green, RealType blue, boolean compute)
public void setOpacity(int opacityValue, int opacityModel, boolean compute)
opacityValue
- How opaque data should be, ranging from 0 - 256opacityModel
- ColorUtil.CONSTANT_ALPHA or ColorUtil.CURVED_ALPHAcompute
- Whether to actually update the datapublic void setRanges(double[] lo, double[] hi, boolean[] fixed)
public void setTables(float[][][] tables)
public void reAutoScale()
public int getBrightness()
public int getContrast()
public int getOpacityValue()
public int getOpacityModel()
public int getColorModel()
public RealType getRed()
public RealType getGreen()
public RealType getBlue()
public double[] getLo()
public double[] getHi()
public boolean[] getFixed()
public float[][][] getTables()
public boolean matches(ColorHandler handler)
public void initState(ColorHandler handler)
public void saveState(Element el) throws SaveException
SaveException
public void restoreState(Element el) throws SaveException
SaveException
Copyright © 2015–2022 SciJava. All rights reserved.