|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.gwoptics.graphics.colourmap.RGBColourmap
public class RGBColourmap
RGBColourmap is an object that allows various colourmaps to be generated from RGB nodes. The class accepts user given values for nodes which are used to build a lookup table for fast access of values. The lookup table ranges from 0.0f to 1.0f where the steps in between are changeable via the constructor. To lookup a colour value the user input of the location must normalise their input and select a value between 0.0 and 1.0(Values greater or less than these are capped). So for a range of 0.0 to 100.0 to get the colour of a point whose value is 69, the location input should be 0.69f.
This class implements the general IColourmap interface which allows it to work with objects that use colourmaps.
IColourmap
,
ColourmapNode
Constructor Summary | |
---|---|
RGBColourmap()
Standard constructor that sets a default resolution of 100 steps in the lookup table. |
|
RGBColourmap(int resolution)
Additional constructor that allows a custom resolution of lookup table. |
Method Summary | |
---|---|
void |
addNode(ColourmapNode n)
This function adds an RGBNode to the colour map, which is then used to generate various gradients of colour. |
void |
generateColourmap()
Generates the lookup table values using supplied nodes. |
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. |
ColourmapNode |
getNode(int i)
|
int |
getNodeCount()
|
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 |
removeNode(int i)
|
void |
setCentreAtZero(boolean value)
|
void |
setNode(int i,
ColourmapNode node)
|
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public RGBColourmap()
public RGBColourmap(int resolution)
resolution
- defines number of steps in colourmap lookup table.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 addNode(ColourmapNode n)
public void generateColourmap()
generateColourmap
in interface IColourmap
GWColour
,
getColourAtLocation
,
getIntAtLocation
,
addNode()
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)
public ColourmapNode getNode(int i)
public void setNode(int i, ColourmapNode node)
public void removeNode(int i)
public int getNodeCount()
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |