Changeset 2885 in Sophya for trunk/SophyaLib/NTools
- Timestamp:
- Jan 4, 2006, 2:36:47 PM (20 years ago)
- Location:
- trunk/SophyaLib/NTools
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/SophyaLib/NTools/cimage.cc
r2870 r2885 101 101 : FIO_TArray<T>() 102 102 { 103 dobj = new Image<T>(obj, true);104 ownobj=true;103 this->dobj = new Image<T>(obj, true); 104 this->ownobj=true; 105 105 } 106 106 … … 124 124 throw TypeMismatchExc(PExcLongMessage(buff)); 125 125 } 126 if ( ownobj && dobj) deletedobj;127 dobj = po;ownobj = false;126 if (this->ownobj && this->dobj) delete this->dobj; 127 this->dobj = po; this->ownobj = false; 128 128 } 129 129 … … 131 131 void FIO_Image<T>::ReadSelf(PInPersist& is) 132 132 { 133 if ( dobj == NULL)dobj = new Image<T>;134 Image<T> * img = dynamic_cast<Image<T> * > ( dobj);133 if (this->dobj == NULL) this->dobj = new Image<T>; 134 Image<T> * img = dynamic_cast<Image<T> * > (this->dobj); 135 135 // On lit les 3 premiers uint_4 136 136 // 0: Numero de version, 1 : reserve … … 155 155 void FIO_Image<T>::WriteSelf(POutPersist& os) const 156 156 { 157 if ( dobj == NULL) return;158 Image<T> * img = dynamic_cast<Image<T> * > ( dobj);157 if (this->dobj == NULL) return; 158 Image<T> * img = dynamic_cast<Image<T> * > (this->dobj); 159 159 // On ecrit 3 uint_4 .... 160 160 uint_4 itab[3]; -
trunk/SophyaLib/NTools/cimage.h
r1390 r2885 33 33 34 34 //! Returns the image size along X (corresponding to the number of columns) 35 inline sa_size_t XSize() const {return NCols();}35 inline sa_size_t XSize() const {return this->NCols();} 36 36 //! Returns the image size along Y (corresponding to the number of lines) 37 inline sa_size_t YSize() const {return NRows();}37 inline sa_size_t YSize() const {return this->NRows();} 38 38 39 39 //! Returns the X position, for pixel(0,0) … … 89 89 // virtual ~FIO_Image(); 90 90 virtual void SetDataObj(AnyDataObj & o); 91 inline operator Image<T>() { return(*(dynamic_cast<Image<T> * >( dobj))); }91 inline operator Image<T>() { return(*(dynamic_cast<Image<T> * >(this->dobj))); } 92 92 protected : 93 93 virtual void ReadSelf(PInPersist&);
Note:
See TracChangeset
for help on using the changeset viewer.