]> Creatis software - gdcm.git/blobdiff - src/gdcmJPEGFragment.cxx
Fix mistypings
[gdcm.git] / src / gdcmJPEGFragment.cxx
index 5aec9aa3a1711acf2bcb5c3422b4ad2a550a8fa5..3a50c996bbceac1474a271afba6cc4c04b95a17d 100644 (file)
@@ -3,8 +3,8 @@
   Program:   gdcm
   Module:    $RCSfile: gdcmJPEGFragment.cxx,v $
   Language:  C++
-  Date:      $Date: 2005/11/28 15:20:33 $
-  Version:   $Revision: 1.15 $
+  Date:      $Date: 2008/01/02 10:48:52 $
+  Version:   $Revision: 1.20 $
                                                                                 
   Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de
   l'Image). All rights reserved. See Doc/License.txt or
@@ -19,7 +19,7 @@
 #include "gdcmJPEGFragment.h"
 #include "gdcmDebug.h"
 
-namespace gdcm
+namespace GDCM_NAME_SPACE
 {
 //-------------------------------------------------------------------------
 // For JPEG 2000, body in file gdcmJpeg2000.cxx
@@ -67,11 +67,13 @@ void JPEGFragment::DecompressJPEGFramesFromFile(std::ifstream *fp,
    }
    else if ( nBits <= 12 )
    {
+       assert( nBits >= 8 );
       // JPEG Lossy : call to IJG 6b - 12 bits
       ReadJPEGFile12 ( fp, buffer, statesuspension);
    }
    else if ( nBits <= 16 )
    {
+       assert( nBits >= 12 );
       // JPEG Lossy : call to IJG 6b - 16 bits
       ReadJPEGFile16 ( fp, buffer, statesuspension);
       //gdcmAssertMacro( IsJPEGLossless );
@@ -82,7 +84,7 @@ void JPEGFragment::DecompressJPEGFramesFromFile(std::ifstream *fp,
       //         NOT the compression method
 
       // other JPEG lossy not supported
-      gdcmStaticErrorMacro( "Unknown jpeg lossy compression ");
+      gdcmErrorMacro( "Unknown jpeg lossy compression ");
    }
 }
 
@@ -99,11 +101,13 @@ void JPEGFragment::DecompressJPEGFramesFromFile(std::ifstream *fp,
  * @param os     Stream to print to.
  * @param indent Indentation string to be prepended during printing.
  */
-void JPEGFragment::Print( std::ostream &os, std::string indent )
+void JPEGFragment::Print( std::ostream &os, std::string const &indent )
 {
    os << indent
-      << "JPEG fragment: offset : " <<  Offset
-      << "   length : " <<  Length
+      << "JPEG fragment: offset : " <<  std::dec << Offset 
+      << " 0x(" << std::hex << Offset << ") "
+      << std::dec << "   length : " <<  Length
+      << " 0x(" << std::hex << Length << ") "      
       << std::endl;
 }