X-Git-Url: https://git.creatis.insa-lyon.fr/pubgit/?a=blobdiff_plain;f=src%2FgdcmRLEFrame.h;h=0554ad4db6fcea4c3a3e3f4ee9df99b96ea0ccb3;hb=e7768bbebdc9a5972e396d71a3e848f5674ee378;hp=21b2dd30c1ec01fc09d3fd65d8124cb6cc49bd98;hpb=ba78e6c6d47d6db1528e8e88e5ebde7296a26692;p=gdcm.git diff --git a/src/gdcmRLEFrame.h b/src/gdcmRLEFrame.h index 21b2dd30..0554ad4d 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/12/03 20:16:58 $ - Version: $Revision: 1.10 $ + 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 @@ -17,14 +17,15 @@ =========================================================================*/ -#ifndef GDCMRLEFRAME_H -#define GDCMRLEFRAME_H +#ifndef _GDCMRLEFRAME_H_ +#define _GDCMRLEFRAME_H_ -#include "gdcmCommon.h" +#include "gdcmBase.h" #include +#include -namespace gdcm +namespace GDCM_NAME_SPACE { /** * \brief Utility class for summerizing the informations of a SINGLE RLE @@ -37,22 +38,35 @@ namespace gdcm * * Each instance of this class (they can be as many instances for * a given Document as they are frames and they are collected in - * a \ref RLEFramesInfo ) describes : + * 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 RLEFrame +class GDCM_EXPORT RLEFrame : public Base { -friend class Document; -friend class PixelReadConvert; - unsigned int NumberFragments; - long Offset[15]; - long Length[15]; -public: - RLEFrame() { NumberFragments = 0; } - void Print( std::string indent = "", std::ostream &os = std::cout ); - +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 //-----------------------------------------------------------------------------