]> Creatis software - gdcm.git/blobdiff - src/gdcmRLEFramesInfo.cxx
ENH: Pass 2 at cleaning the JPEG mess. Still some work to do, but things are getting...
[gdcm.git] / src / gdcmRLEFramesInfo.cxx
index cf24f379876b949a4ca54336b74ecd2689dd6d46..ba65b834c394c5b340d13358cd478e0c498be9b6 100644 (file)
@@ -3,8 +3,8 @@
   Program:   gdcm
   Module:    $RCSfile: gdcmRLEFramesInfo.cxx,v $
   Language:  C++
-  Date:      $Date: 2004/10/12 04:35:47 $
-  Version:   $Revision: 1.2 $
+  Date:      $Date: 2005/01/28 15:42:22 $
+  Version:   $Revision: 1.7 $
                                                                                 
   Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de
   l'Image). All rights reserved. See Doc/License.txt or
@@ -17,6 +17,7 @@
 =========================================================================*/
 
 #include "gdcmRLEFramesInfo.h"
+#include "gdcmDebug.h"
 
 namespace gdcm 
 {
@@ -29,4 +30,52 @@ RLEFramesInfo::~RLEFramesInfo()
    }
    Frames.clear();
 }
+
+/**
+ * \brief        Print self.
+ * @param indent Indentation string to be prepended during printing.
+ * @param os     Stream to print to.
+ */
+void RLEFramesInfo::Print( std::ostream &os, std::string indent )
+{
+   os << std::endl;
+   os << indent
+      << "----------------- RLE frames --------------------------------"
+      << std::endl;
+   os << indent
+      << "Total number of Frames : " << Frames.size()
+      << std::endl;
+   int frameNumber = 0;
+   for(RLEFrameList::iterator it = Frames.begin(); it != Frames.end(); ++it)
+   {
+      os << indent
+         << "   frame number :" << frameNumber++
+         << std::endl;
+      (*it)->Print( os, indent + "   " );
+   }
+}
+
+void RLEFramesInfo::AddFrame(RLEFrame *frame)
+{
+   Frames.push_back(frame);
+}
+
+RLEFrame *RLEFramesInfo::GetFirstFrame()
+{
+   ItFrames = Frames.begin();
+   if (ItFrames != Frames.end())
+      return  *ItFrames;
+   return NULL;
+}
+
+RLEFrame *RLEFramesInfo::GetNexttFrame()
+{
+   gdcmAssertMacro (ItFrames != Frames.end());
+
+   ++ItFrames;
+   if (ItFrames != Frames.end())
+      return  *ItFrames;
+   return NULL;
+}
+
 } // end namespace gdcm