📄 wzcolor.hxx
字号:
#ifndef WZCOLOR_HXX#define WZCOLOR_HXX#ifndef WZ_HXX#include "wz.hxx"#endifclass wzColor{ wzByte R; wzByte G; wzByte B;public: wzByte r() const {return R;} wzByte g() const {return G;} wzByte b() const {return B;} wzColor():R(0),G(0),B(0){;} wzColor(wzString s){set(s);} wzColor(wzByte r, wzByte g, wzByte b):R(r),G(g),B(b){;} wzColor(wzIndex r, wzIndex g, wzIndex b):R(r),G(g),B(b){;} wzColor(wzInteger r, wzInteger g, wzInteger b):R(r),G(g),B(b){;} wzColor(wzFloat r, wzFloat g, wzFloat b) :R((wzByte)(0xff*r)),G((wzByte)(0xff*g)),B((wzByte)(0xff*b)){;} wzColor(const wzColor& c):R(c.R),G(c.G),B(c.B){;} wzColor& operator=(const wzColor& c){R=c.R;G=c.G;B=c.B;return *this;} void set(wzByte r, wzByte g, wzByte b){R=r;G=g;B=b;} void set(wzByte gray=0){R=G=B=gray;}// conversion to string of type #aaa #ababab #abcabcabc #abcdabcdabcd void get(wzString s) const; void set(wzString s); wzColor& operator=(const wzString s){set(s);return *this;}// my private elevation conversion into integers from -32000 to 32000 void getElevation(wzShort &i) const; void setElevation(wzShort i);// variant for floating point values from -1 to 1 void getElevation(wzFloat &f) const {wzShort i; getElevation(i); f=((int)i)/0x7fff;} void setElevation(wzFloat f) {setElevation((wzShort) (f*0x7fff));}};#ifndef strstream_hxxclass ostream;#endifostream& operator<<(ostream& o, wzColor c);#endif
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -