Changeset 1390 in Sophya for trunk/SophyaLib/NTools/cimage.h


Ignore:
Timestamp:
Feb 9, 2001, 6:08:57 PM (25 years ago)
Author:
ansari
Message:

Modifs interface FFTServer , Reza 9/2/2001

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/SophyaLib/NTools/cimage.h

    r1204 r1390  
    1616namespace SOPHYA {
    1717
     18//! Class for handling images
    1819template <class T>
    1920class Image : public TMatrix<T> {
     
    2122public:
    2223  Image();
    23   Image(uint_4 sizx, uint_4 sizy, 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.);
    2425  Image(const Image<T>& a);
    2526  Image(const Image<T>& a, bool share);
     
    2829
    2930  // Inline element acces methods
    30   inline T const& operator()(uint_4 ix,uint_4 jy) const;
    31   inline T&       operator()(uint_4 ix,uint_4 jy);
     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);
    3233
    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();}
    3538
     39  //! Returns the X position, for pixel(0,0)
    3640  inline r_8     XOrg() const {return org_x;}
     41  //! Returns the Y position, for pixel(0,0)
    3742  inline r_8     YOrg() const {return org_y;}
    3843
     44  //! Returns pixel size along X
    3945  inline r_8     XPixSize() const {return pxsz_x;}
     46  //! Returns pixel size along Y
    4047  inline r_8     YPixSize() const {return pxsz_y;}
    4148
    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;}
    4453
     54  //! Set the position for pixel(0,0)
    4555  inline void    SetOrg(r_8 orgx=0., r_8 orgy=0.)
    4656                       { org_x = orgx;  org_y = orgy; } 
     57  //! Set the pixel size
    4758  inline void    SetPixelSize(r_8 szx=1., r_8 szy=1.)
    4859                       { pxsz_x = szx;   pxsz_y = szy; }
     
    5364};
    5465
     66//! () : Return the pixel value (element) for pixel \b ix (column index) and \b jy (line index)
    5567template <class T>
    56 inline T const& Image<T>::operator()(uint_4 ix, uint_4 jy) const
     68inline T const& Image<T>::operator()(sa_size_t ix, sa_size_t jy) const
    5769{
    5870  return (TMatrix<T>::operator() (jy, ix));
    5971}
    6072
     73//! () : Return the pixel value (element) for pixel \b ix (column index) and \b jy (line index)
    6174template <class T>
    62 inline T & Image<T>::operator()(uint_4 ix, uint_4 jy)
     75inline T & Image<T>::operator()(sa_size_t ix, sa_size_t jy)
    6376{
    6477  return (TMatrix<T>::operator() (jy, ix));
     
    8295};
    8396
    84 /*! \ingroup Image \fn operator<<(POutPersist&,Image<T>&)
     97/*! \ingroup NTools \fn operator<<(POutPersist&,Image<T>&)
    8598  \brief Write Image \b obj into POutPersist stream \b os */
    8699template <class T>
     
    88101{ FIO_Image<T> fio(&obj);  fio.Write(os);  return(os); }
    89102
    90 /*! \ingroup Image \fn operator>>(PInPersist&,Image<T>&)
     103/*! \ingroup NTools \fn operator>>(PInPersist&,Image<T>&)
    91104  \brief Read Image \b obj from PInPersist stream \b os */
    92105template <class T>
     
    102115
    103116class GeneralFit;
     117//! OBSOLETE - Should not be used - for compatibility with peida in (s)piapp
    104118class RzImage {
    105119public:
Note: See TracChangeset for help on using the changeset viewer.