#ifndef PM_SUBTRACTION_STAMPS_H
#define PM_SUBTRACTION_STAMPS_H

#include <pslib.h>

/// Status of stamp
typedef enum {
    PM_SUBTRACTION_STAMP_INIT,          ///< Initial state
    PM_SUBTRACTION_STAMP_USED,          ///< Use this stamp
    PM_SUBTRACTION_STAMP_REJECTED,      ///< This stamp has been rejected
    PM_SUBTRACTION_STAMP_CALCULATE,     ///< Calculate matrix and vector values for this stamp
    PM_SUBTRACTION_STAMP_NONE           ///< No stamp in this region
} pmSubtractionStampStatus;

/// A stamp for image subtraction
typedef struct {
    int x, y;                           ///< Position
    psImage *matrix;                    ///< Associated matrix
    psVector *vector;                   ///< Assoicated vector
    pmSubtractionStampStatus status;    ///< Status ofstamp
} pmSubtractionStamp;

/// Find stamps on an image
psArray *pmSubtractionFindStamps(psArray *stamps, ///< Output stamps, or NULL
                                 const psImage *image, ///< Image for which to find stamps
                                 const psImage *mask, ///< Mask
                                 float threshold, ///< Threshold for stamps in the image
                                 float spacing ///< Rough spacing for stamps
    );


#endif
