1 /*=========================================================================
4 Module: $RCSfile: gdcmRLEFrame.h,v $
6 Date: $Date: 2005/02/01 18:37:31 $
7 Version: $Revision: 1.15 $
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
23 #include "gdcmCommon.h"
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
49 RLEFrame() { NumberOfFragments = 0; }
50 void Print( std::ostream &os = std::cout, std::string indent = "" );
52 void SetNumberOfFragments(unsigned int number) { NumberOfFragments = number; };
53 unsigned int GetNumberOfFragments() { return NumberOfFragments; };
54 void SetOffset(unsigned int id, long offset);
55 long GetOffset(unsigned int id);
56 void SetLength(unsigned int id, long length);
57 long GetLength(unsigned int id);
59 uint8_t *ReadAndDecompressRLEFrame( uint8_t *subRaw,long rawSegmentSize,
61 bool ReadAndDecompressRLEFragment( uint8_t *subRaw, long fragmentSize,
62 long rawSegmentSize, std::ifstream *fp );
65 unsigned int NumberOfFragments;
69 } // end namespace gdcm
70 //-----------------------------------------------------------------------------