LZW compression example with java

源代码在线查看: gif.h

软件大小: 40 K
上传用户: alin
关键词: compression example with java
下载地址: 免注册下载 普通下载 VIP

相关代码

				/*The GIF loader, Included as a part of the compression tutorial
				 *Written By Martin Zolnieryk (c) 2004
				 *This code is freeware, however if you use this some credit
				 *be nice.
				 *This code is based upon the GifAllegS Library
				*/
				#define GIF_EOI (1 				#define GIF_CC  (1 				//The gif table
				//:)
				typedef struct GIF_STRUCT
				{
				BITMAP *image;
				//The Signature
				unsigned char id[6]; //Includes GIF + ver number
				unsigned char buffer[255];
				//Screen Descripter
				unsigned short int s_width;  //2 Bytes each, the screen size
				unsigned short int s_height;
				unsigned char global_depth; //first 3 bits = pixel-1, 0, next 3 = bpp-1, next 1 = color map afterwards
				unsigned char bpp;
				unsigned char backround; //next byte
				unsigned char reserved; //Not reserved, for 89a use.
				long counter;
				unsigned char cc;
				//COLOUR TABLE HERE, how every big it is;
				//rgb order
				//Image descripter
				//This  character  is defined as 0x2C hex or ',' Introduces image desc.
				unsigned int  ileft, itop, iwidth, iheight; //Really only useful for animated gifs
				unsigned char depth; //0-3bytes, pixel-1,0,0,0,1 byte interlaced, 1 byte local pal.
				//  character 0x3B hex or ';'  gif terminater, finished, end of gif. goodbye :p
				unsigned char code_size;
				unsigned char block_byte;
				}GIF;
				
				BITMAP *load_gif(const char *filename, RGB *pal); //Loads gif
				void draw_lzw_pixel(BITMAP *image,long counter,unsigned char first_code);  //renders pixel
				int get_gif_lzw_code(FILE *fp,LZW *table, GIF *gif); //gets the gif cod
				
							

相关资源