|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.gwoptics.graphics.colourmap.EquationColourmap
public class EquationColourmap
EquationColourmap implements the IColourmap interface to generate a colourmap from an equation, rather than nodes as in the alternative RGBColourmap. The equation that generates the map returns a Colour object as specified in IColourmapEquation.
Before any values are read from the map, the map must have been generated using
generateColourmap() or a MapNeedsGeneratingException
will be thrown.
GWColour
,
IColourmapEquation
,
IColourmap
,
RGBColourmap
,
MapNeedsGeneratingException
Constructor Summary | |
---|---|
EquationColourmap(IColourmapEquation eq)
Requires an equation object to be passed to it, which is not nullable |
|
EquationColourmap(int resolution,
IColourmapEquation eq)
Additional constructor that allows a custom resolution of lookup table. |
Method Summary | |
---|---|
void |
generateColourmap()
Use the supplied equation to generate colour values for each index in the colourmap. |
GWColour |
getColourAtLocation(float l)
Returns a Colour object that relates to a normalised location on the colourmap |
int |
getIntAtLocation(float l)
Returns an integer that relates to a normalised location on the colourmap. |
boolean |
isCentreAtZero()
Should return true if 0 value for what the colourmap is displaying is represented by the colour at the point 0.5 |
boolean |
isGenerated()
Should return whether colourmap has been generated or not |
void |
setCentreAtZero(boolean value)
|
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public EquationColourmap(IColourmapEquation eq)
eq
- Equation that generates the colourmap, is not nullable.public EquationColourmap(int resolution, IColourmapEquation eq)
resolution
- defines number of steps in colourmap lookup table.eq
- Equation that generates the colourmap, is not nullable.Method Detail |
---|
public boolean isCentreAtZero()
IColourmap
isCentreAtZero
in interface IColourmap
public void setCentreAtZero(boolean value)
public boolean isGenerated()
IColourmap
isGenerated
in interface IColourmap
public void generateColourmap()
generateColourmap
in interface IColourmap
public GWColour getColourAtLocation(float l)
getColourAtLocation
in interface IColourmap
l
- Normalised location input (between 0.0f and 1.0f)
public int getIntAtLocation(float l)
getIntAtLocation
in interface IColourmap
l
- Normalised location input (between 0.0f and 1.0f)
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |