1#include "math/Vector3.hpp"
59 Color(
int r,
int g,
int b,
int colorDepth = 8)
60 :
Vector3(r / std::pow(2, colorDepth), g / std::pow(2, colorDepth),
61 b / std::pow(2, colorDepth)) {}
90 double luminance()
const {
return x * 0.2126 +
y * 0.7152 +
z * 0.0722; }
The color class.
Definition Color.hpp:18
Color(Vector3 vector3)
Creates a new color with the specified Vector3 components as normalized RGB values.
Definition Color.hpp:70
Color & clamp()
Clamps the components of this color to the range .
Definition Color.hpp:77
Color(int r, int g, int b, int colorDepth=8)
Creates a new color with the specified red, green, and blue components and the specified color depth.
Definition Color.hpp:59
double luminance() const
Returns the luminance of this color.
Definition Color.hpp:90
Color(double r, double g, double b)
Creates a new color with the specified normalized red, green, and blue components.
Definition Color.hpp:39
The 3D vector class.
Definition Vector3.hpp:20
double z
The z component of this 3D vector.
Definition Vector3.hpp:24
Vector3 & clamp(const Vector3 &min, const Vector3 &max)
Clamps the components of this 3D vector to the specified minimum and maximum 3D vectors component-wis...
Definition Vector3.hpp:199
double y
The y component of this 3D vector.
Definition Vector3.hpp:23
double x
The x component of this 3D vector.
Definition Vector3.hpp:22
Vector3(double _x, double _y, double _z)
Creates a new 3D vector with the specified components.
Definition Vector3.hpp:96
The t software 3D graphics library namespace.
Definition algorithms.hpp:12