]> Creatis software - gdcm.git/blobdiff - src/gdcmJpeg2000.cxx
ENH: NEW FEATURE: TagKey is now a union of two uint16_t instead of string this greatl...
[gdcm.git] / src / gdcmJpeg2000.cxx
index 74b41960fdbacdcaae5fd392ef6b3ec892433a61..0a08e2e11dd1ea68454155051a30b6d28b576038 100644 (file)
@@ -3,8 +3,8 @@
   Program:   gdcm
   Module:    $RCSfile: gdcmJpeg2000.cxx,v $
   Language:  C++
-  Date:      $Date: 2005/06/02 12:37:21 $
-  Version:   $Revision: 1.22 $
+  Date:      $Date: 2005/07/11 14:37:53 $
+  Version:   $Revision: 1.26 $
                                                                                 
   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,11 @@ namespace gdcm
 
 bool gdcm_read_JPEG2000_file (void* raw, char *inputdata, size_t inputlength)
 {
+#if 0
+  std::ofstream out("/tmp/jpeg2000.jpc");
+  out.write((char*)inputdata,inputlength);
+  out.close();
+#endif
   jas_init(); //important...
   jas_stream_t *jasStream = 
     jas_stream_memopen((char *)inputdata, inputlength);
@@ -61,10 +66,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);
-  printf("%s %d %d %d %d %ld\n", fmtname, numcmpts, width, height, prec, (long) jas_image_rawsize(jasImage));
 
-  // 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)
@@ -97,6 +100,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;