crystalspace.jbind.impl.csgfx.rgbpixel
Class csRGBcolor

java.lang.Object
  extended bycrystalspace.jbind.impl.csNativeObject
      extended bycrystalspace.jbind.impl.csgfx.rgbpixel.csRGBcolor
All Implemented Interfaces:
iPointer

public class csRGBcolor
extends csNativeObject

An RGB color. This class is used whenever we need just R, G and B information, such as when defining a color palette.

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

Field Summary
 
Fields inherited from class crystalspace.jbind.impl.csNativeObject
ImplFactory, nPointer
 
Constructor Summary
csRGBcolor()
          Constructor (initialize to zero).
csRGBcolor(iPointer nPointer)
           
csRGBcolor(short r, short g, short b)
          Initialize the color with some R/G/B value.
 
Method Summary
 csRGBcolor add(csRGBcolor c)
          add two csRGBcolors Definition at line 84 of file rgbpixel.h.
 short blue()
          The red, green, blue components.
 void blue(short b)
          The red, green, blue components.
 boolean equals(java.lang.Object c)
          Compare with an csRGBcolor.
 short green()
          The red, green, blue components.
 void green(short g)
          The red, green, blue components.
protected  boolean isNativePointerValidSafe(long pointer)
           
protected  void nDelete(long pointer)
           
 boolean nEquals(csRGBcolor c)
          Compare with an csRGBcolor.
 short red()
          The red, green, blue components.
 void red(short r)
          The red, green, blue components.
 void set(short r, short g, short b)
          Assign given red/green/blue values to this pixel.
 
Methods inherited from class crystalspace.jbind.impl.csNativeObject
changePointer, 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

csRGBcolor

public csRGBcolor(iPointer nPointer)
Parameters:
nPointer -

csRGBcolor

public csRGBcolor()
Constructor (initialize to zero). Definition at line 70 of file rgbpixel.h. References blue, green, and red. Referenced by operator+().


csRGBcolor

public csRGBcolor(short r,
                  short g,
                  short b)
Initialize the color with some R/G/B value. Definition at line 72 of file rgbpixel.h. References blue, green, and red.

Parameters:
r -
g -
b -
Method Detail

nDelete

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

isNativePointerValidSafe

protected boolean isNativePointerValidSafe(long pointer)
Specified by:
isNativePointerValidSafe in class csNativeObject
See Also:
crystalspace.jbind.impl.csNativeObject#isNativePointerValidSafe()

nEquals

public boolean nEquals(csRGBcolor c)
Compare with an csRGBcolor. Definition at line 81 of file rgbpixel.h. References operator==().

Parameters:
c -
Returns:

add

public csRGBcolor add(csRGBcolor c)
add two csRGBcolors Definition at line 84 of file rgbpixel.h. References blue, csRGBcolor(), green, and red.

Parameters:
c -
Returns:

equals

public boolean equals(java.lang.Object c)
Compare with an csRGBcolor. Definition at line 78 of file rgbpixel.h. References blue, green, and red. Referenced by operator!=().

Overrides:
equals in class csNativeObject
See Also:
Object.equals(java.lang.Object)

set

public void set(short r,
                short g,
                short b)
Assign given red/green/blue values to this pixel. Definition at line 75 of file rgbpixel.h. References blue, green, and red.

Parameters:
r -
g -
b -

blue

public short blue()
The red, green, blue components. Definition at line 68 of file rgbpixel.h. Referenced by csRGBVector::Compare(), csRGBVector::CompareKey(), csPackRGBcolorToRGB(), csRGBcolor(), csUnpackRGBAtoRGBcolor(), csUnpackRGBtoRGBcolor(), operator+(), csRGBpixel::operator+=(), csRGBpixel::operator==(), operator==(), and Set().

Returns:

blue

public void blue(short b)
The red, green, blue components. Definition at line 68 of file rgbpixel.h. Referenced by csRGBVector::Compare(), csRGBVector::CompareKey(), csPackRGBcolorToRGB(), csRGBcolor(), csUnpackRGBAtoRGBcolor(), csUnpackRGBtoRGBcolor(), operator+(), csRGBpixel::operator+=(), csRGBpixel::operator==(), operator==(), and Set().

Parameters:
b -

green

public short green()
The red, green, blue components. Definition at line 68 of file rgbpixel.h. Referenced by csRGBVector::Compare(), csRGBVector::CompareKey(), csPackRGBcolorToRGB(), csRGBcolor(), csUnpackRGBAtoRGBcolor(), csUnpackRGBtoRGBcolor(), operator+(), csRGBpixel::operator+=(), csRGBpixel::operator==(), operator==(), and Set().

Returns:

green

public void green(short g)
The red, green, blue components. Definition at line 68 of file rgbpixel.h. Referenced by csRGBVector::Compare(), csRGBVector::CompareKey(), csPackRGBcolorToRGB(), csRGBcolor(), csUnpackRGBAtoRGBcolor(), csUnpackRGBtoRGBcolor(), operator+(), csRGBpixel::operator+=(), csRGBpixel::operator==(), operator==(), and Set().

Parameters:
g -

red

public short red()
The red, green, blue components. Definition at line 68 of file rgbpixel.h. Referenced by csRGBVector::Compare(), csRGBVector::CompareKey(), csPackRGBcolorToRGB(), csRGBcolor(), csUnpackRGBAtoRGBcolor(), csUnpackRGBtoRGBcolor(), operator+(), csRGBpixel::operator+=(), csRGBpixel::operator==(), operator==(), and Set().

Returns:

red

public void red(short r)
The red, green, blue components. Definition at line 68 of file rgbpixel.h. Referenced by csRGBVector::Compare(), csRGBVector::CompareKey(), csPackRGBcolorToRGB(), csRGBcolor(), csUnpackRGBAtoRGBcolor(), csUnpackRGBtoRGBcolor(), operator+(), csRGBpixel::operator+=(), csRGBpixel::operator==(), operator==(), and Set().

Parameters:
r -