//---------------------------------------------------------------------------
#include <vcl.h>
#pragma hdrstop

#include "Unit1.h"
#include "Unit2.h"
#include "GifLZW.hpp"
#include "TIFLZW.hpp"
#include "ImageEnIO.hpp"
//---------------------------------------------------------------------------
#pragma package(smart_init)
#pragma link "IEOpenSaveDlg"
#pragma link "ImageEnIO"
#pragma link "ImageEnProc"
#pragma link "ImageEnView"
#pragma link "IEOpenSaveDlg"
#pragma link "ImageEnIO"
#pragma link "ImageEnProc"
#pragma link "ImageEnView"
#pragma link "IEOpenSaveDlg"
#pragma link "ImageEnIO"
#pragma link "ImageEnProc"
#pragma link "ImageEnView"
#pragma resource "*.dfm"
TForm1 *Form1;
//---------------------------------------------------------------------------
__fastcall TForm1::TForm1(TComponent* Owner)
        : TForm(Owner)
{
  DefGIF_LZWDECOMPFUNC=GIFLZWDecompress;
  DefGIF_LZWCOMPFUNC=GIFLZWCompress;
  DefTIFF_LZWDECOMPFUNC=TIFFLZWDecompress;
  DefTIFF_LZWCOMPFUNC=TIFFLZWCompress;
}
//---------------------------------------------------------------------------
// Open...
void __fastcall TForm1::Load1Click(TObject *Sender)
{
	if( OpenImageEnDialog1->Execute() )
   	ImageEnIO1->LoadFromFile( OpenImageEnDialog1->FileName );
}
//---------------------------------------------------------------------------
// Save...
void __fastcall TForm1::Save1Click(TObject *Sender)
{
	if( SaveImageEnDialog1->Execute() )
   	ImageEnIO1->SaveToFile( SaveImageEnDialog1->FileName );
}
//---------------------------------------------------------------------------
// Exit
void __fastcall TForm1::Exit1Click(TObject *Sender)
{
	Close();
}
//---------------------------------------------------------------------------
// Select TWain source...
void __fastcall TForm1::SelectTWainsource1Click(TObject *Sender)
{
	ImageEnIO1->SelectAcquireSource();
}
//---------------------------------------------------------------------------
// Acquire...
void __fastcall TForm1::Acquire1Click(TObject *Sender)
{
	ImageEnIO1->Acquire();
}
//---------------------------------------------------------------------------
// Dialogs->Color adjust...
void __fastcall TForm1::Coloradjust1Click(TObject *Sender)
{
        TPreviewEffects pe;
        pe << peContrast << peHSV << peHSL << peRGB  << peUserFilt << peEqualize << peFFT;
	ImageEnProc1->DoPreviews(pe);
}
//---------------------------------------------------------------------------
// Dialogs->Effects...
void __fastcall TForm1::Effects1Click(TObject *Sender)
{
        TPreviewEffects pe;
        pe << peBumpMap << peLens << peWave << peMorph << peRotate; 
	ImageEnProc1->DoPreviews(pe);
}
//---------------------------------------------------------------------------
// Tools->Histogram...
void __fastcall TForm1::Histogram1Click(TObject *Sender)
{
	Form2->ShowModal();
}
//---------------------------------------------------------------------------
// Edit->Undo
void __fastcall TForm1::Undo1Click(TObject *Sender)
{
	ImageEnProc1->Undo();
}
//---------------------------------------------------------------------------
// Edit->Cut
void __fastcall TForm1::Cut1Click(TObject *Sender)
{
	ImageEnProc1->SelCutToClip();
}
//---------------------------------------------------------------------------
// Edit->Copy
void __fastcall TForm1::Copy1Click(TObject *Sender)
{
	ImageEnProc1->SelCopyToClip();
}
//---------------------------------------------------------------------------
// Edit->Paste
void __fastcall TForm1::Paste1Click(TObject *Sender)
{
	ImageEnProc1->PasteFromClipboard();
}
//---------------------------------------------------------------------------

