/*
 * class PpmReader
 *
 * $Date$
 * $Revision$
 *
 */

#ifndef PPM_READER_HH__
#define PPM_READER_HH__

#include "WImage/PixmapReader.hh"

/** 
 * @addtogroup WImage 
 * @{ */

/**
 * A PPM file reader. Only PPMs version 6 are supported.
 */
class 
PpmReader: public PixmapReader
{
public:
  /** Constructor. Only calls the mother class' constructor to initialize
   * the {\em ImageArray} reference. 
   * @param name
   * the file name
   * @param images
   * the array of greyscale images for the values */
  PpmReader (char const * name, Image *images[])
    : PixmapReader (name, images, 3) { }

  /** Destructor - does nothing. */
  virtual ~PpmReader (void) {}

protected:
  /** Read the PPM file format. This does the actual work of reading and
   * parsing the image file. It gets called by the {\em read ()} method.
   * @return 
   * 0 if successful, -1 on read error, -2 on file format error. */
  virtual int readfmt (void);

}; /* class PpmReader */

/** @} */

#endif /* PPM_READER_HH__ */
