X-Git-Url: https://git.creatis.insa-lyon.fr/pubgit/?a=blobdiff_plain;f=src%2FgdcmRLE.cxx;h=4387ebcfd78bb1460a1b434c9c886a81399184ab;hb=2ad968707c3eea27dff9d8dd5f4caf9f7b6c4d6e;hp=33986e46639810263615efa9677b2b320f6a06e2;hpb=2fde1103e77a2448cce41d061781d0ec89ef239b;p=gdcm.git diff --git a/src/gdcmRLE.cxx b/src/gdcmRLE.cxx index 33986e46..4387ebcf 100644 --- a/src/gdcmRLE.cxx +++ b/src/gdcmRLE.cxx @@ -1,33 +1,21 @@ - +// gdcmRLE.cxx +//----------------------------------------------------------------------------- #include #include "gdcmFile.h" #include /* to declare isprint() */ #define str2num(str, typeNum) *((typeNum *)(str)) -static int _gdcm_read_RLE_fragment (char ** image_buffer, - long lengthToDecode, - long uncompressedSegmentSize, - FILE* fp); -// static because nothing but gdcm_read_RLE_file may call it - -// ---------------------------------------------------------------------------- +//----------------------------------------------------------------------------- /** * \ingroup gdcmFile * \brief Reads a 'Run Length Encoded' Dicom encapsulated file + * @param fp already open File Pointer * @param image_buffer destination Address (in caller's memory space) * at which the pixel data should be copied * - * @return int acts as a Boolean + * @return Boolean */ - -// This is a debug version. -// Forget the printf as they will be removed -// as soon as the last Heuristics are checked - -// pb with RLE 16 Bits : - - bool gdcmFile::gdcm_read_RLE_file (FILE *fp,void * image_buffer) { long fragmentBegining; // for ftell, fseek char * im = (char *)image_buffer; @@ -96,7 +84,7 @@ bool gdcmFile::gdcm_read_RLE_file (FILE *fp,void * image_buffer) { RleSegmentLength[k]=RleSegmentOffsetTable[k+1]-RleSegmentOffsetTable[k]; ftellRes=ftell(fp); fragmentBegining=ftell(fp); - _gdcm_read_RLE_fragment (&im, RleSegmentLength[k],uncompressedSegmentSize,fp); + gdcm_read_RLE_fragment (&im, RleSegmentLength[k],uncompressedSegmentSize,fp); fseek(fp,fragmentBegining,SEEK_SET); fseek(fp,RleSegmentLength[k],SEEK_CUR); } @@ -104,7 +92,7 @@ bool gdcmFile::gdcm_read_RLE_file (FILE *fp,void * image_buffer) { RleSegmentLength[nbRleSegments] = fragmentLength - RleSegmentOffsetTable[nbRleSegments]; ftellRes=ftell(fp); fragmentBegining=ftell(fp); - _gdcm_read_RLE_fragment (&im, RleSegmentLength[nbRleSegments],uncompressedSegmentSize, fp); + gdcm_read_RLE_fragment (&im, RleSegmentLength[nbRleSegments],uncompressedSegmentSize, fp); fseek(fp,fragmentBegining,SEEK_SET); fseek(fp,RleSegmentLength[nbRleSegments],SEEK_CUR); @@ -146,20 +134,10 @@ bool gdcmFile::gdcm_read_RLE_file (FILE *fp,void * image_buffer) { } - /* -------------------------------------------------------------------- */ - // - // RLE LossLess Fragment - // - /* -------------------------------------------------------------------- */ - - // static because nothing but gdcm_read_RLE_file can call it - // DO NOT doxygen ! - -static int -_gdcm_read_RLE_fragment (char ** areaToRead, - long lengthToDecode, - long uncompressedSegmentSize, - FILE* fp) { +// ---------------------------------------------------------------------------- +// RLE LossLess Fragment +int gdcmFile::gdcm_read_RLE_fragment(char **areaToRead, long lengthToDecode, + long uncompressedSegmentSize, FILE *fp) { long ftellRes; int count; long numberOfOutputBytes=0; @@ -167,7 +145,6 @@ _gdcm_read_RLE_fragment (char ** areaToRead, ftellRes =ftell(fp); while(numberOfOutputBytes