亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频

? 歡迎來到蟲蟲下載站! | ?? 資源下載 ?? 資源專輯 ?? 關(guān)于我們
? 蟲蟲下載站

?? jpeg.c

?? Ming is a library for generating Macromedia Flash files (.swf), written in C, and includes useful ut
?? C
字號:
/*    Ming, an SWF output library    Copyright (C) 2002  Opaque Industries - http://www.opaque.net/    This library is free software; you can redistribute it and/or    modify it under the terms of the GNU Lesser General Public    License as published by the Free Software Foundation; either    version 2.1 of the License, or (at your option) any later version.    This library 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.  See the GNU    Lesser General Public License for more details.    You should have received a copy of the GNU Lesser General Public    License along with this library; if not, write to the Free Software    Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA*//* $Id: jpeg.c,v 1.18 2008/01/17 14:38:30 vapour Exp $ */#include <stdlib.h>#include "jpeg.h"#include "character.h"#include "input.h"#include "error.h"#include "method.h"#include "libming.h"struct SWFJpegBitmap_s{	struct SWFCharacter_s character;	SWFInput input;	int length;#if TRACK_ALLOCS	/* memory node for garbage collection */	mem_node *gcnode;#endif};struct SWFJpegWithAlpha_s{	struct SWFCharacter_s character;	SWFInput input;	 /* leave these here so that we */	int length;			 /* can cast this to swfJpegBitmap */	SWFInput alpha;	int jpegLength;};/* JPEG stream markers: */#define JPEG_MARKER 0xFF/* Start of Image, End of Image */#define JPEG_SOI	0xD8#define JPEG_EOI	0xD9#define JPEG_JFIF 0xE0/* encoding markers, quantization tables and Huffman tables */#define JPEG_QUANT 0xDB#define JPEG_HUFF	 0xC4/* image markers, start of frame and start of scan */#define JPEG_SOF0 0xC0#define JPEG_SOF1 0xC1#define JPEG_SOF2 0xC2#define JPEG_SOS	0xDA#define JPEG_ED		0xED /* app13 */#define JPEG_EE		0xEE /* app14 */#define JPEG_DD		0xDD /* ??? */static intcompleteSWFJpegBitmap(SWFBlock block){	return ((SWFJpegBitmap)block)->length;}/* clumsy utility function.. */voiddumpJpegBlock(byte type,							SWFInput input, SWFByteOutputMethod method, void *data){	int i, l0, l1, length;	method(JPEG_MARKER, data);	method(type, data);	method((unsigned char)(l0 = SWFInput_getChar(input)), data);	method((unsigned char)(l1 = SWFInput_getChar(input)), data);	length = (l0<<8) + l1 - 2;	for ( i=0; i<length; ++i )		method((unsigned char)SWFInput_getChar(input), data);}intskipJpegBlock(SWFInput input){	int length = (SWFInput_getChar(input)<<8) + SWFInput_getChar(input);	SWFInput_seek(input, length-2, SEEK_CUR);	return length;}voidmethodWriteJpegFile(SWFInput input, SWFByteOutputMethod method, void *data){	int c;	SWFInput_rewind(input);	if ( (c = SWFInput_getChar(input)) != JPEG_MARKER )		SWF_error("Initial Jpeg marker not found!");	if ( (c = SWFInput_getChar(input)) != JPEG_SOI )		SWF_error("Jpeg SOI not found!");	/*	method(JPEG_MARKER, data);	method(JPEG_SOI, data);	method(JPEG_MARKER, data);	method(JPEG_EOI, data);	*/	method(JPEG_MARKER, data);	method(JPEG_SOI, data);	for ( ;; )	{		if ( SWFInput_getChar(input) != JPEG_MARKER )			SWF_error("Jpeg marker not found where expected!");		switch ( c = SWFInput_getChar(input) )		{			case JPEG_EOI:				SWF_error("Unexpected end of Jpeg file (EOI found)!");	/*	case JPEG_JFIF: */			case JPEG_QUANT:			case JPEG_HUFF:			case JPEG_DD:				/* if(!finishedEncoding) */				dumpJpegBlock((unsigned char)c, input, method, data);				/* else					 SWF_error("Encoding tables found in Jpeg image section!"); */				break;			case JPEG_SOF0:			case JPEG_SOF1:			case JPEG_SOF2:				/*				if(!finishedEncoding)				{					finishedEncoding = TRUE;					method(JPEG_MARKER, data);					method(JPEG_EOI, data);					method(JPEG_MARKER, data);					method(JPEG_SOI, data);					method(JPEG_MARKER, data);					method(c, data);				}				*/				dumpJpegBlock((unsigned char)c, input, method, data);				break;			case JPEG_SOS:				/*					if(!finishedEncoding)					SWF_error("Found SOS before SOF in Jpeg file!");				*/				break;			default:				/* dumpJpegBlock(c, input, method, data); */				skipJpegBlock(input);		}		if ( c == JPEG_SOS )			break;		if ( SWFInput_eof(input) )			SWF_error("Unexpected end of Jpeg file (EOF found)!");	}	if ( c != JPEG_SOS )		SWF_error("SOS block not found in Jpeg file!");	/* rest is SOS, dump to end of file */	method(JPEG_MARKER, data);	method((unsigned char)c, data);	while ( (c = SWFInput_getChar(input)) != EOF )		method((unsigned char)c, data);}voidwriteSWFJpegBitmapToMethod(SWFBlock block, SWFByteOutputMethod method, void *data){	SWFJpegBitmap jpeg = (SWFJpegBitmap)block;	methodWriteUInt16(CHARACTERID(jpeg), method, data);	methodWriteJpegFile(jpeg->input, method, data);}voidwriteSWFJpegWithAlphaToMethod(SWFBlock block, SWFByteOutputMethod method, void *data){	SWFJpegWithAlpha jpeg = (SWFJpegWithAlpha)block;	int c;	methodWriteUInt16(CHARACTERID(jpeg), method, data);	methodWriteUInt32(jpeg->jpegLength, method, data);	methodWriteJpegFile(jpeg->input, method, data);	/* now write alpha file.. */	SWFInput_rewind(jpeg->alpha);	while ( (c = SWFInput_getChar(jpeg->alpha)) != EOF )		method((unsigned char)c, data);}voiddestroySWFJpegBitmap(SWFJpegBitmap jpegBitmap){	free(CHARACTER(jpegBitmap)->bounds);#if TRACK_ALLOCS	ming_gc_remove_node(jpegBitmap->gcnode);#endif	free(jpegBitmap);}struct jpegInfo{	int width;	int height;	int length;};static struct jpegInfo*scanJpegFile(SWFInput input){	int length = 0, l, c;	long pos, end;	struct jpegInfo* info = (struct jpegInfo*)malloc(sizeof(struct jpegInfo));	/* If malloc failed, return NULL to signify this */	if (NULL == info)		return NULL;	/* scan file, get height and width, make sure it looks valid,		 also figure length of block.. */	if ( SWFInput_getChar(input) != JPEG_MARKER )		SWF_error("Initial Jpeg marker not found!");	if ( SWFInput_getChar(input) != JPEG_SOI )		SWF_error("Jpeg SOI not found!");	for ( ;; )	{		if ( SWFInput_getChar(input) != JPEG_MARKER )			SWF_error("Jpeg marker not found where expected!");		switch ( c = SWFInput_getChar(input) )		{			case JPEG_EOI:				SWF_error("Unexpected end of Jpeg file (EOI found)!");	/*	case JPEG_JFIF: */			case JPEG_QUANT:			case JPEG_HUFF:			case JPEG_DD:				/*				if(finishedEncoding)					SWF_error("Encoding tables found in Jpeg image section!");				*/				length += skipJpegBlock(input) + 2;				break;			case JPEG_SOF2:				SWF_error("Only baseline (frame 0) jpegs are supported!");			case JPEG_SOF0:			case JPEG_SOF1:				/*				if ( finishedEncoding )					SWF_error("Found second SOF in Jpeg file!");				else				{					finishedEncoding = TRUE;					length += 4; // end image, start image				}				*/				l = SWFInput_getUInt16_BE(input);				SWFInput_getChar(input); /* precision */				info->height = SWFInput_getUInt16_BE(input);				info->width = SWFInput_getUInt16_BE(input);				length += l + 2;				l -= 7;								SWFInput_seek(input, l, SEEK_CUR);				break;			case JPEG_SOS:				/*					if(!finishedEncoding)					SWF_error("Found SOS before SOF in Jpeg file!");				*/				break;			default:				/* length += */				skipJpegBlock(input); /* + 2 */		}		if ( c == JPEG_SOS )			break;		if ( SWFInput_eof(input) )			SWF_error("Unexpected end of Jpeg file (EOF found)!");	}	if ( c != JPEG_SOS )		SWF_error("SOS block not found in Jpeg file!");	/* rest is SOS, dump to end of file */	length += 2; /* SOS tag */	/* figure out how long the rest of the file is */	pos = SWFInput_tell(input);	SWFInput_seek(input, 0, SEEK_END);	end = SWFInput_tell(input);	length += end - pos;	info->length = length;	return info;}SWFJpegBitmapnewSWFJpegBitmap_fromInput(SWFInput input){	SWFJpegBitmap jpeg;	struct jpegInfo *info;	SWFRect temp_rect;	jpeg = (SWFJpegBitmap) malloc(sizeof(struct SWFJpegBitmap_s));	/* If malloc failed, return NULL to signify this */	if (NULL == jpeg)		return NULL;	SWFCharacterInit((SWFCharacter)jpeg);	CHARACTERID(jpeg) = ++SWF_gNumCharacters;	BLOCK(jpeg)->writeBlock = writeSWFJpegBitmapToMethod;	BLOCK(jpeg)->complete = completeSWFJpegBitmap;	BLOCK(jpeg)->dtor = (destroySWFBlockMethod) destroySWFJpegBitmap;	BLOCK(jpeg)->type = SWF_DEFINEBITSJPEG2;	jpeg->input = input;	info = scanJpegFile(input);	/* If scanJpegFile() failed, return NULL to signify this */	if (NULL == info)	{		free (jpeg);		return NULL;	}	temp_rect = newSWFRect(0, info->width, 0, info->height);	/* If newSWFRect() failed, return NULL to signify this */	if (NULL == temp_rect)	{		free(info);		free(jpeg);		return NULL;	}	CHARACTER(jpeg)->bounds = temp_rect;	jpeg->length = info->length + 4;	free(info);#if TRACK_ALLOCS	jpeg->gcnode = ming_gc_add_node(jpeg, (dtorfunctype) destroySWFBitmap);#endif	return jpeg;}static voiddestroySWFJpegBitmap_andInputs(SWFJpegBitmap jpegBitmap){	destroySWFInput(jpegBitmap->input);	destroySWFJpegBitmap(jpegBitmap);}SWFJpegBitmapnewSWFJpegBitmap(FILE *f){	SWFJpegBitmap jpeg = newSWFJpegBitmap_fromInput(newSWFInput_file(f));	/* If newSWFJpegBitmap_fromInput() failed, return NULL to signify this */	if (NULL == jpeg)		return NULL;	BLOCK(jpeg)->dtor = (destroySWFBlockMethod) destroySWFJpegBitmap_andInputs;	return jpeg;}/* f is a jpeg file, alpha is zlib-compressed data */SWFJpegWithAlphanewSWFJpegWithAlpha_fromInput(SWFInput input, SWFInput alpha){	SWFRect temp_rect;	SWFJpegWithAlpha jpeg;	struct jpegInfo *info;	int alen;	jpeg = (SWFJpegWithAlpha) malloc(sizeof(struct SWFJpegWithAlpha_s));	/* If malloc failed, return NULL to signify this */	if (NULL == jpeg)		return NULL;	SWFCharacterInit((SWFCharacter)jpeg);	CHARACTERID(jpeg) = ++SWF_gNumCharacters;	BLOCK(jpeg)->writeBlock = writeSWFJpegWithAlphaToMethod;	BLOCK(jpeg)->complete = completeSWFJpegBitmap; // can use same complete	BLOCK(jpeg)->dtor = (destroySWFBlockMethod) destroySWFJpegBitmap;			 // ditto here	BLOCK(jpeg)->type = SWF_DEFINEBITSJPEG3;	jpeg->input = input;	jpeg->alpha = alpha;	info = scanJpegFile(input);	/* If scanJpegFile() failed, return NULL to signify this */	if (NULL == info)	{		free (jpeg);		return NULL;	}	temp_rect = newSWFRect(0, info->width, 0, info->height);	/* If newSWFRect() failed, return NULL to signify this */	if (NULL == temp_rect)	{		free(info);		free(jpeg);		return NULL;	}	CHARACTER(jpeg)->bounds = temp_rect;	jpeg->jpegLength = info->length + 2; /* ?? */	free(info);	if ( (alen = SWFInput_length(alpha)) == -1 )		SWF_error("couldn't get alpha file length!");	jpeg->length = jpeg->jpegLength + alen + 6;	return jpeg;}voiddestroySWFJpegAlpha_andInputs(SWFJpegWithAlpha jpegWithAlpha){	destroySWFInput(jpegWithAlpha->input);	destroySWFInput(jpegWithAlpha->alpha);	destroySWFJpegBitmap((SWFJpegBitmap) jpegWithAlpha);}SWFJpegWithAlphanewSWFJpegWithAlpha(FILE *f, FILE *alpha){	SWFJpegWithAlpha jpeg =		newSWFJpegWithAlpha_fromInput(newSWFInput_file(f), newSWFInput_file(alpha));	/* If newSWFJpegBitmap_fromInput() failed, return NULL to signify this */	if (NULL == jpeg)		return NULL;	BLOCK(jpeg)->dtor = (destroySWFBlockMethod) destroySWFJpegAlpha_andInputs;	return jpeg;}/* * Local variables: * tab-width: 2 * c-basic-offset: 2 * End: */

?? 快捷鍵說明

復(fù)制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
91影视在线播放| 日韩精品一级二级| 国产精品1区二区.| 国产午夜亚洲精品午夜鲁丝片| 青草av.久久免费一区| 欧美成人性战久久| 国产一区三区三区| 国产精品乱码人人做人人爱 | 精品国一区二区三区| 国产一区二区三区蝌蚪| 国产精品无码永久免费888| 一区二区三区四区亚洲| 日韩精品专区在线影院观看| 欧美日韩在线观看一区二区| 无码av免费一区二区三区试看| 日韩午夜在线观看视频| 欧美va日韩va| 亚洲婷婷综合色高清在线| 丝袜亚洲另类丝袜在线| 丁香另类激情小说| 欧美一区二区三区免费视频| 中文一区二区完整视频在线观看| 国产精品私人自拍| 国产精品1024| 亚洲国产精品传媒在线观看| 欧美在线影院一区二区| 国产目拍亚洲精品99久久精品| 亚洲亚洲人成综合网络| 一本久道久久综合中文字幕| 国产宾馆实践打屁股91| 6080yy午夜一二三区久久| 久久福利资源站| 91麻豆精品国产91久久久久久| 日韩国产欧美在线播放| 91精品国产色综合久久ai换脸 | 国产精品污污网站在线观看| 久久99久久99| wwwwxxxxx欧美| 成人永久免费视频| 国产精品久久久久永久免费观看| 91视频你懂的| 免费观看成人鲁鲁鲁鲁鲁视频| 日韩欧美一级特黄在线播放| 免费在线看一区| 久久综合狠狠综合久久综合88| 欧美日韩综合在线免费观看| 亚洲图片另类小说| 国产日韩综合av| 日本高清无吗v一区| 欧美一区二区三区四区五区 | 亚洲精品国产成人久久av盗摄 | 亚洲国产视频a| 亚洲成人三级小说| 午夜精品久久久久久| 五月天亚洲精品| 青青草国产成人av片免费| 黄色成人免费在线| 大胆亚洲人体视频| 欧洲一区在线观看| 777奇米成人网| 欧美精品一区二区三区很污很色的 | 久久精品久久综合| 国产在线精品一区二区不卡了 | 一区二区三区欧美激情| 亚洲成人三级小说| 精品一区二区三区久久| 丰满白嫩尤物一区二区| 93久久精品日日躁夜夜躁欧美| 91久久精品一区二区三| 欧美区视频在线观看| 日韩精品一区二区在线观看| 国产精品无圣光一区二区| 亚洲影视在线播放| 韩国女主播一区| 欧洲亚洲精品在线| www国产成人免费观看视频 深夜成人网 | 91精品国产色综合久久不卡电影 | 久久超碰97中文字幕| caoporen国产精品视频| 欧美日韩精品高清| 国产色91在线| 亚洲地区一二三色| 国产黑丝在线一区二区三区| 欧美系列日韩一区| 国产欧美日韩一区二区三区在线观看| 亚洲综合色婷婷| 精品一区二区三区久久| 在线观看中文字幕不卡| 久久婷婷成人综合色| 一区二区三区中文在线| 国内精品视频一区二区三区八戒 | 91在线观看免费视频| 欧美一区二区三区在线观看视频| 亚洲成人中文在线| 国产成人在线影院| 欧美疯狂做受xxxx富婆| 国产精品电影院| 精品在线免费观看| 在线看国产一区| 国产日韩欧美精品在线| 五月天激情综合| 99久久精品一区二区| 久久亚洲二区三区| 日韩成人一区二区| 色婷婷激情综合| 欧美国产禁国产网站cc| 午夜影视日本亚洲欧洲精品| 91美女视频网站| 欧美极品另类videosde| 另类小说欧美激情| 欧美美女直播网站| 一区二区三区在线播放| 不卡av在线免费观看| 精品日产卡一卡二卡麻豆| 日韩在线播放一区二区| 色婷婷综合五月| 亚洲国产成人在线| 国产一区二区三区四| 日韩精品中文字幕在线不卡尤物| 亚洲电影一级黄| 一本大道av伊人久久综合| 国产精品天天摸av网| 国产精品一二三四区| 精品盗摄一区二区三区| 蜜桃av噜噜一区| 欧美一三区三区四区免费在线看 | 国产精品网曝门| 国产成人精品亚洲午夜麻豆| 亚洲精品在线网站| 久久er99精品| 日韩欧美aaaaaa| 免费高清成人在线| 日韩三级伦理片妻子的秘密按摩| 亚洲综合视频在线观看| 在线观看不卡一区| 亚洲电影你懂得| 欧美色网一区二区| 午夜日韩在线电影| 91麻豆精品国产综合久久久久久| 午夜视频久久久久久| 91精品婷婷国产综合久久竹菊| 亚洲国产日韩精品| 欧美日韩激情在线| 日本亚洲免费观看| 欧美成人激情免费网| 美女在线视频一区| 精品久久一二三区| 懂色av一区二区在线播放| 国产视频不卡一区| 99视频热这里只有精品免费| 亚洲色图在线播放| 欧美午夜精品一区| 日本麻豆一区二区三区视频| 精品日本一线二线三线不卡| 国产很黄免费观看久久| 国产精品久久久久影院亚瑟 | 国产欧美日韩视频在线观看| fc2成人免费人成在线观看播放 | 久久精品国产第一区二区三区| 精品毛片乱码1区2区3区 | 在线不卡中文字幕播放| 久久精品999| 国产欧美一区二区三区鸳鸯浴| 成人app网站| 亚洲图片一区二区| 日韩欧美卡一卡二| 丁香婷婷综合激情五月色| 一区二区三区在线高清| 日韩精品专区在线影院重磅| 成人网在线免费视频| 午夜国产精品一区| 久久久久久久综合色一本| 99久久久免费精品国产一区二区| 亚洲国产aⅴ天堂久久| 91精品国产欧美一区二区18| 国产精品一线二线三线精华| 亚洲乱码国产乱码精品精98午夜 | 中文字幕永久在线不卡| 欧美三级日本三级少妇99| 美女在线视频一区| 中文字幕一区三区| 日韩欧美三级在线| 色婷婷av一区二区| 国产一区二区视频在线| 亚洲一区二区三区四区五区中文| 欧美mv日韩mv国产网站app| av影院午夜一区| 青青草国产精品97视觉盛宴| 中文字幕在线播放不卡一区| 91精品国产综合久久久久久漫画| 国产91综合网| 爽好多水快深点欧美视频| 国产精品对白交换视频| 精品区一区二区| 欧美日韩视频在线第一区| 懂色中文一区二区在线播放| 免费观看成人av| 亚洲成年人影院| 中文字幕色av一区二区三区| 精品久久一二三区|