88 lines
1.5 KiB
C++
88 lines
1.5 KiB
C++
#ifndef _RGB_HPP_
|
|
#define _RGB_HPP_
|
|
#include <mdiwin/windows.hpp>
|
|
|
|
class RGBStruct
|
|
{
|
|
public:
|
|
RGBStruct(unsigned char red,unsigned char green,unsigned char blue);
|
|
RGBStruct(void);
|
|
void Red(unsigned char red);
|
|
unsigned char Red(void)const;
|
|
void Green(unsigned char green);
|
|
unsigned char Green(void)const;
|
|
void Blue(unsigned char blue);
|
|
unsigned char Blue(void)const;
|
|
WORD operator==(const RGBStruct &someRGBStruct)const;
|
|
void operator=(const RGBStruct &someRGBStruct);
|
|
private:
|
|
unsigned char mRed;
|
|
unsigned char mGreen;
|
|
unsigned char mBlue;
|
|
};
|
|
|
|
inline
|
|
RGBStruct::RGBStruct(unsigned char red,unsigned char green,unsigned char blue)
|
|
: mRed(red), mGreen(green), mBlue(blue)
|
|
{
|
|
}
|
|
|
|
inline
|
|
RGBStruct::RGBStruct()
|
|
: mRed(0), mGreen(0), mBlue(0)
|
|
{
|
|
}
|
|
|
|
inline
|
|
void RGBStruct::Red(unsigned char red)
|
|
{
|
|
mRed=red;
|
|
}
|
|
|
|
inline
|
|
unsigned char RGBStruct::Red(void)const
|
|
{
|
|
return mRed;
|
|
}
|
|
|
|
inline
|
|
void RGBStruct::Green(unsigned char green)
|
|
{
|
|
mGreen=green;
|
|
}
|
|
|
|
inline
|
|
unsigned char RGBStruct::Green(void)const
|
|
{
|
|
return mGreen;
|
|
}
|
|
|
|
inline
|
|
void RGBStruct::Blue(unsigned char blue)
|
|
{
|
|
mBlue=blue;
|
|
}
|
|
|
|
inline
|
|
unsigned char RGBStruct::Blue(void)const
|
|
{
|
|
return mBlue;
|
|
}
|
|
|
|
inline
|
|
void RGBStruct::operator=(const RGBStruct &someRGBStruct)
|
|
{
|
|
mRed=someRGBStruct.mRed;
|
|
mGreen=someRGBStruct.mGreen;
|
|
mBlue=someRGBStruct.mBlue;
|
|
}
|
|
|
|
inline
|
|
WORD RGBStruct::operator==(const RGBStruct &someRGBStruct)const
|
|
{
|
|
return (mRed==someRGBStruct.mRed &&
|
|
mGreen==someRGBStruct.mGreen &&
|
|
mBlue==someRGBStruct.mBlue);
|
|
}
|
|
#endif
|