|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.openmali.vecmath2.Colorf
public class Colorf
A simple float-based color implementation with or without alpha channel. Inspired by Kenji Hiranabe's Color3f/Color4f implementation
| Field Summary | |
|---|---|
static Colorf |
BLACK
The color black. |
static Colorf |
BLACK_TRANSPARENT
The color black and fully transparent. |
static Colorf |
BLUE
The color blue. |
static Colorf |
BROWN
The color brown. |
static Colorf |
CYAN
The color cyan. |
static Colorf |
DARK_BROWN
The color brown. |
static Colorf |
DARK_GRAY
The color dark gray. |
static Colorf |
GRAY
The color gray. |
static Colorf |
GRAY10
A 10% gray. |
static Colorf |
GRAY20
A 20% gray. |
static Colorf |
GRAY25
A 25% gray. |
static Colorf |
GRAY30
A 30% gray. |
static Colorf |
GRAY40
A 40% gray. |
static Colorf |
GRAY50
A 50% gray. |
static Colorf |
GRAY60
A 60% gray. |
static Colorf |
GRAY70
A 70% gray. |
static Colorf |
GRAY75
A 75% gray. |
static Colorf |
GRAY80
A 80% gray. |
static Colorf |
GRAY90
A 90% gray. |
static Colorf |
GREEN
The color green. |
protected boolean |
hasAlpha
|
protected boolean[] |
isDirty
|
static Colorf |
LIGHT_BROWN
The color brown. |
static Colorf |
LIGHT_GRAY
The color light gray. |
static Colorf |
MAGENTA
The color magenta. |
protected static int |
N
|
static Colorf |
ORANGE
The color orange. |
static Colorf |
PINK
The color pink. |
static Colorf |
RED
The color red. |
protected int |
roTrick
|
protected float[] |
values
|
static Colorf |
WHITE
The color white. |
static Colorf |
WHITE_TRANSPARENT
The color white and fully transparent. |
static Colorf |
YELLOW
The color yellow. |
| Constructor Summary | |
|---|---|
|
Colorf()
Creates a new Colorf instance. |
protected |
Colorf(boolean readOnly)
Creates a new Colorf instance. |
protected |
Colorf(boolean readOnly,
java.awt.Color color)
Creates a new Colorf instance. |
protected |
Colorf(boolean readOnly,
Colorf color)
Creates a new Colorf instance. |
protected |
Colorf(boolean readOnly,
float intensity)
Creates a new Colorf instance. |
protected |
Colorf(boolean readOnly,
float[] values,
boolean[] isDirty,
boolean copy)
Creates a new Colorf instance. |
protected |
Colorf(boolean readOnly,
float r,
float g,
float b)
Creates a new Colorf instance. |
protected |
Colorf(boolean readOnly,
float r,
float g,
float b,
float a)
Creates a new Colorf instance. |
|
Colorf(java.awt.Color color)
|
|
Colorf(Colorf color)
Creates a new Colorf instance. |
|
Colorf(Colorf rgbColor,
float alpha)
Creates a new Colorf instance. |
|
Colorf(float intensity)
Creates a new Colorf instance. |
|
Colorf(float[] values)
Creates a new Colorf instance. |
|
Colorf(float r,
float g,
float b)
Creates a new Colorf instance. |
|
Colorf(float r,
float g,
float b,
float a)
Creates a new Colorf instance. |
| Method Summary | |
|---|---|
float |
a()
|
void |
a(float alpha)
Sets the value of the alpha-element of this color. |
Colorf |
add(Colorf color2)
Sets the value of this tuple to the vector sum of itself and tuple t1. |
Colorf |
add(Colorf color1,
Colorf color2)
Sets the value of this color to the vector sum of colors color1 and color2. |
Colorf |
add(float r,
float g,
float b)
Adds the given parameters to this tuple's values. |
Colorf |
add(float r,
float g,
float b,
float a)
Adds the given parameters to this tuple's values. |
Colorf |
addAlpha(float v)
Adds v to this color's alpha value. |
Colorf |
addBlue(float v)
Adds v to this color's blue value. |
Colorf |
addGreen(float v)
Adds v to this color's green value. |
Colorf |
addRed(float v)
Adds v to this color's red value. |
Colorf |
asReadOnly()
|
float |
b()
|
void |
b(float blue)
Sets the Blue color component. |
Colorf |
clamp(float min,
float max)
Clamps this tuple to the range [min, max]. |
Colorf |
clamp(float min,
float max,
Colorf vec)
Clamps the tuple parameter to the range [min, max] and places the values into this tuple. |
Colorf |
clampMax(float max)
Clamps the maximum value of this tuple to the max parameter. |
Colorf |
clampMax(float max,
Colorf vec)
Clamps the maximum value of the tuple parameter to the max parameter and places the values into this tuple. |
Colorf |
clampMin(float min)
Clamps the minimum value of this tuple to the min parameter. |
Colorf |
clampMin(float min,
Colorf vec)
Clamps the minimum value of the tuple parameter to the min parameter and places the values into this tuple. |
Colorf |
clone()
Creates and returns a copy of this object. |
static Colorf |
createGray(float intensity)
Creates a gray of the given intensity. |
int |
deserialize(int pos,
byte[] buffer)
Deserializes this instanc'es data from the byte array. |
Colorf |
div(float vr,
float vg,
float vb)
Divides this color's values by vr, vg, vb. |
Colorf |
div(float vr,
float vg,
float vb,
float va)
Divides this color's values by vr, vg, vb, va. |
Colorf |
divAlpha(float v)
Divides this color's alpha value by v. |
Colorf |
divBlue(float v)
Divides this color's blue value by v. |
Colorf |
divGreen(float v)
Divides this color's green value by v. |
Colorf |
divRed(float v)
Divides this color's red value by v. |
boolean |
epsilonEquals(Colorf color2,
float epsilon)
Returns true if the L-infinite distance between this tuple and tuple t1 is less than or equal to the epsilon parameter, otherwise returns false. |
boolean |
equals(Colorf color2)
Returns true if all of the data members of Tuple3f t1 are equal to the corresponding data members in this |
boolean |
equals(java.lang.Object o)
Returns true if the Object t1 is of type Tuple3f and all of the data members of t1 are equal to the corresponding data members in this Tuple3f. |
static Colorf |
fromPool()
Allocates an Colorf instance from the pool. |
static Colorf |
fromPool(Colorf color)
Allocates an Colorf instance from the pool. |
static Colorf |
fromPool(float r,
float g,
float b)
Allocates an Colorf instance from the pool. |
static Colorf |
fromPool(float r,
float g,
float b,
float a)
Allocates an Colorf instance from the pool. |
float |
g()
|
void |
g(float green)
Sets the Green color component. |
void |
get(Colorf buffer)
Writes all values of this vector to the specified buffer vector. |
void |
get(float[] buffer)
Writes all values of this Tuple to the specified buffer. |
void |
get(float[] buffer,
int offset)
Writes all values of this Tuple to the specified buffer. |
float |
getAlpha()
|
byte |
getAlphaByte()
|
int |
getAlphaInt()
|
java.awt.Color |
getAWTColor()
Gets java.awt.Color. |
float |
getBlue()
|
byte |
getBlueByte()
|
int |
getBlueInt()
|
void |
getBytes(byte[] buffer)
Writes all values of this Tuple to the specified buffer. |
float |
getGreen()
|
byte |
getGreenByte()
|
int |
getGreenInt()
|
void |
getInts(int[] buffer)
Writes all values of this Tuple to the specified buffer. |
Colorf |
getReadOnly()
|
float |
getRed()
|
byte |
getRedByte()
|
int |
getRedInt()
|
int |
getSize()
|
boolean |
hasAlpha()
|
int |
hashCode()
Returns a hash number based on the data values in this object. |
Colorf |
interpolate(Colorf color1,
Colorf color2,
float val)
Linearly interpolates between tuples t1 and t2 and places the result into this tuple: this = (1 - alpha) * t1 + alpha * t2. |
Colorf |
interpolate(Colorf color2,
float val)
Linearly interpolates between this tuple and tuple t2 and places the result into this tuple: this = (1 - alpha) * this + alpha * t1. |
boolean |
isDirty()
|
boolean |
isReadOnly()
|
Colorf |
mul(float factor)
Sets the value of this tuple to the scalar multiplication of itself. |
Colorf |
mul(float vr,
float vg,
float vb)
Multiplies this color's values with vr, vg, vb. |
Colorf |
mul(float vr,
float vg,
float vb,
float va)
Multiplies this color's values with vr, vg, vb, va. |
Colorf |
mulAlpha(float v)
Multiplies this color's alpha value with v. |
Colorf |
mulBlue(float v)
Multiplies this color's blue value with v. |
Colorf |
mulGreen(float v)
Multiplies this color's green value with v. |
Colorf |
mulRed(float v)
Multiplies this color's red value with v. |
static Colorf |
newReadOnly()
Creates a new read-only Colorf instance. |
static Colorf |
newReadOnly(java.awt.Color color)
|
static Colorf |
newReadOnly(Colorf color)
Creates a new read-only Colorf instance. |
static Colorf |
newReadOnly(Colorf rgbColor,
float alpha)
Creates a new read-only Colorf instance. |
static Colorf |
newReadOnly(float intensity)
Creates a new read-only Colorf instance. |
static Colorf |
newReadOnly(float[] values)
Creates a new read-only Colorf instance. |
static Colorf |
newReadOnly(float r,
float g,
float b)
Creates a new read-only Colorf instance. |
static Colorf |
newReadOnly(float r,
float g,
float b,
float a)
Creates a new read-only Colorf instance. |
static Colorf |
parseColor(java.lang.String hexString)
Parses a color-hex-String into a Colorf instance. |
static Colorf |
parseColor(java.lang.String hexString,
Colorf buffer)
Parses a color-hex-String into the color buffer. |
static Colorf |
parseReadOnlyColor(java.lang.String hexString)
Parses a color-hex-String into a new Colorf instance. |
float |
r()
|
void |
r(float red)
Sets the Red color component. |
void |
readExternal(java.io.ObjectInput in)
|
java.nio.FloatBuffer |
readFromBuffer(boolean forceAlpha,
java.nio.FloatBuffer buffer)
Reads the data of one tuple from a FloatBuffer. |
java.nio.FloatBuffer |
readFromBuffer(boolean forceAlpha,
java.nio.FloatBuffer buffer,
int position)
Reads the data of one tuple from a FloatBuffer. |
static java.nio.FloatBuffer |
readFromBuffer(Colorf[] colors,
boolean forceAlpha,
java.nio.FloatBuffer buffer)
Reads the data of one tuple from a FloatBuffer. |
static java.nio.FloatBuffer |
readFromBuffer(Colorf[] colors,
boolean forceAlpha,
java.nio.FloatBuffer buffer,
int position)
Reads the data of one tuple from a FloatBuffer. |
static java.nio.FloatBuffer |
readFromBuffer(Colorf[] colors,
java.nio.FloatBuffer buffer)
Reads the data of one tuple from a FloatBuffer. |
static java.nio.FloatBuffer |
readFromBuffer(Colorf[] colors,
java.nio.FloatBuffer buffer,
int position)
Reads the data of one tuple from a FloatBuffer. |
java.nio.FloatBuffer |
readFromBuffer(java.nio.FloatBuffer buffer)
Reads the data of one tuple from a FloatBuffer. |
java.nio.FloatBuffer |
readFromBuffer(java.nio.FloatBuffer buffer,
int position)
Reads the data of one tuple from a FloatBuffer. |
int |
serialize(int pos,
byte[] buffer)
Serializes this instanc'es data into the byte array. |
void |
set(java.awt.Color color)
Sets color from awt.Color. |
void |
set(Colorf color)
Sets all three values of this Tuple to the specified ones. |
void |
set(float[] values)
Sets all values of this Tuple to the specified ones. |
void |
set(float[] values,
boolean alpha)
Sets all values of this Tuple to the specified ones. |
void |
set(float[] values,
int offset,
boolean alpha)
Sets all values of this Tuple to the specified ones. |
void |
set(float r,
float g,
float b)
Sets all values of this color to the specified ones. |
void |
set(float r,
float g,
float b,
float a)
Sets all values of this color to the specified ones. |
void |
setAlpha(float alpha)
Sets the value of the alpha-element of this color. |
void |
setAlphaByte(byte alpha)
Sets the Alpha value component. |
void |
setAlphaInt(int alpha)
Sets the Alpha value component. |
void |
setBlue(float blue)
Sets the Blue color component. |
void |
setBlueByte(byte blue)
Sets the Blue color component. |
void |
setBlueInt(int blue)
Sets the Blue color component. |
void |
setBytes(byte[] values)
Sets all values of this Tuple to the specified ones. |
boolean |
setClean()
Marks this tuple non-dirty. |
void |
setGreen(float green)
Sets the Green color component. |
void |
setGreenByte(byte green)
Sets the Green color component. |
void |
setGreenInt(int green)
Sets the Green color component. |
void |
setInts(int[] values)
Sets all values of this Tuple to the specified ones. |
void |
setRed(float red)
Sets the Red color component. |
void |
setRedByte(byte red)
Sets the Red color component. |
void |
setRedInt(int red)
Sets the Red color component. |
Colorf |
setZero()
Sets all components to zero. |
Colorf |
sub(Colorf color2)
Sets the value of this color to the vector difference of itself and color2 (this = this - color2). |
Colorf |
sub(Colorf color1,
Colorf color2)
Sets the value of this color to the vector difference of color color1 and color2 (this = color1 - color2). |
Colorf |
sub(float r,
float g,
float b)
Subtracts the given parameters from this tuple's values. |
Colorf |
sub(float r,
float g,
float b,
float a)
Subtracts the given parameters from this tuple's values. |
Colorf |
subAlpha(float v)
Subtracts v from this color's alpha value. |
Colorf |
subBlue(float v)
Subtracts v from this color's blue value. |
Colorf |
subGreen(float v)
Subtracts v from this color's green value. |
Colorf |
subRed(float v)
Subtracts v from this color's red value. |
java.lang.String |
toHexString()
|
static void |
toPool(Colorf o)
Stores the given Colorf instance in the pool. |
java.lang.String |
toString()
Returns a string that contains the values of this Colorf. |
void |
writeExternal(java.io.ObjectOutput out)
|
java.nio.FloatBuffer |
writeToBuffer(boolean forceAlpha,
java.nio.FloatBuffer buffer,
boolean clear,
boolean flip)
Writes the contents of this tuple to a FloatBuffer. |
java.nio.FloatBuffer |
writeToBuffer(boolean forceAlpha,
java.nio.FloatBuffer buffer,
int position,
boolean clear,
boolean flip)
Writes the contents of this tuple to a FloatBuffer. |
static java.nio.FloatBuffer |
writeToBuffer(Colorf[] colors,
boolean forceAlpha,
java.nio.FloatBuffer buffer,
boolean clear,
boolean flip)
Writes the contents of this tuple to a FloatBuffer. |
static java.nio.FloatBuffer |
writeToBuffer(Colorf[] colors,
boolean forceAlpha,
java.nio.FloatBuffer buffer,
int position,
boolean clear,
boolean flip)
Writes the contents of this tuple to a FloatBuffer. |
static java.nio.FloatBuffer |
writeToBuffer(Colorf[] colors,
java.nio.FloatBuffer buffer,
boolean clear,
boolean flip)
Writes the contents of the colors to a FloatBuffer. |
static java.nio.FloatBuffer |
writeToBuffer(Colorf[] colors,
java.nio.FloatBuffer buffer,
int position,
boolean clear,
boolean flip)
Writes the contents of the colors to a FloatBuffer. |
java.nio.FloatBuffer |
writeToBuffer(java.nio.FloatBuffer buffer,
boolean clear,
boolean flip)
Writes the contents of this tuple to a FloatBuffer. |
java.nio.FloatBuffer |
writeToBuffer(java.nio.FloatBuffer buffer,
int position,
boolean clear,
boolean flip)
Writes the contents of this tuple to a FloatBuffer. |
| Methods inherited from class java.lang.Object |
|---|
finalize, getClass, notify, notifyAll, wait, wait, wait |
| Field Detail |
|---|
protected static final int N
protected final float[] values
protected boolean hasAlpha
protected final int roTrick
protected final boolean[] isDirty
public static final Colorf WHITE
public static final Colorf WHITE_TRANSPARENT
public static final Colorf LIGHT_GRAY
public static final Colorf GRAY10
public static final Colorf GRAY20
public static final Colorf GRAY25
public static final Colorf GRAY30
public static final Colorf GRAY40
public static final Colorf GRAY50
public static final Colorf GRAY60
public static final Colorf GRAY70
public static final Colorf GRAY75
public static final Colorf GRAY80
public static final Colorf GRAY90
public static final Colorf GRAY
public static final Colorf DARK_GRAY
public static final Colorf BLACK
public static final Colorf BLACK_TRANSPARENT
public static final Colorf BROWN
public static final Colorf LIGHT_BROWN
public static final Colorf DARK_BROWN
public static final Colorf RED
public static final Colorf PINK
public static final Colorf ORANGE
public static final Colorf YELLOW
public static final Colorf GREEN
public static final Colorf MAGENTA
public static final Colorf CYAN
public static final Colorf BLUE
| Constructor Detail |
|---|
protected Colorf(boolean readOnly,
float r,
float g,
float b,
float a)
readOnly - r - the red element to useg - the green element to useb - the blue element to usea - the alpha channel to use
protected Colorf(boolean readOnly,
float r,
float g,
float b)
readOnly - r - the red element to useg - the green element to useb - the blue element to use
protected Colorf(boolean readOnly,
float intensity)
readOnly - intensity - the gray intensity (used for all three r,g,b values
protected Colorf(boolean readOnly,
float[] values,
boolean[] isDirty,
boolean copy)
readOnly - values - the values array (must be at least size 3)isDirty - copy -
protected Colorf(boolean readOnly,
Colorf color)
readOnly - color - the Colorf to copy the values fromprotected Colorf(boolean readOnly)
readOnly -
protected Colorf(boolean readOnly,
java.awt.Color color)
readOnly - color - the Color to copy the values from
public Colorf(float r,
float g,
float b,
float a)
r - the red element to useg - the green element to useb - the blue element to usea - the alpha channel to use
public Colorf(float r,
float g,
float b)
r - the red element to useg - the green element to useb - the blue element to usepublic Colorf(float intensity)
intensity - the gray intensity (used for all three r,g,b valuespublic Colorf(float[] values)
values - the values array (must be at least size 3)public Colorf(Colorf color)
color - the Colorf to copy the values from
public Colorf(Colorf rgbColor,
float alpha)
rgbColor - the Colorf to copy the RGB-values fromalpha - the value for the alpha channelpublic Colorf()
public Colorf(java.awt.Color color)
| Method Detail |
|---|
public final boolean isReadOnly()
public final boolean setClean()
public final boolean isDirty()
public static Colorf createGray(float intensity)
intensity - the gray's intensity to be applied to all three components.
public final int getSize()
public final boolean hasAlpha()
public final void set(java.awt.Color color)
color - awt color
public final void set(float[] values,
int offset,
boolean alpha)
values - the values array (must be at least size 4 for with-alpha else 3)offset - the offset in the (source) values arrayalpha -
public final void set(float[] values,
boolean alpha)
values - the values array (must be at least size 4 for with-alpha else 3)alpha - public final void set(float[] values)
values - the values array (must be at least size 3)public final void setBytes(byte[] values)
values - the values array (must be at least size 4)public final void setInts(int[] values)
values - the values array (must be at least size 4)public final void set(Colorf color)
color - the tuple to be copied
public final void set(float r,
float g,
float b,
float a)
r - the red element to useg - the green element to useb - the blue element to usea - the alpha element to use
public final void set(float r,
float g,
float b)
r - the red element to useg - the green element to useb - the blue element to usepublic final java.awt.Color getAWTColor()
public final void get(float[] buffer,
int offset)
buffer - the buffer array to write the values tooffset - the offset in the (target) buffer arraypublic final void get(float[] buffer)
buffer - the buffer array to write the values topublic final void getBytes(byte[] buffer)
buffer - the buffer array to write the values topublic final void getInts(int[] buffer)
buffer - the buffer array to write the values topublic final void get(Colorf buffer)
buffer - the buffer vector to write the values to
public final java.nio.FloatBuffer writeToBuffer(boolean forceAlpha,
java.nio.FloatBuffer buffer,
boolean clear,
boolean flip)
forceAlpha - if true, an alpha value is written to the buffer regardless of this color having an alpha value of not.buffer - clear - clear the buffer before writing data?flip - flip the buffer after writing data?
public final java.nio.FloatBuffer writeToBuffer(boolean forceAlpha,
java.nio.FloatBuffer buffer,
int position,
boolean clear,
boolean flip)
forceAlpha - if true, an alpha value is written to the buffer regardless of this color having an alpha value of not.buffer - position - position in the bufferclear - clear the buffer before writing data?flip - flip the buffer after writing data?
public final java.nio.FloatBuffer writeToBuffer(java.nio.FloatBuffer buffer,
boolean clear,
boolean flip)
buffer - clear - clear the buffer before writing data?flip - flip the buffer after writing data?
public final java.nio.FloatBuffer writeToBuffer(java.nio.FloatBuffer buffer,
int position,
boolean clear,
boolean flip)
buffer - position - position in the bufferclear - clear the buffer before writing data?flip - flip the buffer after writing data?
public static final java.nio.FloatBuffer writeToBuffer(Colorf[] colors,
boolean forceAlpha,
java.nio.FloatBuffer buffer,
boolean clear,
boolean flip)
colors - forceAlpha - if true, an alpha value is written to the buffer regardless of this color having an alpha value of not.buffer - clear - clear the buffer before writing data?flip - flip the buffer after writing data?
public static final java.nio.FloatBuffer writeToBuffer(Colorf[] colors,
boolean forceAlpha,
java.nio.FloatBuffer buffer,
int position,
boolean clear,
boolean flip)
colors - forceAlpha - if true, an alpha value is written to the buffer regardless of this color having an alpha value of not.buffer - position - position in the bufferclear - clear the buffer before writing data?flip - flip the buffer after writing data?
public static final java.nio.FloatBuffer writeToBuffer(Colorf[] colors,
java.nio.FloatBuffer buffer,
boolean clear,
boolean flip)
colors - buffer - clear - clear the buffer before writing data?flip - flip the buffer after writing data?
public static final java.nio.FloatBuffer writeToBuffer(Colorf[] colors,
java.nio.FloatBuffer buffer,
int position,
boolean clear,
boolean flip)
colors - buffer - position - position in the bufferclear - clear the buffer before writing data?flip - flip the buffer after writing data?
public final java.nio.FloatBuffer readFromBuffer(boolean forceAlpha,
java.nio.FloatBuffer buffer)
buffer - forceAlpha - if true, an alpha value is read from the buffer regardless of this color having an alpha value of not.
public final java.nio.FloatBuffer readFromBuffer(boolean forceAlpha,
java.nio.FloatBuffer buffer,
int position)
forceAlpha - if true, an alpha value is read from the buffer regardless of this color having an alpha value of not.buffer - position - position in the bufferpublic final java.nio.FloatBuffer readFromBuffer(java.nio.FloatBuffer buffer)
buffer -
public final java.nio.FloatBuffer readFromBuffer(java.nio.FloatBuffer buffer,
int position)
buffer - position - position in the buffer
public static final java.nio.FloatBuffer readFromBuffer(Colorf[] colors,
boolean forceAlpha,
java.nio.FloatBuffer buffer)
colors - forceAlpha - if true, an alpha value is written to the buffer regardless of this color having an alpha value of not.buffer -
public static final java.nio.FloatBuffer readFromBuffer(Colorf[] colors,
boolean forceAlpha,
java.nio.FloatBuffer buffer,
int position)
colors - forceAlpha - if true, an alpha value is written to the buffer regardless of this color having an alpha value of not.buffer - position - position in the buffer
public static final java.nio.FloatBuffer readFromBuffer(Colorf[] colors,
java.nio.FloatBuffer buffer)
colors - buffer -
public static final java.nio.FloatBuffer readFromBuffer(Colorf[] colors,
java.nio.FloatBuffer buffer,
int position)
colors - buffer - position - position in the bufferpublic final void setRed(float red)
public final float getRed()
public final void r(float red)
public final float r()
public final void setRedByte(byte red)
public final byte getRedByte()
public final void setRedInt(int red)
public final int getRedInt()
public final void setGreen(float green)
public final float getGreen()
public final void g(float green)
public final float g()
public final void setGreenByte(byte green)
public final byte getGreenByte()
public final void setGreenInt(int green)
public final int getGreenInt()
public final void setBlue(float blue)
public final float getBlue()
public final void b(float blue)
public final float b()
public final void setBlueByte(byte blue)
public final byte getBlueByte()
public final void setBlueInt(int blue)
public final int getBlueInt()
public final void setAlpha(float alpha)
alpha - public final float getAlpha()
public final void a(float alpha)
alpha - public final float a()
public final void setAlphaByte(byte alpha)
public final byte getAlphaByte()
public final void setAlphaInt(int alpha)
public final int getAlphaInt()
public final Colorf setZero()
public final Colorf addRed(float v)
v -
public final Colorf addGreen(float v)
v -
public final Colorf addBlue(float v)
v -
public final Colorf addAlpha(float v)
v -
public final Colorf subRed(float v)
v -
public final Colorf subGreen(float v)
v -
public final Colorf subBlue(float v)
v -
public final Colorf subAlpha(float v)
v -
public final Colorf mulRed(float v)
v -
public final Colorf mulGreen(float v)
v -
public final Colorf mulBlue(float v)
v -
public final Colorf mulAlpha(float v)
v -
public final Colorf mul(float vr,
float vg,
float vb,
float va)
vr - vg - vb - va -
public final Colorf mul(float vr,
float vg,
float vb)
vr - vg - vb -
public final Colorf mul(float factor)
factor - the scalar value
public final Colorf divRed(float v)
v -
public final Colorf divGreen(float v)
v -
public final Colorf divBlue(float v)
v -
public final Colorf divAlpha(float v)
v -
public final Colorf div(float vr,
float vg,
float vb,
float va)
vr - vg - vb - va -
public final Colorf div(float vr,
float vg,
float vb)
vr - vg - vb -
public final Colorf add(Colorf color1,
Colorf color2)
color1 - the first colorcolor2 - the second color
public final Colorf add(Colorf color2)
color2 - the other tuple
public final Colorf add(float r,
float g,
float b,
float a)
r - g - b - a -
public final Colorf add(float r,
float g,
float b)
r - g - b -
public final Colorf sub(Colorf color1,
Colorf color2)
color1 - the first colorcolor2 - the second color
public final Colorf sub(Colorf color2)
color2 - the other color
public final Colorf sub(float r,
float g,
float b,
float a)
r - g - b - a -
public final Colorf sub(float r,
float g,
float b)
r - g - b -
public final Colorf clampMin(float min)
min - the lowest value in this tuple after clamping
public final Colorf clampMax(float max)
max - the highest value in the tuple after clamping
public final Colorf clamp(float min,
float max)
min - the lowest value in this tuple after clampingmax - the highest value in this tuple after clamping
public final Colorf clamp(float min,
float max,
Colorf vec)
min - the lowest value in the tuple after clampingmax - the highest value in the tuple after clampingvec - the source tuple, which will not be modified
public final Colorf clampMin(float min,
Colorf vec)
min - the lowest value in the tuple after clampingvec - the source tuple, which will not be modified
public final Colorf clampMax(float max,
Colorf vec)
max - the highest value in the tuple after clampingvec - the source tuple, which will not be modified
public final Colorf interpolate(Colorf color2,
float val)
color2 - the first tupleval - the alpha interpolation parameter
public final Colorf interpolate(Colorf color1,
Colorf color2,
float val)
color1 - the first tuplecolor2 - the second tupleval - the interpolation parameter
public Colorf asReadOnly()
getReadOnly()public Colorf getReadOnly()
asReadOnly()public int hashCode()
hashCode in class java.lang.Objectpublic boolean equals(Colorf color2)
color2 - the color with which the comparison is made.public boolean equals(java.lang.Object o)
equals in class java.lang.Objecto - the Object with which the comparison is made
public boolean epsilonEquals(Colorf color2,
float epsilon)
color2 - the color to be compared to this colorepsilon - the threshold valuepublic final java.lang.String toHexString()
public java.lang.String toString()
toString in class java.lang.Objectpublic Colorf clone()
clone in class java.lang.Objectjava.lang.OutOfMemoryError - if there is not enough memory.Cloneable
public int serialize(int pos,
byte[] buffer)
pos - buffer -
public int deserialize(int pos,
byte[] buffer)
pos - buffer -
public void writeExternal(java.io.ObjectOutput out)
throws java.io.IOException
writeExternal in interface java.io.Externalizablejava.io.IOException
public void readExternal(java.io.ObjectInput in)
throws java.io.IOException,
java.lang.ClassNotFoundException
readExternal in interface java.io.Externalizablejava.io.IOException
java.lang.ClassNotFoundException
public static Colorf newReadOnly(float r,
float g,
float b,
float a)
r - the red element to useg - the green element to useb - the blue element to usea - the alpha channel to use
public static Colorf newReadOnly(float r,
float g,
float b)
r - the red element to useg - the green element to useb - the blue element to usepublic static Colorf newReadOnly(float intensity)
intensity - the gray intensity (used for all three r,g,b valuespublic static Colorf newReadOnly(float[] values)
values - the values array (must be at least size 3)public static Colorf newReadOnly(Colorf color)
color - the Colorf to copy the values from
public static Colorf newReadOnly(Colorf rgbColor,
float alpha)
rgbColor - the Colorf to copy the RGB-values fromalpha - the value for the alpha channelpublic static Colorf newReadOnly()
public static Colorf newReadOnly(java.awt.Color color)
public static Colorf parseColor(java.lang.String hexString,
Colorf buffer)
hexString - buffer -
public static Colorf parseColor(java.lang.String hexString)
hexString -
public static Colorf parseReadOnlyColor(java.lang.String hexString)
hexString -
public static Colorf fromPool()
public static Colorf fromPool(float r,
float g,
float b,
float a)
public static Colorf fromPool(float r,
float g,
float b)
public static Colorf fromPool(Colorf color)
public static void toPool(Colorf o)
o -
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||