Changeset 1390 in Sophya for trunk/SophyaLib/NTools/cimage.h
- Timestamp:
- Feb 9, 2001, 6:08:57 PM (25 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/SophyaLib/NTools/cimage.h
r1204 r1390 16 16 namespace SOPHYA { 17 17 18 //! Class for handling images 18 19 template <class T> 19 20 class Image : public TMatrix<T> { … … 21 22 public: 22 23 Image(); 23 Image( uint_4 sizx, uint_4sizy, r_8 szpx=1., r_8 szpy=1., r_8 orgx=0., r_8 orgy=0.);24 Image(sa_size_t sizx, sa_size_t sizy, r_8 szpx=1., r_8 szpy=1., r_8 orgx=0., r_8 orgy=0.); 24 25 Image(const Image<T>& a); 25 26 Image(const Image<T>& a, bool share); … … 28 29 29 30 // Inline element acces methods 30 inline T const& operator()( uint_4 ix,uint_4jy) const;31 inline T& operator()( uint_4 ix,uint_4jy);31 inline T const& operator()(sa_size_t ix, sa_size_t jy) const; 32 inline T& operator()(sa_size_t ix, sa_size_t jy); 32 33 33 inline uint_4 XSize() const {return NCols();} 34 inline uint_4 YSize() const {return NRows();} 34 //! Returns the image size along X (corresponding to the number of columns) 35 inline sa_size_t XSize() const {return NCols();} 36 //! Returns the image size along Y (corresponding to the number of lines) 37 inline sa_size_t YSize() const {return NRows();} 35 38 39 //! Returns the X position, for pixel(0,0) 36 40 inline r_8 XOrg() const {return org_x;} 41 //! Returns the Y position, for pixel(0,0) 37 42 inline r_8 YOrg() const {return org_y;} 38 43 44 //! Returns pixel size along X 39 45 inline r_8 XPixSize() const {return pxsz_x;} 46 //! Returns pixel size along Y 40 47 inline r_8 YPixSize() const {return pxsz_y;} 41 48 42 inline r_8 XPos(uint_4 i) const {return org_x + i*pxsz_x;} 43 inline r_8 YPos(uint_4 j) const {return org_y + j*pxsz_y;} 49 //! Returns the pixel position along X, for pixels with X index \b i 50 inline r_8 XPos(sa_size_t i) const {return org_x + i*pxsz_x;} 51 //! Returns the pixel position along Y, for pixels with Y index \b j 52 inline r_8 YPos(sa_size_t j) const {return org_y + j*pxsz_y;} 44 53 54 //! Set the position for pixel(0,0) 45 55 inline void SetOrg(r_8 orgx=0., r_8 orgy=0.) 46 56 { org_x = orgx; org_y = orgy; } 57 //! Set the pixel size 47 58 inline void SetPixelSize(r_8 szx=1., r_8 szy=1.) 48 59 { pxsz_x = szx; pxsz_y = szy; } … … 53 64 }; 54 65 66 //! () : Return the pixel value (element) for pixel \b ix (column index) and \b jy (line index) 55 67 template <class T> 56 inline T const& Image<T>::operator()( uint_4 ix, uint_4jy) const68 inline T const& Image<T>::operator()(sa_size_t ix, sa_size_t jy) const 57 69 { 58 70 return (TMatrix<T>::operator() (jy, ix)); 59 71 } 60 72 73 //! () : Return the pixel value (element) for pixel \b ix (column index) and \b jy (line index) 61 74 template <class T> 62 inline T & Image<T>::operator()( uint_4 ix, uint_4jy)75 inline T & Image<T>::operator()(sa_size_t ix, sa_size_t jy) 63 76 { 64 77 return (TMatrix<T>::operator() (jy, ix)); … … 82 95 }; 83 96 84 /*! \ingroup Image\fn operator<<(POutPersist&,Image<T>&)97 /*! \ingroup NTools \fn operator<<(POutPersist&,Image<T>&) 85 98 \brief Write Image \b obj into POutPersist stream \b os */ 86 99 template <class T> … … 88 101 { FIO_Image<T> fio(&obj); fio.Write(os); return(os); } 89 102 90 /*! \ingroup Image\fn operator>>(PInPersist&,Image<T>&)103 /*! \ingroup NTools \fn operator>>(PInPersist&,Image<T>&) 91 104 \brief Read Image \b obj from PInPersist stream \b os */ 92 105 template <class T> … … 102 115 103 116 class GeneralFit; 117 //! OBSOLETE - Should not be used - for compatibility with peida in (s)piapp 104 118 class RzImage { 105 119 public:
Note:
See TracChangeset
for help on using the changeset viewer.