Changeset 15656 for trunk/Ohana/src/libfits/matrix/F_compress_M.c
- Timestamp:
- Nov 20, 2007, 12:09:06 AM (19 years ago)
- File:
-
- 1 edited
-
trunk/Ohana/src/libfits/matrix/F_compress_M.c (modified) (5 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/Ohana/src/libfits/matrix/F_compress_M.c
r15655 r15656 30 30 int gfits_uncompress_image (Header *header, Matrix *matrix, FTable *ftable) { 31 31 32 int i, j, status, zimage, zcol, Nzrows, Nout, Nzdata, max_tile_size , bytes_per_pixel;32 int i, j, status, zimage, zcol, Nzrows, Nout, Nzdata, max_tile_size; 33 33 char cmptype[80]; 34 34 char zaxis[10], naxis[10], key[10], word[81], exttype[81], checksum[81], datasum[81]; … … 183 183 184 184 // size of a pixel in the output from the decompression routine 185 odata_pixsize = gfits_uncompressed_data_pixsize (cmptype );185 odata_pixsize = gfits_uncompressed_data_pixsize (cmptype, header[0].bitpix); 186 186 ALLOCATE (out, char, odata_pixsize*max_tile_size); 187 187 … … 201 201 202 202 // gfits_uncompress_data uncompresses from zdata to the temporary output buffer which must be allocated 203 if (!gfits_uncompress_data ((char *)zdata, Nzdata, cmptype, optname, optvalue, Noptions, out, &Nout, bytes_per_pixel)) return (FALSE);203 if (!gfits_uncompress_data ((char *)zdata, Nzdata, cmptype, optname, optvalue, Noptions, out, &Nout, odata_pixsize)) return (FALSE); 204 204 205 205 // copy the uncompressed pixels into their correct locations … … 346 346 // determine the offset of the next line relative to the start position 347 347 offset = counter[matrix->Naxes - 1]; 348 for (j = 1; j < matrix->Naxes; j++) {348 for (j = matrix->Naxes - 2; j >= 0; j--) { 349 349 offset = offset*matrix->Naxis[j] + counter[j]; 350 350 } … … 436 436 } 437 437 438 int gfits_uncompressed_data_pixsize (char *cmptype) { 439 440 if (!strcasecmp(cmptype, "GZIP")) { 441 return (0); 442 } 443 if (!strcasecmp(cmptype, "RICE") || !strcasecmp(cmptype, "RICE_1")) { 438 int gfits_uncompressed_data_pixsize (char *cmptype, int out_bitpix) { 439 440 if (!strcasecmp(cmptype, "GZIP_1")) { 444 441 return (4); 445 442 } 446 if (!strcasecmp(cmptype, "PLIO")) { 443 if (!strcasecmp(cmptype, "RICE_1")) { 444 return (4); 445 } 446 if (!strcasecmp(cmptype, "PLIO_1")) { 447 447 return (1); 448 448 } 449 if (!strcasecmp(cmptype, "HCOMPRESS")) { 450 return (4); 449 if (!strcasecmp(cmptype, "HCOMPRESS_1")) { 450 if (out_bitpix == 8) return (4); 451 if (out_bitpix == 16) return (4); 452 return (8); 451 453 } 452 454 return (0);
Note:
See TracChangeset
for help on using the changeset viewer.
