//	ＡＩＧライブラリ　グラフィック関数
//		Copyright (C) 1992-1994,98,99 by AIG-SOFT

#ifndef	__AIG_GRAPH__
#define	__AIG_GRAPH__	1

#include <stdio.h>
#include "deftype.h"

#ifdef	__cplusplus
// 95/11 : G++対応
extern	"C" {
#endif

#ifdef	__PROTO_TYPE
	int	picload(unchar *);
	int	mpicload(unchar *,unsint *);
	int	gcolor_count(unsint *);
	int	gcolor_count2(unsint *);
	int	trns256(unchar *,unsint *,int);
	int	zimhead(FILE *,unchar *,unchar *,int,int,int,int,int,int);
	int	zim_write(FILE *,unchar *,int,int,int,int);
	int	zim_write_pro(FILE *,unchar *,int,int,int,int);
	int	zim_1write(int,FILE *,unchar *,int,int,int);
	int	zim_1write_pro(int,FILE *,unchar *,int,int,int);
	int	zim_1end(FILE *fp);
	int	pixhead(FILE *,int,int,int);
	int	pix_write(FILE *,unchar *,int,int);
	int	cuthead(FILE *,unchar *,int,int);
	int	cut_write(FILE *,unchar *,int,int);
	int	ttlhead(FILE *,int,int,int,int);
	int	pix_sub(FILE *,unchar *,int,int,int);
	int	ttl_sub(FILE *,unchar *,int,int,int);
	int	beta16_write(FILE *,unchar *,int,int);
	int	beta16_disp(FILE *,int,int,int,int,int,int,int,int);
	int	beta256_disp(FILE *,int,int,int,int,int,int,int,int);
	int	beta64K_disp(FILE *,int,int,int,int,int,int,int);
	int	beta_disp(FILE *,int,int,int,int,int,int,int,int);
	int	gput8(int,unsint *,int);
	int	zim_disp(FILE *,int,int);
	int	pix_disp(FILE *,int,int);
	int	cut_disp(FILE *,int,int,int);
	int	CutDisp2(FILE *,int,int,int);
	int	ttl_disp(FILE *,int,int);
	int	ipx_disp(FILE *,int,int,int,int);
	int	RDGPAL1(int);
	int	pal_write(FILE *,int);
	int	set_pal_beta(unchar *,int,int *,int *,int *,int *,int,int);
	int	write_pal_beta(unchar *,unsint *,int,int,int,int,int,int,int);
	int	RFILL(int,int,int,int,int,int,int,int,int);
	
	unchar	*g_line_pres8(unchar *,int,int,unchar *);
	unchar	*g_line_pres16(unchar *,int,int,unsint *);
	unchar	*cut1disp(unchar *,int,int,unsint *,unchar *);
	
	void	gbwconv(void);
	void	bbwconv(unchar *);
	void	bbwconv_768(unchar *);
	void	bbwconv_pix(unchar *);
	void	bbwconv_256(unchar *);
	void	g8conv(void);
	void	b8conv(unchar *);
	void	b8conv_768(unchar *);
	void	b8conv_pix(unchar *);
	void	b8conv_256(unchar *);
	void	g16conv(unchar *);
	void	g16conv_768(unchar *);
	void	g16conv_pix(unchar *);
	void	g16conv_256(unchar *);
	void	g256conv(unchar *);
	void	g256conv_256(unchar *);
	void	g64kconv_256(unchar *);
	void	pal16set(void);
	void	pal256set(void);
	void	trns256_palset(unsint *,int);
	void	dither256(int,unchar *);
	void	gr512(unchar *,int,int,int,int);
	void	gr1024(unchar *,int,int,int,int);
	void	gr16_512(unchar *,int,int,int,int);
	void	gr16_1024(unchar *,int,int,int,int);
	void	gr64k(unsint *,int,int,int,int);
	void	zim1disp(int,int,unsint *,int);
	void	zim1disp16(int,int,unsint *,int);
	void	rzim1disp16(int,int,unsint *,int);
	void	pixdispm(int,int,unsint *,int);
	void	read_gram1(int,int,int,int,unchar *);
	void	read_gram2(int,int,int,int,unsint *);
	void	HWIPE(void);
	void	zim_expand(unchar *,unchar *,unchar *,int);
	void	ARDGPAL(unsint *,int );
	void	ReadGPal(unsint *,int );
	void	SetGPal(unsint *,int );
	void	gread16(unchar *,int );
	void	gr64k16(unchar *,int ,unsint *);
	void	GrCopy64K(int,int,int,int,int,int);
	void	GrCopy64KR(int,int,int,int,int,int);
	void	symbol2(int,int,char *,int,int,int,int,int,int);
	void	filsym(int,int,int,int,int,int,int,int,char *,int);
	void	GPalHalf(int );
#else
	int	picload();
	int	mpicload();
	int	gcolor_count();
	int	gcolor_count2();
	int	trns256();
	int	zimhead();
	int	zim_write();
	int	zim_write_pro();
	int	zim_1write();
	int	zim_1write_pro();
	int	zim_1end();
	int	pixhead();
	int	pix_write();
	int	cuthead();
	int	cut_write();
	int	ttlhead();
	int	pix_sub();
	int	ttl_sub();
	int	beta16_write();
	int	beta16_disp();
	int	beta256_disp();
	int	beta64K_disp();
	int	beta_disp();
	int	gput8();
	int	zim_disp();
	int	pix_disp();
	int	cut_disp();
	int	CutDisp2();
	int	ttl_disp();
	int	ipx_disp();
	int	RDGPAL1();
	int	pal_write();
	int	set_pal_beta();
	int	write_pal_beta();
	int	RFILL();
	
	unchar	*g_line_pres8();
	unchar	*g_line_pres16();
	unchar	*cut1disp();
	
	void	gbwconv();
	void	bbwconv();
	void	bbwconv_768();
	void	bbwconv_pix();
	void	bbwconv_256();
	void	g8conv();
	void	b8conv();
	void	b8conv_768();
	void	b8conv_pix();
	void	b8conv_256();
	void	g16conv();
	void	g16conv_768();
	void	g16conv_pix();
	void	g16conv_256();
	void	g256conv();
	void	g256conv_256();
	void	g64kconv_256(unchar *);
	void	pal16set();
	void	pal256set();
	void	trns256_palset();
	void	dither256();
	void	gr512();
	void	gr1024();
	void	gr16_512();
	void	gr16_1024();
	void	gr64k();
	void	zim1disp();
	void	zim1disp16();
	void	rzim1disp16();
	void	pixdispm();
	void	read_gram1();
	void	read_gram2();
	void	HWIPE();
	void	zim_expand();
	void	ARDGPAL();
	void	ReadGPal();
	void	SetGPal();
	void	gread16();
	void	gr64k16();
	void	GrCopy64K();
	void	GrCopy64KR();
	void	symbol2();
	void	filsym();
	void	GPalHalf();
#endif
#ifdef	__cplusplus
}
#endif

/* 標準１６色パレット変数 */
extern unchar Def_16_Pal[16][3];

/* マクロ関数 */
/* ６５５３６色べたファイル表示 */
#define beta64K_disp(fp,fcl,fmem,x,y,wx,wy,crt)	beta_disp(fp,fcl,fmem,x,y,wx,wy,0,crt)

/* ２５６色べたファイル表示 */
#define beta256_disp(fp,fcl,fmem,x,y,wx,wy,fpal,crt) beta_disp(fp,fcl,fmem,x,y,wx,wy,fpal,crt)

/* １６色べたファイル表示 */
#define beta16_disp(fp,fcl,fmem,x,y,wx,wy,fpal,crt) beta_disp(fp,fcl,fmem,x,y,wx,wy,fpal,crt)

#endif
