Drag[en]gine Script Module DragonScript  1.21
Dragengine.Scenery.ColorMatrix Class Reference

Immutable 5x4-component row major color matrix. More...

Inheritance diagram for Dragengine.Scenery.ColorMatrix:

Public Member Functions

Management
float getAt (int row, int col)
 Cell value. More...
 
float get11 ()
 Cell value. More...
 
float get12 ()
 Cell value. More...
 
float get13 ()
 Cell value. More...
 
float get14 ()
 Cell value. More...
 
float get15 ()
 Cell value. More...
 
float get21 ()
 Cell value. More...
 
float get22 ()
 Cell value. More...
 
float get23 ()
 Cell value. More...
 
float get24 ()
 Cell value. More...
 
float get25 ()
 Cell value. More...
 
float get31 ()
 Cell value. More...
 
float get32 ()
 Cell value. More...
 
float get33 ()
 Cell value. More...
 
float get34 ()
 Cell value. More...
 
float get35 ()
 Cell value. More...
 
float get41 ()
 Cell value. More...
 
float get42 ()
 Cell value. More...
 
float get43 ()
 Cell value. More...
 
float get44 ()
 Cell value. More...
 
float get45 ()
 Cell value. More...
 
Color getRedBase ()
 Color build from first colon. More...
 
Color getGreenBase ()
 Color build from second colon. More...
 
Color getBlueBase ()
 Color build from third colon. More...
 
Color getAlphaBase ()
 Color build from fourthed colon. More...
 
Color getWhiteBase ()
 Color build from fifth colon. More...
 
bool equals (Object other)
 ColorMatrix is equal to another object. More...
 
int hashCode ()
 Hash code for use as dictionary keys. More...
 
String toString ()
 String representation of color matrix. More...
 
String toString (int precision)
 String representation of color matrix with precision. More...
 
Operators
ColorMatrix operator+ (ColorMatrix matrix)
 Sum of two color matrixs. More...
 
ColorMatrix operator- (ColorMatrix matrix)
 Difference between two color matrixs. More...
 
ColorMatrix operator* (float scalar)
 ColorMatrix with each component scaled by a value. More...
 
ColorMatrix operator/ (float scalar)
 ColorMatrix with each component divided by a value. More...
 
ColorMatrix operator* (ColorMatrix matrix)
 Matrix multiplication of two color matrixs. More...
 
ColorMatrix operator* (Color color)
 Transform color by color matrix. More...
 

Constructors

ColorMatrix new ()
 Create identity color matrix. More...
 
ColorMatrix new (ColorMatrix matrix)
 Create copy of color matrix. More...
 
ColorMatrix new (Color red, Color green, Color blue, Color alpha, Color white)
 Create color matrix with initial colons. More...
 
static ColorMatrix newTranslation (Color color)
 Create translation color matrix. More...
 
static ColorMatrix newTranslation (float red, float green, float blue, float alpha)
 Create translation color matrix. More...
 
static ColorMatrix newScaling (Color color)
 Create scaling color matrix. More...
 
static ColorMatrix newScaling (float red, float green, float blue, float alpha)
 Create scaling color matrix. More...
 
static ColorMatrix newST (Color scaling, Color translation)
 Create scaling then translaction color matrix. More...
 
static ColorMatrix newBrightness (float brightness)
 Create brightness color matrix with same brightness value for each color component. More...
 
static ColorMatrix newBrightness (float red, float green, float blue)
 Create brightness color matrix. More...
 
static ColorMatrix newBrightness (Color brightness)
 Create brightness color matrix. More...
 
static ColorMatrix newContrast (float contrast)
 Create contrast color matrix with same contrast value for each color component. More...
 
static ColorMatrix newContrast (float red, float green, float blue)
 Create contrast color matrix. More...
 
static ColorMatrix newContrast (Color contrast)
 Create contrast color matrix. More...
 
static ColorMatrix newSaturation (float saturation)
 Create saturation color matrix with same saturation value for each color component. More...
 
static ColorMatrix newSaturation (float red, float green, float blue)
 Create saturation color matrix. More...
 
static ColorMatrix newSaturation (Color saturation)
 Create saturation color matrix. More...
 
static ColorMatrix newColorInversion ()
 Create color inversion color matrix. More...
 

File Handling

void writeToFile (FileWriter writer)
 Write color matrix to a file writer. More...
 
static ColorMatrix readFromFile (FileReader reader)
 Read color matrix from a file reader. More...
 

Detailed Description

Immutable 5x4-component row major color matrix.

This is a native class. It can not be subclassed.

Member Function Documentation

◆ equals()

bool Dragengine.Scenery.ColorMatrix.equals ( Object  other)

ColorMatrix is equal to another object.

Implements Object.equals(Object).

Returns
true if other is of type ColorMatrix and components are equal.

◆ get11()

float Dragengine.Scenery.ColorMatrix.get11 ( )

Cell value.

◆ get12()

float Dragengine.Scenery.ColorMatrix.get12 ( )

Cell value.

◆ get13()

float Dragengine.Scenery.ColorMatrix.get13 ( )

Cell value.

◆ get14()

float Dragengine.Scenery.ColorMatrix.get14 ( )

Cell value.

◆ get15()

float Dragengine.Scenery.ColorMatrix.get15 ( )

Cell value.

◆ get21()

float Dragengine.Scenery.ColorMatrix.get21 ( )

Cell value.

◆ get22()

float Dragengine.Scenery.ColorMatrix.get22 ( )

Cell value.

◆ get23()

float Dragengine.Scenery.ColorMatrix.get23 ( )

Cell value.

◆ get24()

float Dragengine.Scenery.ColorMatrix.get24 ( )

Cell value.

◆ get25()

float Dragengine.Scenery.ColorMatrix.get25 ( )

Cell value.

◆ get31()

float Dragengine.Scenery.ColorMatrix.get31 ( )

Cell value.

◆ get32()

float Dragengine.Scenery.ColorMatrix.get32 ( )

Cell value.

◆ get33()

float Dragengine.Scenery.ColorMatrix.get33 ( )

Cell value.

◆ get34()

float Dragengine.Scenery.ColorMatrix.get34 ( )

Cell value.

◆ get35()

float Dragengine.Scenery.ColorMatrix.get35 ( )

Cell value.

◆ get41()

float Dragengine.Scenery.ColorMatrix.get41 ( )

Cell value.

◆ get42()

float Dragengine.Scenery.ColorMatrix.get42 ( )

Cell value.

◆ get43()

float Dragengine.Scenery.ColorMatrix.get43 ( )

Cell value.

◆ get44()

float Dragengine.Scenery.ColorMatrix.get44 ( )

Cell value.

◆ get45()

float Dragengine.Scenery.ColorMatrix.get45 ( )

Cell value.

◆ getAlphaBase()

Color Dragengine.Scenery.ColorMatrix.getAlphaBase ( )

Color build from fourthed colon.

◆ getAt()

float Dragengine.Scenery.ColorMatrix.getAt ( int  row,
int  col 
)

Cell value.

Exceptions
EInvalidParamrow is less than 0 or larger than 3.
EInvalidParamcol is less than 0 or larger than 4.

◆ getBlueBase()

Color Dragengine.Scenery.ColorMatrix.getBlueBase ( )

Color build from third colon.

◆ getGreenBase()

Color Dragengine.Scenery.ColorMatrix.getGreenBase ( )

Color build from second colon.

◆ getRedBase()

Color Dragengine.Scenery.ColorMatrix.getRedBase ( )

Color build from first colon.

◆ getWhiteBase()

Color Dragengine.Scenery.ColorMatrix.getWhiteBase ( )

Color build from fifth colon.

◆ hashCode()

int Dragengine.Scenery.ColorMatrix.hashCode ( )

Hash code for use as dictionary keys.

Implements Object.hashCode().

◆ new() [1/3]

ColorMatrix Dragengine.Scenery.ColorMatrix.new ( )

Create identity color matrix.

◆ new() [2/3]

ColorMatrix Dragengine.Scenery.ColorMatrix.new ( Color  red,
Color  green,
Color  blue,
Color  alpha,
Color  white 
)

Create color matrix with initial colons.

red sets the first colon, green the second, blue the third, alpha the fourthed and white the fifth colon.

◆ new() [3/3]

ColorMatrix Dragengine.Scenery.ColorMatrix.new ( ColorMatrix  matrix)

Create copy of color matrix.

◆ newBrightness() [1/3]

static ColorMatrix Dragengine.Scenery.ColorMatrix.newBrightness ( Color  brightness)
static

Create brightness color matrix.

◆ newBrightness() [2/3]

static ColorMatrix Dragengine.Scenery.ColorMatrix.newBrightness ( float  brightness)
static

Create brightness color matrix with same brightness value for each color component.

◆ newBrightness() [3/3]

static ColorMatrix Dragengine.Scenery.ColorMatrix.newBrightness ( float  red,
float  green,
float  blue 
)
static

Create brightness color matrix.

◆ newColorInversion()

static ColorMatrix Dragengine.Scenery.ColorMatrix.newColorInversion ( )
static

Create color inversion color matrix.

◆ newContrast() [1/3]

static ColorMatrix Dragengine.Scenery.ColorMatrix.newContrast ( Color  contrast)
static

Create contrast color matrix.

◆ newContrast() [2/3]

static ColorMatrix Dragengine.Scenery.ColorMatrix.newContrast ( float  contrast)
static

Create contrast color matrix with same contrast value for each color component.

◆ newContrast() [3/3]

static ColorMatrix Dragengine.Scenery.ColorMatrix.newContrast ( float  red,
float  green,
float  blue 
)
static

Create contrast color matrix.

◆ newSaturation() [1/3]

static ColorMatrix Dragengine.Scenery.ColorMatrix.newSaturation ( Color  saturation)
static

Create saturation color matrix.

◆ newSaturation() [2/3]

static ColorMatrix Dragengine.Scenery.ColorMatrix.newSaturation ( float  red,
float  green,
float  blue 
)
static

Create saturation color matrix.

◆ newSaturation() [3/3]

static ColorMatrix Dragengine.Scenery.ColorMatrix.newSaturation ( float  saturation)
static

Create saturation color matrix with same saturation value for each color component.

◆ newScaling() [1/2]

static ColorMatrix Dragengine.Scenery.ColorMatrix.newScaling ( Color  color)
static

Create scaling color matrix.

◆ newScaling() [2/2]

static ColorMatrix Dragengine.Scenery.ColorMatrix.newScaling ( float  red,
float  green,
float  blue,
float  alpha 
)
static

Create scaling color matrix.

◆ newST()

static ColorMatrix Dragengine.Scenery.ColorMatrix.newST ( Color  scaling,
Color  translation 
)
static

Create scaling then translaction color matrix.

◆ newTranslation() [1/2]

static ColorMatrix Dragengine.Scenery.ColorMatrix.newTranslation ( Color  color)
static

Create translation color matrix.

◆ newTranslation() [2/2]

static ColorMatrix Dragengine.Scenery.ColorMatrix.newTranslation ( float  red,
float  green,
float  blue,
float  alpha 
)
static

Create translation color matrix.

◆ operator*() [1/3]

ColorMatrix Dragengine.Scenery.ColorMatrix.operator* ( Color  color)

Transform color by color matrix.

◆ operator*() [2/3]

ColorMatrix Dragengine.Scenery.ColorMatrix.operator* ( ColorMatrix  matrix)

Matrix multiplication of two color matrixs.

Both matrices are threaded as 5x5 matrices with (0,0,0,0,1) as last row during multiplication. The returned matrix is the upper 5x4 of the multiplication result.

◆ operator*() [3/3]

ColorMatrix Dragengine.Scenery.ColorMatrix.operator* ( float  scalar)

ColorMatrix with each component scaled by a value.

◆ operator+()

ColorMatrix Dragengine.Scenery.ColorMatrix.operator+ ( ColorMatrix  matrix)

Sum of two color matrixs.

◆ operator-()

ColorMatrix Dragengine.Scenery.ColorMatrix.operator- ( ColorMatrix  matrix)

Difference between two color matrixs.

◆ operator/()

ColorMatrix Dragengine.Scenery.ColorMatrix.operator/ ( float  scalar)

ColorMatrix with each component divided by a value.

Exceptions
EDivisionByZeroscalar is 0.

◆ readFromFile()

static ColorMatrix Dragengine.Scenery.ColorMatrix.readFromFile ( FileReader  reader)
static

Read color matrix from a file reader.

◆ toString() [1/2]

String Dragengine.Scenery.ColorMatrix.toString ( )

String representation of color matrix.

Implements Object.toString()

◆ toString() [2/2]

String Dragengine.Scenery.ColorMatrix.toString ( int  precision)

String representation of color matrix with precision.

Same as toString() except the count of digits of each component is precision.

Parameters
precisionPrecision in digits in the range from 0 to 9 inclusive.
Exceptions
EInvalidParamprecision is less than 0 or larger than 9.

◆ writeToFile()

void Dragengine.Scenery.ColorMatrix.writeToFile ( FileWriter  writer)

Write color matrix to a file writer.


The documentation for this class was generated from the following file: