IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Ignore:
Timestamp:
Jun 3, 2015, 7:00:55 AM (11 years ago)
Author:
eugene
Message:

get the input / output / compressed pixels sizes right and get the byteswaps right

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/eam_branches/ohana.20150429/src/libfits/matrix/F_compress_utils.c

    r38355 r38356  
    101101  int i;
    102102
     103  // fprintf (stderr, "swapping %d bytes in pix of size %d bytes...\n", Nzdata, pixsize);
    103104  switch (pixsize) {
    104105    case 1:
     
    106107
    107108    case 2:
    108       for (i = 0; i < 2*Nzdata; i+=2) {
     109      for (i = 0; i < Nzdata; i+=2) {
    109110        DOSWAP (zdata[i+0], zdata[i+1]);
    110111      }
     
    112113
    113114    case 4:
    114       for (i = 0; i < 4*Nzdata; i+=4) {
     115      for (i = 0; i < Nzdata; i+=4) {
    115116        DOSWAP (zdata[i+0], zdata[i+3]);
    116117        DOSWAP (zdata[i+1], zdata[i+2]);
     
    119120
    120121    case 8:
    121       for (i = 0; i < 8*Nzdata; i+=8) {
     122      for (i = 0; i < Nzdata; i+=8) {
    122123        DOSWAP (zdata[i+0], zdata[i+7]);
    123124        DOSWAP (zdata[i+1], zdata[i+6]);
     
    168169
    169170    return (FALSE);
     171}
     172
     173int gfits_cmptype_valid (char *cmptype) {
     174
     175  if (!strcasecmp(cmptype, "NONE")) return TRUE;
     176  if (!strcasecmp(cmptype, "GZIP_1")) return TRUE;
     177  if (!strcasecmp(cmptype, "GZIP_2")) return TRUE;
     178  if (!strcasecmp(cmptype, "PLIO_1")) return TRUE;
     179  if (!strcasecmp(cmptype, "RICE_1")) return TRUE;
     180  if (!strcasecmp(cmptype, "RICE_ONE")) return TRUE;
     181  if (!strcasecmp(cmptype, "HCOMPRESS_1")) return TRUE;
     182  return FALSE;
    170183}
    171184
Note: See TracChangeset for help on using the changeset viewer.