Files
dorayme/source/include/colour.h
Godzil 1e2588441f Rename tuple file to remove the plural.
Also add empty shell ray.
2020-02-15 23:18:04 +00:00

33 lines
933 B
C++

/*
* DoRayMe - a quick and dirty Raytracer
* Colour header
*
* Created by Manoël Trapier
* Copyright (c) 2020 986-Studio.
*
*/
#ifndef DORAYME_COLOUR_H
#define DORAYME_COLOUR_H
#include <tuple.h>
class Colour : public Tuple
{
public:
Colour(double red, double green, double blue) : Tuple(red, green, blue, 0) {};
double red() { return this->x; };
double green() { return this->y; };
double blue() { return this->z; };
double red(double v) { this->x = v; return v; };
double green(double v) { this->y = v; return v; };
double blue(double v) { this->z = v; return v; };
using Tuple::operator*;
Colour operator*(const Colour &b) const { return Colour(this->x * b.x,
this->y * b.y,
this->z * b.z); };
};
#endif /* DORAYME_COLOUR_H */