GDCM_NAME_SPACE::JPEGFragmentsInfo Class Reference

Utility class for gathering the informations of the collection of JPEG fragment[s] (see JPEGFragment) when handling "Encapsulated JPEG Compressed Images". The informations on each frame are obtained during the pixel parsing of a gdcm::File (refer to File::ComputeJPEGFragmentInfo() ). They shall be used when (if necessary) decoding the fragments. More...

#include <gdcmJPEGFragmentsInfo.h>

List of all members.

Private Types

typedef std::list< JPEGFragment * > JPEGFragmentsList

Private Member Functions

 JPEGFragmentsInfo ()
 ~JPEGFragmentsInfo ()
 Default destructor.
void Print (std::ostream &os=std::cout, std::string const &indent="")
 Print self.
void DecompressFromFile (std::ifstream *fp, uint8_t *buffer, int nBits, int numBytes, int length)
void AddFragment (JPEGFragment *fragment)
JPEGFragmentGetFirstFragment ()
JPEGFragmentGetNextFragment ()
unsigned int GetFragmentCount ()

Private Attributes

int StateSuspension
void * SampBuffer
char * pimage
JPEGFragmentsList Fragments
JPEGFragmentsList::iterator ItFragments

Friends

class File
class PixelReadConvert


Detailed Description

Utility class for gathering the informations of the collection of JPEG fragment[s] (see JPEGFragment) when handling "Encapsulated JPEG Compressed Images". The informations on each frame are obtained during the pixel parsing of a gdcm::File (refer to File::ComputeJPEGFragmentInfo() ). They shall be used when (if necessary) decoding the fragments.

This class is simply a stl list<> of JPEGFragment.

Definition at line 40 of file gdcmJPEGFragmentsInfo.h.


Member Typedef Documentation

typedef std::list<JPEGFragment *> GDCM_NAME_SPACE::JPEGFragmentsInfo::JPEGFragmentsList [private]
 

Definition at line 59 of file gdcmJPEGFragmentsInfo.h.


Constructor & Destructor Documentation

GDCM_NAME_SPACE::JPEGFragmentsInfo::JPEGFragmentsInfo  )  [private]
 

Definition at line 28 of file gdcmJPEGFragmentsInfo.cxx.

References StateSuspension.

00029 {
00030    StateSuspension = 0;
00031 }

GDCM_NAME_SPACE::JPEGFragmentsInfo::~JPEGFragmentsInfo  )  [private]
 

Default destructor.

Definition at line 36 of file gdcmJPEGFragmentsInfo.cxx.

References Fragments.

00037 {
00038    for(JPEGFragmentsList::iterator it  = Fragments.begin();
00039                                    it != Fragments.end();
00040                                  ++it )
00041    {
00042       delete *it;
00043    }
00044    Fragments.clear();
00045 }


Member Function Documentation

void GDCM_NAME_SPACE::JPEGFragmentsInfo::AddFragment JPEGFragment fragment  )  [private]
 

Definition at line 66 of file gdcmJPEGFragmentsInfo.cxx.

References Fragments.

Referenced by GDCM_NAME_SPACE::File::ComputeJPEGFragmentInfo().

00067 {
00068    Fragments.push_back(fragment);
00069 }

void GDCM_NAME_SPACE::JPEGFragmentsInfo::DecompressFromFile std::ifstream *  fp,
uint8_t *  buffer,
int  nBits,
int  numBytes,
int  length
[private]
 

Definition at line 49 of file gdcmJPEGFragmentsInfo.cxx.

References Fragments, and StateSuspension.

Referenced by GDCM_NAME_SPACE::PixelReadConvert::ReadAndDecompressJPEGFile().

00050 {
00051    // Pointer to the Raw image
00052    uint8_t *localRaw = buffer;
00053 
00054   // Loop on the fragment[s]
00055    JPEGFragmentsList::const_iterator it;
00056    for( it  = Fragments.begin();
00057         it != Fragments.end();
00058         ++it )
00059    {
00060      (*it)->DecompressJPEGFramesFromFile(fp, localRaw, nBits, StateSuspension);
00061      // update pointer to image after some scanlines read:
00062      localRaw = (*it)->GetImage();
00063    }
00064 }

JPEGFragment * GDCM_NAME_SPACE::JPEGFragmentsInfo::GetFirstFragment  )  [private]
 

Definition at line 71 of file gdcmJPEGFragmentsInfo.cxx.

References Fragments, and ItFragments.

Referenced by GDCM_NAME_SPACE::PixelReadConvert::ReadAndDecompressJPEGFile().

00072 {
00073    ItFragments = Fragments.begin();
00074    if (ItFragments != Fragments.end())
00075       return  *ItFragments;
00076    return NULL;
00077 }

unsigned int GDCM_NAME_SPACE::JPEGFragmentsInfo::GetFragmentCount  )  [private]
 

Definition at line 89 of file gdcmJPEGFragmentsInfo.cxx.

References Fragments.

Referenced by GDCM_NAME_SPACE::PixelReadConvert::ReadAndDecompressJPEGFile().

00090 {
00091    return Fragments.size();
00092 }

JPEGFragment * GDCM_NAME_SPACE::JPEGFragmentsInfo::GetNextFragment  )  [private]
 

Definition at line 79 of file gdcmJPEGFragmentsInfo.cxx.

References Fragments, gdcmAssertMacro, and ItFragments.

Referenced by GDCM_NAME_SPACE::PixelReadConvert::ReadAndDecompressJPEGFile().

00080 {
00081    gdcmAssertMacro (ItFragments != Fragments.end());
00082 
00083    ++ItFragments;
00084    if (ItFragments != Fragments.end())
00085       return  *ItFragments;
00086    return NULL;
00087 }

void GDCM_NAME_SPACE::JPEGFragmentsInfo::Print std::ostream &  os = std::cout,
std::string const &  indent = ""
[private]
 

Print self.

Parameters:
os Stream to print to.
indent Indentation string to be prepended during printing.

Definition at line 107 of file gdcmJPEGFragmentsInfo.cxx.

References Fragments.

00108 {
00109    os << std::endl;
00110    os << indent
00111       << "----------------- JPEG fragments --------------------------------"
00112       << std::endl << std::endl;
00113    os << indent
00114       << "Total number of fragments : " << Fragments.size()
00115       << std::endl;
00116    int fragmentNumber = 0;
00117    for(JPEGFragmentsList::iterator it  = Fragments.begin();
00118                                    it != Fragments.end();
00119                                  ++it)
00120    {
00121       os << indent
00122          << "   fragment number :" << fragmentNumber++;
00123       (*it)->Print( os, indent + "   ");
00124    }
00125    os << std::endl;
00126 }


Friends And Related Function Documentation

friend class File [friend]
 

Definition at line 42 of file gdcmJPEGFragmentsInfo.h.

friend class PixelReadConvert [friend]
 

Definition at line 43 of file gdcmJPEGFragmentsInfo.h.


Member Data Documentation

JPEGFragmentsList GDCM_NAME_SPACE::JPEGFragmentsInfo::Fragments [private]
 

Definition at line 65 of file gdcmJPEGFragmentsInfo.h.

Referenced by AddFragment(), DecompressFromFile(), GetFirstFragment(), GetFragmentCount(), GetNextFragment(), Print(), and ~JPEGFragmentsInfo().

JPEGFragmentsList::iterator GDCM_NAME_SPACE::JPEGFragmentsInfo::ItFragments [private]
 

Definition at line 66 of file gdcmJPEGFragmentsInfo.h.

Referenced by GetFirstFragment(), and GetNextFragment().

char* GDCM_NAME_SPACE::JPEGFragmentsInfo::pimage [private]
 

Definition at line 64 of file gdcmJPEGFragmentsInfo.h.

void* GDCM_NAME_SPACE::JPEGFragmentsInfo::SampBuffer [private]
 

Definition at line 63 of file gdcmJPEGFragmentsInfo.h.

int GDCM_NAME_SPACE::JPEGFragmentsInfo::StateSuspension [private]
 

Definition at line 62 of file gdcmJPEGFragmentsInfo.h.

Referenced by DecompressFromFile(), and JPEGFragmentsInfo().


The documentation for this class was generated from the following files:
Generated on Fri Aug 24 13:01:50 2007 for gdcm by  doxygen 1.4.6