/**********************************************************************
 
	Copyright (C) 2003 Hirohisa MORI <joshua@nichibun.ac.jp>
 
	This program is free software; you can redistribute it 
	and/or modify it under the terms of the GLOBALBASE 
	Library General Public License (G-LGPL) as published by 

	http://www.globalbase.org/
 
	This program is distributed in the hope that it will be 
	useful, but WITHOUT ANY WARRANTY; without even the 
	implied warranty of MERCHANTABILITY or FITNESS FOR A 
	PARTICULAR PURPOSE.

**********************************************************************/

#ifndef _GIF_H
#define _GIF_H

#include <stdlib.h>
#include "gif_rgb.h"

/***********************************************************************
GIF圧縮処理の同時起動スレッド数
************************************************************************/
#ifndef	MEDIANCUT_THREAD_NUM
#define	MEDIANCUT_THREAD_NUM	5
#endif

typedef struct{
	ColorMap cmap;	/* 256色のカラーマップ */
	int width;	/* 画像高さ（必要ないが一応つけておく）*/
	int height;	/* 画像幅（必要ないが一応つけておく）*/
}GIF_ENV;

/***********************************************************************
プロトタイプ宣言（lzw.c）
************************************************************************/
extern int enLZW(unsigned char *code, int clen, unsigned char *text, int tlen);
extern int deLZW(unsigned char *text, int tlen, unsigned char *code, int clen);

/***********************************************************************
プロトタイプ宣言（gif.c）
************************************************************************/
extern unsigned char * gif_compress(
	int * ret_length,
	GIF_ENV * ret_ge,
	GIF_ENV * ge,
	unsigned int * data,
	int width,
	int height);
extern void * gif_conpress(
	int * ret_length,
	GIF_ENV * ret_ge,
	GIF_ENV * ge,
	unsigned int * data,
	int width,
	int height);
extern unsigned int * gif_uncompress(
	int * ret_width,
	int * ret_height,
	GIF_ENV * ge,
	unsigned char * data,
	int length);
extern char * gif_unconpress(
	int * ret_width,
	int * ret_height,
	GIF_ENV * ge,
	unsigned char * data,
	int length);

#endif