//---------------------------------------------------------------------------
#ifndef jpgimageH
#define jpgimageH
//---------------------------------------------------------------------------
#include <SysUtils.hpp>
#include <Controls.hpp>
#include <Classes.hpp>
#include <Forms.hpp>

#include "jpegenco.h"
#include "jpegdeco.h"

//---------------------------------------------------------------------------
class PACKAGE TJpegImage : public TGraphic
{
private:
  BitmapImage image ;
  JpegEncoder encoder ;
  JpegDecoder decoder ;

  Graphics::TBitmap *bitmap ;

protected:
    virtual JpegEncoder * __fastcall GetEncoder () ;

public:
    virtual __fastcall TJpegImage();
    virtual __fastcall ~TJpegImage();
    virtual void __fastcall Draw (TCanvas *canvas, const TRect &rect) ;
    virtual bool __fastcall GetEmpty () ;
    virtual int __fastcall GetHeight () ;
    virtual int __fastcall GetWidth () ;
    virtual void __fastcall  SetHeight (int) ;
    virtual void __fastcall  SetWidth (int) ;
    virtual void __fastcall LoadFromStream (TStream *) ;
    virtual void __fastcall SaveToStream (TStream *) ;
    virtual void __fastcall LoadFromClipboardFormat (Word, int, HPALETTE) ;
    virtual void __fastcall SaveToClipboardFormat (Word &, int &, HPALETTE &) ;
    virtual void __fastcall SetPalette (HPALETTE) ;
    virtual void __fastcall Assign (TPersistent *source) ;
    virtual void __fastcall AssignTo (TPersistent *dest) ;

    __property JpegEncoder *Encoder = { read = GetEncoder } ;

__published:
};
//---------------------------------------------------------------------------
#endif
