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

//#include "WImage/VideoArray.hh"
#include "WImage/ImageArray.hh"
#include "WImage/VideoFrame.hh"
#ifndef _WIN32_WCE
#include "WImage/PgmReader.hh"
#include "WImage/RawReader.hh"
#endif
#ifdef PFI
#include "WImage/PfgReader.hh"
#include "WImage/PfgWriter.hh"
#endif
#ifndef _WIN32_WCE
#include "WImage/PgmWriter.hh"
#include "WImage/RawWriter.hh"
#endif
#include <stdexcept>
#ifndef _WIN32_WCE
#include <iostream>
#endif
#include <cstring>
#include <cassert>

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

VideoFrame::VideoFrame (VideoArray < coeff > *va) : StillImage (true)
{
  m_ysize = va->rows ();
  m_xsize = va->cols ();
  m_xysize = m_ysize * m_xsize;
  m_coeffs = va;
  m_acol = NEW (ColumnVector (m_coeffs));
  m_arow = NEW (RowVector (m_coeffs));
  m_afull = NEW (FullVector (m_coeffs));
  m_asteps = m_ssteps = 0;
  m_coeffsMustDelete = false;
}

VideoFrame::~VideoFrame (void)
{
  // nothing to do since this is done by the parent class destructor
}

Image *
VideoFrame::clone (void) const
{
  Image *ret = NEW (StillImage (*m_coeffs));
  ret->anasteps (this->m_asteps);
  ret->synsteps (this->m_ssteps);
  return ret;
}

