/** @file  pmFPAview.h
*
*  @brief Tools to manipulate the FPA structure elements.
*
*  @ingroup AstroImage
*
*  @author EAM, IfA
*
*  @version $Revision: 1.1.2.8 $ $Name: not supported by cvs2svn $
*  @date $Date: 2006-03-29 20:55:42 $
*
*  Copyright 2004-2005 Institute for Astronomy, University of Hawaii
*/

#ifndef PM_FPA_VIEW_H
#define PM_FPA_VIEW_H

#include "pmFPA.h"

/// @addtogroup AstroImage
/// @{

// depth of interest
typedef enum {
    PM_FPA_DEPTH_NONE,
    PM_FPA_DEPTH_FPA,
    PM_FPA_DEPTH_CHIP,
    PM_FPA_DEPTH_CELL,
    PM_FPA_DEPTH_READOUT,
} pmFPAdepth;

typedef struct
{
    int chip;                           // Number of the chip, or -1 for all
    int cell;                           // Number of the cell, or -1 for all
    int readout;                        // Number of the readout, or -1 for all
    int nRows;                          // Maximum number of rows per readout segment read, or 0 for all
    int iRows;                          // Starting point for this read
}
pmFPAview;

// allocate a pmFPAview structure for this fpa and camera
pmFPAview *pmFPAviewAlloc (int nRows);

// determine the current view depth
pmFPAdepth pmFPAviewDepth (const pmFPAview *view);

// return the currently selected chip for this view
pmChip *pmFPAviewThisChip (const pmFPAview *view, pmFPA *fpa);

// advance view to the next chip
pmChip *pmFPAviewNextChip (pmFPAview *view, pmFPA *fpa, int nStep);

// return the currently selected cell for this view
pmCell *pmFPAviewThisCell (const pmFPAview *view, pmFPA *fpa);

// advance view to the next cell
pmCell *pmFPAviewNextCell (pmFPAview *view, pmFPA *fpa, int nStep);

// return the currently selected readout for this view
pmReadout *pmFPAviewThisReadout (const pmFPAview *view, pmFPA *fpa);

// advance view to the next readout
pmReadout *pmFPAviewNextReadout (pmFPAview *view, pmFPA *fpa, int nStep);

// return the HDU corresponding to the current view
pmHDU *pmFPAviewThisHDU (const pmFPAview *view, pmFPA *fpa);
pmHDU *pmFPAviewThisPHU (const pmFPAview *view, pmFPA *fpa);

# endif
