crystalspace.jbind.impl.csutil.cscolor
Class csColor

java.lang.Object
  extended bycrystalspace.jbind.impl.csNativeObject
      extended bycrystalspace.jbind.impl.csutil.cscolor.csColor
All Implemented Interfaces:
iPointer

public class csColor
extends csNativeObject

A class used to represent a color in RGB space. This class is similar to csRGBpixel and csRGBcolor except that it uses floating-point values to store R,G,B values.

Author:
Quentin Anciaux, c++ version - http://crystal.sourceforge.net/docs/online/pubapi/classcsColor.php

Field Summary
 
Fields inherited from class crystalspace.jbind.impl.csNativeObject
ImplFactory, nPointer
 
Constructor Summary
csColor()
           
csColor(csColor c)
           
csColor(float r, float g, float b)
           
csColor(iPointer nPointer)
           
 
Method Summary
 csColor add(csColor c)
          Add another color to this one.
 void add(float r, float g, float b)
          Add given R,G,B components to color.
 float blue()
          Blue (0..1).
 void blue(float b)
          Blue (0..1).
 void clamp(float r, float g, float b)
          Clamp color to given R,G,B values.
 void clampDown()
          Make sure color components are not negative.
 float green()
          Green (0..1).
 void green(float g)
          Green (0..1).
protected  boolean isNativePointerValidSafe(long pointer)
           
 csColor minus(csColor c)
          Subtract another color to this one.
 csColor mul(float f)
          Multiply this color by a scalar value.
protected  void nDelete(long pointer)
           
 float red()
          Red (0..1).
 void red(float r)
          Red (0..1).
 csColor set(csColor c)
          Assign one color object to another.
 void set(float r, float g, float b)
          Set color to given R,G,B components.
 void subtract(float r, float g, float b)
          Subtract given R,G,B components from color.
 
Methods inherited from class crystalspace.jbind.impl.csNativeObject
changePointer, equals, finalize, getPointer, getPointer, getPointerArray, hashCode, isMemoryOwner, isNativePointerValid, newNativeObject, setMemoryOwner, toString
 
Methods inherited from class java.lang.Object
clone, getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

csColor

public csColor(iPointer nPointer)

csColor

public csColor()

csColor

public csColor(float r,
               float g,
               float b)

csColor

public csColor(csColor c)
Method Detail

nDelete

protected void nDelete(long pointer)
Specified by:
nDelete in class csNativeObject

isNativePointerValidSafe

protected boolean isNativePointerValidSafe(long pointer)
Specified by:
isNativePointerValidSafe in class csNativeObject

add

public void add(float r,
                float g,
                float b)
Add given R,G,B components to color. Definition at line 76 of file cscolor.h. References blue, green, and red.

Parameters:
r -
g -
b -

clamp

public void clamp(float r,
                  float g,
                  float b)
Clamp color to given R,G,B values. Definition at line 50 of file cscolor.h. References blue, green, and red.

Parameters:
r -
g -
b -

clampDown

public void clampDown()
Make sure color components are not negative. Definition at line 57 of file cscolor.h. References blue, green, and red.


mul

public csColor mul(float f)
Multiply this color by a scalar value. Definition at line 67 of file cscolor.h. References blue, green, and red.

Parameters:
f -
Returns:

add

public csColor add(csColor c)
Add another color to this one. Definition at line 70 of file cscolor.h. References blue, green, and red.

Parameters:
c -
Returns:

minus

public csColor minus(csColor c)
Subtract another color to this one. Definition at line 73 of file cscolor.h. References blue, green, and red.

Parameters:
c -
Returns:

set

public csColor set(csColor c)
Assign one color object to another. Definition at line 64 of file cscolor.h. References blue, green, and red.

Parameters:
c -
Returns:

set

public void set(float r,
                float g,
                float b)
Set color to given R,G,B components. Definition at line 47 of file cscolor.h. References blue, green, and red.

Parameters:
r -
g -
b -

subtract

public void subtract(float r,
                     float g,
                     float b)
Subtract given R,G,B components from color. Definition at line 79 of file cscolor.h. References blue, green, and red.

Parameters:
r -
g -
b -

blue

public float blue()
Blue (0..1). Definition at line 35 of file cscolor.h. Referenced by Add(), Clamp(), ClampDown(), csColor(), operator *=(), operator+=(), operator-=(), operator=(), Set(), and Subtract().

Returns:

blue

public void blue(float b)
Blue (0..1). Definition at line 35 of file cscolor.h. Referenced by Add(), Clamp(), ClampDown(), csColor(), operator *=(), operator+=(), operator-=(), operator=(), Set(), and Subtract().

Parameters:
b -

green

public float green()
Green (0..1). Definition at line 33 of file cscolor.h. Referenced by Add(), Clamp(), ClampDown(), csColor(), operator *=(), operator+=(), operator-=(), operator=(), Set(), and Subtract().

Returns:

green

public void green(float g)
Green (0..1). Definition at line 33 of file cscolor.h. Referenced by Add(), Clamp(), ClampDown(), csColor(), operator *=(), operator+=(), operator-=(), operator=(), Set(), and Subtract().

Parameters:
g -

red

public float red()
Red (0..1). Definition at line 31 of file cscolor.h. Referenced by Add(), Clamp(), ClampDown(), csColor(), operator *=(), operator+=(), operator-=(), operator=(), Set(), and Subtract().

Returns:

red

public void red(float r)
Red (0..1). Definition at line 31 of file cscolor.h. Referenced by Add(), Clamp(), ClampDown(), csColor(), operator *=(), operator+=(), operator-=(), operator=(), Set(), and Subtract().

Parameters:
r -