10 #ifndef ossimRgbVector_HEADER 11 #define ossimRgbVector_HEADER 26 out <<
"<" << (long)data.
theBuf[0] <<
", " 27 << (
long)data.
theBuf[1] <<
", " 28 << (long)data.
theBuf[2] <<
">";
40 theBuf[0] = copy_this.
theBuf[0];
41 theBuf[1] = copy_this.
theBuf[1];
42 theBuf[2] = copy_this.
theBuf[2];
52 theBuf[0] = colorData[0];
53 theBuf[1] = colorData[1];
54 theBuf[2] = colorData[2];
65 (
unsigned char)
clamp((
long)theBuf[1] - (
long)rgb.
theBuf[1]),
66 (
unsigned char)
clamp((
long)theBuf[2] - (
long)rgb.
theBuf[2]));
72 (
unsigned char)
clamp((
long)theBuf[1] + (
long)rgb.
theBuf[1]),
73 (
unsigned char)
clamp((
long)theBuf[2] + (
long)rgb.
theBuf[2]));
78 (
unsigned char)
clamp((
long)(theBuf[1]*t)),
79 (
unsigned char)
clamp((
long)(theBuf[2]*t)));
87 return ( (rgb.
theBuf[0] == theBuf[0])&&
88 (rgb.
theBuf[1] == theBuf[1])&&
89 (rgb.
theBuf[2] == theBuf[2]));
93 return ( (rgb.
theBuf[0] != theBuf[0])||
94 (rgb.
theBuf[1] != theBuf[1])||
95 (rgb.
theBuf[2] != theBuf[2]));
97 static long clamp(
long colorValue,
unsigned char min=0,
unsigned char max=255)
99 colorValue = colorValue > (long)
max? (
long)
max:colorValue;
100 colorValue = colorValue < (long)
min? (
long)
min:colorValue;
104 unsigned char getR()
const {
return theBuf[0]; }
105 unsigned char getG()
const {
return theBuf[1]; }
106 unsigned char getB()
const {
return theBuf[2]; }
107 void setR(
unsigned char R) { theBuf[0] = R; }
108 void setG(
unsigned char G) { theBuf[1] = G; }
109 void setB(
unsigned char B) { theBuf[2] = B; }
112 unsigned char theBuf[3];
ossimRgbVector(const ossimRgbVector ©_this)
ossimRationalNumber operator-(ossim_int32 i, ossimRationalNumber &r)
unsigned char getR() const
bool operator!=(const ossimRefPtr< _Tp1 > &__a, const ossimRefPtr< _Tp2 > &__b) noexcept
static long clamp(long colorValue, unsigned char min=0, unsigned char max=255)
void setR(unsigned char R)
ossimRgbVector(unsigned char r=0, unsigned char g=0, unsigned char b=0)
ossimRationalNumber operator*(ossim_int32 i, ossimRationalNumber &r)
void setB(unsigned char B)
ostream & operator<<(ostream &out, const ossimAxes &axes)
unsigned char getB() const
ossimRgbVector(unsigned char colorData[3])
bool operator==(const ossimRefPtr< _Tp1 > &__a, const ossimRefPtr< _Tp2 > &__b) noexcept
void setG(unsigned char G)
unsigned char getG() const
ossimRgbVector(unsigned char grey)
ossimRationalNumber operator+(ossim_int32 i, ossimRationalNumber &r)
std::basic_ostream< char > ostream
Base class for char output streams.