/** @file  pmSubtractBias.h
 *
 *  This file will contain a module which will subtract the detector bias
 *  in place from an input image.
 *
 *  @author George Gusciora, MHPCC
 *
 *  @version $Revision: 1.4 $ $Name: not supported by cvs2svn $
 *  @date $Date: 2004-10-14 18:30:08 $
 *
 *  Copyright 2004 Maui High Performance Computing Center, University of Hawaii
 *
 */

#if !defined(PM_SUBTRACT_BIAS_H)
#define PM_SUBTRACT_BIAS_H

#if HAVE_CONFIG_H
#include <config.h>
#endif

#include<stdio.h>
#include<math.h>
#include "pslib.h"
// XXX: have Desonia do this correctly.
#include "../../psLib/src/dataManip/psConstants.h"

typedef enum {
    PM_OVERSCAN_NONE,                         ///< No overscan subtraction
    PM_OVERSCAN_ROWS,                         ///< Subtract rows
    PM_OVERSCAN_COLUMNS,                      ///< Subtract columns
    PM_OVERSCAN_ALL                           ///< Subtract the statistic of all pixels in overscan region
} pmOverscanAxis;

typedef enum {
    PM_FIT_NONE,                              ///< No fit
    PM_FIT_POLYNOMIAL,                        ///< Fit polynomial
    PM_FIT_SPLINE                             ///< Fit cubic splines
} pmFit;

psReadout *pmSubtractBias(psReadout *in,
                          void *fitSpec,
                          const psList *overscans,
                          pmOverscanAxis overScanAxis,
                          psStats *stat,
                          int nBin,
                          pmFit fit,
                          const psReadout *bias);

#endif
