12 rgb(
float r,
float g,
float b) :
float3(r, g, b) {}
13 explicit rgb(
float x) :
float3(x) {}
16 rgb& operator += (
const rgb& p) {
21 rgb& operator += (
const Atom<rgb>& atom) {
35 rgba(
float r,
float g,
float b,
float a) :
float4(r, g, b, a) {}
36 explicit rgba(
float x) :
float4(x) {}
37 explicit rgba(
const rgb&
rgb,
float a) :
float4(rgb, a) {}
39 rgba& operator += (
const rgba& p) {
59 static const rgb luminance(0.2126f, 0.7152f, 0.0722f);
61 inline rgb gamma(
const rgb& c,
float g = 0.5f) {
62 return rgb(std::pow(c.x, g), std::pow(c.y, g), std::pow(c.z, g));
65 inline rgba gamma(
const rgba& c,
float g = 0.5f) {
66 return rgba(std::pow(c.x, g), std::pow(c.y, g), std::pow(c.z, g), c.w);
69 inline rgb clamp(
const rgb& val,
const rgb& min,
const rgb& max) {
70 return rgb(clamp(val.x, min.x, max.x),
71 clamp(val.y, min.y, max.y),
72 clamp(val.z, min.z, max.z));
75 inline rgba clamp(
const rgba& val,
const rgba& min,
const rgba& max) {
76 return rgba(clamp(val.x, min.x, max.x),
77 clamp(val.y, min.y, max.y),
78 clamp(val.z, min.z, max.z),
79 clamp(val.w, min.w, max.w));
Class that represents a value that has to be treated atomically.
Definition: common.h:143