/*
 * Implementation of class VideoFile
 *
 * $Date$
 * $Revision$
 *
 */

#include "WImage/VideoFile.hh"
#include "WImage/debug.h"
#include <stdexcept>

#if !(defined __WATCOMC__ && __WATCOMC__ < 1230)
using namespace std;
#endif

VideoFile::VideoFile (char const *name, VideoArray < coeff > *arrays[], 
                      int channels, int frames)
{
  m_fname = name;
  m_channels = channels;
  m_cmodel = cm_unknown;
  m_frames = frames;
  init (arrays);
}

VideoFile::~VideoFile (void)
{
  DELETE (m_arrays);
}

void
VideoFile::init (VideoArray < coeff > *arrays[])
{
  if (m_channels > 0)
    {
      m_arrays = NEW (VideoArray < coeff > * [m_channels]);
      
      for (int i = 0; i < m_channels; i++)
        {
          m_arrays[i] = arrays[i];
        }
    }
  else
    {
      m_arrays = NULL;
    }
}

