#ifndef PM_SUBTRACTION_MASK_H
#define PM_SUBTRACTION_MASK_H

#include <pslib.h>

/// Generate a mask for use in the subtraction process
psImage *pmSubtractionMask(const psImage *refMask, ///< Mask for the reference image (will be convolved)
                           const psImage *inMask, ///< Mask for the input image, or NULL
                           psMaskType maskVal, ///< Value to mask out
                           int size, ///< Half-size of the kernel (pmSubtractionKernels.size)
                           int footprint, ///< Half-size of the kernel footprint
                           float badFrac, ///< Maximum fraction of bad input pixels to accept
                           bool useFFT  ///< Use FFT to do convolution?
    );

/// Mark the non-convolved part of the image as blank
bool pmSubtractionBorder(psImage *image,///< Image
                         psImage *weight, ///< Weight map (or NULL)
                         psImage *mask, ///< Mask (or NULL)
                         int size,      ///< Kernel half-size
                         psMaskType blank ///< Mask value for blank regions
    );


#endif
