1 /*=========================================================================
4 Module: $RCSfile: gdcmJPEGFragment.h,v $
6 Date: $Date: 2005/01/24 14:52:50 $
7 Version: $Revision: 1.12 $
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 GDCMJPEGFRAGMENT_H
21 #define GDCMJPEGFRAGMENT_H
23 #include "gdcmCommon.h"
30 #define JOCTET uint8_t
33 * \brief Utility class for summerizing the informations of a JPEG
34 * fragment of an "Encapsulated JPEG Compressed Image".
35 * This information is a mix of:
36 * - the fragment offset
37 * - the fragment length
39 * Each instance of this class (they can be as many instances for
40 * a given Document as they are JPEG fragments and they are
41 * collected in a \ref JPEGFragmentsInfo )
43 class GDCM_EXPORT JPEGFragment
47 void Print( std::ostream &os = std::cout, std::string indent = "" );
48 void DecompressJPEGFramesFromFile(std::ifstream *fp, uint8_t *buffer, int nBits, int & statesuspension);
49 void DecompressJPEGSingleFrameFragmentsFromFile(JOCTET *buffer, size_t totalLength, uint8_t* raw, int nBits);
50 void DecompressJPEGFragmentedFramesFromFile(JOCTET *buffer, uint8_t* raw, int nBits, size_t &howManyRead, size_t &howManyWritten, size_t totalLength);
52 bool gdcm_read_JPEG_file8 (std::ifstream* fp, void* image_buffer, int & statesuspension );
53 bool gdcm_read_JPEG_file12 (std::ifstream* fp, void* image_buffer, int & statesuspension );
54 bool gdcm_read_JPEG_file16 (std::ifstream* fp, void* image_buffer, int & statesuspension );
63 friend class Document;
64 friend class FileHelper;
65 friend class PixelReadConvert;
66 friend class JPEGFragmentsInfo;
68 } // end namespace gdcm
70 //-----------------------------------------------------------------------------