apps.lightrays.raytracer.scene
Class Colour

java.lang.Object
  extended by apps.lightrays.raytracer.scene.Colour

public class Colour
extends java.lang.Object

The Class Colour.


Field Summary
 double b
          The b.
 double g
          The g.
 double r
          The r.
 
Constructor Summary
Colour()
          Instantiates a new colour.
Colour(Colour c)
          Instantiates a new colour.
Colour(double r, double g, double b)
          Instantiates a new colour.
Colour(int rgb)
          Instantiates a new colour.
 
Method Summary
 void attenuate(Colour c)
          Attenuate.
 void attenuate(double a)
          Attenuate.
 void combineWith(Colour c)
          Combine with.
static Colour getAverageColour(Colour[] array)
          Gets the average colour.
 int getRGB()
          Gets the rgb.
 void set(Colour c)
          Sets the.
 void set(double r, double g, double b)
          Sets the.
 java.lang.String toString()
           
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

b

public double b
The b.


g

public double g
The g.


r

public double r
The r.

Constructor Detail

Colour

public Colour()
Instantiates a new colour.


Colour

public Colour(Colour c)
Instantiates a new colour.

Parameters:
c - the c

Colour

public Colour(double r,
              double g,
              double b)
Instantiates a new colour.

Parameters:
r - the r
g - the g
b - the b

Colour

public Colour(int rgb)
Instantiates a new colour.

Parameters:
rgb - the rgb
Method Detail

getAverageColour

public static Colour getAverageColour(Colour[] array)
Gets the average colour.

Parameters:
array - the array
Returns:
the average colour

attenuate

public final void attenuate(Colour c)
Attenuate.

Parameters:
c - the c

attenuate

public final void attenuate(double a)
Attenuate.

Parameters:
a - the a

combineWith

public final void combineWith(Colour c)
Combine with.

Parameters:
c - the c

getRGB

public final int getRGB()
Gets the rgb.

Returns:
the rgb

set

public void set(Colour c)
Sets the.

Parameters:
c - the c

set

public void set(double r,
                double g,
                double b)
Sets the.

Parameters:
r - the r
g - the g
b - the b

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object