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

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

?? shape.c

?? Ming is a library for generating Macromedia Flash files (.swf), written in C, and includes useful ut
?? C
?? 第 1 頁 / 共 3 頁
字號:
/*    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: shape.c,v 1.55 2008/09/12 09:13:36 krechert Exp $ */#include <stdlib.h>#include <stdio.h> 	 #include <stdarg.h>#include "shape.h"#include "character.h"#include "matrix.h"#include "fillstyle.h"#include "linestyle.h"#include "font.h"#include "libming.h"struct stateChangeRecord{	int flags;	int moveToX;	int moveToY;	int leftFill;	int rightFill;	int line;	/* newstyle not used.. */};typedef struct stateChangeRecord *StateChangeRecord;struct lineToRecord{	int dx;	int dy;};typedef struct lineToRecord *LineToRecord;struct curveToRecord{	int controlx;	int controly;	int anchorx;	int anchory;};typedef struct curveToRecord *CurveToRecord;typedef enum{	SHAPERECORD_STATECHANGE,	SHAPERECORD_LINETO,	SHAPERECORD_CURVETO} shapeRecordType;struct shapeRecord{	shapeRecordType type;	union	{		StateChangeRecord stateChange;		LineToRecord lineTo;		CurveToRecord curveTo;	} record;};typedef struct shapeRecord ShapeRecord;struct SWFShape_s{	struct SWFCharacter_s character;	ShapeRecord *records;	int nRecords;	SWFOutput out;	int xpos;	/* cursor for using abs. coords in lineTo, curveTo */	int ypos;	SWFLineStyle *lines;	SWFFillStyle *fills;	byte nLines;	byte nFills;	short lineWidth;	BOOL isMorph;	BOOL isEnded;	int useVersion;	// SWF_DEFINESHAPE4 extensions	unsigned char flags;	SWFRect edgeBounds;#if TRACK_ALLOCS	/* memory node for garbage collection */	mem_node *gcnode;#endif};static voidSWFShape_writeShapeRecord(SWFShape shape, ShapeRecord record, SWFOutput out);static voidwriteSWFShapeBlockToMethod(SWFBlock block,                            SWFByteOutputMethod method, void* data){	SWFOutput out = ((SWFShape)block)->out;	SWFOutput_writeToMethod(out, method, data);}static intcompleteSWFShapeBlock(SWFBlock block){	SWFShape shape = (SWFShape)block;	SWFShape_end(shape);		return SWFOutput_getLength(shape->out);}voiddestroySWFShape(SWFShape shape){	int i;	if(shape->fills != NULL)	{		// Fills have to be destroyed by users. 		/*		for ( i=0; i<shape->nFills; ++i )			destroySWFFillStyle(shape->fills[i]);		*/		free(shape->fills);	}	if(shape->records != NULL)	{		for(i = 0; i < shape->nRecords; i++)		{			free(shape->records[i].record.stateChange);		}	 	free(shape->records);	}	if(shape->edgeBounds != NULL)		free(shape->edgeBounds);	for ( i=0; i<shape->nLines; ++i )		free(shape->lines[i]);	if ( shape->lines != NULL )		free(shape->lines);	destroySWFOutput(shape->out);#if TRACK_ALLOCS	ming_gc_remove_node(shape->gcnode);#endif	destroySWFCharacter((SWFCharacter) shape);}SWFShape newSWFGlyphShape(){	SWFShape shape = (SWFShape)malloc(sizeof(struct SWFShape_s));	/* If malloc failed, return NULL to signify this */	if (NULL == shape)		return NULL;	SWFCharacterInit((SWFCharacter)shape);	BLOCK(shape)->writeBlock = NULL;	BLOCK(shape)->complete = NULL;	BLOCK(shape)->dtor = NULL;	BLOCK(shape)->type = SWF_UNUSEDBLOCK;		shape->out = newSWFOutput();	CHARACTER(shape)->bounds = newSWFRect(0,0,0,0);	shape->edgeBounds = newSWFRect(0,0,0,0);	shape->records = NULL;	shape->lines = NULL;	shape->fills = NULL;	shape->nRecords = 0;	shape->xpos = 0;	shape->ypos = 0;	shape->nLines = 0;	shape->nFills = 0;	shape->lineWidth = 0;	shape->isMorph = FALSE;	shape->isEnded = FALSE;	shape->flags = 0;	shape->useVersion = 0;	SWFOutput_writeUInt8(shape->out, 0); /* space for nFillBits, nLineBits */#if TRACK_ALLOCS	shape->gcnode = ming_gc_add_node(shape, (dtorfunctype) destroySWFShape);#endif	return shape;}SWFShapenewSWFShape(){	SWFShape shape = (SWFShape)malloc(sizeof(struct SWFShape_s));	/* If malloc failed, return NULL to signify this */	if (NULL == shape)		return NULL;	SWFCharacterInit((SWFCharacter)shape);	BLOCK(shape)->writeBlock = writeSWFShapeBlockToMethod;	BLOCK(shape)->complete = completeSWFShapeBlock;	BLOCK(shape)->dtor = (destroySWFBlockMethod) destroySWFShape;	BLOCK(shape)->type = SWF_DEFINESHAPE3;		CHARACTERID(shape) = ++SWF_gNumCharacters;	shape->out = newSWFOutput();	CHARACTER(shape)->bounds = newSWFRect(0,0,0,0);	shape->edgeBounds = newSWFRect(0,0,0,0);	shape->records = NULL;	shape->lines = NULL;	shape->fills = NULL;	shape->nRecords = 0;	shape->xpos = 0;	shape->ypos = 0;	shape->nLines = 0;	shape->nFills = 0;	shape->lineWidth = 0;	shape->isMorph = FALSE;	shape->isEnded = FALSE;	shape->flags = 0;	shape->useVersion = SWF_SHAPE3;	SWFOutput_writeUInt8(shape->out, 0); /* space for nFillBits, nLineBits */#if TRACK_ALLOCS	shape->gcnode = ming_gc_add_node(shape, (dtorfunctype) destroySWFShape);#endif	return shape;}/* * Creates a shape filled with bitmap */SWFShapenewSWFShapeFromBitmap(SWFBitmap bitmap, int flag){	SWFShape shape = newSWFShape();	SWFFillStyle fill;	int width, height;	if ( flag != SWFFILL_TILED_BITMAP && flag != SWFFILL_CLIPPED_BITMAP)	{		SWF_error("Invalid bitmap fill flag");	}	fill = SWFShape_addBitmapFillStyle(shape, bitmap, flag);	width = SWFBitmap_getWidth(bitmap);	height = SWFBitmap_getHeight(bitmap);	SWFShape_setRightFillStyle(shape, fill);	// XXX - scale shouldn't be hardcoded! (here, or in newSWFBitmapFillStyle)	SWFShape_drawScaledLine(shape, width * 20, 0);	SWFShape_drawScaledLine(shape, 0, height * 20);	SWFShape_drawScaledLine(shape, -width * 20, 0);	SWFShape_drawScaledLine(shape, 0, -height * 20);	return shape;}voidSWFOutput_writeGlyphShape(SWFOutput out, SWFShape shape){	unsigned char c;	int styleDone = 0;	int i;	c = 1<<4;	SWFOutput_writeUInt8(out, c);	shape->nFills = 1;	shape->nLines = 0;			for ( i=0; i<shape->nRecords; ++i )	{		if(!styleDone && shape->records[i].type == SHAPERECORD_STATECHANGE)		{			shape->records[i].record.stateChange->flags |= SWF_SHAPE_FILLSTYLE0FLAG;			shape->records[i].record.stateChange->leftFill = 1;			styleDone = 1;		}				if ( i < shape->nRecords-1 ||				 shape->records[i].type != SHAPERECORD_STATECHANGE )		{			SWFShape_writeShapeRecord(shape, shape->records[i], out);		}	}	SWFOutput_writeBits(out, 0, 6); /* end tag */	SWFOutput_byteAlign(out);}voidSWFShape_end(SWFShape shape){	int i;	byte* buffer;	if ( shape->isEnded )		return;	shape->isEnded = TRUE;		buffer = SWFOutput_getBuffer(shape->out);	buffer[0] =		(SWFOutput_numBits(shape->nFills) << 4) + SWFOutput_numBits(shape->nLines);	for ( i=0; i<shape->nRecords; ++i )	{		if ( i < shape->nRecords-1 ||				 shape->records[i].type != SHAPERECORD_STATECHANGE )		{			SWFShape_writeShapeRecord(shape, shape->records[i], shape->out);		}		free(shape->records[i].record.stateChange); /* all in union are pointers */	}	SWFOutput_writeBits(shape->out, 0, 6); /* end tag */	SWFOutput_byteAlign(shape->out);			/* addStyleHeader creates a new output and adds the existing one after		 itself- so even though it's called afterwards it's written before,		 as it should be */	if ( BLOCK(shape)->type > 0 )	{		if(shape->useVersion == SWF_SHAPE4)			BLOCK(shape)->type = SWF_DEFINESHAPE4;			SWFShape_addStyleHeader(shape);	}	free(shape->records);	shape->records = NULL;	shape->nRecords = 0;}SWFOutputSWFShape_getOutput(SWFShape shape){	return shape->out;}voidSWFShape_getFills(SWFShape shape, SWFFillStyle** fills, int* nFills){	*fills = shape->fills;	*nFills = shape->nFills;}voidSWFShape_getLines(SWFShape shape, SWFLineStyle** lines, int* nLines){	*lines = shape->lines;	*nLines = shape->nLines;}voidSWFShape_setMorphFlag(SWFShape shape){	shape->isMorph = TRUE;}voidSWFShape_addStyleHeader(SWFShape shape){	SWFOutput out = newSWFOutput();	SWFOutput_writeUInt16(out, CHARACTERID(shape));	SWFOutput_writeRect(out, SWFCharacter_getBounds(CHARACTER(shape)));	if(shape->useVersion == SWF_SHAPE4)	{		SWFOutput_writeRect(out, shape->edgeBounds);		SWFOutput_writeUInt8(out, shape->flags);	}		SWFOutput_writeFillStyles(out, shape->fills, shape->nFills, 		BLOCK(shape)->type, shape->edgeBounds);	SWFOutput_writeLineStyles(out, shape->lines, shape->nLines, BLOCK(shape)->type);		/* prepend shape->out w/ shape header */	SWFOutput_setNext(out, shape->out);	shape->out = out;}/*	ShapeRecords are an intermediate storage so that we don't have to specify	fill/line types in advance.*/#define SHAPERECORD_INCREMENT 32/* copy shaperecord from other shape */ static ShapeRecord addShapeRecord(SWFShape shape, ShapeRecord record,                                   int *vx, int *vy, float scale){	if ( shape->nRecords % SHAPERECORD_INCREMENT == 0 )	{		shape->records = (ShapeRecord*) realloc(shape->records,					 sizeof(ShapeRecord) *					 (shape->nRecords + SHAPERECORD_INCREMENT));	}	switch ( record.type )	{		case SHAPERECORD_STATECHANGE:		{			StateChangeRecord change = (StateChangeRecord)				calloc(1,sizeof(struct stateChangeRecord));			*change = *record.record.stateChange;			shape->records[shape->nRecords].record.stateChange = change;			change->moveToX += shape->xpos;			change->moveToY += shape->ypos;			change->moveToX *= scale;			change->moveToY *= scale;			*vx = change->moveToX;			*vy = change->moveToY;			break;		}		case SHAPERECORD_LINETO:		{			LineToRecord lineTo = (LineToRecord)				calloc(1,sizeof(struct lineToRecord));

?? 快捷鍵說明

復(fù)制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
欧美系列亚洲系列| 福利一区福利二区| 国产精品的网站| 亚洲免费电影在线| 日韩高清不卡在线| 经典三级在线一区| 91麻豆精品秘密| 日韩一区二区三区四区五区六区| 久久久久久久免费视频了| 亚洲黄色小视频| 久久av资源站| 国产综合久久久久影院| www.视频一区| 制服.丝袜.亚洲.另类.中文| 国产精品久久久久影视| 五月婷婷欧美视频| www.视频一区| 91精品国产综合久久久蜜臀图片| 国产三级久久久| 亚洲国产精品久久久久秋霞影院| 亚洲6080在线| 不卡大黄网站免费看| 日韩一卡二卡三卡四卡| 国产视频不卡一区| 美女一区二区视频| 欧美性大战久久| 国产精品毛片久久久久久久| 久久国产精品色| 欧美日韩一区高清| 国产精品二三区| 国产精品一区二区不卡| 欧美一区二区三区视频免费| 玉足女爽爽91| 成人在线综合网| 国产亚洲婷婷免费| 另类小说综合欧美亚洲| 欧美日韩国产a| 亚洲激情一二三区| 99久久亚洲一区二区三区青草| 精品91自产拍在线观看一区| 天天av天天翘天天综合网 | 国产精品女主播av| 另类小说一区二区三区| 制服丝袜亚洲播放| 亚洲在线观看免费| 久久久久久久久久久久久久久99 | 风间由美一区二区三区在线观看| 国产三级精品三级| 精品一区中文字幕| √…a在线天堂一区| 国产精品欧美久久久久一区二区| 免费人成精品欧美精品| 欧美日韩久久一区| 91免费精品国自产拍在线不卡 | 99久久久国产精品免费蜜臀| 国产精品一区二区久久不卡| 欧洲精品一区二区三区在线观看| 久久久久97国产精华液好用吗| 日韩一区二区电影在线| 亚洲欧美另类综合偷拍| 日本韩国一区二区三区| 日本美女一区二区三区视频| 精品欧美乱码久久久久久1区2区| 久久草av在线| 日韩一区有码在线| 91麻豆精品国产91久久久久| 国产最新精品免费| 一区二区三区中文字幕精品精品 | 粉嫩嫩av羞羞动漫久久久| 亚洲男人天堂av| 欧美精品第一页| 大尺度一区二区| 亚洲福利视频一区| 久久久国产午夜精品| 欧美三级在线视频| 国产成人午夜精品影院观看视频| 亚洲亚洲精品在线观看| 久久这里只精品最新地址| 色综合色狠狠综合色| 麻豆精品视频在线观看视频| 国产精品久久久久国产精品日日 | 无码av中文一区二区三区桃花岛| 2020国产精品| 欧美日韩五月天| 成人丝袜18视频在线观看| 免费观看30秒视频久久| 亚洲视频资源在线| www国产成人免费观看视频 深夜成人网| 色av成人天堂桃色av| 国产在线播放一区| 日韩主播视频在线| 日韩美女啊v在线免费观看| 日韩免费福利电影在线观看| 在线视频国内自拍亚洲视频| 国产成人在线免费观看| 美女诱惑一区二区| 五月婷婷综合在线| 夜夜精品浪潮av一区二区三区| 日本一区二区免费在线观看视频| 91麻豆精品国产91久久久使用方法| 日本道在线观看一区二区| 成人性生交大片免费看中文 | thepron国产精品| 国产精品77777| 国产真实精品久久二三区| 蜜臀av性久久久久蜜臀aⅴ四虎| 亚洲综合久久av| 亚洲欧美另类久久久精品2019| 国产精品无人区| 欧美激情一区在线| 日本一区二区视频在线观看| 国产午夜久久久久| 久久久三级国产网站| 久久久99精品久久| 国产婷婷色一区二区三区四区| 欧美成人三级在线| 亚洲精品在线免费播放| 91精品国产91综合久久蜜臀| 制服丝袜在线91| 91精品国产综合久久婷婷香蕉| 欧美一级淫片007| 欧美电影免费观看高清完整版| 欧美卡1卡2卡| 欧美美女喷水视频| 91精品国产日韩91久久久久久| 7777精品伊人久久久大香线蕉的| 欧美日韩五月天| 欧美一区二区三区不卡| 欧美变态tickling挠脚心| 久久久午夜精品| 自拍偷拍欧美激情| 蜜芽一区二区三区| 国精产品一区一区三区mba桃花| 美国毛片一区二区| 欧美一区二区三区在| 日韩影视精彩在线| 欧美一区二区国产| 国产亚洲欧美日韩在线一区| 狠狠色丁香九九婷婷综合五月| 欧美精品一区二区蜜臀亚洲| 成人一区在线观看| 首页亚洲欧美制服丝腿| 精品国产一区二区三区久久影院| 视频在线观看一区二区三区| 欧洲激情一区二区| 亚洲成人激情综合网| 色婷婷国产精品综合在线观看| 欧美精品一区二区三区视频| 日本欧美一区二区三区乱码| 久久久综合视频| 日本亚洲三级在线| 国产美女娇喘av呻吟久久| 99精品视频一区二区| 欧美日本在线一区| 国产三级精品视频| 天堂久久一区二区三区| 国产精品18久久久久久久网站| 日本伦理一区二区| 久久久亚洲综合| 日日骚欧美日韩| 成人高清视频免费观看| 日韩一区二区在线免费观看| 国产精品久久久久久久久久久免费看| 午夜精品aaa| 99精品桃花视频在线观看| 日韩欧美中文字幕制服| 亚洲欧美日韩综合aⅴ视频| 免费的国产精品| 在线观看亚洲a| 欧美激情一区不卡| 男男gaygay亚洲| 欧美在线观看一区二区| 欧美极品美女视频| 久久 天天综合| 欧美日产国产精品| 亚洲免费观看高清完整版在线观看熊| 国产在线精品一区二区夜色 | 成人妖精视频yjsp地址| 日韩久久久精品| 午夜私人影院久久久久| 色综合久久久久久久久| 国产三级精品在线| 国内精品第一页| 欧美mv和日韩mv的网站| 亚洲444eee在线观看| 在线观看欧美精品| 亚洲男人的天堂在线观看| 国产mv日韩mv欧美| 国产午夜精品一区二区三区视频| 蜜桃视频在线一区| 777午夜精品视频在线播放| 亚洲精品第一国产综合野| 99re这里只有精品6| 国产精品久久久久aaaa樱花| 成人午夜视频福利| 国产午夜精品久久| 成人午夜在线播放| 中文字幕av一区二区三区免费看| 国产精品一区一区| 国产精品区一区二区三|