home *** CD-ROM | disk | FTP | other *** search
/ Magazyn Internet 2000 May / MICD_2000_05.iso / CBuilder5 / INSTALL / DATA1.CAB / Program_Built_Files / Include / Vcl / jpeg.hpp < prev    next >
C/C++ Source or Header  |  2000-02-01  |  5KB  |  164 lines

  1. // Borland C++ Builder
  2. // Copyright (c) 1995, 1999 by Borland International
  3. // All rights reserved
  4.  
  5. // (DO NOT EDIT: machine generated header) 'jpeg.pas' rev: 5.00
  6.  
  7. #ifndef jpegHPP
  8. #define jpegHPP
  9.  
  10. #pragma delphiheader begin
  11. #pragma option push -w-
  12. #pragma option push -Vx
  13. #include <Graphics.hpp>    // Pascal unit
  14. #include <Classes.hpp>    // Pascal unit
  15. #include <SysUtils.hpp>    // Pascal unit
  16. #include <Windows.hpp>    // Pascal unit
  17. #include <SysInit.hpp>    // Pascal unit
  18. #include <System.hpp>    // Pascal unit
  19.  
  20. //-- user supplied -----------------------------------------------------------
  21. #pragma link "jpeg.obj"
  22.  
  23. namespace Jpeg
  24. {
  25. //-- type declarations -------------------------------------------------------
  26. class DELPHICLASS TJPEGData;
  27. class PASCALIMPLEMENTATION TJPEGData : public Graphics::TSharedImage 
  28. {
  29.     typedef Graphics::TSharedImage inherited;
  30.     
  31. private:
  32.     Classes::TCustomMemoryStream* FData;
  33.     int FHeight;
  34.     int FWidth;
  35.     bool FGrayscale;
  36.     
  37. protected:
  38.     virtual void __fastcall FreeHandle(void);
  39.     
  40. public:
  41.     __fastcall virtual ~TJPEGData(void);
  42. public:
  43.     #pragma option push -w-inl
  44.     /* TObject.Create */ inline __fastcall TJPEGData(void) : Graphics::TSharedImage() { }
  45.     #pragma option pop
  46.     
  47. };
  48.  
  49.  
  50. typedef Shortint TJPEGQualityRange;
  51.  
  52. #pragma option push -b-
  53. enum TJPEGPerformance { jpBestQuality, jpBestSpeed };
  54. #pragma option pop
  55.  
  56. #pragma option push -b-
  57. enum TJPEGScale { jsFullSize, jsHalf, jsQuarter, jsEighth };
  58. #pragma option pop
  59.  
  60. #pragma option push -b-
  61. enum TJPEGPixelFormat { jf24Bit, jf8Bit };
  62. #pragma option pop
  63.  
  64. class DELPHICLASS TJPEGImage;
  65. class PASCALIMPLEMENTATION TJPEGImage : public Graphics::TGraphic 
  66. {
  67.     typedef Graphics::TGraphic inherited;
  68.     
  69. private:
  70.     TJPEGData* FImage;
  71.     Graphics::TBitmap* FBitmap;
  72.     int FScaledWidth;
  73.     int FScaledHeight;
  74.     HPALETTE FTempPal;
  75.     bool FSmoothing;
  76.     bool FGrayScale;
  77.     TJPEGPixelFormat FPixelFormat;
  78.     TJPEGQualityRange FQuality;
  79.     bool FProgressiveDisplay;
  80.     bool FProgressiveEncoding;
  81.     TJPEGPerformance FPerformance;
  82.     TJPEGScale FScale;
  83.     bool FNeedRecalc;
  84.     void __fastcall CalcOutputDimensions(void);
  85.     Graphics::TBitmap* __fastcall GetBitmap(void);
  86.     bool __fastcall GetGrayscale(void);
  87.     void __fastcall SetGrayscale(bool Value);
  88.     void __fastcall SetPerformance(TJPEGPerformance Value);
  89.     void __fastcall SetPixelFormat(TJPEGPixelFormat Value);
  90.     void __fastcall SetScale(TJPEGScale Value);
  91.     void __fastcall SetSmoothing(bool Value);
  92.     
  93. protected:
  94.     virtual void __fastcall AssignTo(Classes::TPersistent* Dest);
  95.     virtual void __fastcall Changed(System::TObject* Sender);
  96.     virtual void __fastcall Draw(Graphics::TCanvas* ACanvas, const Windows::TRect &Rect);
  97.     virtual bool __fastcall Equals(Graphics::TGraphic* Graphic);
  98.     void __fastcall FreeBitmap(void);
  99.     virtual bool __fastcall GetEmpty(void);
  100.     virtual int __fastcall GetHeight(void);
  101.     virtual HPALETTE __fastcall GetPalette(void);
  102.     virtual int __fastcall GetWidth(void);
  103.     void __fastcall NewBitmap(void);
  104.     void __fastcall NewImage(void);
  105.     virtual void __fastcall ReadData(Classes::TStream* Stream);
  106.     void __fastcall ReadStream(int Size, Classes::TStream* Stream);
  107.     virtual void __fastcall SetHeight(int Value);
  108.     virtual void __fastcall SetPalette(HPALETTE Value);
  109.     virtual void __fastcall SetWidth(int Value);
  110.     virtual void __fastcall WriteData(Classes::TStream* Stream);
  111.     __property Graphics::TBitmap* Bitmap = {read=GetBitmap};
  112.     
  113. public:
  114.     __fastcall virtual TJPEGImage(void);
  115.     __fastcall virtual ~TJPEGImage(void);
  116.     void __fastcall Compress(void);
  117.     void __fastcall DIBNeeded(void);
  118.     void __fastcall JPEGNeeded(void);
  119.     virtual void __fastcall Assign(Classes::TPersistent* Source);
  120.     virtual void __fastcall LoadFromStream(Classes::TStream* Stream);
  121.     virtual void __fastcall SaveToStream(Classes::TStream* Stream);
  122.     virtual void __fastcall LoadFromClipboardFormat(Word AFormat, unsigned AData, HPALETTE APalette);
  123.     virtual void __fastcall SaveToClipboardFormat(Word &AFormat, unsigned &AData, HPALETTE &APalette);
  124.     __property bool Grayscale = {read=GetGrayscale, write=SetGrayscale, nodefault};
  125.     __property bool ProgressiveEncoding = {read=FProgressiveEncoding, write=FProgressiveEncoding, nodefault
  126.         };
  127.     __property TJPEGQualityRange CompressionQuality = {read=FQuality, write=FQuality, nodefault};
  128.     __property TJPEGPixelFormat PixelFormat = {read=FPixelFormat, write=SetPixelFormat, nodefault};
  129.     __property bool ProgressiveDisplay = {read=FProgressiveDisplay, write=FProgressiveDisplay, nodefault
  130.         };
  131.     __property TJPEGPerformance Performance = {read=FPerformance, write=SetPerformance, nodefault};
  132.     __property TJPEGScale Scale = {read=FScale, write=SetScale, nodefault};
  133.     __property bool Smoothing = {read=FSmoothing, write=SetSmoothing, nodefault};
  134. };
  135.  
  136.  
  137. #pragma pack(push, 1)
  138. struct TJPEGDefaults
  139. {
  140.     TJPEGQualityRange CompressionQuality;
  141.     bool Grayscale;
  142.     TJPEGPerformance Performance;
  143.     TJPEGPixelFormat PixelFormat;
  144.     bool ProgressiveDisplay;
  145.     bool ProgressiveEncoding;
  146.     TJPEGScale Scale;
  147.     bool Smoothing;
  148. } ;
  149. #pragma pack(pop)
  150.  
  151. //-- var, const, procedure ---------------------------------------------------
  152. extern PACKAGE TJPEGDefaults JPEGDefaults;
  153.  
  154. }    /* namespace Jpeg */
  155. #if !defined(NO_IMPLICIT_NAMESPACE_USE)
  156. using namespace Jpeg;
  157. #endif
  158. #pragma option pop    // -w-
  159. #pragma option pop    // -Vx
  160.  
  161. #pragma delphiheader end.
  162. //-- end unit ----------------------------------------------------------------
  163. #endif    // jpeg
  164.