RGBColor - package raytracer.utility public class RGBColor...

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

View Full Document Right Arrow Icon

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

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

Unformatted text preview: package raytracer.utility; public class RGBColor { public float r, g, b; public static final RGBColor black = new RGBColor(0f); public static final RGBColor white = new RGBColor(1f); public static final RGBColor red = new RGBColor(1.0f, 0.0f, 0.0f); // -------------------------------------------------------- default constructor public RGBColor() { r = g = b = 0f; } // -------------------------------------------------------- constructor public RGBColor(float c) { r = g = b = c; } // -------------------------------------------------------- constructor public RGBColor(float newR, float newG, float newB) { r = newR; g = newG; b = newB; } public RGBColor(double newR, double newG, double newB) { r = (float)newR; g = (float)newG; b = (float)newB; } // -------------------------------------------------------- copy constructor public RGBColor(RGBColor c){ r = c.r; g = c.g; b = c.b; } // --------------------------------------------------------assignment operator public void set (RGBColor rhs) { if (this != rhs) {if (this !...
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 / 4

RGBColor - package raytracer.utility public class 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