Initial
This commit is contained in:
110
proto/source/rgb555.hpp
Normal file
110
proto/source/rgb555.hpp
Normal file
@@ -0,0 +1,110 @@
|
||||
#ifndef _PROTO_RGB555_HPP_
|
||||
#define _PROTO_RGB555_HPP_
|
||||
#ifndef _COMMON_WINDOWS_HPP_
|
||||
#include <common/windows.hpp>
|
||||
#endif
|
||||
|
||||
class RGB555
|
||||
{
|
||||
public:
|
||||
RGB555(void);
|
||||
RGB555(const RGB555 &someRGB555);
|
||||
RGB555(BYTE red,BYTE green,BYTE blue);
|
||||
~RGB555(); // the destructor cannot be virtual
|
||||
RGB555 &operator=(const RGB555 &someRGB555);
|
||||
BOOL operator==(const RGB555 &someRGB555);
|
||||
BYTE red(void)const;
|
||||
void red(BYTE red);
|
||||
BYTE green(void)const;
|
||||
void green(BYTE green);
|
||||
BYTE blue(void)const;
|
||||
void blue(BYTE blue);
|
||||
private:
|
||||
typedef struct tagBitFields
|
||||
{
|
||||
unsigned short Red : 5;
|
||||
unsigned short Green : 5;
|
||||
unsigned short Blue : 5;
|
||||
unsigned short Filler : 1;
|
||||
}RGBCOLOR;
|
||||
RGBCOLOR mRGBColor;
|
||||
};
|
||||
|
||||
inline
|
||||
RGB555::RGB555(void)
|
||||
{
|
||||
red(0);
|
||||
green(0);
|
||||
blue(0);
|
||||
}
|
||||
|
||||
inline
|
||||
RGB555::RGB555(BYTE red,BYTE green,BYTE blue)
|
||||
{
|
||||
RGB555::red(red);
|
||||
RGB555::green(green);
|
||||
RGB555::blue(blue);
|
||||
}
|
||||
|
||||
inline
|
||||
RGB555::RGB555(const RGB555 &someRGB555)
|
||||
{
|
||||
*this=someRGB555;
|
||||
}
|
||||
|
||||
inline
|
||||
RGB555::~RGB555()
|
||||
{
|
||||
}
|
||||
|
||||
inline
|
||||
RGB555 &RGB555::operator=(const RGB555 &someRGB555)
|
||||
{
|
||||
red(someRGB555.red());
|
||||
green(someRGB555.green());
|
||||
blue(someRGB555.blue());
|
||||
return *this;
|
||||
}
|
||||
|
||||
inline
|
||||
BOOL RGB555::operator==(const RGB555 &someRGB555)
|
||||
{
|
||||
return red()==someRGB555.red()&&green()==someRGB555.green()&&blue()==someRGB555.blue();
|
||||
}
|
||||
|
||||
inline
|
||||
BYTE RGB555::red(void)const
|
||||
{
|
||||
return mRGBColor.Red;
|
||||
}
|
||||
|
||||
inline
|
||||
void RGB555::red(BYTE red)
|
||||
{
|
||||
mRGBColor.Red=red;
|
||||
}
|
||||
|
||||
inline
|
||||
BYTE RGB555::green(void)const
|
||||
{
|
||||
return mRGBColor.Green;
|
||||
}
|
||||
|
||||
inline
|
||||
void RGB555::green(BYTE green)
|
||||
{
|
||||
mRGBColor.Green=green;
|
||||
}
|
||||
|
||||
inline
|
||||
BYTE RGB555::blue(void)const
|
||||
{
|
||||
return mRGBColor.Blue;
|
||||
}
|
||||
|
||||
inline
|
||||
void RGB555::blue(BYTE blue)
|
||||
{
|
||||
mRGBColor.Blue=blue;
|
||||
}
|
||||
#endif
|
||||
Reference in New Issue
Block a user