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

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

?? rotated.c

?? 混沌分析工具
?? C
?? 第 1 頁 / 共 3 頁
字號:
/* ********************************************************************** *//* xvertext 5.0, Copyright (c) 1993 Alan Richardson (mppa3@uk.ac.sussex.syma) * * Permission 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 that both the * copyright notice and this permission notice appear in supporting * documentation.  All work developed as a consequence of the use of * this program should duly acknowledge such use. No representations are * made about the suitability of this software for any purpose.  It is * provided "as is" without express or implied warranty. *//* ********************************************************************** *//* BETTER: xvertext now does rotation at any angle!! * * BEWARE: function arguments have CHANGED since version 2.0!! *//* ********************************************************************** */#include <X11/Xlib.h>#include <X11/Xutil.h>#include <X11/Xatom.h>#include <stdio.h>#include <math.h>#include "rotated.h"/* ---------------------------------------------------------------------- *//* Make sure cache size is set */#ifndef CACHE_SIZE_LIMIT#define CACHE_SIZE_LIMIT 0#endif /*CACHE_SIZE_LIMIT */    /* Make sure a cache method is specified */#ifndef CACHE_XIMAGES#ifndef CACHE_BITMAPS#define CACHE_BITMAPS#endif /*CACHE_BITMAPS*/#endif /*CACHE_XIMAGES*//* ---------------------------------------------------------------------- *//* Debugging macros */#ifdef DEBUGstatic int debug=1;#elsestatic int debug=0;#endif /*DEBUG*/#define DEBUG_PRINT1(a) if (debug) printf (a)#define DEBUG_PRINT2(a, b) if (debug) printf (a, b)#define DEBUG_PRINT3(a, b, c) if (debug) printf (a, b, c)#define DEBUG_PRINT4(a, b, c, d) if (debug) printf (a, b, c, d)#define DEBUG_PRINT5(a, b, c, d, e) if (debug) printf (a, b, c, d, e)/* ---------------------------------------------------------------------- */#ifndef M_PI#define M_PI 3.14159265358979323846#endif/* ---------------------------------------------------------------------- *//* A structure holding everything needed for a rotated string */typedef struct rotated_text_item_template {    Pixmap bitmap;    XImage *ximage;        char *text;    char *font_name;    Font fid;    float angle;    int align;    float magnify;        int cols_in;    int rows_in;    int cols_out;    int rows_out;        int nl;    int max_width;    float *corners_x;    float *corners_y;        long int size;    int cached;    struct rotated_text_item_template *next;} RotatedTextItem;RotatedTextItem *first_text_item=NULL;/* ---------------------------------------------------------------------- *//* A structure holding current magnification and bounding box padding */static struct style_template {    float magnify;    int bbx_pad;} style={    1.,    0    };/* ---------------------------------------------------------------------- */static char            *my_strdup();static char            *my_strtok();float                   XRotVersion();void                    XRotSetMagnification();void                    XRotSetBoundingBoxPad();int                     XRotDrawString();int                     XRotDrawImageString();int                     XRotDrawAlignedString();int                     XRotDrawAlignedImageString();XPoint                 *XRotTextExtents();static XImage          *MakeXImage();static int              XRotPaintAlignedString();static int              XRotDrawHorizontalString();static RotatedTextItem *XRotRetrieveFromCache();static RotatedTextItem *XRotCreateTextItem();static void             XRotAddToLinkedList();static void             XRotFreeTextItem();static XImage          *XRotMagnifyImage();/* ---------------------------------------------------------------------- *//**************************************************************************//* Routine to mimic `strdup()' (some machines don't have it)              *//**************************************************************************/static char *my_strdup(str)    char *str;{    char *s;        if(str==NULL)	return NULL;        s=(char *)malloc((unsigned)(strlen(str)+1));    if(s!=NULL) 	strcpy(s, str);        return s;}/* ---------------------------------------------------------------------- *//**************************************************************************//* Routine to replace `strtok' : this one returns a zero length string if *//* it encounters two consecutive delimiters                               *//**************************************************************************/static char *my_strtok(str1, str2)    char *str1, *str2;{    char *ret;    int i, j, stop;    static int start, len;    static char *stext;        if(str2==NULL)	return NULL;        /* initialise if str1 not NULL */    if(str1!=NULL) {	start=0;	stext=str1;	len=strlen(str1);    }        /* run out of tokens ? */    if(start>=len)	return NULL;        /* loop through characters */    for(i=start; i<len; i++) {	/* loop through delimiters */	stop=0;	for(j=0; j<strlen(str2); j++)	    if(stext[i]==str2[j])		stop=1;		if(stop)	    break;    }        stext[i]='\0';        ret=stext+start;        start=i+1;        return ret;}/* ---------------------------------------------------------------------- *//**************************************************************************//* Return version/copyright information                                   *//**************************************************************************/float XRotVersion(str, n)    char *str;    int n;{    if(str!=NULL)	strncpy(str, XV_COPYRIGHT, n);    return XV_VERSION;}/* ---------------------------------------------------------------------- *//**************************************************************************//* Set the font magnification factor for all subsequent operations        *//**************************************************************************/void XRotSetMagnification(m)    float m;{    if(m>0.)	style.magnify=m;}/* ---------------------------------------------------------------------- *//**************************************************************************//* Set the padding used when calculating bounding boxes                   *//**************************************************************************/void XRotSetBoundingBoxPad(p)    int p;{    if(p>=0)	style.bbx_pad=p;}/* ---------------------------------------------------------------------- *//**************************************************************************//*  Create an XImage structure and allocate memory for it                 *//**************************************************************************/static XImage *MakeXImage(dpy, w, h)    Display *dpy;    int w, h;{    XImage *I;    char *data;        /* reserve memory for image */    data=(char *)calloc((unsigned)(((w-1)/8+1)*h), 1);    if(data==NULL)	return NULL;        /* create the XImage */    I=XCreateImage(dpy, DefaultVisual(dpy, DefaultScreen(dpy)), 1, XYBitmap,                   0, data, w, h, 8, 0);    if(I==NULL)	return NULL;        I->byte_order=I->bitmap_bit_order=MSBFirst;    return I;}/* ---------------------------------------------------------------------- *//**************************************************************************//*  A front end to XRotPaintAlignedString:                                *//*      -no alignment, no background                                      *//**************************************************************************/int XRotDrawString(dpy, font, angle, drawable, gc, x, y, str)    Display *dpy;    XFontStruct *font;    float angle;    Drawable drawable;    GC gc;    int x, y;    char *str;{    return (XRotPaintAlignedString(dpy, font, angle, drawable, gc,				   x, y, str, NONE, 0));}/* ---------------------------------------------------------------------- *//**************************************************************************//*  A front end to XRotPaintAlignedString:                                *//*      -no alignment, paints background                                  *//**************************************************************************/int XRotDrawImageString(dpy, font, angle, drawable, gc, x, y, str)    Display *dpy;    XFontStruct *font;    float angle;    Drawable drawable;    GC gc;    int x, y;    char *str;{    return(XRotPaintAlignedString(dpy, font, angle, drawable, gc,				  x, y, str, NONE, 1));}/* ---------------------------------------------------------------------- *//**************************************************************************//*  A front end to XRotPaintAlignedString:                                *//*      -does alignment, no background                                    *//**************************************************************************/int XRotDrawAlignedString(dpy, font, angle, drawable, gc, x, y, text, align)    Display *dpy;    XFontStruct *font;    float angle;    Drawable drawable;    GC gc;    int x, y;    char *text;    int align;{    return(XRotPaintAlignedString(dpy, font, angle, drawable, gc,				  x, y, text, align, 0));}/* ---------------------------------------------------------------------- *//**************************************************************************//*  A front end to XRotPaintAlignedString:                                *//*      -does alignment, paints background                                *//**************************************************************************/int XRotDrawAlignedImageString(dpy, font, angle, drawable, gc, x, y, text,			       align)    Display *dpy;    XFontStruct *font;    float angle;    Drawable drawable;    GC gc;    int x, y;    char *text;    int align;{    return(XRotPaintAlignedString(dpy, font, angle, drawable, gc,				  x, y, text, align, 1));}/* ---------------------------------------------------------------------- *//**************************************************************************//*  Aligns and paints a rotated string                                    *//**************************************************************************/static int XRotPaintAlignedString(dpy, font, angle, drawable, gc, x, y, text,				  align, bg)    Display *dpy;    XFontStruct *font;    float angle;    Drawable drawable;    GC gc;    int x, y;    char *text;    int align;    int bg;{    int i;    GC my_gc;    int xp, yp;    float hot_x, hot_y;    float hot_xp, hot_yp;    float sin_angle, cos_angle;    RotatedTextItem *item;    Pixmap bitmap_to_paint;        /* return early for NULL/empty strings */    if(text==NULL)        return 0;        if(strlen(text)==0)	return 0;    /* manipulate angle to 0<=angle<360 degrees */    while(angle<0)        angle+=360;        while(angle>=360)        angle-=360;        angle*=M_PI/180;        /* horizontal text made easy */    if(angle==0. && style.magnify==1.) 	return(XRotDrawHorizontalString(dpy, font, drawable, gc, x, y,					text, align, bg));        /* get a rotated bitmap */    item=XRotRetrieveFromCache(dpy, font, angle, text, align);    if(item==NULL)	return 0;        /* this gc has similar properties to the user's gc */    my_gc=XCreateGC(dpy, drawable, NULL, 0);    XCopyGC(dpy, gc, GCForeground|GCBackground|GCFunction|GCPlaneMask,	    my_gc);    /* alignment : which point (hot_x, hot_y) relative to bitmap centre       coincides with user's specified point? */        /* y position */    if(align==TLEFT || align==TCENTRE || align==TRIGHT)        hot_y=(float)item->rows_in/2*style.magnify;    else if(align==MLEFT || align==MCENTRE || align==MRIGHT)	hot_y=0;    else if(align==BLEFT || align==BCENTRE || align==BRIGHT)	hot_y=-(float)item->rows_in/2*style.magnify;    else	hot_y=-((float)item->rows_in/2-(float)font->descent)*style.magnify;        /* x position */    if(align==TLEFT || align==MLEFT || align==BLEFT || align==NONE)	hot_x=-(float)item->max_width/2*style.magnify;    else if(align==TCENTRE || align==MCENTRE || align==BCENTRE)	hot_x=0;    else        hot_x=(float)item->max_width/2*style.magnify;        /* pre-calculate sin and cos */    sin_angle=sin(angle);    cos_angle=cos(angle);        /* rotate hot_x and hot_y around bitmap centre */    hot_xp= hot_x*cos_angle - hot_y*sin_angle;    hot_yp= hot_x*sin_angle + hot_y*cos_angle;        /* text background will be drawn using XFillPolygon */    if(bg) {	GC depth_one_gc;	XPoint *xpoints;	Pixmap empty_stipple;		/* reserve space for XPoints */	xpoints=(XPoint *)malloc((unsigned)(4*item->nl*sizeof(XPoint)));	if(!xpoints)	    return 1;		/* rotate corner positions */	for(i=0; i<4*item->nl; i++) {	    xpoints[i].x=(float)x + ( (item->corners_x[i]-hot_x)*cos_angle + 				      (item->corners_y[i]+hot_y)*sin_angle);	    xpoints[i].y=(float)y + (-(item->corners_x[i]-hot_x)*sin_angle + 				      (item->corners_y[i]+hot_y)*cos_angle);	}		/* we want to swap foreground and background colors here;	   XGetGCValues() is only available in R4+ */		empty_stipple=XCreatePixmap(dpy, drawable, 1, 1, 1);		depth_one_gc=XCreateGC(dpy, empty_stipple, NULL, 0);	XSetForeground(dpy, depth_one_gc, 0);	XFillRectangle(dpy, empty_stipple, depth_one_gc, 0, 0, 2, 2);	XSetStipple(dpy, my_gc, empty_stipple);	XSetFillStyle(dpy, my_gc, FillOpaqueStippled);		XFillPolygon(dpy, drawable, my_gc, xpoints, 4*item->nl, Nonconvex,		     CoordModeOrigin);		/* free our resources */	free((char *)xpoints);	XFreeGC(dpy, depth_one_gc);	XFreePixmap(dpy, empty_stipple);    }        /* where should top left corner of bitmap go ? */    xp=(float)x-((float)item->cols_out/2 +hot_xp);    yp=(float)y-((float)item->rows_out/2 -hot_yp);    

?? 快捷鍵說明

復(fù)制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
欧美日韩一区二区欧美激情| 日韩美女主播在线视频一区二区三区| 亚洲国产视频直播| 久久亚洲春色中文字幕久久久| 91碰在线视频| 精品在线播放免费| 亚洲国产精品人人做人人爽| 欧美国产日本韩| 日韩精品在线一区二区| 欧美亚洲高清一区| 成人黄色一级视频| 国产一区二区免费在线| 蜜臀av性久久久久蜜臀aⅴ流畅| 中文字幕日韩欧美一区二区三区| 欧美va亚洲va香蕉在线| 欧美日韩亚洲综合在线| 91尤物视频在线观看| 国产91精品一区二区| 日本不卡高清视频| 亚洲一二三区不卡| 亚洲综合免费观看高清完整版在线| 国产日韩欧美制服另类| 欧美成人aa大片| 欧美精品九九99久久| 在线观看日韩高清av| 99久久99精品久久久久久| 国产91精品精华液一区二区三区 | 色综合久久88色综合天天6| 极品销魂美女一区二区三区| 视频一区在线播放| 亚洲一区二区三区自拍| 亚洲美女屁股眼交| 亚洲精品国产无天堂网2021| 亚洲天堂久久久久久久| 中文字幕在线不卡视频| 国产精品久久99| 国产精品免费视频观看| 国产精品久久久久影视| 欧美激情在线一区二区三区| 欧美国产97人人爽人人喊| 国产欧美精品一区| 国产精品不卡在线| 亚洲视频精选在线| 一区二区三区在线观看国产| 亚洲男人的天堂网| 亚洲综合丁香婷婷六月香| 亚洲免费观看高清完整版在线观看熊| 亚洲天堂a在线| 亚洲综合清纯丝袜自拍| 五月婷婷综合网| 免费成人深夜小野草| 国产一区二区主播在线| 国产不卡一区视频| kk眼镜猥琐国模调教系列一区二区| 成人国产精品免费观看动漫| 91视频免费观看| 欧美日韩不卡视频| 日韩一级欧美一级| 久久亚洲精华国产精华液| 日本一区二区三区高清不卡| 欧美国产视频在线| 亚洲美女精品一区| 日韩国产欧美三级| 国产精品99久久久久久宅男| av电影天堂一区二区在线观看| 色综合天天做天天爱| 欧美日韩一级视频| 久久综合久久综合久久综合| 国产精品日韩成人| 亚洲第一会所有码转帖| 精品亚洲porn| 色综合激情五月| 欧美一区二区三区不卡| 久久久国产一区二区三区四区小说| 亚洲视频一二区| 欧美bbbbb| 91在线看国产| 日韩欧美综合在线| 国产精品美女久久久久久2018 | 久久久精品影视| 亚洲精品国产无天堂网2021| 青青草原综合久久大伊人精品| 国产成人精品影院| 在线一区二区三区| 精品久久国产字幕高潮| 亚洲视频免费观看| 久久国产剧场电影| 欧美影院午夜播放| 久久久91精品国产一区二区精品| 亚洲免费看黄网站| 国模冰冰炮一区二区| 日本黄色一区二区| 2欧美一区二区三区在线观看视频 337p粉嫩大胆噜噜噜噜噜91av | 成人黄色777网| 欧美精品色一区二区三区| 久久婷婷国产综合国色天香| 一区二区不卡在线播放 | 欧美日韩精品系列| 国产精品欧美久久久久一区二区 | 99riav久久精品riav| 日韩欧美国产综合一区 | 韩国理伦片一区二区三区在线播放| 不卡电影一区二区三区| 欧美一区二区三区婷婷月色| 日韩毛片视频在线看| 激情综合色综合久久综合| 欧美性生活一区| 成人欧美一区二区三区黑人麻豆 | 日韩欧美国产精品| 亚洲国产另类精品专区| 成人免费视频一区| 日韩一区二区电影在线| 亚洲影视在线播放| 91香蕉视频在线| 亚洲国产精品激情在线观看| 精品一二三四区| 欧美精品乱码久久久久久| 国产精品国产三级国产三级人妇| 国产一区高清在线| 欧美成人aa大片| 免费在线观看成人| 69成人精品免费视频| 一区二区三区在线视频观看58| 成人99免费视频| 国产日韩欧美精品一区| 裸体歌舞表演一区二区| 91精品久久久久久蜜臀| 丝袜亚洲另类欧美综合| 欧美午夜一区二区三区免费大片| 亚洲日本一区二区三区| 99久久精品免费观看| 国产精品乱人伦中文| 国产成人自拍在线| 久久精品亚洲国产奇米99 | 欧美中文字幕久久| 亚洲蜜桃精久久久久久久| 一本色道久久综合亚洲aⅴ蜜桃| 国产精品丝袜久久久久久app| 国产一区二区三区| 久久久久国产成人精品亚洲午夜 | 91在线码无精品| 亚洲精品视频自拍| 在线观看91精品国产入口| 亚洲精品久久久久久国产精华液| 一本到一区二区三区| 亚洲最大的成人av| 欧美日韩国产天堂| 欧美aaaaaa午夜精品| 精品国精品自拍自在线| 狠狠色丁香婷综合久久| 久久亚洲一区二区三区四区| 国产精品18久久久久久久久久久久| 国产日韩成人精品| 99精品偷自拍| 亚洲大片精品永久免费| 欧美一区在线视频| 国产一区二区福利视频| 国产精品高潮呻吟| 91国产成人在线| 婷婷综合另类小说色区| 欧美一区二区三区免费大片| 激情图片小说一区| 国产精品乱码久久久久久| 在线亚洲一区观看| 毛片一区二区三区| 国产欧美一二三区| 欧美在线免费视屏| 日本视频一区二区三区| 国产婷婷精品av在线| a级精品国产片在线观看| 亚洲一区二区视频在线| 精品欧美一区二区久久| 成人免费黄色大片| 国产精品免费久久久久| 欧美日韩免费电影| 激情综合色丁香一区二区| 中文字幕在线不卡一区| 91精品中文字幕一区二区三区| 九九视频精品免费| 国产精品成人网| 欧美一区二区人人喊爽| 国产精品羞羞答答xxdd| 玉米视频成人免费看| 精品久久久久久久久久久院品网| 成人18视频在线播放| 日韩高清欧美激情| 亚洲欧洲av色图| 日韩欧美高清一区| 99国产精品久| 黄色成人免费在线| 亚洲视频免费看| 精品国产不卡一区二区三区| 色婷婷av一区二区| 极品少妇xxxx偷拍精品少妇| 亚洲综合在线免费观看| 日本一区二区免费在线观看视频 | 99精品久久免费看蜜臀剧情介绍| 日韩成人一级片| 亚洲精品视频观看| 亚洲一区二区黄色|