24 using namespace Color;
26 #define MUL(a,b,i,j) (a[i][0] * b[0][j] + a[i][1] * b[1][j] + a[i][2] * b[2][j] + a[i][3] * b[3][j])
54 for (
int i = 0; i < 4; i++) {
75 const float H = hDegrees * (float)
pi / 180,
76 S = saturationFactor, V = valueFactor;
77 r() = { (V*(12 * S*cos(H) + 6)) / 18, -(V*(6 * S*cos(H) + 6 * sqrtf(3)*S*sin(H) - 6)) / 18, (V*(6 * sqrtf(3)*S*sin(H) - 6 * S*cos(H) + 6)) / 18, 0 };
78 g() = { (V*(6 * sqrtf(3)*S*sin(H) - 6 * S*cos(H) + 6)) / 18, (V*(12 * S*cos(H) + 6)) / 18, -(V*(S*cos(H) + sqrtf(3)*S*sin(H) - 1)) / 3, 0 };
79 b() = {-(V*(6 * S*cos(H) + 6 * sqrtf(3)*S*sin(H) - 6)) / 18, (V*(6 * sqrtf(3)*S*sin(H) - 6 * S*cos(H) + 6)) / 18, (V*(4 * S*cos(H) + 2)) / 6, 0 };
91 const float _2H = 2 * (-hsva.
h * 2 *
pi -
pi / 6),
92 S = saturationFactor, V = valueFactor;
93 r() = { (V*(S*cos(_2H) - sqrtf(3)*S*sin(_2H) + 1)) / 3, -(V*(2 * S*cos(_2H) - 1)) / 3, (V*(S*cos(_2H) + sqrtf(3)*S*sin(_2H) + 1)) / 3, 0 };
94 g() = {-(V*(2 * S*cos(_2H) - 1)) / 3, (V*(S*cos(_2H) + sqrtf(3)*S*sin(_2H) + 1)) / 3, (V*(S*cos(_2H) - sqrtf(3)*S*sin(_2H) + 1)) / 3, 0 };
95 b() = { (V*(S*cos(_2H) + sqrtf(3)*S*sin(_2H) + 1)) / 3, (V*(S*cos(_2H) - sqrtf(3)*S*sin(_2H) + 1)) / 3, -(V*(4 * S*cos(_2H) - 2)) / 6, 0 };
Matrix()
Initializes the color matrix to identity.
void operator=(const Matrix &)
Matrix operator*(const Matrix &) const
Computes the right-multiplication of the current Matrix and another Matrix.
color4f & operator[](int)
Retrieves matrix rows by index in 0..3 range.
HSVA quad (for hue, saturation, value and alpha)
jobject jlong jint jint jint jint g
jobject jlong jint jint jint jint jint b
jobject jlong jint jint jint r
jobject jlong jint jint jint jint jint jint a
Beatmup::color3f preservedColor