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 #ifndef IMG_INDEX_H
00028 #define IMG_INDEX_H
00029
00030 #include <iosfwd>
00031
00032 #include <ost/base.hh>
00033 #include <ost/img/size.hh>
00034
00035 namespace ost { namespace img { namespace image_state {
00036
00037
00038
00039
00040
00041 struct DLLEXPORT_OST_IMG_BASE Index {
00042 Index(unsigned int uu,unsigned int vv, unsigned int ww);
00043
00044 bool equal(const Index& i) const;
00045
00046 unsigned int u,v,w;
00047 };
00048
00049 DLLEXPORT_OST_IMG_BASE bool operator==(const Index& i1, const Index& i2);
00050 DLLEXPORT_OST_IMG_BASE bool operator!=(const Index& i1, const Index& i2);
00051
00052 DLLEXPORT_OST_IMG_BASE std::ostream& operator<<(std::ostream& out, const Index& i);
00053
00054 class DLLEXPORT_OST_IMG_BASE IndexIterator {
00055 public:
00056 IndexIterator(int w, int h, int d);
00057 IndexIterator(const Size& s);
00058
00059 bool AtStart() const;
00060 bool AtEnd() const;
00061
00062 IndexIterator& ToStart();
00063 IndexIterator& ToEnd();
00064
00065
00066 IndexIterator& operator++();
00067
00068 IndexIterator operator++(int);
00069
00070 IndexIterator& operator--();
00071
00072 IndexIterator operator--(int);
00073
00074 operator Index() const;
00075 private:
00076 unsigned int w_,h_,d_;
00077 Index indx_;
00078 bool at_end_;
00079
00080 void increment();
00081 void decrement();
00082 };
00083
00084 }}}
00085
00086 #endif