/*------------------------------------------------------------------------------
 src/plugin/djImageIoVlut/base.h
 
 Copyright (c) 2004-2006 Darby Johnston.
 All rights reserved.
 Use is subject to license terms.
 
 Requirements:
 
 * X.org Server - X Video Mode Extension
 * SGI X Server - X Video Control Extension
------------------------------------------------------------------------------*/

#ifndef DJ_IMAGE_IO_VLUT_BASE_H
#define DJ_IMAGE_IO_VLUT_BASE_H
#include <djBase.h>
#include <X11/Xlib.h>
#if defined(DJ_VLUT_XORG)
#include <X11/extensions/xf86vmode.h>
#elif defined(DJ_VLUT_XSGI)
#include <X11/extensions/XSGIvc.h>
#endif

namespace djImageIoVlut {
using namespace dj;

// Plugin name.
//
inline const Str name() { return "VLUT"; }

// X server handle.
//
class XHandle {
public:

  XHandle(const Str & displayName);
  ~XHandle();

  Display * display;
  int screen;
};

// Video LUT handle.
//
#if defined(DJ_VLUT_XORG)
class VlutHandle {
public:

  VlutHandle(int size, int channels);
  ~VlutHandle();

  unsigned short ** data;
  int size;
  int channels;
};
#elif defined(DJ_VLUT_XSGI)
class VlutHandle {
public:

  VlutHandle(int size, int channels);
  ~VlutHandle();

  unsigned short ** data;
  int size;
  int channels;
private:
  bool _internal;
};
#endif

}

#endif
