00001 /************************************************************************** 00002 ** Title: int image 00003 ** $RCSfile: SimpleRGBImage.hh,v $ 00004 ** $Revision: 1.1 $$Name: $ 00005 ** $Date: 2005/05/02 12:07:11 $ 00006 ** Copyright: GPL $Author: fehr $ 00007 ** Description: 00008 ** 00009 ** 00010 ** 00011 **------------------------------------------------------------------------- 00012 ** 00013 ** $Log: IntImage.hh,v $ 00014 ** 00015 ** 00016 **************************************************************************/ 00017 00018 #ifndef INTIMAGE_HH 00019 #define INTIMAGE_HH 00020 00021 #include <iostream> 00022 #include "MyError.hh" 00023 00024 00025 /*======================================================================*/ 00032 /*======================================================================*/ 00033 class IntImage 00034 { 00035 00036 static const unsigned int MAX_DIMENSION = 16384; 00037 00038 public: 00039 /*======================================================================*/ 00043 /*======================================================================*/ 00044 IntImage(); 00045 00046 /*======================================================================*/ 00050 /*======================================================================*/ 00051 IntImage(const IntImage& image); 00052 00053 /*======================================================================*/ 00060 /*======================================================================*/ 00061 IntImage(unsigned int width, unsigned int height); 00062 00063 00064 /*======================================================================*/ 00068 /*======================================================================*/ 00069 ~IntImage(); 00070 00071 /*======================================================================*/ 00079 /*======================================================================*/ 00080 void resize(unsigned int width, unsigned int height); 00081 00082 00083 /*======================================================================*/ 00092 /*======================================================================*/ 00093 int& operator()(unsigned int x, unsigned int y); 00094 const int& operator()(unsigned int x, unsigned int y) const; 00095 00096 00097 00098 /*======================================================================*/ 00104 /*======================================================================*/ 00105 unsigned int width() const; 00106 00107 00108 /*======================================================================*/ 00114 /*======================================================================*/ 00115 unsigned int height() const; 00116 00117 /*======================================================================*/ 00123 /*======================================================================*/ 00124 size_t size() const; 00125 00126 /*======================================================================*/ 00132 /*======================================================================*/ 00133 int* begin(); 00134 const int* begin() const; 00135 00136 /*======================================================================*/ 00143 /*======================================================================*/ 00144 int* end(); 00145 const int* end() const; 00146 00147 /*======================================================================*/ 00154 /*======================================================================*/ 00155 int& operator[](size_t n); 00156 const int& operator[](size_t n) const; 00157 00158 00159 /*======================================================================*/ 00166 /*======================================================================*/ 00167 IntImage& operator=(const IntImage& image); 00168 00169 private: 00170 unsigned int _width, _height, _size; 00171 int* _pixels; 00172 int* _pixelsEnd; 00173 int** _rowStart; 00174 }; 00175 00176 #include "IntImage.icc" 00177 00178 #endif