Main Page | Namespace List | Class Hierarchy | Alphabetical List | Class List | File List | Namespace Members | Class Members | File Members | Related Pages

gdcm::JPEGFragment Class Reference

*very* internal class . Shouldn't appear here ! Utility class for summerizing the informations of a JPEG fragment of an "Encapsulated JPEG Compressed Image". This information is a mix of: -the fragment offset -the fragment length More...

#include <gdcmJPEGFragment.h>

List of all members.

Public Member Functions

 JPEGFragment ()
 Default constructor.

void Print (std::ostream &os=std::cout, std::string indent="")
 Print self.

void DecompressJPEGFramesFromFile (std::ifstream *fp, uint8_t *buffer, int nBits, int &statesuspension)
 Decompress 8bits JPEG Fragment.

bool ReadJPEGFile8 (std::ifstream *fp, void *image_buffer, int &statesuspension)
bool ReadJPEGFile12 (std::ifstream *fp, void *image_buffer, int &statesuspension)
bool ReadJPEGFile16 (std::ifstream *fp, void *image_buffer, int &statesuspension)
void SetLength (uint32_t length)
uint32_t GetLength ()
void SetOffset (uint32_t offset)
uint32_t GetOffset ()
uint8_t * GetImage ()

Private Attributes

uint32_t Offset
uint32_t Length
uint8_t * pImage


Detailed Description

*very* internal class . Shouldn't appear here ! Utility class for summerizing the informations of a JPEG fragment of an "Encapsulated JPEG Compressed Image". This information is a mix of: -the fragment offset -the fragment length

Each instance of this class (they can be as many instances for a given Document as they are JPEG fragments and they are collected in a JPEGFragmentsInfo )

Definition at line 42 of file gdcmJPEGFragment.h.


Constructor & Destructor Documentation

gdcm::JPEGFragment::JPEGFragment  ) 
 

Default constructor.

Definition at line 38 of file gdcmJPEGFragment.cxx.

References pImage.

00039 {
00040    Offset = 0;
00041    Length = 0;
00042 
00043    pImage = 0;
00044 
00045 }


Member Function Documentation

void gdcm::JPEGFragment::DecompressJPEGFramesFromFile std::ifstream *  fp,
uint8_t *  buffer,
int  nBits,
int &  statesuspension
 

Decompress 8bits JPEG Fragment.

Parameters:
fp ifstream to write to
buffer output (data decompress)
nBits 8/12 or 16 bits jpeg
statesuspension state suspension

Definition at line 56 of file gdcmJPEGFragment.cxx.

References gdcmErrorMacro, ReadJPEGFile12(), ReadJPEGFile16(), and ReadJPEGFile8().

00059 {
00060    // First thing need to reset file to proper position:
00061    fp->seekg( Offset, std::ios::beg);
00062 
00063    if ( nBits == 8 )
00064    {
00065       // JPEG Lossy : call to IJG 6b - 8 bits
00066       ReadJPEGFile8( fp, buffer, statesuspension);
00067    }
00068    else if ( nBits <= 12 )
00069    {
00070       // JPEG Lossy : call to IJG 6b - 12 bits
00071       ReadJPEGFile12 ( fp, buffer, statesuspension);
00072    }
00073    else if ( nBits <= 16 )
00074    {
00075       // JPEG Lossy : call to IJG 6b - 16 bits
00076       ReadJPEGFile16 ( fp, buffer, statesuspension);
00077       //gdcmAssertMacro( IsJPEGLossless );
00078    }
00079    else
00080    {
00081       // FIXME : only the bits number is checked,
00082       //         NOT the compression method
00083 
00084       // other JPEG lossy not supported
00085       gdcmErrorMacro( "Unknown jpeg lossy compression ");
00086    }
00087 }

uint8_t* gdcm::JPEGFragment::GetImage  )  [inline]
 

Definition at line 59 of file gdcmJPEGFragment.h.

00059 { return pImage;   };

uint32_t gdcm::JPEGFragment::GetLength  )  [inline]
 

Definition at line 56 of file gdcmJPEGFragment.h.

Referenced by fill_input_buffer().

00056 { return Length;   };

uint32_t gdcm::JPEGFragment::GetOffset  )  [inline]
 

Definition at line 58 of file gdcmJPEGFragment.h.

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

00058 { return Offset;   };

void gdcm::JPEGFragment::Print std::ostream &  os = std::cout,
std::string  indent = ""
 

Print self.

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

Definition at line 102 of file gdcmJPEGFragment.cxx.

00103 {
00104    os << indent
00105       << "JPEG fragment: offset : " <<  Offset
00106       << "   length : " <<  Length
00107       << std::endl;
00108 }

bool gdcm::JPEGFragment::ReadJPEGFile12 std::ifstream *  fp,
void *  image_buffer,
int &  statesuspension
 

Referenced by DecompressJPEGFramesFromFile().

bool gdcm::JPEGFragment::ReadJPEGFile16 std::ifstream *  fp,
void *  image_buffer,
int &  statesuspension
 

Referenced by DecompressJPEGFramesFromFile().

bool gdcm::JPEGFragment::ReadJPEGFile8 std::ifstream *  fp,
void *  image_buffer,
int &  statesuspension
 

Referenced by DecompressJPEGFramesFromFile().

void gdcm::JPEGFragment::SetLength uint32_t  length  )  [inline]
 

Definition at line 55 of file gdcmJPEGFragment.h.

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

00055 { Length = length; };

void gdcm::JPEGFragment::SetOffset uint32_t  offset  )  [inline]
 

Definition at line 57 of file gdcmJPEGFragment.h.

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

00057 { Offset = offset; };


Member Data Documentation

uint32_t gdcm::JPEGFragment::Length [private]
 

Definition at line 63 of file gdcmJPEGFragment.h.

uint32_t gdcm::JPEGFragment::Offset [private]
 

Definition at line 62 of file gdcmJPEGFragment.h.

uint8_t* gdcm::JPEGFragment::pImage [private]
 

Definition at line 65 of file gdcmJPEGFragment.h.

Referenced by JPEGFragment().


The documentation for this class was generated from the following files:
Generated on Thu Feb 10 22:18:10 2005 for gdcm by doxygen 1.3.6