Changeset 23724
- Timestamp:
- Apr 7, 2009, 12:45:31 PM (17 years ago)
- Location:
- trunk/Ohana/src/libfits
- Files:
-
- 1 added
- 3 edited
-
Makefile (modified) (1 diff)
-
extern/gzip.c (added)
-
matrix/F_compress_M.c (modified) (2 diffs)
-
matrix/F_uncompress_data.c (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/Ohana/src/libfits/Makefile
r16093 r23724 60 60 $(EXT)/fits_hdecompress.$(ARCH).o \ 61 61 $(EXT)/pliocomp.$(ARCH).o \ 62 $(EXT)/ricecomp.$(ARCH).o 62 $(EXT)/ricecomp.$(ARCH).o \ 63 $(EXT)/gzip.$(ARCH).o 63 64 64 65 OBJS = $(HEADER_OBJ) $(MATRIX_OBJ) $(TABLE_OBJ) $(EXTERN_OBJ) -
trunk/Ohana/src/libfits/matrix/F_compress_M.c
r20652 r23724 248 248 // XXX not certain this is the correct place to do the swap (or if zdata_pixsize is 249 249 // the correct size to guide the swap) 250 if (!gfits_byteswap_zdata (zdata, Nzdata, zdata_pixsize)) return (FALSE); 250 251 if (strcasecmp(cmptype, "GZIP_1")) { 252 if (!gfits_byteswap_zdata (zdata, Nzdata, zdata_pixsize)) return (FALSE); 253 } 251 254 252 255 // gfits_uncompress_data uncompresses from zdata to the temporary output buffer which must be allocated … … 496 499 497 500 if (!strcasecmp(cmptype, "GZIP_1")) { 498 return (4); 501 if (out_bitpix == 8) return (1); 502 if (out_bitpix == 16) return (2); 503 if (out_bitpix == 32) return (4); 504 if (out_bitpix == -32) return (4); 505 if (out_bitpix == -64) return (8); 506 return (1); 499 507 } 500 508 if (!strcasecmp(cmptype, "RICE_1")) { -
trunk/Ohana/src/libfits/matrix/F_uncompress_data.c
r18272 r23724 22 22 int pl_l2pi (short *ll_src, int xs, int *px_dst, int npix); 23 23 24 /* functions defined in gzip.c */ 25 int gfits_gz_stripheader (unsigned char *data, int *ndata); 26 int gfits_uncompress (Bytef *dest, uLongf *destLen, const Bytef *source, uLong sourceLen); 27 24 28 int gfits_uncompress_data (char *zdata, int Nzdata, char *cmptype, char **optname, char **optvalue, int Nopt, char *outdata, int *Nout, int out_pixsize) { 25 29 … … 30 34 if (!strcasecmp(cmptype, "GZIP_1")) { 31 35 unsigned long tNout = *Nout * out_pixsize; 36 37 // for GZIP data, I need to check for and remove the header on the first block: 38 gfits_gz_stripheader ((unsigned char *)zdata, &Nzdata); 39 32 40 // uncompress does not require us to know the expected number of pixel; it tells us the number 33 status = uncompress ((Bytef *) outdata, &tNout, (Bytef *) zdata, Nzdata);41 status = gfits_uncompress ((Bytef *) outdata, &tNout, (Bytef *) zdata, Nzdata); 34 42 if (status != Z_OK) { 35 43 fprintf (stderr, "error in uncompress (GZIP)\n"); 36 44 return (FALSE); 37 45 } 38 *Nout = tNout; 46 47 // the resulting uncompressed data is byteswapped 48 if (!gfits_byteswap_zdata (outdata, tNout, out_pixsize)) return (FALSE); 49 50 *Nout = tNout / out_pixsize; 39 51 return (TRUE); 40 52 }
Note:
See TracChangeset
for help on using the changeset viewer.
