RGBColor - {} //...

Info iconThis preview shows pages 1–2. Sign up to view the full content.

View Full Document Right Arrow Icon
// This file contains the definition of the class RGBColor / #include <math.h> # #include "RGBColor.h" # // -------------------------------------------------------- default constructor / RGBColor::RGBColor(void) : r(0.0), g(0.0), b(0.0) : {} { // -------------------------------------------------------- constructor / RGBColor::RGBColor(float c) : r(c), g(c), b(c) : {} { // -------------------------------------------------------- constructor / RGBColor::RGBColor(float _r, float _g, float _b) R : r(_r), g(_g), b(_b) {} { // -------------------------------------------------------- copy constructor / : r(c.r), g(c.g), b(c.b)
Background image of page 1

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
Background image of page 2
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: {} // -------------------------------------------------------- destructor / RGBColor::~RGBColor(void) R {} { // --------------------------------------------------------assignment operator / RGBColor&amp; R RGBColor::operator= (const RGBColor&amp; rhs) { if (this == &amp;rhs) return (*this); r r = rhs.r; g = rhs.g; b = rhs.b; r return (*this); } // -------------------------------------------------------- powc // raise each component to the specified power // used for color filtering in Chapter 28 / RGBColor RGBColor::powc(float p) const { return (RGBColor(pow(r, p), pow(g, p), pow(b, p))); }...
View Full Document

This note was uploaded on 02/19/2010 for the course CS 390 taught by Professor Hu during the Spring '10 term at Westminster UT.

Page1 / 2

RGBColor - {} //...

This preview shows document pages 1 - 2. Sign up to view the full document.

View Full Document Right Arrow Icon
Ask a homework question - tutors are online