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


Ignore:
Timestamp:
Aug 29, 2000, 6:13:31 PM (25 years ago)
Author:
ansari
Message:

Handler PPersist pour Image<T> (classe FIO_Image<T>) - Reza 29/8/2000

File:
1 edited

Legend:

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

    r1104 r1159  
    88
    99#include "tmatrix.h"
     10#include "fioarr.h"
    1011
    1112
     
    6162}
    6263
     64/////////////////////////////////////////////////////////////////////////
     65//! Class for persistent management of Image
     66template <class T>
     67class FIO_Image : public FIO_TArray<T>   {
     68public:
     69  FIO_Image();
     70  FIO_Image(string const & filename);
     71  FIO_Image(const Image<T> & obj);
     72  FIO_Image(Image<T> * obj);
     73  //  virtual ~FIO_Image(); 
     74  virtual void        SetDataObj(AnyDataObj & o);
     75  inline operator Image<T>() { return(*(dynamic_cast<Image<T> * >dobj)); }
     76protected :
     77  virtual void ReadSelf(PInPersist&);           
     78  virtual void WriteSelf(POutPersist&) const; 
     79};
     80
     81/*! \ingroup Image \fn operator<<(POutPersist&,Image<T>&)
     82  \brief Write Image \b obj into POutPersist stream \b os */
     83template <class T>
     84inline POutPersist& operator << (POutPersist& os, Image<T> & obj)
     85{ FIO_Image<T> fio(&obj);  fio.Write(os);  return(os); }
     86
     87/*! \ingroup Image \fn operator>>(PInPersist&,Image<T>&)
     88  \brief Read Image \b obj from PInPersist stream \b os */
     89template <class T>
     90inline PInPersist& operator >> (PInPersist& is, Image<T> & obj)
     91{ FIO_Image<T> fio(&obj);  fio.Read(is);  return(is); }
     92
     93
    6394
    6495typedef Image<uint_2> ImageU2;
Note: See TracChangeset for help on using the changeset viewer.