87template<
typename ChannelStorageType, eSpace Space, eAlpha Alpha>
class ColorRGBA {
89 ChannelStorageType
r,
g,
b,
a;
92 constexpr ColorRGBA(
const ChannelStorageType rgba[4])
93 :
r(rgba[0]),
g(rgba[1]),
b(rgba[2]),
a(rgba[3])
98 const ChannelStorageType
g,
99 const ChannelStorageType
b,
100 const ChannelStorageType
a)
105 operator ChannelStorageType *()
110 operator const ChannelStorageType *()
const
119 uint64_t x1 = *
reinterpret_cast<const uint32_t *
>(&
r);
120 uint64_t x2 = *
reinterpret_cast<const uint32_t *
>(&
g);
121 uint64_t x3 = *
reinterpret_cast<const uint32_t *
>(&
b);
122 uint64_t x4 = *
reinterpret_cast<const uint32_t *
>(&
a);
123 return (x1 * 1283591) ^ (x2 * 850177) ^ (x3 * 735391) ^ (x4 * 442319);
129template<eAlpha Alpha>
class ColorSceneLinear4f;
130template<eAlpha Alpha>
class ColorSceneLinearByteEncoded4b;
131template<
typename ChannelStorageType>
class ColorTheme4;
133template<eAlpha Alpha>
149template<eAlpha Alpha>
151 :
public ColorRGBA<uint8_t, eSpace::SceneLinearByteEncoded, Alpha> {
175template<
typename ChannelStorageType>
186 ChannelStorageType
g,
187 ChannelStorageType
b,
188 ChannelStorageType
a)
#define BLI_STRUCT_EQUALITY_OPERATORS_4(Type, m1, m2, m3, m4)
unsigned long long int uint64_t
constexpr ColorRGBA(const ChannelStorageType r, const ChannelStorageType g, const ChannelStorageType b, const ChannelStorageType a)
constexpr ColorRGBA(const ChannelStorageType rgba[4])
constexpr ColorRGBA()=default
constexpr ColorSceneLinear4f(const float *rgba)
constexpr ColorSceneLinear4f()=default
constexpr ColorSceneLinear4f(float r, float g, float b, float a)
constexpr ColorSceneLinearByteEncoded4b(const uint8_t *rgba)
constexpr ColorSceneLinearByteEncoded4b(uint8_t r, uint8_t g, uint8_t b, uint8_t a)
constexpr ColorSceneLinearByteEncoded4b()=default
constexpr ColorTheme4(const ChannelStorageType *rgba)
constexpr ColorTheme4()=default
constexpr ColorTheme4(ChannelStorageType r, ChannelStorageType g, ChannelStorageType b, ChannelStorageType a)
ColorTheme4< uint8_t > ColorTheme4b
ColorSceneLinearByteEncoded4b< eAlpha::Straight > ColorPaint4b
ColorSceneLinear4f< eAlpha::Straight > ColorPaint4f
ColorSceneLinear4f< eAlpha::Premultiplied > ColorGeometry4f
ColorTheme4< float > ColorTheme4f
ColorSceneLinearByteEncoded4b< eAlpha::Premultiplied > ColorGeometry4b