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

// (DO NOT EDIT: machine generated header) 'EnCLib.pas' rev: 4.00

#ifndef EnCLibHPP
#define EnCLibHPP

#pragma delphiheader begin
#pragma option push -w-
#include <Classes.hpp>	// Pascal unit
#include <SysUtils.hpp>	// Pascal unit
#include <Windows.hpp>	// Pascal unit
#include <EnMisc.hpp>	// Pascal unit
#include <SysInit.hpp>	// Pascal unit
#include <System.hpp>	// Pascal unit

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

namespace Enclib
{
//-- type declarations -------------------------------------------------------
typedef Word TWordArray[1073741823];

typedef Word *TpWordArray;

typedef void *TTiffHandle;

#pragma option push -b-
enum TTiffOpenMode { omRead, omWrite, omAppend };
#pragma option pop

typedef void *png_structp;

typedef void * *png_structpp;

typedef void *png_infop;

typedef void * *png_infopp;

typedef Byte png_byte;

typedef Byte *png_bytep;

typedef png_bytep *png_bytepp;

typedef int png_size_t;

typedef Word png_uint_16;

typedef Word *png_uint_16p;

typedef unsigned png_uint_32;

typedef unsigned *png_uint_32p;

typedef void *png_voidp;

typedef char *png_const_charp;

#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;

typedef png_color png_palette[256];

typedef png_color *png_palettep;

typedef png_palettep *png_palettepp;

#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;

typedef void __cdecl (*png_error_ptr)(void * png_ptr, char * msg);

typedef void __cdecl (*png_rw_ptr)(void * png_ptr, png_bytep pbuffer, int size);

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

typedef unsigned *PCardinal;

typedef void *j_error_mgr_ptr;

typedef void * *j_error_mgr_ptr_ptr;

typedef void *j_decompress_ptr;

typedef void * *j_decompress_ptr_ptr;

typedef void *j_compress_ptr;

typedef void * *j_compress_ptr_ptr;

#pragma pack(push, 1)
struct TGbmFt
{
	char *ShortName;
	char *LongName;
	char *Extensions;
	int Flags;
} ;
#pragma pack(pop)

#pragma pack(push, 1)
struct TGbmRgb
{
	Byte R;
	Byte G;
	Byte B;
} ;
#pragma pack(pop)

typedef TGbmRgb *TpGbmRgb;

typedef TGbmRgb TGbmPalette[256];

struct TGbm;
typedef TGbm *TpGbm;

#pragma pack(push, 1)
struct TGbm
{
	int W;
	int H;
	int Bpp;
	Byte Priv[2000];
} ;
#pragma pack(pop)

typedef int TGbm_Err;

typedef void __cdecl (*TGbmProgressProc)(Shortint Progress, int CallBackData);

//-- var, const, procedure ---------------------------------------------------
static const Word TIFFTAG_IMAGEWIDTH = 0x100;
static const Word TIFFTAG_IMAGELENGTH = 0x101;
static const Word TIFFTAG_BITSPERSAMPLE = 0x102;
static const Word TIFFTAG_COMPRESSION = 0x103;
static const Word TIFFTAG_SAMPLESPERPIXEL = 0x115;
static const Word TIFFTAG_ROWSPERSTRIP = 0x116;
static const Word TIFFTAG_XRESOLUTION = 0x11a;
static const Word TIFFTAG_YRESOLUTION = 0x11b;
static const Word TIFFTAG_RESOLUTIONUNIT = 0x128;
static const Word TIFFTAG_PHOTOMETRIC = 0x106;
static const Word TIFFTAG_COLORMAP = 0x140;
static const Word TIFFTAG_PLANARCONFIG = 0x11c;
static const Word TIFFTAG_GROUP3OPTIONS = 0x124;
static const Word TIFFTAG_SOFTWARE = 0x131;
static const Word TIFFTAG_DATETIME = 0x132;
static const Word TIFFTAG_PREDICTOR = 0x13d;
static const Word TIFFTAG_DOCUMENTNAME = 0x10d;
static const Word TIFFTAG_IMAGEDESCRIPTION = 0x10e;
static const Word TIFFTAG_MAKE = 0x10f;
static const Word TIFFTAG_MODEL = 0x110;
static const Word TIFFTAG_PAGENAME = 0x11d;
static const Word TIFFTAG_ARTIST = 0x13b;
static const Word TIFFTAG_HOSTCOMPUTER = 0x13c;
static const Shortint GROUP3OPT_2DENCODING = 0x1;
static const Shortint RESUNIT_NONE = 0x1;
static const Shortint RESUNIT_INCH = 0x2;
static const Shortint RESUNIT_CENTIMETER = 0x3;
static const Shortint COMPRESSION_NONE = 0x1;
static const Shortint COMPRESSION_CCITTRLE = 0x2;
static const Shortint COMPRESSION_CCITTFAX3 = 0x3;
static const Shortint COMPRESSION_CCITTFAX4 = 0x4;
static const Shortint COMPRESSION_LZW = 0x5;
static const Word COMPRESSION_CCITTRLEW = 0x8003;
static const Word COMPRESSION_PACKBITS = 0x8005;
static const Word COMPRESSION_DEFLATE = 0x80b2;
static const Shortint COMPRESSION_JPEG = 0x7;
static const int TIFFTAG_JPEGQUALITY = 0x10001;
static const Shortint Z_BEST_SPEED = 0x1;
static const Shortint Z_MEDIUM = 0x5;
static const Shortint Z_BEST_COMPRESSION = 0x9;
#define PNG_LIBPNG_VER_STRING "1.0.2"
static const Shortint PNG_RESOLUTION_UNKNOWN = 0x0;
static const Shortint PNG_RESOLUTION_METER = 0x1;
static const Shortint PNG_INTERLACE_NONE = 0x0;
static const Shortint PNG_INTERLACE_ADAM7 = 0x1;
static const Shortint PNG_FILTER_TYPE_BASE = 0x0;
static const Shortint PNG_COMPRESSION_TYPE_BASE = 0x0;
static const Shortint PNG_COLOR_MASK_PALETTE = 0x1;
static const Shortint PNG_COLOR_MASK_COLOR = 0x2;
static const Shortint PNG_COLOR_MASK_ALPHA = 0x4;
static const Shortint PNG_BACKGROUND_GAMMA_SCREEN = 0x1;
static const Shortint PNG_BACKGROUND_GAMMA_FILE = 0x2;
static const Shortint PNG_COLOR_TYPE_GRAY = 0x0;
static const Shortint PNG_COLOR_TYPE_PALETTE = 0x3;
static const Shortint PNG_COLOR_TYPE_RGB = 0x2;
static const Shortint PNG_COLOR_TYPE_RGB_ALPHA = 0x6;
static const Shortint PNG_COLOR_TYPE_GRAY_ALPHA = 0x4;
static const Shortint JCS_UNKNOWN = 0x0;
static const Shortint JCS_GRAYSCALE = 0x1;
static const Shortint JCS_RGB = 0x2;
static const Shortint JCS_YCbCr = 0x3;
static const Shortint JCS_CMYK = 0x4;
static const Shortint JCS_YCCK = 0x5;
static const Shortint JPEG_DOTSPERINCH = 0x1;
static const Shortint JPEG_DOTSPERCM = 0x2;
static const Word PRIV_SIZE = 0x7d0;
static const Shortint GBM_ERR_OK = 0x0;
static const Shortint GBM_ERR_MEM = 0x1;
static const Shortint GBM_ERR_NOT_SUPP = 0x2;
static const Shortint GBM_ERR_BAD_OPTION = 0x3;
static const Shortint GBM_ERR_NOT_FOUND = 0x4;
static const Shortint GBM_ERR_BAD_MAGIC = 0x5;
static const Shortint GBM_ERR_BAD_SIZE = 0x6;
static const Shortint GBM_ERR_READ = 0x7;
static const Shortint GBM_ERR_WRITE = 0x8;
static const Shortint GBM_ERR_BAD_ARG = 0x9;
static const Shortint GBM_FT_R1 = 0x1;
static const Shortint GBM_FT_R4 = 0x2;
static const Shortint GBM_FT_R8 = 0x4;
static const Shortint GBM_FT_R24 = 0x8;
static const Shortint GBM_FT_W1 = 0x10;
static const Shortint GBM_FT_W4 = 0x20;
static const Shortint GBM_FT_W8 = 0x40;
static const Byte GBM_FT_W24 = 0x80;
extern PACKAGE int __fastcall TIFFVSetIntField(void * TiffHandle, int Tag, int Data);
extern PACKAGE int __fastcall TiffImageCount(const void * TiffHandle);
extern PACKAGE void __fastcall SetTiffTagValues(int UserTag1, int UserTag2, int UserTag3, int UserTag4
	, int UserTag5, int UserTag6, int UserTag7, int UserTag8, int UserTag9, int UserTag10, int UserTag11
	, int UserTag12, int UserTag13, int UserTag14, int UserTag15, int UserTag16, int UserTag17, int UserTag18
	, int UserTag19, int UserTag20);
extern PACKAGE void * __fastcall TIFFOpen(const Classes::TStream* Stream, const TTiffOpenMode OpenMode
	);
extern PACKAGE void __fastcall TIFFClose(void * TiffHandle);
extern PACKAGE bool __fastcall TIFFGetField(void * TiffHandle, int Tag, void *Field);
extern PACKAGE bool __fastcall TIFFGetField3(void * TiffHandle, int Tag, void *Field1, void *Field2, 
	void *Field3);
extern PACKAGE int __fastcall TIFFSetIntField(void * TiffHandle, int Tag, int Field);
extern PACKAGE int __fastcall TIFFSetFloatField(void * TiffHandle, int Tag, float Field);
extern PACKAGE int __fastcall TIFFSetPCharField(void * TiffHandle, int Tag, char * Field);
extern PACKAGE int __fastcall TIFFSetColorMap(void * TiffHandle, TpWordArray pRedValues, TpWordArray 
	pGreenValues, TpWordArray pBlueValues);
extern PACKAGE int __fastcall TIFFScanlineSize(void * TiffHandle);
extern PACKAGE int __fastcall TIFFStripSize(void * TiffHandle);
extern PACKAGE int __fastcall TIFFReadEncodedStrip(void * TiffHandle, int StripNo, void * pBuffer, int 
	StripSize);
extern PACKAGE int __fastcall TIFFComputeStrip(void * TiffHandle, int RowNo, Word SampleNo);
extern PACKAGE int __fastcall TIFFReadScanline(void * TiffHandle, void * pBuffer, int ScanLineSize);
	
extern PACKAGE int __fastcall TIFFWriteScanline(void * TiffHandle, void * pBuffer, int RowNo);
extern PACKAGE int __fastcall TIFFIsTiled(void * TiffHandle);
extern PACKAGE int __fastcall TIFFReadRGBAImage(void * TiffHandle, int ImageWidth, int ImageHeight, 
	void * pBuffer, int StopOnError);
extern PACKAGE int __fastcall TIFFSetDirectory(void * TiffHandle, Word Directory);
extern PACKAGE int __fastcall png_sig_cmp(png_bytep sig, int start, int num_to_check);
extern PACKAGE void * __fastcall png_create_read_struct(char * user_png_ver, void * error_ptr, png_error_ptr 
	error_fn, png_error_ptr warn_fn);
extern PACKAGE void * __fastcall png_create_write_struct(char * user_png_ver, void * error_ptr, png_error_ptr 
	error_fn, png_error_ptr warn_fn);
extern PACKAGE void * __fastcall png_create_info_struct(void * png_ptr);
extern PACKAGE void __fastcall png_destroy_read_struct(png_structpp png_ptr_ptr, png_infopp info_ptr_ptr
	, png_infopp end_info_ptr_ptr);
extern PACKAGE void __fastcall png_destroy_write_struct(png_structpp png_ptr_ptr, png_infopp info_ptr_ptr
	);
extern PACKAGE unsigned __fastcall png_get_rowbytes(void * png_ptr, void * info_ptr);
extern PACKAGE void __fastcall png_read_update_info(void * png_ptr, void * info_ptr);
extern PACKAGE void __fastcall png_set_sig_bytes(void * png_ptr, int num_bytes);
extern PACKAGE void __fastcall png_set_read_fn(void * png_ptr, void * io_ptr, png_rw_ptr read_data_fn
	);
extern PACKAGE void __fastcall png_set_write_fn(void * png_ptr, void * io_ptr, png_rw_ptr write_data_fn
	, png_flush_ptr output_flush_fn);
extern PACKAGE void * __fastcall png_get_io_ptr(void * png_ptr);
extern PACKAGE void __fastcall png_read_info(void * png_ptr, void * info_ptr);
extern PACKAGE unsigned __fastcall png_get_IHDR(void * png_ptr, void * info_ptr, png_uint_32p width, 
	png_uint_32p height, Windows::PInteger bit_depth, Windows::PInteger color_type, Windows::PInteger interlace_type
	, Windows::PInteger compression_type, Windows::PInteger filter_type);
extern PACKAGE void __fastcall png_set_IHDR(void * png_ptr, void * info_ptr, unsigned width, unsigned 
	height, int bit_depth, int color_type, int interlace_type, int compression_type, int filter_type);
extern PACKAGE void __fastcall png_set_gamma(void * png_ptr, double screen_gamma, double default_file_gamma
	);
extern PACKAGE unsigned __fastcall png_get_pHYs(void * png_ptr, void * info_ptr, png_uint_32p res_x, 
	png_uint_32p res_y, Windows::PInteger unit_type);
extern PACKAGE void __fastcall png_set_pHYs(void * png_ptr, void * info_ptr, unsigned res_x, unsigned 
	res_y, int unit_type);
extern PACKAGE unsigned __fastcall png_get_oFFs(void * png_ptr, void * info_ptr, png_uint_32p offset_x
	, png_uint_32p offset_y, Windows::PInteger unit_type);
extern PACKAGE unsigned __fastcall png_get_PLTE(void * png_ptr, void * info_ptr, png_palettepp palette_ptr_ptr
	, Windows::PInteger num_palette);
extern PACKAGE void __fastcall png_set_PLTE(void * png_ptr, void * info_ptr, png_colorp palette_ptr, 
	int num_palette);
extern PACKAGE void __fastcall png_set_strip_16(void * png_ptr);
extern PACKAGE void __fastcall png_set_packing(void * png_ptr);
extern PACKAGE void __fastcall png_set_bgr(void * png_ptr);
extern PACKAGE unsigned __fastcall png_get_bKGD(void * png_ptr, void * info_ptr, png_color_16pp background
	);
extern PACKAGE void __fastcall png_set_bKGD(void * png_ptr, void * info_ptr, png_color_16p background
	);
extern PACKAGE void __fastcall png_set_tRNS(void * png_ptr, void * info_ptr, png_bytep trans, int num_trans
	, png_color_16p trans_values);
extern PACKAGE void __fastcall png_set_background(void * png_ptr, png_color_16p background_color, int 
	background_gamma_code, int need_expand, double background_gamma);
extern PACKAGE unsigned __fastcall png_get_gAMA(void * png_ptr, void * info_ptr, Windows::PDouble file_gamma
	);
extern PACKAGE void __fastcall png_set_gAMA(void * png_ptr, void * info_ptr, double file_gamma);
extern PACKAGE void __fastcall png_set_swap(void * png_ptr);
extern PACKAGE void __fastcall png_set_packswap(void * png_ptr);
extern PACKAGE int __fastcall png_set_interlace_handling(void * png_ptr);
extern PACKAGE void __fastcall png_read_row(void * png_ptr, png_bytep row, png_bytep display_row);
extern PACKAGE void __fastcall png_write_row(void * png_ptr, png_bytep row);
extern PACKAGE void __fastcall png_write_info(void * png_ptr, void * info_ptr);
extern PACKAGE void __fastcall png_write_end(void * png_ptr, void * info_ptr);
extern PACKAGE void __fastcall png_read_end(void * png_ptr, void * info_ptr);
extern PACKAGE void __fastcall png_read_image(void * png_ptr, png_bytepp image);
extern PACKAGE unsigned __fastcall png_get_sRGB(void * png_ptr, void * info_ptr, Windows::PInteger intent
	);
extern PACKAGE void __fastcall png_set_sRGB(void * png_ptr, void * info_ptr, int intent);
extern PACKAGE unsigned __fastcall png_get_valid(void * png_ptr, void * info_ptr, unsigned flag);
extern PACKAGE void __fastcall png_set_compression_level(void * png_ptr, int level);
extern PACKAGE void __fastcall jpeg_init_decompress(j_error_mgr_ptr_ptr error_mgr_ptr_ptr, j_decompress_ptr_ptr 
	decompress_ptr_ptr);
extern PACKAGE void __fastcall jpeg_decompress_done(void * error_mgr_ptr, void * decompress_ptr);
extern PACKAGE void __fastcall jpeg_init_compress(j_error_mgr_ptr_ptr error_mgr_ptr_ptr, j_compress_ptr_ptr 
	compress_ptr_ptr);
extern PACKAGE void __fastcall jpeg_compress_done(void * error_mgr_ptr, void * compress_ptr);
extern PACKAGE void __fastcall jpeg_stdio_src(void * cinfo, void * infile);
extern PACKAGE void __fastcall jpeg_stdio_dest(void * cinfo, void * infile);
extern PACKAGE int __fastcall jpeg_read_header(void * cinfo, int require_image);
extern PACKAGE int __fastcall jpeg_start_decompress(void * cinfo);
extern PACKAGE int __fastcall jpeg_finish_decompress(void * cinfo);
extern PACKAGE void __fastcall jpeg_start_compress(void * cinfo, int write_all_tables);
extern PACKAGE void __fastcall jpeg_finish_compress(void * cinfo);
extern PACKAGE void __fastcall jpeg_get_info(void * cinfo, PCardinal Width, PCardinal Height, Windows::PInteger 
	Components, Windows::PByte ResUnit, Windows::PSmallInt XRes, Windows::PSmallInt YRes, Windows::PInteger 
	FileColorSpace);
extern PACKAGE void __fastcall jpeg_set_info(void * cinfo, unsigned Width, unsigned Height, int Components
	, Byte ResUnit, short XRes, short YRes, int FileColorSpace, int Quality, int Progressive, int OptimizedHuffman
	);
extern PACKAGE unsigned __fastcall jpeg_read_scanlines(void * cinfo, void * scanlines, unsigned max_lines
	);
extern PACKAGE unsigned __fastcall jpeg_write_scanlines(void * cinfo, void * scanlines, unsigned num_lines
	);
extern PACKAGE void __fastcall jpeg_set_out_colorspace(void * cinfo, int colorspace);
extern PACKAGE int __fastcall gbm_init(void);
extern PACKAGE int __fastcall gbm_deinit(void);
extern PACKAGE int __fastcall gbm_guess_filetype(const char * FileName, Windows::PInteger FileType);
	
extern PACKAGE int __fastcall gbm_read_header(const char * FileName, int FileHandle, int FileType, TpGbm 
	GbmPtr, const char * Options);
extern PACKAGE int __fastcall gbm_read_palette(int FileHandle, int FileType, TpGbm GbmPtr, TpGbmRgb 
	PalettePtr);
extern PACKAGE int __fastcall gbm_read_data(int FileHandle, int FileType, TpGbm GbmPtr, void * pData
	, const TGbmProgressProc ProgressFunc, const int CallBackData);
extern PACKAGE int __fastcall gbm_write(const char * FileName, int FileHandle, int FileType, const TpGbm 
	GbmPtr, const TpGbmRgb PalettePtr, const void * pData, const char * Options, const TGbmProgressProc 
	ProgressFunc, const int CallBackData);

}	/* namespace Enclib */
#if !defined(NO_IMPLICIT_NAMESPACE_USE)
using namespace Enclib;
#endif
#pragma option pop	// -w-

#pragma delphiheader end.
//-- end unit ----------------------------------------------------------------
#endif	// EnCLib
