X-Git-Url: https://git.creatis.insa-lyon.fr/pubgit/?a=blobdiff_plain;f=src%2FgdcmRLEFrame.h;h=cc1d40d7d609626a2fd3772229b5a3f812319aed;hb=fa8fa610de8d935491343df2d8a543ff6fdb6e69;hp=9b6ba0256c46e87b0217d0cf341aeaef30dc2783;hpb=64f79e8efbfae49231d1f469aa4fcc4acf0da70c;p=gdcm.git diff --git a/src/gdcmRLEFrame.h b/src/gdcmRLEFrame.h index 9b6ba025..cc1d40d7 100644 --- a/src/gdcmRLEFrame.h +++ b/src/gdcmRLEFrame.h @@ -3,8 +3,8 @@ Program: gdcm Module: $RCSfile: gdcmRLEFrame.h,v $ Language: C++ - Date: $Date: 2004/10/06 09:58:08 $ - Version: $Revision: 1.1 $ + Date: $Date: 2005/09/02 07:10:03 $ + Version: $Revision: 1.16 $ Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de l'Image). All rights reserved. See Doc/License.txt or @@ -22,31 +22,51 @@ #include "gdcmCommon.h" +#include +#include + +namespace gdcm +{ /** * \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 \ref 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 { -friend class gdcmDocument; -friend class gdcmFile; - int NumberFragments; - uint8_t Offset[15]; - long Length[15]; - gdcmRLEFrame() { NumberFragments = 0; } - -}; +public: + RLEFrame() { NumberOfFragments = 0; } + void Print( std::ostream &os = std::cout, std::string 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 ); + +private: + unsigned int NumberOfFragments; + long Offset[15]; + long Length[15]; +}; +} // end namespace gdcm //----------------------------------------------------------------------------- #endif