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

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

?? shape.c

?? Ming is a library for generating Macromedia Flash files (.swf), written in C, and includes useful ut
?? C
?? 第 1 頁(yè) / 共 3 頁(yè)
字號(hào):
/*    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));

?? 快捷鍵說(shuō)明

復(fù)制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號(hào) Ctrl + =
減小字號(hào) Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
日韩免费观看高清完整版 | 日韩精品一区二区三区四区| 国产精品1区2区3区| 国产风韵犹存在线视精品| 国产精品一区二区三区网站| 国产成人亚洲综合a∨婷婷图片| 久久不见久久见中文字幕免费| 老司机精品视频线观看86| 丝袜亚洲另类欧美综合| 精品国产乱码久久久久久图片| 成人黄色综合网站| 久久精品国产色蜜蜜麻豆| 艳妇臀荡乳欲伦亚洲一区| 欧美一级在线免费| 欧美日韩一区二区在线观看视频 | 午夜精品123| 中文字幕在线不卡一区| 精品国产a毛片| 亚洲综合成人在线| 亚洲二区在线观看| 欧美aa在线视频| 理论片日本一区| 国产高清不卡一区| 成人理论电影网| 国产91在线看| 成人看片黄a免费看在线| 99国产精品99久久久久久| 色噜噜夜夜夜综合网| 色婷婷av久久久久久久| 欧美人妖巨大在线| 久久久久久免费网| 国产精品高潮呻吟久久| 亚洲精品国产第一综合99久久 | 久热成人在线视频| 成人一区在线看| 欧美日韩免费电影| 亚洲综合视频在线观看| 91久久精品一区二区三| 久久一日本道色综合| 亚洲欧美日韩小说| 美国毛片一区二区三区| 91麻豆精品一区二区三区| 欧美日产在线观看| 亚洲欧美日韩国产成人精品影院 | 久久久久97国产精华液好用吗| 亚洲精品国产精品乱码不99 | 亚洲1区2区3区视频| 国产成人亚洲综合a∨猫咪 | 亚洲欧美日韩国产另类专区| 三级在线观看一区二区| 成人在线视频一区| 日韩精品综合一本久道在线视频| 国产精品久久久久久久久搜平片| 色偷偷成人一区二区三区91| 日韩欧美在线不卡| 亚洲国产视频网站| 99久久99精品久久久久久| 久久精品夜夜夜夜久久| 亚瑟在线精品视频| 91久久精品一区二区三区| 久久久av毛片精品| 久久国产精品色婷婷| 91福利在线免费观看| 亚洲欧美国产毛片在线| www.66久久| 亚洲激情av在线| 欧美日韩三级一区| 日韩主播视频在线| 26uuu亚洲综合色欧美| 成人国产在线观看| 亚洲摸摸操操av| 欧美久久一区二区| 国产一区二区福利视频| 一区二区日韩av| 99久久夜色精品国产网站| 专区另类欧美日韩| 日本韩国欧美三级| 日韩av中文字幕一区二区| 日韩亚洲欧美一区二区三区| 国产精品一区二区无线| 亚洲精品成人悠悠色影视| 91色.com| 精品在线观看免费| 欧美国产激情一区二区三区蜜月 | 国产三级一区二区| 欧美这里有精品| 日韩福利电影在线| 欧美激情综合网| 欧美精品三级在线观看| 狠狠色丁香久久婷婷综合丁香| 18欧美乱大交hd1984| 欧美一区二区三区免费大片| 国产成人亚洲综合a∨婷婷图片| 亚洲精品v日韩精品| 久久午夜免费电影| 欧美视频一区二区在线观看| 国产不卡在线播放| 日韩电影免费在线看| 国产精品久久久久一区 | 欧美大白屁股肥臀xxxxxx| 国产精品18久久久久久vr| 日韩有码一区二区三区| 亚洲欧洲精品一区二区精品久久久| 欧美日韩国产一二三| 91在线精品秘密一区二区| 久久超碰97人人做人人爱| 五月婷婷综合激情| 亚洲一线二线三线视频| 综合激情成人伊人| 欧美国产97人人爽人人喊| 精品日韩一区二区三区| 欧美一区二区视频在线观看2020| 在线亚洲人成电影网站色www| 国产999精品久久| 国产乱国产乱300精品| 精品影视av免费| 麻豆精品视频在线观看免费| 日韩激情一二三区| 午夜电影一区二区| 蜜臀99久久精品久久久久久软件| 亚洲成人中文在线| 亚洲444eee在线观看| 日韩成人精品在线观看| 久久99精品久久久久久| 国产一区日韩二区欧美三区| 国产高清不卡一区二区| 97se狠狠狠综合亚洲狠狠| 欧美中文字幕一二三区视频| 欧美性高清videossexo| 欧美电影在哪看比较好| 欧美草草影院在线视频| 久久蜜臀精品av| 亚洲视频在线一区观看| 亚洲一区精品在线| 久久成人免费电影| 成人app在线观看| 欧美日韩精品一区二区三区蜜桃 | 成人精品gif动图一区| 91性感美女视频| 7777精品伊人久久久大香线蕉完整版 | 日本aⅴ免费视频一区二区三区| 国产真实乱偷精品视频免| 99视频精品在线| 欧美福利电影网| 欧美国产一区在线| 日韩av电影免费观看高清完整版 | av电影天堂一区二区在线观看| 欧美色国产精品| 国产精品嫩草99a| 久久国产生活片100| 欧美日韩一区精品| 国产精品麻豆视频| 国产真实乱对白精彩久久| 欧美熟乱第一页| 亚洲丝袜美腿综合| 国产精品资源在线观看| 51精品国自产在线| 亚洲欧美日韩小说| 粉嫩高潮美女一区二区三区| 欧美一激情一区二区三区| 亚洲日本乱码在线观看| 国产精品77777| 欧美tk丨vk视频| 美女精品一区二区| 91精品麻豆日日躁夜夜躁| 樱花影视一区二区| eeuss影院一区二区三区| 欧美高清在线精品一区| 成人精品一区二区三区四区| 国产午夜精品一区二区三区视频| 韩日欧美一区二区三区| 久久精品男人的天堂| 成人久久久精品乱码一区二区三区 | 国产精品一区二区视频| 久久网这里都是精品| 国产高清无密码一区二区三区| 精品国产乱子伦一区| 国产乱码精品一区二区三 | 91色综合久久久久婷婷| 亚洲一卡二卡三卡四卡无卡久久| 欧美日韩国产片| 国产麻豆9l精品三级站| 久久久久久影视| 欧美在线一区二区| 激情av综合网| 亚洲欧美另类久久久精品2019| 欧美影片第一页| 免费看欧美女人艹b| 久久综合99re88久久爱| 国产精品亚洲成人| 一区二区三区在线影院| 日韩精品最新网址| 一本一道久久a久久精品| 日本视频免费一区| 国产亚洲精品中文字幕| 欧美日韩国产系列| 不卡av免费在线观看| 日韩av一区二区三区| 亚洲精品福利视频网站| 国产亚洲一区二区三区在线观看|