]> Creatis software - gdcm.git/blob - src/gdcmJPEGFragmentsInfo.h
Fix mistypings
[gdcm.git] / src / gdcmJPEGFragmentsInfo.h
1 /*=========================================================================
2                                                                                 
3   Program:   gdcm
4   Module:    $RCSfile: gdcmJPEGFragmentsInfo.h,v $
5   Language:  C++
6   Date:      $Date: 2007/09/17 12:16:01 $
7   Version:   $Revision: 1.24 $
8                                                                                 
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.
12                                                                                 
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.
16                                                                                 
17 =========================================================================*/
18
19
20 #ifndef _GDCMJPEGFRAGMENTSINFO_H_
21 #define _GDCMJPEGFRAGMENTSINFO_H_
22
23 #include "gdcmJPEGFragment.h"
24
25 #include <list>
26 #include <iostream>
27
28 namespace GDCM_NAME_SPACE
29 {
30 /**
31  * \brief Utility class for gathering the informations of the collection
32  *        of JPEG fragment[s] (see JPEGFragment) when handling
33  *        "Encapsulated JPEG Compressed Images". 
34  *        The informations on each frame are obtained during the pixel parsing
35  *        of a gdcm::File (refer to File::ComputeJPEGFragmentInfo() ).
36  *        They shall be used when (if necessary) decoding the fragments.
37  *
38  *        This class is simply a stl list<> of JPEGFragment.
39  */
40 class GDCM_EXPORT JPEGFragmentsInfo
41 {
42 friend class File;
43 friend class PixelReadConvert;
44
45 private:
46    JPEGFragmentsInfo();
47    ~JPEGFragmentsInfo();
48    void Print( std::ostream &os = std::cout, std::string const &indent = "" );
49
50    void DecompressFromFile(std::ifstream *fp, uint8_t *buffer, int nBits,
51                            int numBytes, int length);
52
53    void AddFragment(JPEGFragment *fragment);
54    JPEGFragment *GetFirstFragment();
55    JPEGFragment *GetNextFragment();
56    unsigned int GetFragmentCount();
57
58 //private:
59    typedef std::list<JPEGFragment *> JPEGFragmentsList;
60
61     //Some mathieu hack:
62    int StateSuspension;
63    void *SampBuffer;
64    char *pimage;
65    JPEGFragmentsList Fragments;
66    JPEGFragmentsList::iterator ItFragments;
67 };
68 } // end namespace gdcm
69
70 //-----------------------------------------------------------------------------
71 #endif
72