00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00027 #ifndef __COLOUR_HEADER_INCLUDED_HEADER_INCLUDED__
00028 #define __COLOUR_HEADER_INCLUDED_HEADER_INCLUDED__
00029
00030 #include <iosfwd>
00031
00032 namespace pdf { namespace util {
00033
00037 class CColour
00038 {
00039 private :
00040 double m_red, m_green, m_blue ;
00041
00042 public :
00043 static const double max = 1.0f, min = 0.0f ;
00044
00045 public :
00046 CColour( ) ;
00047 CColour( double red, double green, double blue ) ;
00048
00049 double R( ) const { return m_red ; }
00050 double G( ) const { return m_green ; }
00051 double B( ) const { return m_blue ; }
00052
00053 void R( double red ) { m_red = red ; }
00054 void G( double green ) { m_green = green ; }
00055 void B( double blue ) { m_blue = blue ; }
00056
00057 std::ostream& Print( std::ostream& os ) const ;
00058
00059 bool operator==( const CColour& colour ) const ;
00060 bool operator!=( const CColour& colour ) const
00061 { return !operator==( colour ) ; }
00062 } ;
00063
00064 inline std::ostream& operator<<( std::ostream& os, const CColour& colour )
00065 {
00066 return colour.Print( os ) ;
00067 }
00068
00070
00071 const CColour Red( ) ;
00072 const CColour Green( ) ;
00073 const CColour Blue( ) ;
00074 const CColour Purple( ) ;
00075 const CColour Cyan( ) ;
00076 const CColour Yellow( ) ;
00077 const CColour Orange( ) ;
00079
00080 } }
00081
00082 #endif