#ifndef PM_CHIP_MOSAIC_H
#define PM_CHIP_MOSAIC_H

#include "pslib.h"
#include "pmFPA.h"

// Mosaic multiple images, with flips, binning and offsets
psImage *p_pmImageMosaic(const psArray *source, // Images to splice in
                         const psVector *xFlip, const psVector *yFlip, // Need to flip x and y?
                         const psVector *xBinSource, const psVector *yBinSource, // Binning in x and y of
                         // source images
                         int xBinTarget, int yBinTarget, // Binning in x and y of target images
                         const psVector *x0, const psVector *y0 // Offsets for source images on target
                        );

// Mosaic a chip together into a single cell with single readout
int pmChipMosaic(pmChip *chip,// Chip to mosaic
                 int xBinChip, int yBinChip // Binning of mosaic image in x and y
                );

// Mosaic all the cells in all (valid) chips together (neglecting the overscans); return number of chips
int pmFPAMosaicCells(pmFPA *fpa,        // FPA
                     int xBinChip, int yBinChip // Binning of mosaic image in x and y
                    );

#endif
