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_SIZE_H
00028 #define IMG_SIZE_H
00029
00030 #include <iosfwd>
00031
00032 #include <ost/img/module_config.hh>
00033
00034 namespace ost { namespace img {
00035
00036 class Point;
00037
00039 class DLLEXPORT_OST_IMG_BASE Size {
00040 public:
00041 Size();
00042 Size(const Size &s);
00043
00045 explicit Size(unsigned int w);
00046
00048 explicit Size(unsigned int w, unsigned int h);
00049
00051 explicit Size(unsigned int w, unsigned int h, unsigned int d);
00052
00054 Size(const Point& p1, const Point& p2);
00055
00057
00060 Point GetHalf() const;
00061
00063 unsigned int GetWidth() const;
00065 unsigned int GetHeight() const;
00067 unsigned int GetDepth() const;
00069 unsigned int GetSlab() const;
00071 unsigned int GetVol() const;
00073 unsigned int GetVolume() const;
00074
00076 unsigned int GetDim() const;
00077
00078
00079 Size& operator=(const Size& s);
00080 unsigned int operator[](unsigned int index) const;
00081 unsigned int& operator[](unsigned int index);
00082 bool operator==(const Size& s) const;
00083 bool operator!=(const Size& s) const;
00084
00085 Size& operator+=(const Size& s);
00086 Size& operator-=(const Size& s);
00087
00088 private:
00089 unsigned int w_,h_,d_;
00090
00091 bool equal(const Size& s) const;
00092 };
00093
00094 DLLEXPORT_OST_IMG_BASE Size operator+(const Size& s1, const Size& s2);
00095 DLLEXPORT_OST_IMG_BASE Size operator-(const Size& s1, const Size& s2);
00096
00097 DLLEXPORT_OST_IMG_BASE std::ostream& operator<<(std::ostream& os, const Size& s);
00098
00099
00100 }}
00101
00102
00103 #endif