Package primitives
Class Factors
java.lang.Object
primitives.Factors
public class Factors
extends java.lang.Object
This class represents attenuation factors for the red, green, and blue channels. These are to be used to scale
colours. Using these, geometries can look a certain colour.
-
Field Summary
-
Constructor Summary
-
Method Summary
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Field Details
-
ONE
The maximum value of Factors. That is (1, 1, 1). -
ZERO
The minimum value of Factors. That is (0, 0, 0).
-
-
Constructor Details
-
Factors
public Factors(double red, double green, double blue)Construct a factors object.- Parameters:
red
- The red factor.green
- The green factor.blue
- The blue factor.
-
Factors
public Factors(double value)Construct a factors object with the same value for all channels.- Parameters:
value
- The value for all channels.
-
-
Method Details
-
lt
public boolean lt(double threshold)Returns whether or not the values of the factors are all less than some threshold.- Parameters:
threshold
- The lower bound of the factors.- Returns:
- true if all values are less than the threshold, otherwise false.
-
scale
Scale each factor by the corresponding given factor.- Parameters:
factors
- The given factors to scale these factors by.- Returns:
- A new Factors object where each factor is the product of the two corresponding factors.
-