Source: raytracer/pixel.h


Annotated List
Files
Globals
Hierarchy
Index
/* *************************************************************************
                          pixel.h  -  description
                             -------------------
    begin                : Wed Oct 16 2002    
    copyright            : (C) 2002 by Micha Riser
    email                : mriser@gmx.net
 ************************************************************************* */

/* *************************************************************************
 *                                                                         *
 *   This program is free software; you can redistribute it and/or modify  *
 *   it under the terms of the GNU General Public License as published by  *
 *   the Free Software Foundation; either version 2 of the License, or     *
 *   (at your option) any later version.                                   *
 *                                                                         *
 ************************************************************************* */

#ifndef PIXEL_H
#define PIXEL_H

#include "colour.h"

/**Element of the picture.
  *@author Micha Riser
  */
class Pixel {
  
public: // Public attributes
    /**Horizontal coordinate.
      */
    int x;

    /**Vertical coordinate.
      */
    int y;

    /**RGB Colour value.
      */
    Colour3 c;
  
public: // Constructor and destructor
    Pixel(): c(0) {}
    Pixel(int px, int py, const Colour3& col): x(px), y(py), c(col) {}
    ~Pixel() {}

public: // Public methods

    /**Introduce order between pixels.
      */
    bool operator<(const Pixel& s) const {
        if (y<s.y) return true; else if (y>s.y) return false;
        if (x<s.x) return true; else if (x>s.x) return false;
        return false;
    }

};

#endif

Generated by: micha@laptop on Thu Oct 24 20:25:24 2002, using kdoc 2.0a53.