
/** @file  psImageIO.h
 *
 *  @brief Contains image input/output routines
 *
 *  This file defines the file input/output functions for the psImage structure.
 *
 *  @ingroup ImageIO
 *
 *  @author Robert DeSonia, MHPCC
 *
 *  @version $Revision: 1.9 $ $Name: not supported by cvs2svn $
 *  @date $Date: 2005-02-17 19:26:24 $
 *
 *  Copyright 2004-2005 Maui High Performance Computing Center, University of Hawaii
 */
#ifndef PS_IMAGEIO_H
#define PS_IMAGEIO_H

#include "psImage.h"

/// @addtogroup ImageIO
/// @{

/** Read an image or subimage from a FITS file specified by a filename.
 *
 *  return psImage* The image read from the specified file.  NULL
 *                          signifies that a problem had occured.
 */
psImage* psImageReadSection(
    psImage* output,
    /**< the output psImage to recycle, or NULL if new psImage desired */

    psS32 col0,
    /**< the column index of the origin to start reading */

    psS32 row0,
    /**< the row index of the origin to start reading */

    psS32 numCols,
    /**< the number of desired columns to read */

    psS32 numRows,
    /**< the number of desired rows to read */

    psS32 z,
    /**< the z index to read if file is organized as a 3D image cube. */

    char *extname,
    /**< the image extension to read (this should match the EXTNAME keyword in
        *   the extension If NULL, the extnum parameter is to be used instead
        */

    psS32 extnum,
    /**< the image extension to read (0=PHU, 1=first extension, etc.)  This is
        *   only used if extname is NULL
        */

    char *filename
    /**< the filename of the FITS image file to read */
);

/** Read an image or subimage from a FITS file specified by a filename.
 *
 *  return psBool         TRUE is successful, otherwise FALSE.
 */
psBool psImageWriteSection(
    psImage* input,
    /**< the psImage to write */

    psS32 col0,
    /**< the column index of the origin to start writing */

    psS32 row0,
    /**< the row index of the origin to start writing */

    psS32 z,
    /**< the z index to start writing */

    char *extname,
    /**< the image extension to write (this should match the EXTNAME keyword in
    *   the extension If NULL, the extnum parameter is to be used instead
    */

    psS32 extnum,
    /**< the image extension to write (0=PHU, 1=first extension, etc.)  This is
    *   only used if extname is NULL.
    */

    char *filename
    /**< the filename of the FITS image file to write */
);

/// @}

#endif
