Package uk.ac.starlink.ttools.plot
Class DensityStyle
java.lang.Object
uk.ac.starlink.ttools.plot.DensityStyle
Style for the way that a density map (2d histogram) is plotted.
- Since:
- 1 Dec 2005
- Author:
- Mark Taylor
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic classEnumeration class which describes a colour channel. -
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final DensityStyle.ChannelBlue colour channel.static final DensityStyle.ChannelGreen colour channel.static final DensityStyle.ChannelRed colour channel. -
Constructor Summary
ConstructorsConstructorDescriptionDensityStyle(DensityStyle.Channel channel) Constructs a new style which plots in a given colour channel. -
Method Summary
Modifier and TypeMethodDescriptionintintReturns an icon suitable for displaying in a legend for this style.Returns the shader to use in indexed (non-RGB) mode.protected abstract booleanisRGB()Indicates whether the plotting is currently to be treated as three-channel RGB plotting or as single-channel intensity plotting.intlevelBits(byte level) Defines how the style looks.voidvoidSets the shader to use in indexed (non-RGB) mode.toString()
-
Field Details
-
RED
Red colour channel. -
GREEN
Green colour channel. -
BLUE
Blue colour channel.
-
-
Constructor Details
-
DensityStyle
Constructs a new style which plots in a given colour channel.- Parameters:
channel- colour channel
-
-
Method Details
-
setShader
Sets the shader to use in indexed (non-RGB) mode. This should be an absolute shader.- Parameters:
shader- shader
-
getShader
Returns the shader to use in indexed (non-RGB) mode. This should be an absolute shader.- Returns:
- shader
-
levelBits
public int levelBits(byte level) Defines how the style looks. This converts an unsigned byte value (that is a value in the range 0-255 got by doingvalue=0x000000ff&level) to a bitmask which can be OR-ed with an existing integer to give a 32-type ARGB colour value.- Parameters:
level- unsigned byte value- Returns:
- ORable bit mask for modifying a colour value
-
isRGB
protected abstract boolean isRGB()Indicates whether the plotting is currently to be treated as three-channel RGB plotting or as single-channel intensity plotting.- Returns:
- true iff plotting is currently three-channel
-
getLegendIcon
Description copied from interface:StyleReturns an icon suitable for displaying in a legend for this style.- Specified by:
getLegendIconin interfaceStyle
-
getIconHeight
public int getIconHeight()- Specified by:
getIconHeightin interfaceIcon
-
getIconWidth
public int getIconWidth()- Specified by:
getIconWidthin interfaceIcon
-
paintIcon
-
toString
-