00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020 #ifndef _GDCMJPEGFRAGMENT_H_
00021 #define _GDCMJPEGFRAGMENT_H_
00022
00023 #include "gdcmBase.h"
00024
00025 #include <iostream>
00026 #include <fstream>
00027
00028 namespace GDCM_NAME_SPACE
00029 {
00042 class GDCM_EXPORT JPEGFragment : public Base
00043 {
00044 public:
00045 JPEGFragment();
00046 void Print( std::ostream &os = std::cout, std::string const &indent = "" );
00047 void DecompressJPEGFramesFromFile(std::ifstream *fp,
00048 uint8_t *buffer, int nBits,
00049 int &statesuspension);
00050
00051 bool ReadJPEGFile8 (std::ifstream *fp, void *image_buffer, int &statesuspension );
00052 bool ReadJPEGFile12 (std::ifstream *fp, void *image_buffer, int &statesuspension );
00053 bool ReadJPEGFile16 (std::ifstream *fp, void *image_buffer, int &statesuspension );
00054
00055 void SetLength(uint32_t length) { Length = length; }
00056 uint32_t GetLength() { return Length; }
00057 void SetOffset(uint32_t offset) { Offset = offset; }
00058 uint32_t GetOffset() { return Offset; }
00059 uint8_t *GetImage() { return pImage; }
00060
00061 private:
00062 uint32_t Offset;
00063 uint32_t Length;
00064
00065 uint8_t *pImage;
00066 };
00067 }
00068
00069
00070 #endif