]> Creatis software - gdcm.git/blobdiff - src/gdcmJPEGFragment.cxx
ENH: Pass 2 at cleaning the JPEG mess. Still some work to do, but things are getting...
[gdcm.git] / src / gdcmJPEGFragment.cxx
index 65b9e3934194c56ba32ba301bef8559ba4f53116..e3569967180264d0184d685be5bddf91c9556228 100644 (file)
@@ -3,8 +3,8 @@
   Program:   gdcm
   Module:    $RCSfile: gdcmJPEGFragment.cxx,v $
   Language:  C++
-  Date:      $Date: 2005/01/31 03:22:25 $
-  Version:   $Revision: 1.10 $
+  Date:      $Date: 2005/01/31 04:00:04 $
+  Version:   $Revision: 1.11 $
                                                                                 
   Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de
   l'Image). All rights reserved. See Doc/License.txt or
@@ -38,8 +38,6 @@ JPEGFragment::JPEGFragment()
    Offset = 0;
    Length = 0;
 
-//   StateSuspension = 0;
-//   void *SampBuffer;
    pImage = 0;
 
 }
@@ -73,27 +71,18 @@ void JPEGFragment::DecompressJPEGFramesFromFile(std::ifstream *fp,
 
    if ( nBits == 8 )
    {
-      // JPEG Lossy : call to IJG 6b
-      if ( ! this->gdcm_read_JPEG_file8( fp, buffer, statesuspension) )
-      {
-         //return false;
-      }
+      // JPEG Lossy : call to IJG 6b - 8 bits
+      ReadJPEGFile8( fp, buffer, statesuspension);
    }
    else if ( nBits <= 12 )
    {
-      // Reading Fragment pixels
-      if ( ! this->gdcm_read_JPEG_file12 ( fp, buffer, statesuspension) )
-      {
-         //return false;
-      }
+      // JPEG Lossy : call to IJG 6b - 8 bits
+      ReadJPEGFile12 ( fp, buffer, statesuspension);
    }
    else if ( nBits <= 16 )
    {
-      // Reading Fragment pixels
-      if ( ! this->gdcm_read_JPEG_file16 ( fp, buffer, statesuspension) )
-      {
-         //return false;
-      }
+      // JPEG Lossy : call to IJG 6b - 8 bits
+      ReadJPEGFile16 ( fp, buffer, statesuspension);
       //gdcmAssertMacro( IsJPEGLossless );
    }
    else
@@ -103,9 +92,7 @@ void JPEGFragment::DecompressJPEGFramesFromFile(std::ifstream *fp,
 
       // other JPEG lossy not supported
       gdcmErrorMacro( "Unknown jpeg lossy compression ");
-      //return false;
    }
-
 }
 
 } // end namespace gdcm