00001 /* ************************************************************************* 00002 pixel.h - description 00003 ------------------- 00004 begin : Wed Oct 16 2002 00005 copyright : (C) 2002 by Micha Riser 00006 email : mriser@gmx.net 00007 00008 $Id: pixel_8h-source.html,v 1.1 2005/02/04 21:02:27 micha Exp $ 00009 00010 ************************************************************************* */ 00011 00012 /* ************************************************************************* 00013 * * 00014 * This program is free software; you can redistribute it and/or modify * 00015 * it under the terms of the GNU General Public License as published by * 00016 * the Free Software Foundation; either version 2 of the License, or * 00017 * (at your option) any later version. * 00018 * * 00019 ************************************************************************* */ 00020 00021 #ifndef PIXEL_H 00022 #define PIXEL_H 00023 00024 #include "colour.h" 00025 00029 class Pixel { 00030 00031 public: // Public attributes 00034 int x; 00035 00038 int y; 00039 00042 Colour c; 00043 00044 public: // Constructor and destructor 00045 Pixel(): c(0) {} 00046 Pixel(int px, int py, const Colour& col): x(px), y(py), c(col) {} 00047 ~Pixel() {} 00048 00049 public: // Public methods 00050 00053 bool operator<(const Pixel& s) const { 00054 if (y<s.y) return true; else if (y>s.y) return false; 00055 if (x<s.x) return true; else if (x>s.x) return false; 00056 return false; 00057 } 00058 00059 }; 00060 00061 #endif
1.3.8