//---------------------------------------------------------------------------

#ifndef MainH
#define MainH
//---------------------------------------------------------------------------
#include <System.Classes.hpp>
#include <Vcl.Controls.hpp>
#include <Vcl.StdCtrls.hpp>
#include <Vcl.Forms.hpp>
#include "WCamera.hpp"
#include <Vcl.ComCtrls.hpp>
#include <Vcl.ExtCtrls.hpp>
#include <Vcl.XPMan.hpp>
//---------------------------------------------------------------------------
class TFormMain : public TForm
{
__published:  // IDE-managed Components
    TPanel *PanelTop;
    TLabel *LabelCamera;
    TLabel *LabelFormat;
    TLabel *LabelBorderColor;
    TComboBox *ComboBoxCamera;
    TComboBox *ComboBoxFormat;
    TCheckBox *CheckBoxAspectRatio;
    TButton *ButtonSaveCurrentImage;
    TColorBox *ColorBoxBorderColor;
    TCheckBox *CheckBoxStretch;
    TPanel *PanelRight;
    TLabel *LabelBacklightCompensation;
    TLabel *LabelBrightness;
    TLabel *LabelColorEnable;
    TLabel *LabelContrast;
    TLabel *LabelExposure;
    TLabel *LabelFocus;
    TLabel *LabelGain;
    TLabel *LabelGamma;
    TLabel *LabelHue;
    TLabel *LabelIris;
    TLabel *LabelPan;
    TLabel *LabelRoll;
    TLabel *LabelSaturation;
    TLabel *LabelSharpness;
    TLabel *LabelTilt;
    TLabel *LabelWhiteBalance;
    TLabel *LabelZoom;
    TTrackBar *TrackBarBacklightCompensation;
    TCheckBox *CheckBoxBacklightCompensation;
    TTrackBar *TrackBarBrightness;
    TCheckBox *CheckBoxBrightness;
    TTrackBar *TrackBarColorEnable;
    TCheckBox *CheckBoxColorEnable;
    TTrackBar *TrackBarContrast;
    TCheckBox *CheckBoxContrast;
    TTrackBar *TrackBarExposure;
    TCheckBox *CheckBoxExposure;
    TTrackBar *TrackBarFocus;
    TCheckBox *CheckBoxFocus;
    TTrackBar *TrackBarGain;
    TCheckBox *CheckBoxGain;
    TTrackBar *TrackBarGamma;
    TCheckBox *CheckBoxGamma;
    TTrackBar *TrackBarHue;
    TCheckBox *CheckBoxHue;
    TTrackBar *TrackBarIris;
    TCheckBox *CheckBoxIris;
    TTrackBar *TrackBarPan;
    TCheckBox *CheckBoxPan;
    TTrackBar *TrackBarRoll;
    TCheckBox *CheckBoxRoll;
    TTrackBar *TrackBarSaturation;
    TCheckBox *CheckBoxSaturation;
    TTrackBar *TrackBarSharpness;
    TCheckBox *CheckBoxSharpness;
    TTrackBar *TrackBarTilt;
    TCheckBox *CheckBoxTilt;
    TTrackBar *TrackBarWhiteBalance;
    TCheckBox *CheckBoxWhiteBalance;
    TTrackBar *TrackBarZoom;
    TCheckBox *CheckBoxZoom;
    TButton *ButtonDefaultValues;
    TPanel *PanelCenter;
    TPaintBox *PaintBox;
    TWCamera *WCamera;
  void __fastcall FormCreate(TObject *Sender);
  void __fastcall ComboBoxCameraChange(TObject *Sender);
  void __fastcall ComboBoxCameraDropDown(TObject *Sender);
  void __fastcall ComboBoxFormatChange(TObject *Sender);
  void __fastcall CheckBoxAspectRatioClick(TObject *Sender);
  void __fastcall ColorBoxBorderColorChange(TObject *Sender);
  void __fastcall ButtonSaveCurrentImageClick(TObject *Sender);
  void __fastcall ButtonDefaultValuesClick(TObject *Sender);
  void __fastcall TrackBarChange(TObject *Sender);
  void __fastcall CheckBoxClick(TObject *Sender);
  void __fastcall PanelCenterResize(TObject *Sender);
  void __fastcall FormDestroy(TObject *Sender);
    void __fastcall CheckBoxStretchClick(TObject *Sender);
    void __fastcall WCameraImageAvailable(TObject *Sender, double SampleTime);
    void __fastcall PaintBoxPaint(TObject *Sender);
private:  // User declarations
  TWCameraFormat Format;
  TMemoryStream *MemoryStream;
  TBitmap *Bitmap;
  void __fastcall SetDevices();
  void __fastcall SetFormats();
  void __fastcall SetTrackBars();
  void __fastcall StartDevice();
  void __fastcall UpdateVideoPosition();
public:    // User declarations
  __fastcall TFormMain(TComponent* Owner);
};
//---------------------------------------------------------------------------
extern PACKAGE TFormMain *FormMain;
//---------------------------------------------------------------------------
#endif
