DATAKIT API  V2025.1
Dtk_RGB Class Reference

Public Member Functions

int & A ()
 
const int & A () const
 
int & B ()
 
const int & B () const
 
void Clear ()
 
 Dtk_RGB ()
 
 Dtk_RGB (const Dtk_RGB &s)
 
 Dtk_RGB (int r, int g, int b, int a=-1, int inIndexReader=-1)
 
 Dtk_RGB (int(&rgb)[3])
 
 Dtk_RGB (int(&rgba)[4])
 
 Dtk_RGB (int(&rgba)[5])
 
int & G ()
 
const int & G () const
 
void GetRGB (int &outRed, int &outGreen, int &outBlue)
 
void GetRGBA (int &outRed, int &outGreen, int &outBlue, int &outAlpha)
 
bool HasAlpha () const
 
bool HasColor () const
 
int & IndexReader ()
 
const int & IndexReader () const
 
bool IsFilled () const
 
Dtk_RGBoperator= (const Dtk_RGB &s)
 
int & operator[] (int pos)
 
const int & operator[] (int pos) const
 
int & R ()
 
const int & R () const
 
void SetRGBA (const int &inRed, const int &inGreen, const int &inBlue, const int &inAlpha=-1)
 
 ~Dtk_RGB ()
 

Friends

bool operator!= (const Dtk_RGB &lhs, const Dtk_RGB &rhs)
 
bool operator< (const Dtk_RGB &lhs, const Dtk_RGB &rhs)
 
bool operator<= (const Dtk_RGB &lhs, const Dtk_RGB &rhs)
 
bool operator== (const Dtk_RGB &lhs, const Dtk_RGB &rhs)
 
bool operator> (const Dtk_RGB &lhs, const Dtk_RGB &rhs)
 
bool operator>= (const Dtk_RGB &lhs, const Dtk_RGB &rhs)
 

Constructor & Destructor Documentation

◆ Dtk_RGB() [1/6]

Dtk_RGB::Dtk_RGB ( )

◆ Dtk_RGB() [2/6]

Dtk_RGB::Dtk_RGB ( const Dtk_RGB s)

◆ Dtk_RGB() [3/6]

Dtk_RGB::Dtk_RGB ( int  r,
int  g,
int  b,
int  a = -1,
int  inIndexReader = -1 
)

◆ Dtk_RGB() [4/6]

Dtk_RGB::Dtk_RGB ( int(&)  rgba[5])

◆ Dtk_RGB() [5/6]

Dtk_RGB::Dtk_RGB ( int(&)  rgba[4])

◆ Dtk_RGB() [6/6]

Dtk_RGB::Dtk_RGB ( int(&)  rgb[3])

◆ ~Dtk_RGB()

Dtk_RGB::~Dtk_RGB ( )

Member Function Documentation

◆ A() [1/2]

int& Dtk_RGB::A ( )
43 {return _RGBA[3];}

◆ A() [2/2]

const int& Dtk_RGB::A ( ) const
44 {return _RGBA[3];}

◆ B() [1/2]

int& Dtk_RGB::B ( )
40 {return _RGBA[2];}

◆ B() [2/2]

const int& Dtk_RGB::B ( ) const
41 {return _RGBA[2];}

◆ Clear()

void Dtk_RGB::Clear ( )
21 { reset(); }

◆ G() [1/2]

int& Dtk_RGB::G ( )
37 {return _RGBA[1];}

◆ G() [2/2]

const int& Dtk_RGB::G ( ) const
38 {return _RGBA[1];}

◆ GetRGB()

void Dtk_RGB::GetRGB ( int &  outRed,
int &  outGreen,
int &  outBlue 
)
58  {
59  outRed = _RGBA[0];
60  outGreen = _RGBA[1];
61  outBlue = _RGBA[2];
62  }

◆ GetRGBA()

void Dtk_RGB::GetRGBA ( int &  outRed,
int &  outGreen,
int &  outBlue,
int &  outAlpha 
)
64  {
65  GetRGB(outRed, outGreen, outBlue);
66  outAlpha = _RGBA[3];
67  }

◆ HasAlpha()

bool Dtk_RGB::HasAlpha ( ) const
30 { return _RGBA[3] >= 0;}

◆ HasColor()

bool Dtk_RGB::HasColor ( ) const
28 { return _RGBA[0] >= 0;}

◆ IndexReader() [1/2]

int& Dtk_RGB::IndexReader ( )
46 {return _RGBA[4];}

◆ IndexReader() [2/2]

const int& Dtk_RGB::IndexReader ( ) const
47 {return _RGBA[4];}

◆ IsFilled()

bool Dtk_RGB::IsFilled ( ) const
32 { return (_RGBA[0] >= 0 || _RGBA[3] >= 0);}

◆ operator=()

Dtk_RGB& Dtk_RGB::operator= ( const Dtk_RGB s)

◆ operator[]() [1/2]

int& Dtk_RGB::operator[] ( int  pos)

◆ operator[]() [2/2]

const int& Dtk_RGB::operator[] ( int  pos) const

◆ R() [1/2]

int& Dtk_RGB::R ( )
34 {return _RGBA[0];}

◆ R() [2/2]

const int& Dtk_RGB::R ( ) const
35 {return _RGBA[0];}

◆ SetRGBA()

void Dtk_RGB::SetRGBA ( const int &  inRed,
const int &  inGreen,
const int &  inBlue,
const int &  inAlpha = -1 
)
50  {
51  _RGBA[0] = inRed;
52  _RGBA[1] = inGreen;
53  _RGBA[2] = inBlue;
54  _RGBA[3] = inAlpha;
55  }

Friends And Related Function Documentation

◆ operator!=

bool operator!= ( const Dtk_RGB lhs,
const Dtk_RGB rhs 
)
friend

◆ operator<

bool operator< ( const Dtk_RGB lhs,
const Dtk_RGB rhs 
)
friend

◆ operator<=

bool operator<= ( const Dtk_RGB lhs,
const Dtk_RGB rhs 
)
friend

◆ operator==

bool operator== ( const Dtk_RGB lhs,
const Dtk_RGB rhs 
)
friend

◆ operator>

bool operator> ( const Dtk_RGB lhs,
const Dtk_RGB rhs 
)
friend

◆ operator>=

bool operator>= ( const Dtk_RGB lhs,
const Dtk_RGB rhs 
)
friend
Dtk_RGB::GetRGB
void GetRGB(int &outRed, int &outGreen, int &outBlue)
Definition: dtk_rgb.hpp:57