#ifndef STREAKSEXTERN_H
#define STREAKSEXTERN_H

/** psLib includes */

#include "psImage.h"

/** streakremove includes */

#include "streaksastrom.h"

/** Equatorial coordinates of streak endpoints in radians */

typedef struct {
    double ra1;
    double dec1;
    double ra2;
    double dec2;
    double width;   /**< Width of streak in pixels */
} streak;

/** List of streak objects to map to image pixel positions */

typedef struct {
    unsigned int size;
    streak *list;
} Streaks;

/** Pixel position within an image */

typedef struct {
    unsigned int x; /**< X (column) pixel position */
    unsigned int y; /**< Y (row) pixel position */
} PixelPos;

/** For now, use psArray to define a list of PixelPos pointers */

typedef psImage StreakPixels;

/** Create a list of pixel positions from a Streaks pointer list
    converting the equatorial coordinates into the pixel coordinates
    using strkAstrom and building streak pixels using the specified
    width and store in StreakPixels object returned

    @param[in] streaks List of streak pointer objects to convert to
                       pixel positions output in StreakPixels
    @param[in] astrom Astrometry object for converting streak equatorial
                      coordinates into pixel positions
    @param[in] numCols number of columns in the image to map streak equatorial
                       coordinates into pixel positions
    @param[in] numRows number of rows in the image to map streak equatorial
                       coordinates into pixel positions
    @return list of PixelPos pointers for the streaks mapped to the image
            pixels
*/

extern StreakPixels *streak_on_component(Streaks *streaks, strkAstrom *astrom,
                                         int numCols, int numRows);

/** Read a list of streak equatorial coordinate definitions and width
    from a text file.  The format is:

    @verbatim
    numStreaks
    ra1 dec1 ra2 dec2 width
    @endverbatim

    @param[in] fileName path to streak text file to read
    @return a list of streak objects.  If there is an error in reading
            the text file, return NULL
*/

extern Streaks *readStreaksFile(char *fileName);

#endif /* STREAKSEXTERN_H */
