X-Git-Url: https://git.creatis.insa-lyon.fr/pubgit/?a=blobdiff_plain;f=src%2FgdcmJpeg2000.cxx;h=5bcb13ea4bd3cad3f3c39d98218c97228a05ab3a;hb=21d241b3fdcf675d8d91a6daf6dfd6f448b68195;hp=524f0fc9abf6f09ea9f5de0364c7a22714e01119;hpb=f6e8309485468573c9154322921194f29337d7f6;p=gdcm.git diff --git a/src/gdcmJpeg2000.cxx b/src/gdcmJpeg2000.cxx index 524f0fc9..5bcb13ea 100644 --- a/src/gdcmJpeg2000.cxx +++ b/src/gdcmJpeg2000.cxx @@ -3,8 +3,8 @@ Program: gdcm Module: $RCSfile: gdcmJpeg2000.cxx,v $ Language: C++ - Date: $Date: 2005/06/07 20:21:57 $ - Version: $Revision: 1.23 $ + Date: $Date: 2005/09/20 09:24:10 $ + Version: $Revision: 1.28 $ Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de l'Image). All rights reserved. See Doc/License.txt or @@ -35,6 +35,12 @@ namespace gdcm bool gdcm_read_JPEG2000_file (void* raw, char *inputdata, size_t inputlength) { +#if 0 + std::cerr << "Inputlenght=" << inputlength << std::endl; + std::ofstream out("/tmp/jpeg2000.jpc", std::ios::binary); + out.write((char*)inputdata,inputlength); + out.close(); +#endif jas_init(); //important... jas_stream_t *jasStream = jas_stream_memopen((char *)inputdata, inputlength); @@ -47,7 +53,7 @@ bool gdcm_read_JPEG2000_file (void* raw, char *inputdata, size_t inputlength) } // Decode the image. - jas_image_t *jasImage = NULL; + jas_image_t *jasImage /* = NULL*/; // Useless assignation if (!(jasImage = jas_image_decode(jasStream, fmtid, 0))) { gdcmErrorMacro("cannot decode image"); @@ -61,9 +67,8 @@ bool gdcm_read_JPEG2000_file (void* raw, char *inputdata, size_t inputlength) int height = jas_image_cmptheight(jasImage, 0); int prec = jas_image_cmptprec(jasImage, 0); int i, j, k; - char *fmtname = jas_image_fmttostr(fmtid); - // The following should serioulsy be rewritten I cannot belive we need to + // The following should serioulsy be rewritten I cannot believe we need to // do a per pixel decompression, there should be a way to read a full // scanline... if (prec == 8) @@ -96,6 +101,11 @@ bool gdcm_read_JPEG2000_file (void* raw, char *inputdata, size_t inputlength) //FIXME //delete the jpeg temp buffer +#if 0 + std::ofstream rawout("/tmp/jpeg2000.raw"); + rawout.write((char*)raw,height*width*numcmpts*((prec+4)/8)); + rawout.close(); +#endif delete[] inputdata; return true;