dasher
Class CCustomColours

java.lang.Object
  extended by dasher.CCustomColours

public class CCustomColours
extends java.lang.Object

Represents a custom colour scheme, wrapping a ColourInfo object and importing its contents into Collections suitable for random access.

This also ensures that the ColourInfo object is read-only when in use.


Field Summary
protected  java.util.ArrayList<java.lang.Integer> m_Blue
          Fast-access array of available colours' blue values.
protected  CColourIO.ColourInfo m_ColourInfo
          Wrapped colour info object.
protected  java.util.ArrayList<java.lang.Integer> m_Green
          Fast-access array of available colours' green values.
protected  java.util.ArrayList<java.lang.Integer> m_Red
          Fast-access array of available colours' red values.
 
Constructor Summary
CCustomColours(CColourIO.ColourInfo ColInfo)
          Sole constructor; copies the data from a given ColourInfo object.
 
Method Summary
 int GetBlue(int colour)
          Gets the blue value of a given colour.
 int GetGreen(int colour)
          Gets the green value of a given colour.
 int GetNumColours()
          Gets number of available colours.
 int GetRed(int colour)
          Gets the red value of a given colour.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

m_ColourInfo

protected CColourIO.ColourInfo m_ColourInfo
Wrapped colour info object.


m_Red

protected java.util.ArrayList<java.lang.Integer> m_Red
Fast-access array of available colours' red values.


m_Green

protected java.util.ArrayList<java.lang.Integer> m_Green
Fast-access array of available colours' green values.


m_Blue

protected java.util.ArrayList<java.lang.Integer> m_Blue
Fast-access array of available colours' blue values.

Constructor Detail

CCustomColours

public CCustomColours(CColourIO.ColourInfo ColInfo)
Sole constructor; copies the data from a given ColourInfo object.

Parameters:
ColInfo - ColourInfo object detailing the scheme we wish to represent.
Method Detail

GetNumColours

public int GetNumColours()
Gets number of available colours.

Returns:
Number of available colours.

GetRed

public int GetRed(int colour)
Gets the red value of a given colour.

Parameters:
colour - Index of the colour to look up.
Returns:
Red value, on a scale from 0 to 255.

GetGreen

public int GetGreen(int colour)
Gets the green value of a given colour.

Parameters:
colour - Index of the colour to look up.
Returns:
green value, on a scale from 0 to 255.

GetBlue

public int GetBlue(int colour)
Gets the blue value of a given colour.

Parameters:
colour - Index of the colour to look up.
Returns:
blue value, on a scale from 0 to 255.