org.gwoptics.graphics.graph2D.effects
Interface ITraceColourEffect

All Known Implementing Classes:
AxisColourmapEffect, XAxisColourmapEffect, YAxisColourmapEffect

public interface ITraceColourEffect

This interface is consumed and implemented by the IGraphTrace object. An ITraceColourEffect is called for each point/segment of a trace and is given the x and y graph values and control positions in pixels. These can be used in anyway to generate a colour to return to the rendering object.

The setXAxisValues and setAxisYValues methods are called to allow you to store the range of the axes the trace is on. This allows normalisations of values to change between max and mins of the axes.

Since:
0.4.0
Author:
Daniel Brown 13/7/09

Method Summary
 GWColour getPixelColour(int xPos, int yPos, float xVal, float yVal)
          The trace this effect relates to should call this function for each segment of the trace.
 void setXAxisValues(int axisLength, float minValue, float maxValue)
          Accepts values relating to the axes the trace is being plotted on.
 void setYAxisValues(int axisLength, float minValue, float maxValue)
          Accepts values relating to the axes the trace is being plotted on.
 

Method Detail

getPixelColour

GWColour getPixelColour(int xPos,
                        int yPos,
                        float xVal,
                        float yVal)
The trace this effect relates to should call this function for each segment of the trace. it should provide the x and y position and graph value of the segment so this function can generate a colour to return.

Parameters:
xPos -
yPos -
xVal -
yVal -
Returns:

setXAxisValues

void setXAxisValues(int axisLength,
                    float minValue,
                    float maxValue)
Accepts values relating to the axes the trace is being plotted on.

Parameters:
axisLength -
minValue -
maxValue -

setYAxisValues

void setYAxisValues(int axisLength,
                    float minValue,
                    float maxValue)
Accepts values relating to the axes the trace is being plotted on.

Parameters:
axisLength -
minValue -
maxValue -


processing library gwoptics by Daniel Brown and Andreas Freise. (c) 2009 onwards