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

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

?? gameswf_tesselate.cpp

?? 一個(gè)開(kāi)源的嵌入式flash播放器 具體看文檔和例子就可
?? CPP
字號(hào):
// gameswf_tesselate.cpp	-- Thatcher Ulrich <tu@tulrich.com> 2003// This source code has been donated to the Public Domain.  Do// whatever you want with it.// 2D shape tesselator.  Actually a "trapezoidizer".  Takes line/curve// segments with a style index, and outputs trapezoids.//// Comments on tesselation strategies://// Current method basically works but has some problems.  It's slow,// it generates lots of triangles where the poly edges are curvy, and// occasionally it makes a leak around very thin shapes.//// Shewchuk's constrained delaunay triangulator: not appropriate for// rendering; it's big thing is making roundish triangles, at the// expense of triangle count.  That's the right tradeoff for FEA// (Shewchuk's main target application), but the wrong tradeoff for// rendering; we don't have any particular problem with skinny// triangles.//// Something like "A Fast Trapezoidation Technique For Planar// Polygons".  The key improvement there is to only cut from a// vertex/event to the nearest adjacent edges, instead of slicing// across the entire set of active edges.  This sounds good.//// Or, "FIST: Fast Industrial-Strength Triangulation of Polygons" by// Martin Held.  This looks good; application is rasterization.  The// funny thing here is that they explicitly deal with holes by// inserting zero-area bridge edges to connect the holes with the// outer boundary, to make one continuous poly.  This seems a little// hacky and possibly tricky.//// Or, just optimize what we've got.  I took a quick look at the cairo// project's trapezoider -- it's very similar to ours but seems to do// its work in-place without resizing the edge list constantly, so it// should be pretty quick.  They do some high-precision integer voodoo// in their intercept calculation that I don't 100% understand.////// Findings re SWF polygons://// (Based on experiments with Flash MX 2004; old movies seem to obey// these rules as well, as far as I can tell)://// * no intersecting edges -- if you make intersections in the tool// (even by stretching curve segments around), the tool inserts verts// automatically.//// * left-fill and right-fill seem to be randomly selected.//// * individual paths (i.e. segment paths with a consistent set of// fill styles) are not closed//// * there's no odd-even insanity; the tool cleans up the poly if you// try to make self-intersections and flips and such.//// * if you duplicate the paths with two fill styles (so every path// has just one fill style), and reverse the right-fill paths so they// make left-fill paths, and then join open verts of the same fill// style, you will be left with a set of non-intersecting closed polys// with a consistent winding.  I.e. fairly well-behaved.  They may// have holes though.//// Current outlook: Any of "A Fast Trapezoidation", "FIST", or// cairo-style should work.  FIST will make the fewest tris (since it// doesn't add any verts).  Current method can be optimized as well --// can remove intersection checks (they're probably just harmful).//// FIST will probably be the most impervious to leaks, since it// rationally deals with self-intersection by just overlapping parts// of the tesselated poly.#include "gameswf_tesselate.h"#include "gameswf_types.h"#include "base/utility.h"#include "base/container.h"#include <stdlib.h>namespace gameswf{namespace tesselate{	// Curve subdivision error tolerance.	static float	s_tolerance = 1.0f;	static trapezoid_accepter*	s_accepter = NULL;	struct fill_segment	{		point	m_begin;		point	m_end;		int	m_left_style, m_right_style, m_line_style;		fill_segment() {}		fill_segment(			const point& a,			const point& b,			int left_style,			int right_style,			int line_style)			:			m_begin(a),			m_end(b),			m_left_style(left_style),			m_right_style(right_style),			m_line_style(line_style)		{			// For rasterization, we want to ensure that			// the segment always points towards positive			// y...			if (m_begin.m_y > m_end.m_y)			{				flip();			}		}		void	flip()		// Exchange end points, and reverse fill sides.		{			swap(&m_begin, &m_end);			// swap fill styles...			swap(&m_left_style, &m_right_style);		}		float	get_height() const		// Return segment height.		{			assert(m_end.m_y >= m_begin.m_y);			return m_end.m_y - m_begin.m_y;		}	};	// More Renderer state.	static array<fill_segment>	s_current_segments;	// @@ should not dynamically resize this thing!	static array<point>	s_current_path;			// @@ should not dynamically resize this thing!	static point	s_last_point;	static int	s_current_left_style;	static int	s_current_right_style;	static int	s_current_line_style;	static bool	s_shape_has_line;	// flag to let us skip the line rendering if no line styles were set when defining the shape.	static bool	s_shape_has_fill;	// flag to let us skip the fill rendering if no fill styles were set when defining the shape.	static void	peel_off_and_emit(int i0, int i1, float y0, float y1);	void	begin_shape(trapezoid_accepter* accepter, float curve_error_tolerance)	{		assert(accepter);		s_accepter = accepter;		// ensure we're not already in a shape or path.		// make sure our shape state is cleared out.		assert(s_current_segments.size() == 0);		s_current_segments.resize(0);		assert(s_current_path.size() == 0);		s_current_path.resize(0);		assert(curve_error_tolerance > 0);		if (curve_error_tolerance > 0)		{			s_tolerance = curve_error_tolerance;		}		else		{			s_tolerance = 1.0f;		}		s_current_line_style = -1;		s_current_left_style = -1;		s_current_right_style = -1;		s_shape_has_fill = false;		s_shape_has_line = false;	}	static int	compare_segment_y(const void* a, const void* b)	// For sorting segments by m_begin.m_y, and then by height.	{		const fill_segment*	A = (const fill_segment*) a;		const fill_segment*	B = (const fill_segment*) b;		const float	ay0 = A->m_begin.m_y;		const float	by0 = B->m_begin.m_y;		if (ay0 < by0)		{			return -1;		}		else if (ay0 == by0)		{			const float	ah = A->get_height();			const float	bh = B->get_height();			if (ah < bh)			{				return -1;			}			else if (ah == bh)			{				return 0;			}			else			{				return 1;			}		}		else		{			return 1;		}	}	static int	compare_segment_x(const void* a, const void* b)	// For sorting segments by m_begin.m_x, and then by m_end.m_x.	{		const fill_segment*	A = (const fill_segment*) a;		const fill_segment*	B = (const fill_segment*) b;		const float	ax0 = A->m_begin.m_x;		const float	bx0 = B->m_begin.m_x;		if (ax0 < bx0)		{			return -1;		}		else if (ax0 == bx0)		{			const float	ax1 = A->m_end.m_x;			const float	bx1 = B->m_end.m_x;			if (ax1 < bx1)			{				return -1;			}			else if (ax1 == bx1)			{				return 0;			}			else			{				return 1;			}		}		else		{			return 1;		}	}	void	output_current_segments()	// Draw our shapes and lines, then clear the segment list.	{		if (s_shape_has_fill)		{			//			// Output the trapezoids making up the filled shape.			//			// sort by begining y (smaller first), then by height (shorter first)			qsort(				&s_current_segments[0],				s_current_segments.size(),				sizeof(s_current_segments[0]),				compare_segment_y);					int	base = 0;			while (base < s_current_segments.size())			{				float	ytop = s_current_segments[base].m_begin.m_y;				int	next_base = base + 1;				for (;;)				{					if (next_base == s_current_segments.size()					    || s_current_segments[next_base].m_begin.m_y > ytop)					{						break;					}					next_base++;				}				// sort this first part again by y				qsort(					&s_current_segments[base],					next_base - base,					sizeof(s_current_segments[0]),					compare_segment_y);				// s_current_segments[base] through s_current_segments[next_base - 1] is all the segs that start at ytop				if (next_base >= s_current_segments.size()				    || s_current_segments[base].m_end.m_y <= s_current_segments[next_base].m_begin.m_y)				{					// No segments start between ytop and					// [base].m_end.m_y, so we can peel					// off that whole interval and render					// it right away.					float	ybottom = s_current_segments[base].m_end.m_y;					peel_off_and_emit(base, next_base, ytop, ybottom);					while (base < s_current_segments.size()					       && s_current_segments[base].m_end.m_y <= ybottom)					{						base++;					}				}				else				{					float	ybottom = s_current_segments[next_base].m_begin.m_y;					assert(ybottom > ytop);					peel_off_and_emit(base, next_base, ytop, ybottom);					// don't update base; it's still active.				}			}		}				s_current_segments.release();	}	void	peel_off_and_emit(int i0, int i1, float y0, float y1)	// Clip the interval [y0, y1] off of the segments from	// s_current_segments[i0 through (i1-1)] and emit the clipped	// trapezoids.  Modifies the values in s_current_segments.	{		assert(i0 < i1);		if (y0 == y1)		{			// Don't bother doing any work...			return;		}		// Peel off first.		array<fill_segment>	slab;	// @@ make this use static storage		for (int i = i0; i < i1; i++)		{			fill_segment*	f = &s_current_segments[i];			assert(f->m_begin.m_y == y0);			assert(f->m_end.m_y >= y1);			float	dy = f->m_end.m_y - f->m_begin.m_y;			float	t = 1.0f;			if (dy > 0)			{				t = (y1 - f->m_begin.m_y) / dy;			}			point	intersection;			intersection.m_y = y1;			intersection.m_x = f->m_begin.m_x + (f->m_end.m_x - f->m_begin.m_x) * t;			// Peel off.			slab.push_back(*f);			slab.back().m_end = intersection;			// Modify segment.			s_current_segments[i].m_begin = intersection;		}		// Sort by x.		qsort(&slab[0], slab.size(), sizeof(slab[0]), compare_segment_x);		// Emit the trapezoids in this slab.		if (slab.size() > 0		    && slab[0].m_left_style == -1		    && slab[0].m_right_style >= 0)		{			// Reverse sense of polygon fill!  Right fill style is in charge.			for (int i = 0; i < slab.size() - 1; i++)			{				if (slab[i].m_right_style >= 0)				{					trapezoid	tr;					tr.m_y0 = slab[i].m_begin.m_y;					tr.m_y1 = slab[i].m_end.m_y;					tr.m_lx0 = slab[i].m_begin.m_x;					tr.m_lx1 = slab[i].m_end.m_x;					tr.m_rx0 = slab[i + 1].m_begin.m_x;					tr.m_rx1 = slab[i + 1].m_end.m_x;					s_accepter->accept_trapezoid(slab[i].m_right_style, tr);				}			}		}		else		{			for (int i = 0; i < slab.size() - 1; i++)			{				if (slab[i].m_left_style >= 0)				{					trapezoid	tr;					tr.m_y0 = slab[i].m_begin.m_y;					tr.m_y1 = slab[i].m_end.m_y;					tr.m_lx0 = slab[i].m_begin.m_x;					tr.m_lx1 = slab[i].m_end.m_x;					tr.m_rx0 = slab[i + 1].m_begin.m_x;					tr.m_rx1 = slab[i + 1].m_end.m_x;					s_accepter->accept_trapezoid(slab[i].m_left_style, tr);				}			}		}	}	void	end_shape()	{		output_current_segments();		s_accepter = NULL;		s_current_path.release();	}	void	begin_path(int style_left, int style_right, int line_style, float ax, float ay)	// This call begins recording a sequence of segments, which	// all share the same fill & line styles.  Add segments to the	// shape using add_curve_segment() or add_line_segment(), and	// call end_path() when you're done with this sequence.	//	// Pass in -1 for styles that you want to disable.  Otherwise pass in	// the integral ID of the style for filling, to the left or right.	{		s_current_left_style = style_left;		s_current_right_style = style_right;		s_current_line_style = line_style;		s_last_point.m_x = ax;		s_last_point.m_y = ay;		assert(s_current_path.size() == 0);		s_current_path.resize(0);		s_current_path.push_back(s_last_point);		if (style_left != -1 || style_right != -1)		{			s_shape_has_fill = true;		}		if (line_style != -1)		{			s_shape_has_line = true;		}	}	void	add_line_segment(float ax, float ay)	// Add a line running from the previous anchor point to the	// given new anchor point.	{		point	p(ax, ay);		// s_current_segments is used for filling shapes.		s_current_segments.push_back(			fill_segment(				s_last_point,				p,				s_current_left_style,				s_current_right_style,				s_current_line_style));		s_last_point = p;		s_current_path.push_back(p);	}	static void	curve(float p0x, float p0y, float p1x, float p1y, float p2x, float p2y)	// Recursive routine to generate bezier curve within tolerance.	{#ifndef NDEBUG		static int	recursion_count = 0;		recursion_count++;		if (recursion_count > 500)		{			assert(0);	// probably a bug!		}#endif // not NDEBUG		// @@ use struct point in here?		// Midpoint on line between two endpoints.		float	midx = (p0x + p2x) * 0.5f;		float	midy = (p0y + p2y) * 0.5f;		// Midpoint on the curve.		float	qx = (midx + p1x) * 0.5f;		float	qy = (midy + p1y) * 0.5f;		float	dist = fabsf(midx - qx) + fabsf(midy - qy);		if (dist < s_tolerance)		{			// Emit edge.//			add_line_segment(qx, qy);			add_line_segment(p2x, p2y);		}		else		{			// Error is too large; subdivide.			curve(p0x, p0y, (p0x + p1x) * 0.5f, (p0y + p1y) * 0.5f, qx, qy);			curve(qx, qy, (p1x + p2x) * 0.5f, (p1y + p2y) * 0.5f, p2x, p2y);		}#ifndef NDEBUG		recursion_count--;#endif // not NDEBUG	}		void	add_curve_segment(float cx, float cy, float ax, float ay)	// Add a curve segment to the shape.  The curve segment is a	// quadratic bezier, running from the previous anchor point to	// the given new anchor point (ax, ay), with (cx, cy) acting	// as the control point in between.	{		// Subdivide, and add line segments...		curve(s_last_point.m_x, s_last_point.m_y, cx, cy, ax, ay);	}	void	end_path()	// Mark the end of a set of edges that all use the same styles.	{		if (s_current_line_style >= 0 && s_current_path.size() > 1)		{			//			// Emit our line.			//			s_accepter->accept_line_strip(s_current_line_style, &s_current_path[0], s_current_path.size());		}		s_current_path.resize(0);	}}	// end namespace tesselate};	// end namespace gameswf// Local Variables:// mode: C++// c-basic-offset: 8 // tab-width: 8// indent-tabs-mode: t// End:

?? 快捷鍵說(shuō)明

復(fù)制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號(hào) Ctrl + =
減小字號(hào) Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
日韩你懂的在线观看| 午夜免费欧美电影| 精品在线观看免费| 欧美日韩国产在线观看| 国产精品久久国产精麻豆99网站| 日韩电影在线一区| 日韩三级免费观看| 另类欧美日韩国产在线| 日韩视频一区二区| 国精产品一区一区三区mba视频| 欧洲国内综合视频| 黄色精品一二区| 精品久久国产字幕高潮| 精品一区二区免费视频| 久久精品男人的天堂| 国产剧情av麻豆香蕉精品| 国产视频911| 95精品视频在线| 亚洲成人激情综合网| 欧美一级午夜免费电影| 国产伦精品一区二区三区免费迷| 久久久午夜电影| 欧美日韩精品一区二区在线播放| 青青草精品视频| 国产精品久久久久四虎| av一区二区三区| 日韩av电影一区| 一区二区三区中文字幕在线观看| 56国语精品自产拍在线观看| 国产成人免费视频网站高清观看视频 | 久久亚洲捆绑美女| 99r国产精品| 精品一区二区三区av| 久久久亚洲精品一区二区三区 | 裸体一区二区三区| 伊人夜夜躁av伊人久久| 久久嫩草精品久久久精品| 欧美日韩不卡在线| 成人激情校园春色| 国产麻豆91精品| 蜜臀精品久久久久久蜜臀| 日韩一区中文字幕| 91精品国产综合久久久久久久 | 一区二区三区精密机械公司| 亚洲在线视频网站| 国产精品少妇自拍| 亚洲精品一区二区精华| 日韩欧美一区中文| 精品免费日韩av| 久久久午夜电影| 国产欧美一区二区三区网站| 日韩欧美一级在线播放| 欧美精品久久久久久久多人混战 | 麻豆成人在线观看| 久久国产剧场电影| 日韩精品乱码av一区二区| 亚洲一区二区三区四区五区中文 | 91麻豆精品久久久久蜜臀| 欧美日韩精品一区二区三区四区| 这里只有精品视频在线观看| 欧美三级日韩三级国产三级| 91精品久久久久久久91蜜桃| 亚洲精品日产精品乱码不卡| 国产精品情趣视频| 亚洲乱码中文字幕| 老司机午夜精品| 99国产欧美另类久久久精品| av中文字幕不卡| 欧美专区亚洲专区| 欧美国产精品久久| 亚洲男人的天堂av| 久久精品国产网站| 风间由美一区二区av101| 91免费观看在线| 欧美午夜精品一区二区蜜桃| 在线综合亚洲欧美在线视频| 国产日产精品一区| 日韩电影在线一区二区| 国产传媒久久文化传媒| 91国偷自产一区二区三区观看| 日韩欧美一级二级| 一区二区三区精品| 国产福利不卡视频| 欧美一区二区三级| 亚洲免费观看高清在线观看| 国产一区二区精品久久99| 在线视频你懂得一区二区三区| 欧美mv日韩mv亚洲| 亚洲观看高清完整版在线观看 | 国产酒店精品激情| 日韩欧美卡一卡二| 五月天欧美精品| 欧美日韩一二区| 国产精品久久二区二区| 国产福利精品导航| 久久人人爽人人爽| 国产一区二区免费看| 久久久久久久久久久久久久久99 | 中文字幕一区二区日韩精品绯色| 日韩高清在线不卡| 欧美精品一区二区三区视频| 久久电影网站中文字幕| 欧美一区二区三区四区视频| 日韩福利视频网| 日韩一本二本av| 男人的j进女人的j一区| 欧美一区二区三区在线电影| 日韩国产欧美视频| 欧美一级午夜免费电影| 日本午夜一本久久久综合| 欧美精品第一页| 国产做a爰片久久毛片| 国产精品国产自产拍高清av王其| 99久久综合99久久综合网站| 亚洲国产精品黑人久久久| 欧美写真视频网站| 久久 天天综合| 亚洲免费av在线| 精品盗摄一区二区三区| 国产99久久精品| 亚洲高清久久久| 久久精品视频一区| 在线影院国内精品| 不卡的电视剧免费网站有什么| 亚洲小说春色综合另类电影| 国产午夜亚洲精品不卡| 色吊一区二区三区| 不卡高清视频专区| 国产一区视频导航| 亚洲一区二区在线观看视频| 亚洲精品在线一区二区| 91黄视频在线| 99r国产精品| 国产一区二区电影| 国产精品系列在线播放| 日韩电影一区二区三区| 亚洲午夜免费电影| 国产精品国产三级国产普通话99 | 国产精品123区| 久久99热这里只有精品| 亚洲成人tv网| 一区二区三区视频在线看| 亚洲视频一区在线| 欧美国产精品专区| 国产精品人人做人人爽人人添| 精品免费视频一区二区| 日韩欧美一级在线播放| 日韩精品一区二区三区视频 | 91视视频在线观看入口直接观看www| 久久国产夜色精品鲁鲁99| 日韩成人午夜精品| 黄网站免费久久| 成人综合婷婷国产精品久久蜜臀 | 国产成人在线视频免费播放| 久久99精品一区二区三区| 久久精品国产秦先生| 国产精品一区二区黑丝| 91麻豆成人久久精品二区三区| www.在线欧美| 欧美精品丝袜中出| 久久精品人人做人人爽97| 亚洲国产精品t66y| 亚洲一区二区三区三| 蜜臀va亚洲va欧美va天堂| 国产成人午夜视频| 日本电影欧美片| 久久新电视剧免费观看| 亚洲精品美腿丝袜| 日本亚洲视频在线| 在线观看网站黄不卡| 久久九九全国免费| 亚洲午夜精品在线| 黑人巨大精品欧美一区| 91视视频在线观看入口直接观看www | 一本久久综合亚洲鲁鲁五月天 | 亚洲成人综合网站| 男女男精品视频| 在线观看一区二区视频| 欧美国产禁国产网站cc| 九九国产精品视频| 欧美电影在线免费观看| 中文字幕成人网| 麻豆91免费看| 3751色影院一区二区三区| 一区二区三区免费看视频| 国产精品自在在线| 日韩小视频在线观看专区| 亚洲最大的成人av| www.爱久久.com| 欧美激情艳妇裸体舞| 激情五月激情综合网| 欧美一区二区三区人| 亚洲.国产.中文慕字在线| 91色|porny| 亚洲一区二区三区免费视频| 色综合咪咪久久| 亚洲视频一区二区免费在线观看| 国产91在线|亚洲| 中文乱码免费一区二区| 99久久综合狠狠综合久久|