home *** CD-ROM | disk | FTP | other *** search
/ IRIS Development Option 6.2 / IRIS_Development_Option_6.2_814-0478-001.iso / dist / motif_dev.idb / usr / include / Sgm / SgColor.h.z / SgColor.h
C/C++ Source or Header  |  1996-03-14  |  972b  |  42 lines

  1. #ifndef __SgColor_h_
  2. #define __SgColor_h_
  3.  
  4. class SgColor {
  5. public:
  6.   void * operator new(size_t size);
  7.   
  8.   void operator delete( void * obj );
  9.   
  10.   static SgColor* FindColor(float h, float s, float v,
  11.                 const char* schemename = NULL);
  12.   static SgColor* FindColor(short r, short g, short b,
  13.                 const char* schemename = NULL);
  14.   static void RGBtoHSV(short r, short g, short b, 
  15.                float &h, float &s, float &v);
  16.   static void HSVtoRGB(float h, float s, float v, 
  17.                short &r, short &g, short &b);
  18.   virtual ~SgColor();
  19.   
  20.   short getRed() {return red;}
  21.   short getGreen() {return green;}
  22.   short getBlue() {return blue;}
  23.   void getHSV(float& h, float& s, float& v);
  24.   
  25.   
  26.   char* getString();        // Get a string representing this color.
  27.   
  28. protected:
  29.   SgColor(short r, short g, short b, const char* schemename);
  30.   
  31.   short red;
  32.   short green;
  33.   short blue;
  34.   char* schemename;
  35.   
  36.   SgColor* next;
  37.   static SgColor* first;
  38. };
  39.  
  40. #endif /* __SgColor_h_ */
  41.  
  42.