Program: gdcm
Module: $RCSfile: gdcmJpeg2000.cxx,v $
Language: C++
- Date: $Date: 2005/06/07 20:21:57 $
- Version: $Revision: 1.23 $
+ Date: $Date: 2005/07/11 18:10:29 $
+ Version: $Revision: 1.27 $
Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de
l'Image). All rights reserved. See Doc/License.txt or
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);
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)
//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;