|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectuk.ac.starlink.ttools.plot.Fogger
public class Fogger
Defines how colours are changed at different depths (distances away from the viewer) by interposing a 'fog' which makes the colours gloomier the further away you go.
Various methods are provided to fog colours at a given Z coordinate.
For reasonable rendering, z
should be greater than
or equal to zero, and of order of this renderer's scale distance.
Instances of this class are not thread safe.
The fogging algorithm comes from Eric Dumont's fog FAQ.
Constructor Summary | |
---|---|
Fogger(double scale)
Constructs a new depth tweaker for rendering distances of the order of a given scale. |
Method Summary | |
---|---|
DataColorTweaker |
createTweaker(int ifog,
DataColorTweaker base)
Constructs a DataColorTweaker based on an existing one which appends the affect of this fogger. |
DataColorTweaker |
createTweaker(int ifog,
int ncoord)
Constructs a DataColorTweaker corresponding to this fogger which just takes care of fogging. |
Color |
fogAt(double z,
Color color)
Returns a fogged version of a given colour at a given depth. |
void |
fogAt(double z,
float[] rgba)
Returns a fogged version of a given colour at a given depth using normalised components. |
int |
fogAt(double z,
int argb)
Returns a fogged version of a given colour at a given depth. |
void |
fogAt(double z,
int[] rgba)
Returns a fogged version of a given colour at a given depth. |
double |
getFogginess()
Returns the thickness of the fog. |
double |
getScale()
Returns the depth scale distance. |
void |
setFogginess(double fogginess)
Sets the thickness of the fog. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public Fogger(double scale)
scale
- depth scale distanceMethod Detail |
---|
public double getScale()
public void setFogginess(double fogginess)
fogginess
- intensity of fog per scale distancepublic double getFogginess()
public Color fogAt(double z, Color color)
z
- distance at which the colour is being viewedcolor
- original colour
public void fogAt(double z, int[] rgba)
z
- distance at which the colour is being viewedrgba
- rgba colour components; these will be modified on
exit to represent the fogged valuepublic void fogAt(double z, float[] rgba)
z
- distance at which the colour is being viewedrgba
- normalised rgba colour components; these will
be modified on exit to represent the fogged valuepublic int fogAt(double z, int argb)
z
- distance at which the colour is being viewed
public DataColorTweaker createTweaker(int ifog, int ncoord)
ifog
- index in coordinate array of Z coordinatencoord
- size of coordinate arraypublic DataColorTweaker createTweaker(int ifog, DataColorTweaker base)
ifog
- index in coordinate array of Z coordinatebase
- color tweaker to be additionally fogged
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |