Kanzi  3.9.9
Kanzi Engine Java API
ColorRGBA Class Reference

Color with 4 floating point components: red, green, blue and alpha (r, g, b, a). More...

Public Member Functions

 ColorRGBA ()
 Default constructor, initializes the color to (0.0, 0.0, 0.0, 0.0).
 
 ColorRGBA (float v)
 Constructor, initializes the color to (v, v, v, v). More...
 
 ColorRGBA (float r, float g, float b)
 Constructor, initializes the color to (r, g, b, 1.0). More...
 
 ColorRGBA (float r, float g, float b, float a)
 Constructor, initializes the color to (r, g, b, a). More...
 
ColorRGBA add (float scalar)
 Adds a scalar to each color element. More...
 
ColorRGBA add (ColorRGBA v)
 Modifies this color by adding another color. More...
 
synchronized void delete ()
 
ColorRGBA divide (float scalar)
 Divides each color element with a scalar. More...
 
boolean equals (Object obj)
 Indicates whether some other object is "equal to" this one. More...
 
float get (int index)
 Returns individual color channel value at index. More...
 
float getAlpha ()
 Returns the alpha element of the color
More...
 
float getBlue ()
 Returns the blue element of the color
More...
 
float getGreen ()
 Returns the green element of the color
More...
 
float getRed ()
 Returns the red element of the color
More...
 
int hashCode ()
 Returns a hash code value for the object. More...
 
boolean hasNan ()
 Returns true if and only if at least one of the vector values is NaN.
 
ColorRGBA multiply (float scalar)
 Multiplies each color element with a scalar. More...
 
void set (int index, float v)
 Sets the individual color channel at index to value. More...
 
void setAlpha (float value)
 Sets the alpha element of the color. More...
 
void setBlue (float value)
 Sets the blue element of the color. More...
 
void setGreen (float value)
 Sets the green element of the color. More...
 
void setRed (float value)
 Sets the red element of the color. More...
 
ColorRGBA subtract (ColorRGBA v)
 Modifies this color by subtracting another color from this color. More...
 

Static Public Member Functions

static ColorRGBA add (ColorRGBA v1, ColorRGBA v2)
 Adds two colors and returns the sum. More...
 
static ColorRGBA add (float v1, ColorRGBA v2)
 Adds a color and a scalar and returns the sum. More...
 
static ColorRGBA add (ColorRGBA v1, float v2)
 Adds a color and a scalar and returns the sum. More...
 
static ColorRGBA componentAbs (ColorRGBA v)
 Calculates component-wise absolute value for all elements and returns the resulting color. More...
 
static ColorRGBA componentAdd (ColorRGBA v, float scalar)
 Adds a value to all color elements and returns the resulting color. More...
 
static ColorRGBA componentCeil (ColorRGBA v)
 Calculates component-wise ceil value for all elements and returns the resulting color. More...
 
static ColorRGBA componentFloor (ColorRGBA v)
 Calculates component-wise floor value for all elements and returns the resulting color. More...
 
static ColorRGBA componentRound (ColorRGBA v)
 Calculates component-wise rounded value for all elements and returns the resulting color. More...
 
static ColorRGBA componentSqrt (ColorRGBA v)
 Calculates component-wise square root all elements and returns the resulting color. More...
 
static ColorRGBA componentSubtract (ColorRGBA v, float scalar)
 Subtracts a value from all color elements and returns the resulting color. More...
 
static ColorRGBA componentWiseDivide (ColorRGBA v1, ColorRGBA v2)
 Divides component-wise all color elements and returns the resulting color. More...
 
static ColorRGBA componentWiseMax (ColorRGBA v1, ColorRGBA v2)
 Calculates component-wise maximum for all color elements and returns the resulting color. More...
 
static ColorRGBA componentWiseMin (ColorRGBA v1, ColorRGBA v2)
 Calculates component-wise minimum for all color elements and returns the resulting color. More...
 
static ColorRGBA componentWiseMultiply (ColorRGBA v1, ColorRGBA v2)
 Multiplies component-wise all color elements and returns the resulting color. More...
 
static ColorRGBA componentWiseRemainder (ColorRGBA v1, ColorRGBA v2)
 Calculates component-wise the remainder for all color elements and returns the resulting color. More...
 
static ColorRGBA divide (ColorRGBA v, float scalar)
 Divides all color elements with a scalar and returns the resulting color. More...
 
static float dotProduct (ColorRGBA v1, ColorRGBA v2)
 Calculates the dot product of two colors. More...
 
static ColorRGBA fromSRGB (float r, float g, float b, float a)
 Returns a linear color with each element set from a sRGB value. More...
 
static ColorRGBA fromSRGB (float r, float g, float b)
 Returns a linear color with each element set from a sRGB value. More...
 
static ColorRGBA getThemeBlue ()
 Returns the default blue theme color. More...
 
static ColorRGBA getThemeGray ()
 Returns the default gray theme color. More...
 
static ColorRGBA getThemeGreen ()
 Returns the default green theme color. More...
 
static ColorRGBA getThemeOrange ()
 Returns the default orange theme color. More...
 
static ColorRGBA getThemeRed ()
 Returns the default red theme color. More...
 
static ColorRGBA getThemeYellow ()
 Returns the default yellow theme color. More...
 
static ColorRGBA highestValue ()
 Returns the color with each element having the most positive float value. More...
 
static ColorRGBA linearTosRGB (ColorRGBA cs)
 Converts whole ColorRGBA color from linear to sRGB. More...
 
static ColorRGBA lowestValue ()
 Returns the color with each element having the most negative float value. More...
 
static ColorRGBA multiply (float scalar, ColorRGBA v)
 Multiplies all color elements with a scalar and returns the resulting color. More...
 
static ColorRGBA multiply (ColorRGBA v, float scalar)
 Multiplies all color elements with a scalar and returns the resulting color. More...
 
static ColorRGBA nan ()
 Returns the color with each element being NaN. More...
 
static ColorRGBA negativeInfinity ()
 Returns the color with each element being the negative infinity. More...
 
static ColorRGBA one ()
 Returns the color with each element being one. More...
 
static ColorRGBA opaqueBlack ()
 Returns opaque black color (0.0, 0.0, 0.0, 1.0). More...
 
static ColorRGBA positiveInfinity ()
 Returns the color with each element being the positive infinity. More...
 
static ColorRGBA sRGBToLinear (ColorRGBA cs)
 Converts to whole ColorRGBA from sRGB to linear. More...
 
static ColorRGBA subtract (ColorRGBA v1, ColorRGBA v2)
 Subtracts two colors and returns the difference. More...
 
static ColorRGBA transparentBlack ()
 Returns transparent black color (0.0, 0.0, 0.0, 0.0). More...
 
static ColorRGBA zero ()
 Returns the color with each element being zero. More...
 

Protected Member Functions

void finalize ()
 Called by the garbage collector on an object when garbage collection determines that there are no more references to the object. More...
 

Protected Attributes

transient boolean swigCMemOwn
 Does this object own its native object. More...
 

Detailed Description

Color with 4 floating point components: red, green, blue and alpha (r, g, b, a).


Constructor & Destructor Documentation

ColorRGBA ( float  v)

Constructor, initializes the color to (v, v, v, v).


Parameters
vRed, Green, Blue, and Alpha component of the color.
ColorRGBA ( float  r,
float  g,
float  b 
)

Constructor, initializes the color to (r, g, b, 1.0).


Parameters
rRed component of the color.
gGreen component of the color.
bBlue component of the color.
ColorRGBA ( float  r,
float  g,
float  b,
float  a 
)

Constructor, initializes the color to (r, g, b, a).


Parameters
rRed component of the color.
gGreen component of the color.
bBlue component of the color.
aAlpha component of the color.

Member Function Documentation

ColorRGBA add ( float  scalar)

Adds a scalar to each color element.


Parameters
scalarAnother color.
Returns
This color.
ColorRGBA add ( ColorRGBA  v)

Modifies this color by adding another color.


Parameters
vAnother color.
Returns
This color.
static ColorRGBA add ( ColorRGBA  v1,
ColorRGBA  v2 
)
static

Adds two colors and returns the sum.

Parameters
v1Left hand side color.
v2Right hand side color.
Returns
The result color.
static ColorRGBA add ( float  v1,
ColorRGBA  v2 
)
static

Adds a color and a scalar and returns the sum.

Parameters
v1Left hand side scalar.
v2Right hand side color.
Returns
The result color.
static ColorRGBA add ( ColorRGBA  v1,
float  v2 
)
static

Adds a color and a scalar and returns the sum.

Parameters
v1Left hand side color.
v2Right hand side scalar.
Returns
The result color.
static ColorRGBA componentAbs ( ColorRGBA  v)
static

Calculates component-wise absolute value for all elements and returns the resulting color.


Parameters
vColor input.
Returns
The result color.
static ColorRGBA componentAdd ( ColorRGBA  v,
float  scalar 
)
static

Adds a value to all color elements and returns the resulting color.


Parameters
vColor.
scalarValue
Returns
Result color.
static ColorRGBA componentCeil ( ColorRGBA  v)
static

Calculates component-wise ceil value for all elements and returns the resulting color.


Parameters
vColor input.
Returns
The result color.
static ColorRGBA componentFloor ( ColorRGBA  v)
static

Calculates component-wise floor value for all elements and returns the resulting color.


Parameters
vColor input.
Returns
The result color.
static ColorRGBA componentRound ( ColorRGBA  v)
static

Calculates component-wise rounded value for all elements and returns the resulting color.


Parameters
vColor input.
Returns
The result color.
static ColorRGBA componentSqrt ( ColorRGBA  v)
static

Calculates component-wise square root all elements and returns the resulting color.


Parameters
vColor input.
Returns
The result color.
static ColorRGBA componentSubtract ( ColorRGBA  v,
float  scalar 
)
static

Subtracts a value from all color elements and returns the resulting color.


Parameters
vColor.
scalarValue
Returns
Result color.
static ColorRGBA componentWiseDivide ( ColorRGBA  v1,
ColorRGBA  v2 
)
static

Divides component-wise all color elements and returns the resulting color.


Parameters
v1The first color.
v2The second color.
Returns
The result color.
static ColorRGBA componentWiseMax ( ColorRGBA  v1,
ColorRGBA  v2 
)
static

Calculates component-wise maximum for all color elements and returns the resulting color.


Parameters
v1The first color.
v2The second color.
Returns
The result color.
static ColorRGBA componentWiseMin ( ColorRGBA  v1,
ColorRGBA  v2 
)
static

Calculates component-wise minimum for all color elements and returns the resulting color.


Parameters
v1The first color.
v2The second color.
Returns
The result color.
static ColorRGBA componentWiseMultiply ( ColorRGBA  v1,
ColorRGBA  v2 
)
static

Multiplies component-wise all color elements and returns the resulting color.


Parameters
v1The first color.
v2The second color.
Returns
The result color.
static ColorRGBA componentWiseRemainder ( ColorRGBA  v1,
ColorRGBA  v2 
)
static

Calculates component-wise the remainder for all color elements and returns the resulting color.


Parameters
v1The first color.
v2The second color.
Returns
The result color.
ColorRGBA divide ( float  scalar)

Divides each color element with a scalar.


Parameters
scalarDivider for each color element.
Returns
This color.
static ColorRGBA divide ( ColorRGBA  v,
float  scalar 
)
static

Divides all color elements with a scalar and returns the resulting color.

Parameters
vA color.
scalarA scalar.
Returns
The result color.
static float dotProduct ( ColorRGBA  v1,
ColorRGBA  v2 
)
static

Calculates the dot product of two colors.


Parameters
v1The first color.
v2The second color.
Returns
The dot product of the colors.
boolean equals ( Object  obj)

Indicates whether some other object is "equal to" this one.

Parameters
objThe reference object with which to compare.
Returns
True if this object is the same as the obj argument, otherwise false.
void finalize ( )
protected

Called by the garbage collector on an object when garbage collection determines that there are no more references to the object.

Finalization is deprecated and subject to removal in future.

static ColorRGBA fromSRGB ( float  r,
float  g,
float  b,
float  a 
)
static

Returns a linear color with each element set from a sRGB value.


Parameters
rRed Channel (0-1.0)
gGreen Channel (0-1.0)
bBlue Channel (0-1.0)
aAlpha Channel (0-1.0)
Returns
Color in linear color space.
static ColorRGBA fromSRGB ( float  r,
float  g,
float  b 
)
static

Returns a linear color with each element set from a sRGB value.


Parameters
rRed Channel (0-1.0)
gGreen Channel (0-1.0)
bBlue Channel (0-1.0)
Returns
Color in linear color space.
float get ( int  index)

Returns individual color channel value at index.


Returns
The color channel value at index.
float getAlpha ( )

Returns the alpha element of the color

Returns
The alpha element.
float getBlue ( )

Returns the blue element of the color

Returns
The blue element.
float getGreen ( )

Returns the green element of the color

Returns
The green element.
float getRed ( )

Returns the red element of the color

Returns
The red element.
static ColorRGBA getThemeBlue ( )
static

Returns the default blue theme color.


Returns
The default blue theme color.
static ColorRGBA getThemeGray ( )
static

Returns the default gray theme color.


Returns
The default gray theme color.
static ColorRGBA getThemeGreen ( )
static

Returns the default green theme color.


Returns
The default green theme color.
static ColorRGBA getThemeOrange ( )
static

Returns the default orange theme color.


Returns
The default orange theme color.
static ColorRGBA getThemeRed ( )
static

Returns the default red theme color.


Returns
The default red theme color.
static ColorRGBA getThemeYellow ( )
static

Returns the default yellow theme color.


Returns
The default yellow theme color.
int hashCode ( )

Returns a hash code value for the object.

Returns
A hash code value for this object.
static ColorRGBA highestValue ( )
static

Returns the color with each element having the most positive float value.


Returns
Color with the highest possible value.
static ColorRGBA linearTosRGB ( ColorRGBA  cs)
static

Converts whole ColorRGBA color from linear to sRGB.


Parameters
csColor in linear format.
Returns
Color in sRGB format.
static ColorRGBA lowestValue ( )
static

Returns the color with each element having the most negative float value.


Returns
Color with the lowest possible value.
ColorRGBA multiply ( float  scalar)

Multiplies each color element with a scalar.


Parameters
scalarMultiplier for each color element.
Returns
This color.
static ColorRGBA multiply ( float  scalar,
ColorRGBA  v 
)
static

Multiplies all color elements with a scalar and returns the resulting color.

Parameters
scalarA scalar.
vA color.
Returns
The result color.
static ColorRGBA multiply ( ColorRGBA  v,
float  scalar 
)
static

Multiplies all color elements with a scalar and returns the resulting color.

Parameters
vA color.
scalarA scalar.
Returns
The result color.
static ColorRGBA nan ( )
static

Returns the color with each element being NaN.


Returns
Color with NaN elements.
static ColorRGBA negativeInfinity ( )
static

Returns the color with each element being the negative infinity.


Returns
Color with negative infinity elements.
static ColorRGBA one ( )
static

Returns the color with each element being one.


Returns
Color with unit element values.
static ColorRGBA opaqueBlack ( )
static

Returns opaque black color (0.0, 0.0, 0.0, 1.0).


Returns
Opaque black.
static ColorRGBA positiveInfinity ( )
static

Returns the color with each element being the positive infinity.


Returns
Color with positive infinity elements.
void set ( int  index,
float  v 
)

Sets the individual color channel at index to value.


Parameters
indexColor channel index to set.
void setAlpha ( float  value)

Sets the alpha element of the color.


Parameters
valueThe new value of the alpha element.
void setBlue ( float  value)

Sets the blue element of the color.


Parameters
valueThe new value of the blue element.
void setGreen ( float  value)

Sets the green element of the color.


Parameters
valueThe new value of the green element.
void setRed ( float  value)

Sets the red element of the color.


Parameters
valueThe new value of the red element.
static ColorRGBA sRGBToLinear ( ColorRGBA  cs)
static

Converts to whole ColorRGBA from sRGB to linear.


Parameters
csColor in sRGB format.
Returns
Color in linear format.
ColorRGBA subtract ( ColorRGBA  v)

Modifies this color by subtracting another color from this color.


Parameters
vAnother color.
Returns
This color.
static ColorRGBA subtract ( ColorRGBA  v1,
ColorRGBA  v2 
)
static

Subtracts two colors and returns the difference.

Parameters
v1Left hand side color.
v2Right hand side color.
Returns
The result color.
static ColorRGBA transparentBlack ( )
static

Returns transparent black color (0.0, 0.0, 0.0, 0.0).


Returns
Transparent black color.
static ColorRGBA zero ( )
static

Returns the color with each element being zero.


Returns
Color with zeroed elements.

Member Data Documentation

transient boolean swigCMemOwn
protected

Does this object own its native object.