X-Git-Url: https://git.creatis.insa-lyon.fr/pubgit/?a=blobdiff_plain;f=src%2FgdcmJPEGFragment.cxx;h=3a50c996bbceac1474a271afba6cc4c04b95a17d;hb=224876ca6cbe71952f2a1d66d9853eca7745d3a0;hp=5aec9aa3a1711acf2bcb5c3422b4ad2a550a8fa5;hpb=46afb30d2d016a9b1581c7ee4ca96d614a35203c;p=gdcm.git diff --git a/src/gdcmJPEGFragment.cxx b/src/gdcmJPEGFragment.cxx index 5aec9aa3..3a50c996 100644 --- a/src/gdcmJPEGFragment.cxx +++ b/src/gdcmJPEGFragment.cxx @@ -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; }