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

? 歡迎來到蟲蟲下載站! | ?? 資源下載 ?? 資源專輯 ?? 關于我們
? 蟲蟲下載站

?? miarc.c

?? linux下電話本所依賴的一些圖形庫
?? C
?? 第 1 頁 / 共 5 頁
字號:
/* $XFree86: xc/programs/Xserver/mi/miarc.c,v 3.7 1999/12/27 00:39:56 robin Exp $ *//***********************************************************Copyright 1987, 1998  The Open GroupAll Rights Reserved.The above copyright notice and this permission notice shall be included inall copies or substantial portions of the Software.THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS ORIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL THEOPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER INAN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR INCONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.Except as contained in this notice, the name of The Open Group shall not beused in advertising or otherwise to promote the sale, use or other dealingsin this Software without prior written authorization from The Open Group.Copyright 1987 by Digital Equipment Corporation, Maynard, Massachusetts.                        All Rights ReservedPermission to use, copy, modify, and distribute this software and its documentation for any purpose and without fee is hereby granted, provided that the above copyright notice appear in all copies and thatboth that copyright notice and this permission notice appear in supporting documentation, and that the name of Digital not beused in advertising or publicity pertaining to distribution of thesoftware without specific, written prior permission.  DIGITAL DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDINGALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALLDIGITAL BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES ORANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION,ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THISSOFTWARE.******************************************************************//* $TOG: miarc.c /main/91 1998/02/09 14:45:57 kaleb $ *//* Author: Keith Packard and Bob Scheifler *//* Warning: this code is toxic, do not dally very long here. */#define _XOPEN_SOURCE_EXTENDED	/* to get prototype for cbrt on some systems */#define _XOPEN_SOURCE     	/* to get prototype for hypot on some systems */#include <config.h>#include <string.h>		/* memmove */#include <limits.h>#include <math.h>#include "mi.h"#include "gdkprivate-fb.h"static double miDsin(double a), miDcos(double a), miDasin(double a), miDatan2(double x, double y);#ifdef ICEILTEMPDECLICEILTEMPDECL#endif/* * some interesting sematic interpretation of the protocol: * * Self intersecting arcs (i.e. those spanning 360 degrees)  *  never join with other arcs, and are drawn without caps *  (unless on/off dashed, in which case each dash segment *  is capped, except when the last segment meets the *  first segment, when no caps are drawn) * * double dash arcs are drawn in two parts, first the *  odd dashes (drawn in background) then the even dashes *  (drawn in foreground).  This means that overlapping *  sections of foreground/background are drawn twice, *  first in background then in foreground.  The double-draw *  occurs even when the function uses the destination values *  (e.g. xor mode).  This is the same way the wide-line *  code works and should be "fixed". * */#undef max#undef min#if defined (__GNUC__) && defined (__STDC__) && !defined (__STRICT_ANSI__)#define USE_INLINE#endifstruct bound {	double	min, max;};struct ibound {	int	min, max;};#define boundedLe(value, bounds)\	((bounds).min <= (value) && (value) <= (bounds).max)struct line {	double	m, b;	int	valid;};#define intersectLine(y,line) (line.m * (y) + line.b)/* * these are all y value bounds */struct arc_bound {	struct bound	ellipse;	struct bound	inner;	struct bound	outer;	struct bound	right;	struct bound	left;	struct ibound	inneri;	struct ibound	outeri;};struct accelerators {	double		tail_y;	double		h2;	double		w2;	double		h4;	double		w4;	double		h2mw2;	double		h2l;	double		w2l;	double		fromIntX;	double		fromIntY;	struct line	left, right;	int		yorgu;	int		yorgl;	int		xorg;};struct arc_def {	double	w, h, l;	double	a0, a1;};# define todeg(xAngle)	(((double) (xAngle)) / 64.0)# define RIGHT_END	0# define LEFT_END	1typedef struct _miArcJoin {	int	arcIndex0, arcIndex1;	int	phase0, phase1;	int	end0, end1;} miArcJoinRec, *miArcJoinPtr;typedef struct _miArcCap {	int		arcIndex;	int		end;		} miArcCapRec, *miArcCapPtr;typedef struct _miArcFace {	SppPointRec	clock;	SppPointRec	center;	SppPointRec	counterClock;} miArcFaceRec, *miArcFacePtr;typedef struct _miArcData {	miArc		arc;	int		render;		/* non-zero means render after drawing */	int		join;		/* related join */	int		cap;		/* related cap */	int		selfJoin;	/* final dash meets first dash */	miArcFaceRec	bounds[2];	double		x0, y0, x1, y1;} miArcDataRec, *miArcDataPtr;/* * This is an entire sequence of arcs, computed and categorized according * to operation.  miDashArcs generates either one or two of these. */typedef struct _miPolyArc {	int		narcs;	miArcDataPtr	arcs;	int		ncaps;	miArcCapPtr	caps;	int		njoins;	miArcJoinPtr	joins;} miPolyArcRec, *miPolyArcPtr;typedef struct {    short lx, lw, rx, rw;} miArcSpan;typedef struct {    miArcSpan *spans;    int count1, count2, k;    char top, bot, hole;} miArcSpanData;typedef struct {    unsigned long lrustamp;    unsigned short lw;    unsigned short width, height;    miArcSpanData *spdata;} arcCacheRec;# define DASH_MAP_SIZE	91typedef struct {	double	map[DASH_MAP_SIZE];} dashMap;static void fillSpans(GdkDrawable *pDrawable, GdkGC *pGC);static void newFinalSpan(int y, int xmin, int xmax);static void drawArc (miArc *tarc, int l, int a0, int a1, miArcFacePtr right, miArcFacePtr left);static void drawQuadrant(struct arc_def *def, struct accelerators *acc,			 int a0, int a1, int mask, miArcFacePtr right, miArcFacePtr left,			 miArcSpanData *spdata);static void drawZeroArc(GdkDrawable *pDraw, GdkGC *pGC, miArc *tarc, int lw, miArcFacePtr right, miArcFacePtr left);static void miArcJoin(GdkDrawable *pDraw, GdkGC *pGC, miArcFacePtr pRight, miArcFacePtr pLeft, int xOrgRight, int yOrgRight,		      double xFtransRight, double yFtransRight,		      int xOrgLeft, int yOrgLeft,		      double xFtransLeft, double yFtransLeft);static void miArcCap(GdkDrawable *pDraw, GdkGC *pGC, miArcFacePtr pFace, int end, int xOrg, int yOrg,		     double xFtrans, double yFtrans);static void miRoundCap(GdkDrawable *pDraw, GdkGC *pGC, SppPointRec pCenter, SppPointRec pEnd, SppPointRec pCorner,		       SppPointRec pOtherCorner, int fLineEnd, int xOrg, int yOrg,		       double xFtrans, double yFtrans);static void miFreeArcs(miPolyArcPtr arcs, GdkGC *pGC);static int computeAngleFromPath(int startAngle, int endAngle, dashMap *map, int *lenp, int backwards);static miPolyArcPtr miComputeArcs (miArc *parcs, int narcs, GdkGC *gc);static int miGetArcPts(SppArcPtr parc, int cpt, SppPointPtr *ppPts);# define CUBED_ROOT_2	1.2599210498948732038115849718451499938964# define CUBED_ROOT_4	1.5874010519681993173435330390930175781250/* * draw one segment of the arc using the arc spans generation routines */static voidmiArcSegment(GdkDrawable *pDraw, GdkGC *pGC, miArc tarc, miArcFacePtr right, miArcFacePtr left){    int l = GDK_GC_FBDATA(pGC)->values.line_width;    int a0, a1, startAngle, endAngle;    miArcFacePtr	temp;    if (!l)	l = 1;    if (tarc.width == 0 || tarc.height == 0) {    	drawZeroArc (pDraw, pGC, &tarc, l, left, right);	return;    }    a0 = tarc.angle1;    a1 = tarc.angle2;    if (a1 > FULLCIRCLE)	a1 = FULLCIRCLE;    else if (a1 < -FULLCIRCLE)	a1 = -FULLCIRCLE;    if (a1 < 0) {    	startAngle = a0 + a1;	endAngle = a0;	temp = right;	right = left;	left = temp;    } else {	startAngle = a0;	endAngle = a0 + a1;    }    /*     * bounds check the two angles     */    if (startAngle < 0)	startAngle = FULLCIRCLE - (-startAngle) % FULLCIRCLE;    if (startAngle >= FULLCIRCLE)	startAngle = startAngle % FULLCIRCLE;    if (endAngle < 0)	endAngle = FULLCIRCLE - (-endAngle) % FULLCIRCLE;    if (endAngle > FULLCIRCLE)	endAngle = (endAngle-1) % FULLCIRCLE + 1;    if ((startAngle == endAngle) && a1) {	startAngle = 0;	endAngle = FULLCIRCLE;    }    drawArc (&tarc, l, startAngle, endAngle, right, left);}/*Three equations combine to describe the boundaries of the arcx^2/w^2 + y^2/h^2 = 1			ellipse itself(X-x)^2 + (Y-y)^2 = r^2			circle at (x, y) on the ellipse(Y-y) = (X-x)*w^2*y/(h^2*x)		normal at (x, y) on the ellipseThese lead to a quartic relating Y and yy^4 - (2Y)y^3 + (Y^2 + (h^4 - w^2*r^2)/(w^2 - h^2))y^2    - (2Y*h^4/(w^2 - h^2))y + (Y^2*h^4)/(w^2 - h^2) = 0The reducible cubic obtained from this quartic isz^3 - (3N)z^2 - 2V = 0whereN = (Y^2 + (h^4 - w^2*r^2/(w^2 - h^2)))/6V = w^2*r^2*Y^2*h^4/(4 *(w^2 - h^2)^2)Lett = z - Np = -N^2q = -N^3 - VThen we gett^3 + 3pt + 2q = 0The discriminant of this cubic isD = q^2 + p^3When D > 0, a real root is obtained asz = N + cbrt(-q+sqrt(D)) + cbrt(-q-sqrt(D))When D < 0, a real root is obtained asz = N - 2m*cos(acos(-q/m^3)/3)wherem = sqrt(|p|) * sign(q)Given a real root Z of the cubic, the roots of the quartic are the rootsof the two quadraticsy^2 + ((b+A)/2)y + (Z + (bZ - d)/A) = 0where A = +/- sqrt(8Z + b^2 - 4c)b, c, d are the cubic, quadratic, and linear coefficients of the quarticSome experimentation is then required to determine which solutionscorrespond to the inner and outer boundaries.*/#define CACHESIZE 25static arcCacheRec arcCache[CACHESIZE];static unsigned long lrustamp;static arcCacheRec *lastCacheHit = &arcCache[0];#if 0static RESTYPE cacheType;/* * External so it can be called when low on memory. * Call with a zero ID in that case. *//*ARGSUSED*/intmiFreeArcCache (data, id)    gpointer	    data;    guint		    id;{    int k;    arcCacheRec *cent;    if (id)	cacheType = 0;    for (k = CACHESIZE, cent = &arcCache[0]; --k >= 0; cent++)    {	if (cent->spdata)	{	    cent->lrustamp = 0;	    cent->lw = 0;	    g_free(cent->spdata);	    cent->spdata = NULL;	}    }    lrustamp = 0;    return TRUE;}#endifstatic voidmiComputeCircleSpans(int lw, miArc *parc, miArcSpanData *spdata){    register miArcSpan *span;    int doinner;    register int x, y, e;    int xk, yk, xm, ym, dx, dy;    register int slw, inslw;    int inx = 0, iny, ine = 0;    int inxk = 0, inyk = 0, inxm = 0, inym = 0;    doinner = -lw;    slw = parc->width - doinner;    y = parc->height >> 1;    dy = parc->height & 1;    dx = 1 - dy;    MIWIDEARCSETUP(x, y, dy, slw, e, xk, xm, yk, ym);    inslw = parc->width + doinner;    if (inslw > 0)    {	spdata->hole = spdata->top;	MIWIDEARCSETUP(inx, iny, dy, inslw, ine, inxk, inxm, inyk, inym);    }    else    {	spdata->hole = FALSE;	doinner = -y;    }    spdata->count1 = -doinner - spdata->top;    spdata->count2 = y + doinner;    span = spdata->spans;    while (y)    {	MIFILLARCSTEP(slw);	span->lx = dy - x;	if (++doinner <= 0) 	{	    span->lw = slw;	    span->rx = 0;	    span->rw = span->lx + slw;	}	else	{	    MIFILLINARCSTEP(inslw);	    span->lw = x - inx;	    span->rx = dy - inx + inslw;	    span->rw = inx - x + slw - inslw;	}	span++;    }    if (spdata->bot)    {	if (spdata->count2)	    spdata->count2--;	else	{	    if (lw > (int)parc->height)		span[-1].rx = span[-1].rw = -((lw - (int)parc->height) >> 1);	    else		span[-1].rw = 0;	    spdata->count1--;	}    }}static voidmiComputeEllipseSpans(int lw, miArc *parc, miArcSpanData *spdata){    register miArcSpan *span;    double w, h, r, xorg;    double Hs, Hf, WH, K, Vk, Nk, Fk, Vr, N, Nc, Z, rs;    double A, T, b, d, x, y, t, inx, outx = 0.0, hepp, hepm;    int flip, solution;    w = (double)parc->width / 2.0;    h = (double)parc->height / 2.0;    r = lw / 2.0;    rs = r * r;    Hs = h * h;    WH = w * w - Hs;    Nk = w * r;    Vk = (Nk * Hs) / (WH + WH);    Hf = Hs * Hs;    Nk = (Hf - Nk * Nk) / WH;    Fk = Hf / WH;    hepp = h + EPSILON;    hepm = h - EPSILON;    K = h + ((lw - 1) >> 1);    span = spdata->spans;    if (parc->width & 1)	xorg = .5;    else	xorg = 0.0;    if (spdata->top)    {	span->lx = 0;	span->lw = 1;	span++;    }    spdata->count1 = 0;    spdata->count2 = 0;    spdata->hole = (spdata->top &&		 (int)parc->height * lw <= (int)(parc->width * parc->width) &&		    lw < (int)parc->height);    for (; K > 0.0; K -= 1.0)    {	N = (K * K + Nk) / 6.0;	Nc = N * N * N;	Vr = Vk * K;	t = Nc + Vr * Vr;	d = Nc + t;	if (d < 0.0) {	    d = Nc;	    b = N;	    if ( (b < 0.0) == (t < 0.0) )	    {		b = -b;		d = -d;	    }	    Z = N - 2.0 * b * cos(acos(-t / d) / 3.0);	    if ( (Z < 0.0) == (Vr < 0.0) )		flip = 2;	    else		flip = 1;	}	else	{

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
国产伦精品一区二区三区免费迷| 99re8在线精品视频免费播放| 久久蜜桃一区二区| 色婷婷av一区二区三区之一色屋| 卡一卡二国产精品| 一二三区精品视频| 欧美激情一区二区三区蜜桃视频 | 久久色在线观看| 欧美色网站导航| 成人av电影在线| 韩国毛片一区二区三区| 亚洲成av人片在线观看无码| 中文字幕一区二区5566日韩| 精品国产91乱码一区二区三区| 欧美丝袜自拍制服另类| 国产不卡在线视频| 极品美女销魂一区二区三区免费| 亚洲最大成人网4388xx| 亚洲图片激情小说| 国产精品欧美一区二区三区| 久久色视频免费观看| 日韩精品中文字幕一区二区三区 | 蜜臀av在线播放一区二区三区| 中文字幕佐山爱一区二区免费| 久久综合999| 精品国精品国产尤物美女| 欧美老肥妇做.爰bbww视频| 欧美做爰猛烈大尺度电影无法无天| 成人av在线观| 成人小视频免费在线观看| 国产成人自拍高清视频在线免费播放| 日本亚洲一区二区| 奇米一区二区三区| 免费观看在线色综合| 日本亚洲三级在线| 蜜臀国产一区二区三区在线播放| 日本欧美在线看| 日韩av高清在线观看| 天天操天天综合网| 日本午夜精品视频在线观看| 视频在线观看一区二区三区| 调教+趴+乳夹+国产+精品| 亚洲v日本v欧美v久久精品| 亚洲成av人片| 久久精品国产999大香线蕉| 精品一二三四区| 国产伦精品一区二区三区免费迷 | 亚洲与欧洲av电影| 一个色妞综合视频在线观看| 亚洲福中文字幕伊人影院| 亚洲精品日韩一| 亚洲成人资源网| 蜜乳av一区二区| 国产精品18久久久久久久久久久久| 国产精品影音先锋| 成人v精品蜜桃久久一区| 日本高清视频一区二区| 欧美日韩亚洲不卡| 亚洲精品一区二区三区四区高清| 蜜桃精品视频在线观看| 精品一区二区在线免费观看| 高清国产一区二区三区| 一本色道久久综合精品竹菊| 欧美日韩国产区一| 2023国产精品| 国产精品视频免费看| 一区二区三区中文字幕电影| 男男视频亚洲欧美| 国产精品自在在线| 91麻豆国产福利在线观看| 欧美日韩久久一区| 久久综合久久综合亚洲| 成人免费在线播放视频| 日本欧美一区二区三区乱码| 国产乱人伦精品一区二区在线观看| 成人国产亚洲欧美成人综合网 | 在线不卡一区二区| 337p粉嫩大胆色噜噜噜噜亚洲| 国产精品大尺度| 丝袜亚洲另类欧美| 国产在线视频一区二区三区| 色哟哟欧美精品| 日韩精品中文字幕在线不卡尤物| 最新日韩av在线| 免费高清视频精品| 色妹子一区二区| 久久久久久亚洲综合| 艳妇臀荡乳欲伦亚洲一区| 激情六月婷婷综合| 欧洲精品一区二区三区在线观看| 久久久久久亚洲综合影院红桃| 亚洲曰韩产成在线| 成人app在线| www激情久久| 五月婷婷欧美视频| 99精品视频在线播放观看| 精品日韩欧美一区二区| 亚洲国产精品久久久久秋霞影院 | 欧美aaaaaa午夜精品| 成人av动漫在线| 欧美www视频| 亚洲影视在线播放| av网站一区二区三区| 欧美精品一区二区三| 亚洲a一区二区| 91在线观看成人| 久久精品人人爽人人爽| 日本三级亚洲精品| 欧美日韩大陆一区二区| 亚洲嫩草精品久久| 东方aⅴ免费观看久久av| 日韩精品一区二区三区四区| 亚洲不卡av一区二区三区| 色天天综合久久久久综合片| 国产精品国产三级国产三级人妇| 国模大尺度一区二区三区| 日韩一区二区免费在线观看| 亚洲成人先锋电影| 欧美亚一区二区| 一区二区三区精品视频| 91小视频免费看| 国产精品你懂的在线| 国产一区二区不卡在线| 日韩你懂的在线观看| 乱一区二区av| 日韩欧美自拍偷拍| 欧美aaaaaa午夜精品| 欧美一级欧美三级在线观看| 亚洲国产日日夜夜| 91国在线观看| 亚洲影院久久精品| 欧美三级在线播放| 99re热这里只有精品视频| 久久久久国产精品人| 国产精品主播直播| 日本一区二区综合亚洲| 国产成人精品影视| 国产精品全国免费观看高清| 国产成人精品www牛牛影视| 欧美高清在线一区| 成人影视亚洲图片在线| 亚洲视频在线观看一区| 在线观看成人免费视频| 天天综合网 天天综合色| 欧美一级黄色录像| 久久99热这里只有精品| 26uuu久久综合| a4yy欧美一区二区三区| 亚洲欧洲制服丝袜| 欧美日韩亚洲国产综合| 久久国产综合精品| 欧美激情资源网| 色综合天天视频在线观看| 亚洲国产精品尤物yw在线观看| 欧美肥胖老妇做爰| 国产一区二区三区av电影| 国产精品不卡一区| 在线视频一区二区三| 日本中文字幕不卡| 久久午夜电影网| 色综合久久88色综合天天| 亚洲.国产.中文慕字在线| 精品国产亚洲一区二区三区在线观看 | 欧美肥妇free| 国产美女一区二区| 亚洲精品一二三| 日韩亚洲欧美一区| 成人免费视频app| 一级中文字幕一区二区| 精品国精品自拍自在线| 97久久精品人人爽人人爽蜜臀| 午夜精品在线看| 久久久99免费| 欧美色手机在线观看| 久久精品国产999大香线蕉| 中文字幕视频一区| 欧美理论电影在线| 风间由美一区二区av101| 午夜在线电影亚洲一区| 国产午夜亚洲精品不卡| 欧美性一级生活| 国产成人午夜精品影院观看视频| 一区二区三区四区亚洲| 久久一留热品黄| 欧洲精品在线观看| 丁香婷婷综合五月| 日韩电影在线一区| 国产精品少妇自拍| 欧美一区二区久久| 色综合久久综合| 国产精品18久久久久久vr| 香蕉久久夜色精品国产使用方法 | 欧美系列在线观看| 国产精品538一区二区在线| 亚洲18女电影在线观看| 亚洲色图另类专区| 欧美精品一区二区久久久| 欧美日韩国产a| 色综合色狠狠综合色| 国产+成+人+亚洲欧洲自线|