/*
 * class VideoFile
 *
 * $Date$
 * $Revision$
 *
 */

#ifndef VIDEO_FILE_HH__
#define VIDEO_FILE_HH__

#include "WImage/VideoArray.hh"
#include "WImage/miscdefs.h"

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

/** 
 * An abstract image file. A framework to create readers and writers on
 * any color images.
 */
/*abstract*/
class 
VideoFile
{
public:
  
  /** Constructor. Initializes internal fields and gets an {\em ImageArray} 
   * object that may already contain an image or will get one later. 
   * @param name
   * the file name
   * @param arrays
   * the array of video arrays for the values 
   * @param channels
   * the number of colors 
   * @param frames the number of frames */
  VideoFile (char const *name, VideoArray < coeff > *arrays[], int channels,
             int frames);
  
  /** Destructor. Releases some memory. */
  virtual ~VideoFile (void);

  /** Returns the current color model.
   * @return the current color model */
  inline clrmodel colormodel (void) { return m_cmodel; }
  /** Sets a new color model.
   * @param cm the new color model */
  inline void colormodel (clrmodel cm) { m_cmodel = cm; }

  /** Return the number of channels. 
   * @return the number of channels */
  inline int channels (void) const { return m_channels; }

  /** Return the number of frames. 
   * @return the number of frames */
  inline int frames (void) const { return m_frames; }

  /** Return the color model. 
   * @return the color model */
  inline clrmodel colormodel (void) const { return m_cmodel; }

protected:

  /** The color channels. */
  VideoArray < coeff > **m_arrays;
  /** The number of channels (usually: colors). */
  int m_channels;
  /** The file name. The name of the file associated with this object. */
  char const * m_fname;
  /** The way the current image's colors are encoded. */
  clrmodel m_cmodel;
  /** The number of frames */
  int m_frames;
  
  /** internal initialization */
  void init (VideoArray < coeff > *videos[]);
}; /* class VideoFile */

/** @} */

#endif /* VIDEO_FILE_HH__ */
