/** @file  pmFPAview.h
*
*  @brief Tools to manipulate the FPA structure elements.
*
*  @ingroup AstroImage
*
*  @author EAM, IfA
*
*  @version $Revision: 1.3 $ $Name: not supported by cvs2svn $
*  @date $Date: 2006-08-02 02:17:11 $
*
*  Copyright 2004-2005 Institute for Astronomy, University of Hawaii
*/

#ifndef PM_FPA_VIEW_H
#define PM_FPA_VIEW_H

#include "pmFPA.h"

/// @addtogroup AstroImage
/// @{

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);

// Reset a view
bool pmFPAviewReset(pmFPAview *view);

// determine the current view level
pmFPALevel pmFPAviewLevel (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
