83 template<
typename ChannelStorageType, eSpace Space, eAlpha Alpha>
class ColorRGBA {
85 ChannelStorageType
r,
g,
b,
a;
94 const ChannelStorageType
g,
95 const ChannelStorageType
b,
96 const ChannelStorageType
a)
101 operator ChannelStorageType *()
106 operator const ChannelStorageType *()
const
115 stream << Space << Alpha <<
"(" <<
c.r <<
", " <<
c.g <<
", " <<
c.b <<
", " <<
c.a <<
")";
122 return a.r ==
b.r &&
a.g ==
b.g &&
a.b ==
b.b &&
a.a ==
b.a;
137 return (x1 * 1283591) ^ (
x2 * 850177) ^ (x3 * 735391) ^ (x4 * 442319);
143 template<eAlpha Alpha>
class ColorSceneLinear4f;
144 template<eAlpha Alpha>
class ColorSceneLinearByteEncoded4b;
145 template<
typename ChannelStorageType>
class ColorTheme4;
152 template<eAlpha Alpha>
189 return premultiplied;
214 template<eAlpha Alpha>
216 :
public ColorRGBA<uint8_t, eSpace::SceneLinearByteEncoded, Alpha> {
250 template<
typename ChannelStorageType>
261 ChannelStorageType
g,
262 ChannelStorageType
b,
263 ChannelStorageType
a)
273 if constexpr ((std::is_same_v<ChannelStorageType, uint8_t>)) {
286 if constexpr ((std::is_same_v<ChannelStorageType, float>)) {
MINLINE void straight_to_premul_v4_v4(float premul[4], const float straight[4])
MINLINE void srgb_to_linearrgb_uchar4(float linear[4], const unsigned char srgb[4])
MINLINE void srgb_to_linearrgb_v4(float linear[4], const float srgb[4])
void rgba_uchar_to_float(float r_col[4], const unsigned char col_ub[4])
void rgba_float_to_uchar(unsigned char r_col[4], const float col_f[4])
MINLINE void premul_to_straight_v4_v4(float straight[4], const float premul[4])
MINLINE void linearrgb_to_srgb_uchar4(unsigned char srgb[4], const float linear[4])
MINLINE void linearrgb_to_srgb_v4(float srgb[4], const float linear[4])
_GL_VOID GLfloat value _GL_VOID_RET _GL_VOID const GLuint GLboolean *residences _GL_BOOL_RET _GL_VOID GLsizei GLfloat GLfloat GLfloat GLfloat const GLubyte *bitmap _GL_VOID_RET _GL_VOID GLenum const void *lists _GL_VOID_RET _GL_VOID const GLdouble *equation _GL_VOID_RET _GL_VOID GLdouble GLdouble blue _GL_VOID_RET _GL_VOID GLfloat GLfloat blue _GL_VOID_RET _GL_VOID GLint GLint blue _GL_VOID_RET _GL_VOID GLshort GLshort blue _GL_VOID_RET _GL_VOID GLubyte GLubyte blue _GL_VOID_RET _GL_VOID GLuint GLuint blue _GL_VOID_RET _GL_VOID GLushort GLushort blue _GL_VOID_RET _GL_VOID GLbyte GLbyte GLbyte alpha _GL_VOID_RET _GL_VOID GLdouble GLdouble GLdouble alpha _GL_VOID_RET _GL_VOID GLfloat GLfloat GLfloat alpha _GL_VOID_RET _GL_VOID GLint GLint GLint alpha _GL_VOID_RET _GL_VOID GLshort GLshort GLshort alpha _GL_VOID_RET _GL_VOID GLubyte GLubyte GLubyte alpha _GL_VOID_RET _GL_VOID GLuint GLuint GLuint alpha _GL_VOID_RET _GL_VOID GLushort GLushort GLushort alpha _GL_VOID_RET _GL_VOID GLenum mode _GL_VOID_RET _GL_VOID GLint GLsizei GLsizei GLenum type _GL_VOID_RET _GL_VOID GLsizei GLenum GLenum const void *pixels _GL_VOID_RET _GL_VOID const void *pointer _GL_VOID_RET _GL_VOID GLdouble v _GL_VOID_RET _GL_VOID GLfloat v _GL_VOID_RET _GL_VOID GLint GLint i2 _GL_VOID_RET _GL_VOID GLint j _GL_VOID_RET _GL_VOID GLfloat param _GL_VOID_RET _GL_VOID GLint param _GL_VOID_RET _GL_VOID GLdouble GLdouble GLdouble GLdouble GLdouble zFar _GL_VOID_RET _GL_UINT GLdouble *equation _GL_VOID_RET _GL_VOID GLenum GLint *params _GL_VOID_RET _GL_VOID GLenum GLfloat *v _GL_VOID_RET _GL_VOID GLenum GLfloat *params _GL_VOID_RET _GL_VOID GLfloat *values _GL_VOID_RET _GL_VOID GLushort *values _GL_VOID_RET _GL_VOID GLenum GLfloat *params _GL_VOID_RET _GL_VOID GLenum GLdouble *params _GL_VOID_RET _GL_VOID GLenum GLint *params _GL_VOID_RET _GL_VOID GLsizei const void *pointer _GL_VOID_RET _GL_VOID GLsizei const void *pointer _GL_VOID_RET _GL_BOOL GLfloat param _GL_VOID_RET _GL_VOID GLint param _GL_VOID_RET _GL_VOID GLenum GLfloat param _GL_VOID_RET _GL_VOID GLenum GLint param _GL_VOID_RET _GL_VOID GLushort pattern _GL_VOID_RET _GL_VOID GLdouble GLdouble GLint GLint const GLdouble *points _GL_VOID_RET _GL_VOID GLdouble GLdouble GLint GLint GLdouble GLdouble GLint GLint const GLdouble *points _GL_VOID_RET _GL_VOID GLdouble GLdouble u2 _GL_VOID_RET _GL_VOID GLdouble GLdouble GLint GLdouble GLdouble v2 _GL_VOID_RET _GL_VOID GLenum GLfloat param _GL_VOID_RET _GL_VOID GLenum GLint param _GL_VOID_RET _GL_VOID GLenum mode _GL_VOID_RET _GL_VOID GLdouble GLdouble nz _GL_VOID_RET _GL_VOID GLfloat GLfloat nz _GL_VOID_RET _GL_VOID GLint GLint nz _GL_VOID_RET _GL_VOID GLshort GLshort nz _GL_VOID_RET _GL_VOID GLsizei const void *pointer _GL_VOID_RET _GL_VOID GLsizei const GLfloat *values _GL_VOID_RET _GL_VOID GLsizei const GLushort *values _GL_VOID_RET _GL_VOID GLint param _GL_VOID_RET _GL_VOID const GLuint const GLclampf *priorities _GL_VOID_RET _GL_VOID GLdouble y _GL_VOID_RET _GL_VOID GLfloat y _GL_VOID_RET _GL_VOID GLint y _GL_VOID_RET _GL_VOID GLshort y _GL_VOID_RET _GL_VOID GLdouble GLdouble z _GL_VOID_RET _GL_VOID GLfloat GLfloat z _GL_VOID_RET _GL_VOID GLint GLint z _GL_VOID_RET _GL_VOID GLshort GLshort z _GL_VOID_RET _GL_VOID GLdouble GLdouble GLdouble w _GL_VOID_RET _GL_VOID GLfloat GLfloat GLfloat w _GL_VOID_RET _GL_VOID GLint GLint GLint w _GL_VOID_RET _GL_VOID GLshort GLshort GLshort w _GL_VOID_RET _GL_VOID GLdouble GLdouble x2
friend bool operator==(const ColorRGBA< ChannelStorageType, Space, Alpha > &a, const ColorRGBA< ChannelStorageType, Space, Alpha > &b)
constexpr ColorRGBA(const ChannelStorageType r, const ChannelStorageType g, const ChannelStorageType b, const ChannelStorageType a)
constexpr ColorRGBA(const ChannelStorageType rgba[4])
friend bool operator!=(const ColorRGBA< ChannelStorageType, Space, Alpha > &a, const ColorRGBA< ChannelStorageType, Space, Alpha > &b)
friend std::ostream & operator<<(std::ostream &stream, const ColorRGBA< ChannelStorageType, Space, Alpha > &c)
constexpr ColorRGBA()=default
ColorSceneLinear4f< eAlpha::Premultiplied > premultiply_alpha() const
ColorSceneLinearByteEncoded4b< Alpha > encode() const
ColorSceneLinear4f< eAlpha::Straight > unpremultiply_alpha() const
constexpr ColorSceneLinearByteEncoded4b(const uint8_t *rgba)
constexpr ColorSceneLinearByteEncoded4b(uint8_t r, uint8_t g, uint8_t b, uint8_t a)
constexpr ColorSceneLinearByteEncoded4b()=default
ColorSceneLinear4f< Alpha > decode() const
ColorTheme4< uint8_t > to_4b() const
constexpr ColorTheme4(const ChannelStorageType *rgba)
constexpr ColorTheme4(ChannelStorageType r, ChannelStorageType g, ChannelStorageType b, ChannelStorageType a)
ColorTheme4< float > to_4f() const
BLI_INLINE ColorSceneLinear4f< eAlpha::Straight > BLI_color_convert_to_scene_linear(const ColorTheme4f &theme4f)
std::ostream & operator<<(std::ostream &stream, const eAlpha &space)
ColorTheme4< float > ColorTheme4f
BLI_INLINE ColorTheme4< float > BLI_color_convert_to_theme4f(const ColorTheme4< uint8_t > &srgb4b)
ColorTheme4< uint8_t > ColorTheme4b
BLI_INLINE ColorTheme4< uint8_t > BLI_color_convert_to_theme4b(const ColorTheme4< float > &srgb4f)
static const pxr::TfToken rgba("rgba", pxr::TfToken::Immortal)
unsigned __int64 uint64_t