#ifndef _COMMON_RGBQUAD_HPP_
#define _COMMON_RGBQUAD_HPP_
#ifndef _COMMON_WINDOWS_HPP_
#include <common/windows.hpp>
#endif

class RGBQuad : private tagRGBQUAD
{
public:
	RGBQuad(void);
	RGBQuad(BYTE red,BYTE green,BYTE blue);
	RGBQuad(const RGBQuad &someRGBQuad);
  RGBQuad(const tagRGBQUAD &someRGBQUAD);
	~RGBQuad();       // destructor cannot be virtual
	operator RGBQUAD(void)const;
	RGBQuad &operator=(const RGBQuad &someRGBQuad);
  RGBQuad &operator=(const RGBQUAD &someRGBQUAD);
	WORD operator==(const RGBQuad &someRGBQuad)const;
	BYTE red(void)const;
	void red(BYTE red);
	BYTE green(void)const;
	void green(BYTE green);
	BYTE blue(void)const;
	void blue(BYTE blue);
	RGBQUAD getRGBQUAD(void)const;
private:
	BYTE reserved(void)const;
  void reserved(BYTE reserved);
};

inline
RGBQuad::RGBQuad(void)
{
	tagRGBQUAD::rgbRed=0;
	tagRGBQUAD::rgbGreen=0;
	tagRGBQUAD::rgbBlue=0;
	tagRGBQUAD::rgbReserved=0;
}

inline
RGBQuad::RGBQuad(BYTE red,BYTE green,BYTE blue)
{
	tagRGBQUAD::rgbRed=red;
	tagRGBQUAD::rgbGreen=green;
	tagRGBQUAD::rgbBlue=blue;
	tagRGBQUAD::rgbReserved=0;
}

inline
RGBQuad::RGBQuad(const tagRGBQUAD &someRGBQUAD)
{
	red(someRGBQUAD.rgbRed);
	green(someRGBQUAD.rgbGreen);
	blue(someRGBQUAD.rgbBlue);
	reserved(someRGBQUAD.rgbReserved);
}

inline
RGBQuad::RGBQuad(const RGBQuad &someRGBQuad)
{
  *this=someRGBQuad;
}

inline
RGBQuad::~RGBQuad()
{
}

inline
RGBQuad::operator RGBQUAD(void)const
{
  return getRGBQUAD();
}

inline
RGBQUAD RGBQuad::getRGBQUAD(void)const
{
	RGBQUAD rgbQuad;

	rgbQuad.rgbRed=red();
	rgbQuad.rgbGreen=green();
	rgbQuad.rgbBlue=blue();
	return rgbQuad;
}

inline
RGBQuad &RGBQuad::operator=(const RGBQuad &someRGBQuad)
{
	red(someRGBQuad.red());
	green(someRGBQuad.green());
	blue(someRGBQuad.blue());
  return *this;
}

inline
RGBQuad &RGBQuad::operator=(const RGBQUAD &someRGBQUAD)
{
	red(someRGBQUAD.rgbRed);
	green(someRGBQUAD.rgbGreen);
	blue(someRGBQUAD.rgbBlue);
  return *this;
}

inline
WORD RGBQuad::operator==(const RGBQuad &someRGBQuad)const
{
	return (red()==someRGBQuad.red()&&
					blue()==someRGBQuad.blue()&&
          green()==someRGBQuad.green());
}

inline
BYTE RGBQuad::red(void)const
{
	return tagRGBQUAD::rgbRed;
}

inline
void RGBQuad::red(BYTE red)
{
	tagRGBQUAD::rgbRed=red;
}

inline
BYTE RGBQuad::green(void)const
{
	return tagRGBQUAD::rgbGreen;
}

inline
void RGBQuad::green(BYTE green)
{
	tagRGBQUAD::rgbGreen=green;
}

inline
BYTE RGBQuad::blue(void)const
{
	return tagRGBQUAD::rgbBlue;
}

inline
void RGBQuad::blue(BYTE blue)
{
	tagRGBQUAD::rgbBlue=blue;
}

inline
BYTE RGBQuad::reserved(void)const
{
	return tagRGBQUAD::rgbReserved;
}

inline
void RGBQuad::reserved(BYTE reserved)
{
	tagRGBQUAD::rgbReserved=reserved;
}
#endif
