/*------------------------------------------------------------------------------
 src/lib/djWidget/djImageIoDpxWidget.h
 
 Copyright (c) 2004-2006 Darby Johnston.
 All rights reserved.
 Use is subject to license terms.
------------------------------------------------------------------------------*/

#ifndef DJ_IMAGE_IO_DPX_WIDGET_H
#define DJ_IMAGE_IO_DPX_WIDGET_H
#include <djImageIoDpx.h>
#include <djEnumWidget.h>
#include <djImageIoWidget.h>

namespace dj {
class CheckButtonWidget;
class IntWidget;
class FloatWidget;
class FloatSliderWidget;
namespace ImageIoDpx {

// Image load widget.
//
class LoadWidget : public ImageLoadWidget {
public:

  LoadWidget();
  
  const Str name() const { return ImageIoDpx::name(); }
  Plugin * copy() const { return new LoadWidget; }
  
  void set(ImageLoad *);
  void widgetUpdate();
  
private:

  DJ_CALLBACK(LoadWidget, colorCallback, COLOR)
  DJ_CALLBACK(LoadWidget, printBlackCallback, double)
  DJ_CALLBACK(LoadWidget, printBlackCallback, int)
  DJ_CALLBACK(LoadWidget, printWhiteCallback, double)
  DJ_CALLBACK(LoadWidget, printWhiteCallback, int)
  DJ_CALLBACK(LoadWidget, printGammaCallback, double)
  DJ_CALLBACK(LoadWidget, printSoftClipCallback, double)
  DJ_CALLBACK(LoadWidget, printSoftClipCallback, int)

  EnumWidget<COLOR> * _colorWidget;
  IntWidget * _printBlackWidget, * _printWhiteWidget;
  FloatSliderWidget * _printBlackSlider, * _printWhiteSlider;
  FloatWidget * _printGammaWidget;
  FloatSliderWidget * _printGammaSlider;
  IntWidget * _printSoftClipWidget;
  FloatSliderWidget * _printSoftClipSlider;
  bool _callbacks;
};

// Image save widget.
//
class SaveWidget : public ImageSaveWidget {
public:

  SaveWidget();
  
  const Str name() const { return ImageIoDpx::name(); }
  Plugin * copy() const { return new SaveWidget; }
  
  void set(ImageSave *);
  void widgetUpdate();
  
private:

  DJ_CALLBACK(SaveWidget, colorCallback, COLOR)
  DJ_CALLBACK(SaveWidget, printBlackCallback, double)
  DJ_CALLBACK(SaveWidget, printBlackCallback, int)
  DJ_CALLBACK(SaveWidget, printWhiteCallback, double)
  DJ_CALLBACK(SaveWidget, printWhiteCallback, int)
  DJ_CALLBACK(SaveWidget, printGammaCallback, double)
  DJ_CALLBACK(SaveWidget, bitDepthCallback, BIT_DEPTH)
  DJ_CALLBACK(SaveWidget, channelsCallback, CHANNELS)
  DJ_CALLBACK(SaveWidget, packCallback, bool)
  DJ_CALLBACK(SaveWidget, endianCallback, ENDIAN)

  EnumWidget<COLOR> * _colorWidget;
  IntWidget * _printBlackWidget, * _printWhiteWidget;
  FloatSliderWidget * _printBlackSlider, * _printWhiteSlider;
  FloatWidget * _printGammaWidget;
  FloatSliderWidget * _printGammaSlider;
  EnumWidget<BIT_DEPTH> * _bitDepthWidget;
  EnumWidget<CHANNELS> * _channelsWidget;
  CheckButtonWidget * _packWidget;
  EnumWidget<ENDIAN> * _endianWidget;
  bool _callbacks;
};

}
}

#endif
