gdcmJPEGFragment.h

Go to the documentation of this file.
00001 /*=========================================================================
00002                                                                                 
00003   Program:   gdcm
00004   Module:    $RCSfile: gdcmJPEGFragment.h,v $
00005   Language:  C++
00006   Date:      $Date: 2007/08/22 16:14:04 $
00007   Version:   $Revision: 1.22 $
00008                                                                                 
00009   Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de
00010   l'Image). All rights reserved. See Doc/License.txt or
00011   http://www.creatis.insa-lyon.fr/Public/Gdcm/License.html for details.
00012                                                                                 
00013      This software is distributed WITHOUT ANY WARRANTY; without even
00014      the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
00015      PURPOSE.  See the above copyright notices for more information.
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 } // end namespace gdcm
00068 
00069 //-----------------------------------------------------------------------------
00070 #endif

Generated on Fri Aug 24 12:59:31 2007 for gdcm by  doxygen 1.4.6