// Borland C++ Builder
// Copyright (c) 1995, 1998 by Borland International
// All rights reserved

// (DO NOT EDIT: machine generated header) 'pngfilt.pas' rev: 3.00

#ifndef pngfiltHPP
#define pngfiltHPP
#include <iedefs.hpp>
#include <ImageEnIO.hpp>
#include <ImageEnProc.hpp>
#include <SysUtils.hpp>
#include <Classes.hpp>
#include <Graphics.hpp>
#include <Windows.hpp>
#include <SysInit.hpp>
#include <System.hpp>

//-- user supplied -----------------------------------------------------------

namespace Pngfilt
{
//-- type declarations -------------------------------------------------------
typedef Cardinal png_uint_32;

typedef Cardinal *png_uint_32p;

typedef int png_int_32;

typedef Word png_uint_16;

typedef short png_int_16;

typedef Byte png_byte;

typedef Cardinal png_size_t;

typedef char * *png_charpp;

typedef char *png_charp;

typedef float float;

typedef int int;

typedef Byte *png_bytep;

typedef png_bytep *png_bytepp;

typedef Word *png_uint_16p;

typedef png_uint_16p *png_uint_16pp;

typedef void *png_voidp;

typedef int time_t;

typedef double *png_doublep;

typedef double png_double;

typedef void *user_error_ptr;

typedef void __fastcall (*png_error_ptr)(void * png_ptr, void * msg);

typedef png_error_ptr *png_error_ptrp;

typedef void __fastcall (*png_rw_ptr)(void * png_ptr, void * data, Cardinal length);

typedef png_rw_ptr *png_rw_ptrp;

typedef void __fastcall (*png_flush_ptr)(void * png_ptr);

typedef png_flush_ptr *png_flush_ptrp;

typedef void __fastcall (*png_progressive_info_ptr)(void * png_ptr, void * info_ptr);

typedef png_progressive_info_ptr *png_progressive_info_ptrp;

typedef void __fastcall (*png_progressive_end_ptr)(void * png_ptr, void * info_ptr);

typedef png_progressive_end_ptr *png_progressive_end_ptrp;

typedef void __fastcall (*png_progressive_row_ptr)(void * png_ptr, void * data, Cardinal length, int 
	count);

typedef png_progressive_row_ptr *png_progressive_row_ptrp;

typedef void __fastcall (*png_read_status_ptr)(void * png_ptr, Cardinal row_number, int pass);

typedef void __fastcall (*png_write_status_ptr)(void * png_ptr, Cardinal row_number, int pass);

typedef void __fastcall (*png_user_transform_ptr)(void * png_ptr, void * row_info, png_bytep data);

#pragma pack(push, 1)
struct png_color
{
	Byte red;
	Byte green;
	Byte blue;
} ;
#pragma pack(pop)

typedef png_color *png_colorp;

typedef png_colorp *png_colorpp;

#pragma pack(push, 1)
struct png_color_16
{
	Byte index;
	Word red;
	Word green;
	Word blue;
	Word gray;
} ;
#pragma pack(pop)

typedef png_color_16 *png_color_16p;

typedef png_color_16p *png_color_16pp;

#pragma pack(push, 1)
struct png_color_8
{
	Byte red;
	Byte green;
	Byte blue;
	Byte gray;
	Byte alpha;
} ;
#pragma pack(pop)

typedef png_color_8 *png_color_8p;

typedef png_color_8p *png_color_8pp;

#pragma pack(push, 1)
struct tpng_text
{
	int compression;
	char *key;
	char *text;
	Cardinal text_length;
} ;
#pragma pack(pop)

typedef tpng_text *png_textp;

typedef png_textp *png_textpp;

#pragma pack(push, 1)
struct tpng_time
{
	Word year;
	Byte month;
	Byte day;
	Byte hour;
	Byte minute;
	Byte second;
} ;
#pragma pack(pop)

typedef tpng_time *png_timep;

typedef png_timep *png_timepp;

typedef void * *png_infopp;

typedef void *png_infop;

#pragma pack(push, 1)
struct png_row_info
{
	Cardinal width;
	Cardinal rowbytes;
	Byte color_type;
	Byte bit_depth;
	Byte channels;
	Byte pixel_depth;
} ;
#pragma pack(pop)

typedef png_row_info *png_row_infop;

typedef png_row_infop *png_row_infopp;

typedef void * *png_structpp;

typedef void *png_structp;

typedef void * __fastcall (*TAlloc)(void * AppData, int Items, int Size);

typedef void __fastcall (*TFree)(void * AppData, void * Block);

#pragma pack(push, 1)
struct TZStreamRec
{
	char *next_in;
	int avail_in;
	int total_in;
	char *next_out;
	int avail_out;
	int total_out;
	char *msg;
	void *internal;
	TAlloc zalloc;
	TFree zfree;
	void *AppData;
	int data_type;
	int adler;
	int reserved;
} ;
#pragma pack(pop)

class DELPHICLASS TCustomZlibStream;
class PASCALIMPLEMENTATION TCustomZlibStream : public Classes::TStream 
{
	typedef Classes::TStream inherited;
	
private:
	Classes::TStream* FStrm;
	int FStrmPos;
	Classes::TNotifyEvent FOnProgress;
	TZStreamRec FZRec;
	char FBuffer[65536];
	
protected:
	DYNAMIC void __fastcall Progress(System::TObject* Sender);
	__property Classes::TNotifyEvent OnProgress = {read=FOnProgress, write=FOnProgress};
	__fastcall TCustomZlibStream(Classes::TStream* Strm);
public:
	/* TObject.Destroy */ __fastcall virtual ~TCustomZlibStream(void) { }
	
};

#pragma option push -b
enum TCompressionLevel { clNone, clFastest, clDefault, clMax };
#pragma option pop
class DELPHICLASS TCompressionStream;
class PASCALIMPLEMENTATION TCompressionStream : public Pngfilt::TCustomZlibStream 
{
	typedef Pngfilt::TCustomZlibStream inherited;
	
private:
	float __fastcall GetCompressionRate(void);
	
public:
	__fastcall TCompressionStream(TCompressionLevel CompressionLevel, Classes::TStream* Dest);
	__fastcall virtual ~TCompressionStream(void);
	virtual int __fastcall Read(void *Buffer, int Count);
	virtual int __fastcall Write(const void *Buffer, int Count);
	virtual int __fastcall Seek(int Offset, Word Origin);
	__property float CompressionRate = {read=GetCompressionRate};
	__property OnProgress ;
};

class DELPHICLASS TDecompressionStream;
class PASCALIMPLEMENTATION TDecompressionStream : public Pngfilt::TCustomZlibStream 
{
	typedef Pngfilt::TCustomZlibStream inherited;
	
public:
	__fastcall TDecompressionStream(Classes::TStream* Source);
	__fastcall virtual ~TDecompressionStream(void);
	virtual int __fastcall Read(void *Buffer, int Count);
	virtual int __fastcall Write(const void *Buffer, int Count);
	virtual int __fastcall Seek(int Offset, Word Origin);
	__property OnProgress ;
};

class DELPHICLASS EZlibError;
class PASCALIMPLEMENTATION EZlibError : public Sysutils::Exception 
{
	typedef Sysutils::Exception inherited;
	
public:
	/* Exception.Create */ __fastcall EZlibError(const System::AnsiString Msg) : Sysutils::Exception(Msg
		) { }
	/* Exception.CreateFmt */ __fastcall EZlibError(const System::AnsiString Msg, const System::TVarRec 
		* Args, const int Args_Size) : Sysutils::Exception(Msg, Args, Args_Size) { }
	/* Exception.CreateRes */ __fastcall EZlibError(int Ident, Extended Dummy) : Sysutils::Exception(Ident
		, Dummy) { }
	/* Exception.CreateResFmt */ __fastcall EZlibError(int Ident, const System::TVarRec * Args, const int 
		Args_Size) : Sysutils::Exception(Ident, Args, Args_Size) { }
	/* Exception.CreateHelp */ __fastcall EZlibError(const System::AnsiString Msg, int AHelpContext) : 
		Sysutils::Exception(Msg, AHelpContext) { }
	/* Exception.CreateFmtHelp */ __fastcall EZlibError(const System::AnsiString Msg, const System::TVarRec 
		* Args, const int Args_Size, int AHelpContext) : Sysutils::Exception(Msg, Args, Args_Size, AHelpContext
		) { }
	/* Exception.CreateResHelp */ __fastcall EZlibError(int Ident, int AHelpContext) : Sysutils::Exception(
		Ident, AHelpContext) { }
	/* Exception.CreateResFmtHelp */ __fastcall EZlibError(int Ident, const System::TVarRec * Args, const 
		int Args_Size, int AHelpContext) : Sysutils::Exception(Ident, Args, Args_Size, AHelpContext) { }
	
public:
	/* TObject.Destroy */ __fastcall virtual ~EZlibError(void) { }
	
};

class DELPHICLASS ECompressionError;
class PASCALIMPLEMENTATION ECompressionError : public Pngfilt::EZlibError 
{
	typedef Pngfilt::EZlibError inherited;
	
public:
	/* Exception.Create */ __fastcall ECompressionError(const System::AnsiString Msg) : Pngfilt::EZlibError(
		Msg) { }
	/* Exception.CreateFmt */ __fastcall ECompressionError(const System::AnsiString Msg, const System::TVarRec 
		* Args, const int Args_Size) : Pngfilt::EZlibError(Msg, Args, Args_Size) { }
	/* Exception.CreateRes */ __fastcall ECompressionError(int Ident, Extended Dummy) : Pngfilt::EZlibError(
		Ident, Dummy) { }
	/* Exception.CreateResFmt */ __fastcall ECompressionError(int Ident, const System::TVarRec * Args, 
		const int Args_Size) : Pngfilt::EZlibError(Ident, Args, Args_Size) { }
	/* Exception.CreateHelp */ __fastcall ECompressionError(const System::AnsiString Msg, int AHelpContext
		) : Pngfilt::EZlibError(Msg, AHelpContext) { }
	/* Exception.CreateFmtHelp */ __fastcall ECompressionError(const System::AnsiString Msg, const System::TVarRec 
		* Args, const int Args_Size, int AHelpContext) : Pngfilt::EZlibError(Msg, Args, Args_Size, AHelpContext
		) { }
	/* Exception.CreateResHelp */ __fastcall ECompressionError(int Ident, int AHelpContext) : Pngfilt::
		EZlibError(Ident, AHelpContext) { }
	/* Exception.CreateResFmtHelp */ __fastcall ECompressionError(int Ident, const System::TVarRec * Args
		, const int Args_Size, int AHelpContext) : Pngfilt::EZlibError(Ident, Args, Args_Size, AHelpContext
		) { }
	
public:
	/* TObject.Destroy */ __fastcall virtual ~ECompressionError(void) { }
	
};

class DELPHICLASS EDecompressionError;
class PASCALIMPLEMENTATION EDecompressionError : public Pngfilt::EZlibError 
{
	typedef Pngfilt::EZlibError inherited;
	
public:
	/* Exception.Create */ __fastcall EDecompressionError(const System::AnsiString Msg) : Pngfilt::EZlibError(
		Msg) { }
	/* Exception.CreateFmt */ __fastcall EDecompressionError(const System::AnsiString Msg, const System::TVarRec 
		* Args, const int Args_Size) : Pngfilt::EZlibError(Msg, Args, Args_Size) { }
	/* Exception.CreateRes */ __fastcall EDecompressionError(int Ident, Extended Dummy) : Pngfilt::EZlibError(
		Ident, Dummy) { }
	/* Exception.CreateResFmt */ __fastcall EDecompressionError(int Ident, const System::TVarRec * Args
		, const int Args_Size) : Pngfilt::EZlibError(Ident, Args, Args_Size) { }
	/* Exception.CreateHelp */ __fastcall EDecompressionError(const System::AnsiString Msg, int AHelpContext
		) : Pngfilt::EZlibError(Msg, AHelpContext) { }
	/* Exception.CreateFmtHelp */ __fastcall EDecompressionError(const System::AnsiString Msg, const System::TVarRec 
		* Args, const int Args_Size, int AHelpContext) : Pngfilt::EZlibError(Msg, Args, Args_Size, AHelpContext
		) { }
	/* Exception.CreateResHelp */ __fastcall EDecompressionError(int Ident, int AHelpContext) : Pngfilt::
		EZlibError(Ident, AHelpContext) { }
	/* Exception.CreateResFmtHelp */ __fastcall EDecompressionError(int Ident, const System::TVarRec * 
		Args, const int Args_Size, int AHelpContext) : Pngfilt::EZlibError(Ident, Args, Args_Size, AHelpContext
		) { }
	
public:
	/* TObject.Destroy */ __fastcall virtual ~EDecompressionError(void) { }
	
};

typedef int jmpbuf[8];

//-- var, const, procedure ---------------------------------------------------
#define zlib_Version "1.0.4"
#define PNG_TEXT_COMPRESSION_NONE_WR (Shortint)(-3)
#define PNG_TEXT_COMPRESSION_zTXt_WR (Shortint)(-2)
#define PNG_TEXT_COMPRESSION_NONE (Shortint)(-1)
#define PNG_TEXT_COMPRESSION_zTXt (Byte)(0)
#define PNG_COLOR_MASK_PALETTE (Byte)(1)
#define PNG_COLOR_MASK_COLOR (Byte)(2)
#define PNG_COLOR_MASK_ALPHA (Byte)(4)
#define PNG_COLOR_TYPE_GRAY (Byte)(0)
#define PNG_COLOR_TYPE_PALETTE (Byte)(3)
#define PNG_COLOR_TYPE_RGB (Byte)(2)
#define PNG_COLOR_TYPE_RGB_ALPHA (Byte)(6)
#define PNG_COLOR_TYPE_GRAY_ALPHA (Byte)(4)
#define PNG_COMPRESSION_TYPE_BASE (Byte)(0)
#define PNG_COMPRESSION_TYPE_DEFAULT (Byte)(0)
#define PNG_FILTER_TYPE_BASE (Byte)(0)
#define PNG_FILTER_TYPE_DEFAULT (Byte)(0)
#define PNG_INTERLACE_NONE (Byte)(0)
#define PNG_INTERLACE_ADAM7 (Byte)(1)
#define PNG_OFFSET_PIXEL (Byte)(0)
#define PNG_OFFSET_MICROMETER (Byte)(1)
#define PNG_EQUATION_LINEAR (Byte)(0)
#define PNG_EQUATION_BASE_E (Byte)(1)
#define PNG_EQUATION_ARBITRARY (Byte)(2)
#define PNG_EQUATION_HYPERBOLIC (Byte)(3)
#define PNG_RESOLUTION_UNKNOWN (Byte)(0)
#define PNG_RESOLUTION_METER (Byte)(1)
#define PNG_sRGB_INTENT_SATURATION (Byte)(0)
#define PNG_sRGB_INTENT_PERCEPTUAL (Byte)(1)
#define PNG_sRGB_INTENT_ABSOLUTE (Byte)(2)
#define PNG_sRGB_INTENT_RELATIVE (Byte)(3)
#define PNG_BACKGROUND_GAMMA_UNKNOWN (Byte)(0)
#define PNG_BACKGROUND_GAMMA_SCREEN (Byte)(1)
#define PNG_BACKGROUND_GAMMA_FILE (Byte)(2)
#define PNG_BACKGROUND_GAMMA_UNIQUE (Byte)(3)
#define PNG_CRC_DEFAULT (Byte)(0)
#define PNG_CRC_ERROR_QUIT (Byte)(1)
#define PNG_CRC_WARN_DISCARD (Byte)(2)
#define PNG_CRC_WARN_USE (Byte)(3)
#define PNG_CRC_QUIET_USE (Byte)(4)
#define PNG_CRC_NO_CHANGE (Byte)(5)
#define PNG_NO_FILTERS (Byte)(0)
#define PNG_FILTER_NONE (Byte)(8)
#define PNG_FILTER_SUB (Byte)(16)
#define PNG_FILTER_UP (Byte)(32)
#define PNG_FILTER_AVG (Byte)(64)
#define PNG_FILTER_PAETH (Byte)(128)
#define PNG_ALL_FILTERS (Byte)(248)
#define PNG_FILTER_VALUE_NONE (Byte)(0)
#define PNG_FILTER_VALUE_SUB (Byte)(1)
#define PNG_FILTER_VALUE_UP (Byte)(2)
#define PNG_FILTER_VALUE_AVG (Byte)(3)
#define PNG_FILTER_VALUE_PAETH (Byte)(4)
#define PNG_FILTER_HEURISTIC_DEFAULT (Byte)(0)
#define PNG_FILTER_HEURISTIC_UNWEIGHTED (Byte)(1)
#define PNG_FILTER_HEURISTIC_WEIGHTED (Byte)(2)
#define PNG_FILTER_HEURISTIC_LAST (Byte)(3)
extern PACKAGE void __cdecl _memset(void * P, Byte B, int count);
extern PACKAGE void __cdecl _memcpy(void * dest, void * source, int count);
extern PACKAGE void * __cdecl _malloc(int size);
extern PACKAGE void __cdecl _free(void * P);
extern PACKAGE int __cdecl _setjmp(const int * jb);
extern PACKAGE void __cdecl _longjmp(const int * jb, int i);
extern PACKAGE double __cdecl _fabs(double v);
extern PACKAGE double __cdecl _pow(double Base, double Exponent);
extern PACKAGE int __cdecl __ftol(void);
extern PACKAGE Cardinal __cdecl _strlen(char * s);
extern PACKAGE void __fastcall ReadPNGStream(Classes::TStream* Stream, Graphics::TBitmap* Bitmap, Imageenio::TIOParamsVals* 
	&IOParams, Iedefs::TProgressRec &xProgress, bool Preview);
extern PACKAGE bool __fastcall IsPNGStream(Classes::TStream* Stream);
extern PACKAGE void __fastcall CompressBuf(const void * InBuf, int InBytes, /* out */ void * &OutBuf
	, /* out */ int &OutBytes);
extern PACKAGE void __fastcall DecompressBuf(const void * InBuf, int InBytes, int OutEstimate, /* out */ 
	void * &OutBuf, /* out */ int &OutBytes);
extern PACKAGE int __fastcall deflateInit_(TZStreamRec &strm, int level, char * version, int recsize
	);
extern PACKAGE void __fastcall deflateInit2_(void);
extern PACKAGE void __fastcall deflateReset(void);
extern PACKAGE int __fastcall deflate(TZStreamRec &strm, int flush);
extern PACKAGE int __fastcall deflateEnd(TZStreamRec &strm);
extern PACKAGE int __fastcall inflateReset(TZStreamRec &strm);
extern PACKAGE int __fastcall inflateEnd(TZStreamRec &strm);
extern PACKAGE int __fastcall inflateInit_(TZStreamRec &strm, char * version, int recsize);
extern PACKAGE int __fastcall inflate(TZStreamRec &strm, int flush);
extern PACKAGE void __fastcall inflate_trees_bits(void);
extern PACKAGE void __fastcall inflate_trees_dynamic(void);
extern PACKAGE void __fastcall inflate_trees_fixed(void);
extern PACKAGE void __fastcall inflate_trees_free(void);
extern PACKAGE void __fastcall _tr_init(void);
extern PACKAGE void __fastcall _tr_stored_block(void);
extern PACKAGE void __fastcall _tr_align(void);
extern PACKAGE void __fastcall _tr_flush_block(void);
extern PACKAGE void __fastcall _tr_tally(void);
extern PACKAGE void __fastcall adler32(void);
extern PACKAGE void __fastcall inflate_blocks_reset(void);
extern PACKAGE void __fastcall inflate_blocks_new(void);
extern PACKAGE void __fastcall inflate_blocks(void);
extern PACKAGE void __fastcall inflate_blocks_free(void);
extern PACKAGE void __fastcall inflate_set_dictionary(void);
extern PACKAGE void __fastcall inflate_codes_new(void);
extern PACKAGE void __fastcall inflate_codes(void);
extern PACKAGE void __fastcall inflate_codes_free(void);
extern PACKAGE void __fastcall inflate_flush(void);
extern PACKAGE void *_inflate_mask;
extern PACKAGE void __fastcall inflate_fast(void);
extern PACKAGE void __fastcall crc32(void);

}	/* namespace Pngfilt */
#if !defined(NO_IMPLICIT_NAMESPACE_USE)
using namespace Pngfilt;
#endif
//-- end unit ----------------------------------------------------------------
#endif	// pngfilt
