//-----------------------------------------------------------------------------
#ifndef WizardSaturationH
#define WizardSaturationH WizardSaturationH
//-----------------------------------------------------------------------------
#include <mvIMPACT_CPP/mvIMPACT_acquire.h>
#include <mvIMPACT_CPP/mvIMPACT_acquire_GenICam.h>
#include "ValuesFromUserDlg.h"
#include "spinctld.h"

class wxCheckBox;
class wxSlider;

//-----------------------------------------------------------------------------
class WizardSaturation : public OkAndCancelDlg
//-----------------------------------------------------------------------------
{
	DECLARE_EVENT_TABLE()
protected:
	//-----------------------------------------------------------------------------
	enum TWidgetIDs_Saturation
	//-----------------------------------------------------------------------------
	{
		widMainFrame = widFirst,
		widCBEnable,
		widSLSaturation,
		widSCSaturation
	};
	wxCheckBox*							pCBEnable_;
	wxSlider*							pSLSaturation_;
	wxSpinCtrlDbl*						pSCSaturation_;

	void ApplySaturation( void ) { ApplySaturation( pCBEnable_->GetValue(), pSLSaturation_->GetValue() / 1000. ); }
	virtual void ApplySaturation( const bool boEnable, const double K ) = 0;
	void CreateGUI( void );
	virtual void OnBtnCancel( wxCommandEvent& )       { Hide(); }
	virtual void OnBtnOk( wxCommandEvent& )           { Hide(); }
	void OnCBEnable( wxCommandEvent& )                { ApplySaturation(); }
	void OnSLSaturation( wxScrollEvent& e )           { pSCSaturation_->SetValue( static_cast<double>(e.GetPosition()) / 1000. ); ApplySaturation(); }
	void OnSCSaturationChanged( wxSpinEvent& )        { pSLSaturation_->SetValue( static_cast<int>(pSCSaturation_->GetValue() * 1000.) ); ApplySaturation(); }
	void OnSCSaturationTextChanged( wxCommandEvent& ) { pSLSaturation_->SetValue( static_cast<int>(pSCSaturation_->GetValue() * 1000.) ); ApplySaturation(); }
public:
	explicit WizardSaturation( wxWindow* pParent, const wxString& title );
};

//-----------------------------------------------------------------------------
class WizardSaturationViaColorTwist : public WizardSaturation
//-----------------------------------------------------------------------------
{
	mvIMPACT::acquire::ImageProcessing ip_;
protected:
	virtual void ApplySaturation( const bool boEnable, const double K );
public:
	explicit WizardSaturationViaColorTwist( wxWindow* pParent, const wxString& title, mvIMPACT::acquire::Device* pDev );
};

//-----------------------------------------------------------------------------
class WizardSaturationViaColorTransformationControl : public WizardSaturation
//-----------------------------------------------------------------------------
{
	mvIMPACT::acquire::GenICam::ColorTransformationControl ctc_;
protected:
	virtual void ApplySaturation( const bool boEnable, const double K );
public:
	explicit WizardSaturationViaColorTransformationControl( wxWindow* pParent, const wxString& title, mvIMPACT::acquire::Device* pDev );
};

#endif // WizardSaturationH
