RGBColor類定義


這個類主要是顏色操作,操作詳細原理如下圖:

類聲明:

class RGBColor {
public:
	RGBColor();
	~RGBColor();
	RGBColor(ldouble a);
	RGBColor(ldouble red, ldouble green, ldouble blue);
	RGBColor(const RGBColor& c);
	RGBColor operator+(const RGBColor& c) const;
	RGBColor& operator+=(const RGBColor& c);
	RGBColor operator*(const ldouble a) const;
	RGBColor& operator*=(const ldouble a);
	RGBColor operator/(const ldouble f) const;
	RGBColor& operator/=(const ldouble f);
	RGBColor operator*(const RGBColor& c) const;
	RGBColor& operator=(const RGBColor& c);
	bool operator==(const RGBColor& c) const;
	bool operator!=(const RGBColor& c) const;
	RGBColor powc(ldouble p) const;
	ldouble average() const;
	friend std::ostream& operator<<(std::ostream& os, const RGBColor& c);
	friend std::istream& operator>>(std::istream& is, RGBColor& c);
	ldouble r, g, b;
};

 


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM