reference/ocr-simple/Point.h
author viric@llimona
Thu, 18 May 2006 23:12:51 +0200
changeset 0 6b8091ca909a
permissions -rw-r--r--
Init from working directory of svn repository.

#ifndef _POINT_H
#define _POINT_H

class Point{
	public:
		Point(int xCoord = -1, int yCoord= -1)
		  : fx(xCoord), fy(yCoord) {};

		inline int & x(){return fx;}
		inline int & y() {return fy;};

		// Relational operators

		inline bool operator ==(Point p)
		  { return (fx == p.x() && fy == p.y());};
		inline bool operator !=(Point p)
		  { return (fx != p.x() || fy != p.y());};
		inline bool operator < (Point p)
		  { return (fx < p.x()) && (fy < p.y()); };
		inline bool operator  > (Point p)
		  { return (fx > p.x()) && (fy > p.y()); };
		inline bool operator <=(Point p)
		  { return (fx <= p.x()) && (fy <= p.y()); };
		inline bool operator >=(Point p)
		  { return (fx >= p.x()) && (fy >= p.y()); };

	private:
		int fx;
		int fy;
};



#endif