/*------------------------------------------------------------------------------
 src/plugin/djImageIoVlut/io.h
 
 Copyright (c) 2004-2006 Darby Johnston.
 All rights reserved.
 Use is subject to license terms.
------------------------------------------------------------------------------*/

#ifndef DJ_IMAGE_IO_VLUT_IO_H
#define DJ_IMAGE_IO_VLUT_IO_H
#include "base.h"
#include <djImageIo.h>

namespace djImageIoVlut {

// Image load plugin.
//
class Load : public ImageLoad {
public:

  Load();
  ~Load();
  
  const Str name() const { return djImageIoVlut::name(); }
  Plugin * copy() const { return new Load(*this); }
  
  bool open(const Str & fileName, ImageIoInfo *);

protected:

  bool imageOpen(const Str & fileName, ImageIoInfo *);
  bool imageBegin(int frame, ImageIoInfo *);
  bool imageGet(PixelData *, int proxyScale);
  
private:

  Str _displayName;
  XHandle * _x;
  int _size;
};

// Image save plugin.
//
class Save : public ImageSave {
public:

  Save();
  ~Save();
  
  const Str name() const { return djImageIoVlut::name(); }
  Plugin * copy() const { return new Save(*this); }
  
  bool open(const Str & displayName, const ImageIoInfo &);

protected:

  bool imageOpen(const Str & fileName, const Image &);
  bool imageBegin(const Image &, int frame);
  bool imageSet(const PixelData &);
  
private:

  int _size;

  Str _displayName;
  XHandle * _x;
};

}

#endif
