1 /*=========================================================================
4 Module: $RCSfile: gdcmRLEFrame.h,v $
6 Date: $Date: 2007/05/23 14:18:11 $
7 Version: $Revision: 1.21 $
9 Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de
10 l'Image). All rights reserved. See Doc/License.txt or
11 http://www.creatis.insa-lyon.fr/Public/Gdcm/License.html for details.
13 This software is distributed WITHOUT ANY WARRANTY; without even
14 the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
15 PURPOSE. See the above copyright notices for more information.
17 =========================================================================*/
20 #ifndef GDCMRLEFRAME_H
21 #define GDCMRLEFRAME_H
28 namespace GDCM_NAME_SPACE
31 * \brief Utility class for summerizing the informations of a SINGLE RLE
32 * frame of an "Encapsulated RLE Compressed Image" (refer to
33 * PS 3.5-2003 annex G).
34 * This information is a mix of:
35 * - the RLE Header (see PS 3.5-2003 section G5) and
36 * - the lengths of each RLE segment [ which can be decuded from
37 * both the above RLE Header and the itemlength of the frame).
39 * Each instance of this class (they can be as many instances for
40 * a given Document as they are frames and they are collected in
41 * a \ref RLEFramesInfo ) describes :
42 * - the total number of segments (up to 15),
43 * - the offsets of each segment of the frame,
44 * - the (corresponding) lengths of each segment of the frame.
46 class GDCM_EXPORT RLEFrame : public Base
49 friend class RLEFramesInfo;
51 RLEFrame() { NumberOfFragments = 0; }
52 void Print( std::ostream &os = std::cout, std::string const &indent = "" );
54 void SetNumberOfFragments(unsigned int number)
55 { NumberOfFragments = number; }
56 unsigned int GetNumberOfFragments() { return NumberOfFragments; }
57 void SetOffset(unsigned int id, long offset);
58 long GetOffset(unsigned int id);
59 void SetLength(unsigned int id, long length);
60 long GetLength(unsigned int id);
62 uint8_t *ReadAndDecompressRLEFrame( uint8_t *subRaw,long rawSegmentSize,
64 bool ReadAndDecompressRLEFragment( uint8_t *subRaw, long fragmentSize,
65 long rawSegmentSize, std::ifstream *fp );
67 unsigned int NumberOfFragments;
71 } // end namespace gdcm
72 //-----------------------------------------------------------------------------