www.pudn.com > PtOpenGuiSourceCode.zip > LZW_Module.hpp


// Borland C++ Builder 
// Copyright (c) 1995, 1999 by Borland International 
// All rights reserved 
 
// (DO NOT EDIT: machine generated header) 'LZW_Module.pas' rev: 4.00 
 
#ifndef LZW_ModuleHPP 
#define LZW_ModuleHPP 
 
#pragma delphiheader begin 
#pragma option push -w- 
#include 	// Pascal unit 
#include 	// Pascal unit 
#include 	// Pascal unit 
#include 	// Pascal unit 
 
//-- user supplied ----------------------------------------------------------- 
 
namespace Lzw_module 
{ 
//-- type declarations ------------------------------------------------------- 
#pragma pack(push, 4) 
struct TTableEntry 
{ 
	Word index; 
	Word prefix; 
	Byte suffix; 
	Byte firstbyte; 
} ; 
#pragma pack(pop) 
 
struct TCluster; 
typedef TCluster *PCluster; 
 
#pragma pack(push, 4) 
struct TCluster 
{ 
	Word indx; 
	TCluster *next; 
} ; 
#pragma pack(pop) 
 
typedef Byte TByteStream[1]; 
 
typedef Byte *PByteStream; 
 
typedef Shortint TSmoothRange; 
 
class DELPHICLASS TLZW; 
#pragma pack(push, 4) 
class PASCALIMPLEMENTATION TLZW : public System::TObject  
{ 
	typedef System::TObject inherited; 
	 
private: 
	void *CodeAdress; 
	void *Destination; 
	Byte CodeLength; 
	Byte BorrowedBits; 
	Word Code; 
	Word OldCode; 
	Word LastEntry; 
	unsigned BytesHaveBeenReaden; 
	TTableEntry Table[4096]; 
	TCluster *Clusters[4096]; 
	Word __fastcall GetNextCode(void); 
	void __fastcall Initialize(void); 
	void __fastcall ReleaseClusters(void); 
	void __fastcall WriteBytes(const TTableEntry &Entry); 
	void __fastcall AddEntry(const TTableEntry &Entry); 
	TTableEntry __fastcall Concatention(Word PPrefix, Byte LastByte, Word Indx); 
	void __fastcall AddTableEntry(const TTableEntry &Entry); 
	void __fastcall WriteCodeToStream(Word Code); 
	Word __fastcall CodeFromString(const TTableEntry &Str); 
	 
public: 
	void __fastcall DecodeLZW(void * Sourse, void * Dest); 
	void __fastcall EncodeLZW(void * Sourse, void * Dest, unsigned &ByteCounts); 
	void __fastcall SmoothEncodeLZW(void * Sourse, void * Dest, TSmoothRange SmoothRange, unsigned &ByteCounts 
		); 
public: 
	#pragma option push -w-inl 
	/* TObject.Create */ inline __fastcall TLZW(void) : System::TObject() { } 
	#pragma option pop 
	#pragma option push -w-inl 
	/* TObject.Destroy */ inline __fastcall virtual ~TLZW(void) { } 
	#pragma option pop 
	 
}; 
 
#pragma pack(pop) 
 
//-- var, const, procedure --------------------------------------------------- 
extern PACKAGE Word ClearCode; 
static const Word EoiCode = 0x101; 
 
}	/* namespace Lzw_module */ 
#if !defined(NO_IMPLICIT_NAMESPACE_USE) 
using namespace Lzw_module; 
#endif 
#pragma option pop	// -w- 
 
#pragma delphiheader end. 
//-- end unit ---------------------------------------------------------------- 
#endif	// LZW_Module