00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028
00029
00030
00031 #ifndef IMG_POINT_H
00032 #define IMG_POINT_H
00033
00034 #include <vector>
00035 #include <iosfwd>
00036
00037 #include <ost/img/module_config.hh>
00038 #include "vecmat.hh"
00039
00040 namespace ost { namespace img {
00041
00042
00043 class Size;
00044
00046 class DLLEXPORT_OST_IMG_BASE Point {
00047 public:
00048 Point();
00049 Point(const Point &p);
00050
00052 explicit Point(int a);
00054 Point(int a, int b);
00056 Point(int a, int b, int c);
00058 explicit Point(const Vec2& v);
00059
00061 explicit Point(const Vec3& v);
00062
00064 explicit Point(const Vec4& v);
00065
00067 Point(const Size& s);
00068
00070 Point Mirror(int planes);
00071
00072
00073 int operator[](unsigned int index) const;
00074
00075 int& operator[](unsigned int index);
00076
00077 Point& operator=(const Point& p);
00078
00079 Point& operator+=(const Point& p);
00080
00081 Point& operator-=(const Point& p);
00082
00083 Point operator-() const;
00084
00085 bool operator==(const Point &p) const;
00086
00087 bool operator!=(const Point &p) const;
00088
00089 bool operator<(const Point &p) const;
00090
00091 bool operator<=(const Point &p) const;
00092
00093 bool operator>(const Point &p) const;
00094
00095 bool operator>=(const Point &p) const;
00096
00097 Point& operator+=(const Size& p);
00098
00099 Point& operator-=(const Size& p);
00100
00101
00102 Vec2 ToVec2() const;
00103 Vec3 ToVec3() const;
00104 Vec4 ToVec4() const;
00105
00106 private:
00107 int data_[3];
00108
00109 bool equal(const Point &p) const;
00110 bool less(const Point &p) const;
00111 Point neg() const;
00112
00113 friend Point absolute(const Point&);
00114
00115 Point absolute() const;
00116 };
00117
00118 DLLEXPORT_OST_IMG_BASE Point operator+(const Point& p1, const Point& p2);
00119 DLLEXPORT_OST_IMG_BASE Point operator-(const Point& p1, const Point& p2);
00120
00121
00122
00123
00124
00125
00126
00127
00128
00129 DLLEXPORT_OST_IMG_BASE std::ostream& operator<<(std::ostream& os, const Point &p);
00130
00131
00132 }}
00133
00134
00135 #endif
00136
00137
00138