raytracer.internal
Class Color

java.lang.Object
  |
  +--raytracer.internal.Color

public class Color
extends java.lang.Object

Represents a color with values for red, green, blue ranging from 0 to 1


Constructor Summary
Color(Color col)
          Copy constructor
Color(float r, float g, float b)
          Creates a color object with the given intensities
 
Method Summary
 void add(Color col)
          Adds a color
 void add(Color obj, Color intensity)
          Adds a color with the given intensity
 void add(Color obj, Color light, float intensity)
           
 void add(Color obj, float intensity)
          Adds a color with the given intensity
 float getB()
           
 float getG()
           
 float getR()
           
 float influence()
          Calculates how much the color would influence an exisiting color (usually the distance to zero)
 void mul(Color c)
           
 void mul(Color c, float intensity)
           
 void transmit(Color obj, Color transmission)
           
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Color

public Color(float r,
             float g,
             float b)
Creates a color object with the given intensities

Parameters:
r - intensity for red
g - intensity for green
b - intensity for blue

Color

public Color(Color col)
Copy constructor

Parameters:
col - color object to duplicate
Method Detail

add

public void add(Color col)
Adds a color

Parameters:
col - Color to add

add

public void add(Color obj,
                float intensity)
Adds a color with the given intensity

Parameters:
obj - Color to add
intensity - Intensity factor applied to all components of the added color

add

public void add(Color obj,
                Color intensity)
Adds a color with the given intensity

Parameters:
obj - Color to add
intensity - Intensity color applied componentwise of the added color

add

public void add(Color obj,
                Color light,
                float intensity)

transmit

public void transmit(Color obj,
                     Color transmission)

mul

public void mul(Color c)

mul

public void mul(Color c,
                float intensity)

influence

public float influence()
Calculates how much the color would influence an exisiting color (usually the distance to zero)

Returns:
Influence factor

getR

public float getR()

getG

public float getG()

getB

public float getB()