X-Git-Url: https://git.creatis.insa-lyon.fr/pubgit/?a=blobdiff_plain;f=src%2FgdcmPixelReadConvert.cxx;h=2d6e0545343db63c889fafd913593a574c68624c;hb=786ec05267c2b2892666e1a2ee3ca8a5d2c877a1;hp=1439cdefbc5250267b30a5e6c3a9b4abb9976bb2;hpb=7ffa5a65da43145ef4cfe6a1bbd413842f7ee94e;p=gdcm.git diff --git a/src/gdcmPixelReadConvert.cxx b/src/gdcmPixelReadConvert.cxx index 1439cdef..2d6e0545 100644 --- a/src/gdcmPixelReadConvert.cxx +++ b/src/gdcmPixelReadConvert.cxx @@ -3,8 +3,8 @@ Program: gdcm Module: $RCSfile: gdcmPixelReadConvert.cxx,v $ Language: C++ - Date: $Date: 2004/12/14 08:31:30 $ - Version: $Revision: 1.10 $ + Date: $Date: 2004/12/16 11:37:03 $ + Version: $Revision: 1.12 $ Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de l'Image). All rights reserved. See Doc/License.txt or @@ -175,24 +175,24 @@ void PixelReadConvert::ReadAndDecompress12BitsTo16Bits( std::ifstream* fp ) */ bool PixelReadConvert::DecompressRLE16BitsFromRLE8Bits( int NumberOfFrames ) { - size_t PixelNumber = XSize * YSize; - size_t RawSize = XSize * YSize * NumberOfFrames; + size_t pixelNumber = XSize * YSize; + size_t rawSize = XSize * YSize * NumberOfFrames; // We assumed Raw contains the decoded RLE pixels but as // 8 bits per pixel. In order to convert those pixels to 16 bits // per pixel we cannot work in place within Raw and hence // we copy it in a safe place, say copyRaw. - uint8_t* copyRaw = new uint8_t[ RawSize * 2 ]; - memmove( copyRaw, Raw, RawSize * 2 ); + uint8_t* copyRaw = new uint8_t[ rawSize * 2 ]; + memmove( copyRaw, Raw, rawSize * 2 ); uint8_t* x = Raw; uint8_t* a = copyRaw; - uint8_t* b = a + PixelNumber; + uint8_t* b = a + pixelNumber; for ( int i = 0; i < NumberOfFrames; i++ ) { - for ( unsigned int j = 0; j < PixelNumber; j++ ) + for ( unsigned int j = 0; j < pixelNumber; j++ ) { *(x++) = *(b++); *(x++) = *(a++); @@ -1303,6 +1303,15 @@ bool PixelReadConvert::BuildRGBImage() return true; } +/** + * \brief Print self. + * @param os Stream to print to. + */ +void PixelReadConvert::Print( std::ostream &os ) +{ + Print("",os); +} + /** * \brief Print self. * @param indent Indentation string to be prepended during printing. @@ -1315,10 +1324,10 @@ void PixelReadConvert::Print( std::string indent, std::ostream &os ) << std::endl; os << indent << "Pixel Data: offset " << PixelOffset - << " x" << std::hex << PixelOffset << std::dec - << " length " << PixelDataLength - << " x" << std::hex << PixelDataLength << std::dec - << std::endl; + << " x(" << std::hex << PixelOffset << std::dec + << ") length " << PixelDataLength + << " x(" << std::hex << PixelDataLength << std::dec + << ")" << std::endl; if ( IsRLELossless ) {