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

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

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

PixmapFile::PixmapFile (char const * name, Image *images[], int channels)
{
  m_fname = name;
  m_channels = channels;
  m_cmodel = cm_rgb;
  init (images);
}

PixmapFile::~PixmapFile (void)
{
  DELETEAR (m_images);
}

void
PixmapFile::init (Image *images[])
{
  if (m_channels > 0)
    {
      m_images = NEW (Image* [m_channels]);

      for (int i = 0; i < m_channels; i++)
        {
          m_images[i] = images[i];
        }
    }
  else
    {
      m_images = NULL;
    }
}

