#ifndef PP_STACK_H
#define PP_STACK_H

#define PPSTACK_RECIPE "PPSTACK"

#include <psmodules.h>

// Parse command-line arguments
bool ppStackArguments(int argc, char *argv[], // Command-line arguments
                      pmConfig *config  // Configuration
    );

// Parse cameras
bool ppStackCamera(pmConfig *config     // Configuration
    );

// Loop over the inputs, doing the combination
bool ppStackLoop(pmConfig *config       // Configuration
    );

// Perform stacking on a readout
bool ppStackReadout(pmConfig *config,   // Configuration
                    const pmFPAview *view // View for readout
    );

// Return software version
psString ppStackVersion(void);

// Return long description of software version
psString ppStackVersionLong(void);

// Supplement metadata with software version
void ppStackVersionMetadata(psMetadata *metadata // Metadata to supplement
    );

/// Convolve image to match specified seeing
bool ppStackMatch(pmReadout *output,    ///< Convolved readout
                  const pmReadout *input, ///< Readout to be convolved
                  const pmReadout *sourcesRO, ///< Readout with sources
                  const pmConfig *config ///< Configuration
    );

#endif
