]> Creatis software - gdcm.git/blobdiff - src/gdcmRLEFrame.h
Fix mistypings
[gdcm.git] / src / gdcmRLEFrame.h
index 3eb74aacd308ef5c19ec6a3566590d3b591c301e..0554ad4db6fcea4c3a3e3f4ee9df99b96ea0ccb3 100644 (file)
@@ -3,8 +3,8 @@
   Program:   gdcm
   Module:    $RCSfile: gdcmRLEFrame.h,v $
   Language:  C++
-  Date:      $Date: 2004/10/06 22:31:31 $
-  Version:   $Revision: 1.2 $
+  Date:      $Date: 2007/09/17 12:16:01 $
+  Version:   $Revision: 1.23 $
                                                                                 
   Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de
   l'Image). All rights reserved. See Doc/License.txt or
 =========================================================================*/
 
 
-#ifndef GDCMRLEFRAME_H
-#define GDCMRLEFRAME_H
+#ifndef _GDCMRLEFRAME_H_
+#define _GDCMRLEFRAME_H_
 
-#include "gdcmCommon.h"
+#include "gdcmBase.h"
 
+#include <iostream>
+#include <fstream>
+
+namespace GDCM_NAME_SPACE
+{
 /**
  * \brief Utility class for summerizing the informations of a SINGLE RLE
- *        frame of an "Encapsulated RLE Compressed Image" (see PS-3.3 annex G).
+ *        frame of an "Encapsulated RLE Compressed Image" (refer to
+ *        PS 3.5-2003 annex G).
  *        This information is a mix of:
- *        - the RLE Header (see PS-3.3 section G5) and
+ *        - the RLE Header (see PS 3.5-2003 section G5) and
  *        - the lengths of each RLE segment [ which can be decuded from
  *          both the above RLE Header and the itemlength of the frame).
  *
  *        Each instance of this class (they can be as many instances for
- *        a given gdcmDocument as they are frames and they are collected in
- *        a \ref gdcmRLEFramesInfo ) describes :
+ *        a given Document as they are frames and they are collected in
+ *        a RLEFramesInfo ) describes :
  *        - the total number of segments (up to 15),
  *        - the offsets of each segment of the frame,
  *        - the (corresponding) lengths of each segment of the frame.
  */
-class GDCM_EXPORT gdcmRLEFrame
+class GDCM_EXPORT RLEFrame : public Base
 {
-friend class gdcmDocument;
-friend class gdcmFile;
-   int     NumberFragments;
-   long    Offset[15];
-   long    Length[15];
-   gdcmRLEFrame() { NumberFragments = 0; }
-   
-};
+friend class File;
+friend class RLEFramesInfo;
+private:
+   RLEFrame() { NumberOfFragments = 0; }
+   void Print( std::ostream &os = std::cout, std::string const &indent = "" );
 
+   void SetNumberOfFragments(unsigned int number) 
+                                       { NumberOfFragments = number; }   
+   unsigned int GetNumberOfFragments() { return NumberOfFragments; }
+   void SetOffset(unsigned int id, long offset);
+   long GetOffset(unsigned int id);
+   void SetLength(unsigned int id, long length);
+   long GetLength(unsigned int id);
+
+   uint8_t *ReadAndDecompressRLEFrame( uint8_t *subRaw,long rawSegmentSize,
+                                       std::ifstream *fp );
+   bool ReadAndDecompressRLEFragment( uint8_t *subRaw, long fragmentSize,
+                                      long rawSegmentSize, std::ifstream *fp );
+
+   unsigned int NumberOfFragments;
+   long Offset[15];
+   long Length[15];
+};
+} // end namespace gdcm
 //-----------------------------------------------------------------------------
 #endif