IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Ignore:
Timestamp:
Jun 1, 2015, 8:56:11 AM (11 years ago)
Author:
eugene
Message:

extending gfits_table_get_ APIs to allow separate scaling from swapping, in prep of using compression on tables

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/eam_branches/ohana.20150429/src/libautocode/def/autocode.c

    r29537 r38344  
    2727/*** add test of EXTNAME and header-defined columns? ***/
    2828/* return internal structure representation */
    29 $STRUCT *gfits_table_get_$STRUCT (FTable *ftable, off_t *Ndata, char *swapped) {
     29/* scaledData & nativeBytes describe the current state of the ftable.buffer */
     30$STRUCT *gfits_table_get_$STRUCT (FTable *ftable, off_t *Ndata, char *scaledValue, char *nativeOrder) {
    3031
    3132  int Ncols;
     
    4041  *Ndata = ftable[0].header[0].Naxis[1];
    4142  data = ($STRUCT *) ftable[0].buffer;
    42   if ((swapped == NULL) || (*swapped == FALSE)) {
     43
     44  // if the pointer is not passed, we need to swap
     45  if (!nativeOrder || !*nativeOrder) {
    4346    if (!gfits_convert_$STRUCT (data, sizeof ($STRUCT), *Ndata)) {
    4447      return NULL;
    4548    }
     49    if (nativeOrder) *nativeOrder = TRUE;
     50  }
     51  // if the pointer is not passed, we need to scale
     52  if (!scaledValue || !*scaledValue) {
    4653    gfits_table_scale_data (ftable);
    47     if (swapped != NULL) *swapped = TRUE;
     54    if (scaledValue) *scaledValue = TRUE;
    4855  }
    4956  return (data);
Note: See TracChangeset for help on using the changeset viewer.