X-Git-Url: https://git.creatis.insa-lyon.fr/pubgit/?a=blobdiff_plain;f=src%2FgdcmRLEFrame.h;h=f265b713aa4790cfd1d312e59f813a4494bb6be7;hb=f540ed5835e7b89478e6048a577d494c0e156f2a;hp=3f288ecfc83ce7b4f03b78fde1d196dc55532901;hpb=67845c7dc1241480f5c5fcfa0cfc2e86918dad1e;p=gdcm.git diff --git a/src/gdcmRLEFrame.h b/src/gdcmRLEFrame.h index 3f288ecf..f265b713 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/08 16:27:20 $ - Version: $Revision: 1.4 $ + Date: $Date: 2006/02/16 20:06:15 $ + Version: $Revision: 1.20 $ Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de l'Image). All rights reserved. See Doc/License.txt or @@ -20,8 +20,13 @@ #ifndef GDCMRLEFRAME_H #define GDCMRLEFRAME_H -#include "gdcmCommon.h" +#include "gdcmBase.h" +#include +#include + +namespace gdcm +{ /** * \brief Utility class for summerizing the informations of a SINGLE RLE * frame of an "Encapsulated RLE Compressed Image" (refer to @@ -32,23 +37,37 @@ * 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 : public Base { -friend class gdcmDocument; -friend class gdcmFile; -friend class gdcmPixelConvert; - 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