Main Page | Class Hierarchy | Alphabetical List | Class List | File List | Class Members | File Members

ColorDefinitions.h

Go to the documentation of this file.
00001 #ifndef AFX_COLORDEFINITIONS_H__AA2ABF89_C24B_4DA3_832F_B8EA68C11662__INCLUDED_
00002 #define AFX_COLORDEFINITIONS_H__AA2ABF89_C24B_4DA3_832F_B8EA68C11662__INCLUDED_
00003 
00004 #include <map>
00005 
00006 class ColorDefinitions  {
00007 public:
00008    ColorDefinitions();
00009    virtual ~ColorDefinitions();
00010 
00011    void setColor(unsigned char& r, unsigned char& g, unsigned char& b, const char* name);
00012 
00013 private:
00014 
00015    struct SimpleColor {
00016       SimpleColor() {
00017          r=g=b=0;
00018       }
00019       SimpleColor(unsigned char x, unsigned char y, unsigned char z) {
00020          r=x; g=y; b=z;
00021       }
00022       unsigned char r, g, b;
00023    };
00024 
00025    struct ltstr {
00026       bool operator()(const char* s1, const char* s2) const  {
00027          return strcmp(s1, s2) < 0;
00028       }
00029    };
00030 
00031    std::map<const char*, SimpleColor, ltstr> names;
00032 
00033 };
00034 
00035 #endif // AFX_COLORDEFINITIONS_H__AA2ABF89_C24B_4DA3_832F_B8EA68C11662__INCLUDED_

Thyrix homepageUsers' guide

(C) Arxia 2004-2005