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

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

?? 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);    

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
国产日本亚洲高清| 国产精品久99| 五月婷婷欧美视频| 一本色道久久综合狠狠躁的推荐| 国产清纯在线一区二区www| 国产一区高清在线| 欧美v亚洲v综合ⅴ国产v| 久久精品国产**网站演员| 7777精品伊人久久久大香线蕉最新版| 亚洲国产精品麻豆| 欧美日韩一区二区欧美激情| 一区二区欧美国产| 一本色道久久综合亚洲精品按摩| 亚洲欧美一区二区三区极速播放| 97久久精品人人爽人人爽蜜臀| 国产精品免费视频网站| 成人一区二区视频| 日韩伦理免费电影| 色网站国产精品| 亚洲一级不卡视频| 在线播放日韩导航| 免费美女久久99| 精品国产电影一区二区| 国产精品亚洲专一区二区三区| 久久久久久久久久久电影| 成人午夜激情片| 亚洲美女视频在线| 欧美日韩免费一区二区三区| 亚洲国产一区二区视频| 欧美精品tushy高清| 日本视频在线一区| 欧美精品一区二区高清在线观看 | 美女一区二区三区| 精品久久久久久久久久久久久久久久久 | 亚洲综合色视频| 精品视频1区2区| 日本最新不卡在线| 久久久久99精品国产片| 成人动漫视频在线| 亚洲综合一区二区精品导航| 欧美亚洲国产一区在线观看网站 | 国产精品久久久久aaaa| 日本精品一区二区三区高清| 国产成人8x视频一区二区| 国产精品福利电影一区二区三区四区| av在线播放成人| 天天综合日日夜夜精品| 日韩欧美亚洲另类制服综合在线 | 免费观看久久久4p| 久久久精品国产免大香伊| 91小视频免费观看| 午夜婷婷国产麻豆精品| 精品国产91亚洲一区二区三区婷婷| 丁香婷婷深情五月亚洲| 亚洲国产精品久久人人爱| 精品国产一区二区三区四区四| 成人国产精品免费观看视频| 亚洲韩国一区二区三区| 久久嫩草精品久久久精品一| 91小视频在线免费看| 免费人成在线不卡| 中文字幕人成不卡一区| 69精品人人人人| 成人午夜免费电影| 一区二区三区日本| 久久精品视频免费| 欧美性感一类影片在线播放| 九色综合狠狠综合久久| 综合欧美一区二区三区| 欧美va亚洲va在线观看蝴蝶网| 成a人片国产精品| 美女精品一区二区| 亚洲天堂av老司机| 欧美tickling网站挠脚心| 色综合网站在线| 激情综合色综合久久| 亚洲精品日日夜夜| 久久久久久久久蜜桃| 欧美日韩久久久久久| 丰满少妇在线播放bd日韩电影| 午夜精品一区二区三区三上悠亚| 26uuu久久天堂性欧美| 91高清在线观看| 国产ts人妖一区二区| 日本中文在线一区| 亚洲四区在线观看| 国产欧美中文在线| 欧美va在线播放| 欧美日韩国产首页| 91影视在线播放| 国产成人午夜99999| 久久疯狂做爰流白浆xx| 亚洲精品国久久99热| 久久久99久久| 日韩欧美一区二区免费| 欧美日韩一区三区四区| www.综合网.com| 精品在线观看免费| 亚洲一二三级电影| 亚洲素人一区二区| 国产精品免费免费| 久久久.com| 欧美电影免费提供在线观看| 欧美日韩美少妇| 色婷婷久久一区二区三区麻豆| 国产高清精品在线| 黄页网站大全一区二区| 日韩精品亚洲专区| 亚洲国产视频一区二区| 成人免费在线播放视频| 亚洲国产经典视频| 国产亚洲欧美在线| 精品久久久久久最新网址| 欧美二区三区的天堂| 欧美在线看片a免费观看| 在线中文字幕不卡| 色综合色狠狠综合色| 91亚洲午夜精品久久久久久| 99久久婷婷国产精品综合| 成人动漫一区二区在线| 成人精品视频网站| hitomi一区二区三区精品| 高清不卡一区二区在线| 国产成人在线网站| 丰满少妇久久久久久久| 丁香一区二区三区| 成人福利视频在线| 久久久久综合网| 国产亚洲成av人在线观看导航 | 亚洲欧美一区二区久久| 国产精品美女久久久久久2018 | 日韩精品一区二区三区在线| 欧美一区二区性放荡片| 91精品国产综合久久香蕉麻豆| 欧美精品久久一区二区三区| 欧美男生操女生| 3d成人h动漫网站入口| 日韩情涩欧美日韩视频| 日韩午夜精品视频| 精品成人一区二区三区四区| 久久嫩草精品久久久久| 国产精品网站在线播放| 国产女主播视频一区二区| 国产亚洲综合色| 国产精品九色蝌蚪自拍| 亚洲免费观看高清完整版在线观看| 亚洲人123区| 亚洲狠狠爱一区二区三区| 日本91福利区| 久久66热re国产| 国产高清成人在线| 91视视频在线直接观看在线看网页在线看| 91在线观看一区二区| 日本久久电影网| 日韩一区二区三区免费观看| 2020国产精品自拍| 亚洲国产精品精华液2区45| 中文字幕一区二区不卡| 亚洲香蕉伊在人在线观| 美女视频黄 久久| 国产真实乱子伦精品视频| 成人中文字幕在线| 欧美视频中文字幕| 欧美电影免费观看高清完整版在线| 国产欧美一区二区在线观看| 亚洲女性喷水在线观看一区| 午夜私人影院久久久久| 韩国中文字幕2020精品| av在线这里只有精品| 欧美日韩中文一区| 久久综合色综合88| 最新国产の精品合集bt伙计| 亚洲第一精品在线| 国产精品中文字幕欧美| 色噜噜狠狠成人网p站| 欧美一卡二卡在线观看| 国产精品欧美一区喷水| 亚洲国产视频一区二区| 国产精品一二一区| 欧美视频一区二区三区| 国产亚洲欧美一级| 午夜一区二区三区在线观看| 国产另类ts人妖一区二区| 91小视频在线免费看| 欧美大片日本大片免费观看| 国产精品麻豆久久久| 日韩电影在线一区| 成人激情校园春色| 欧美一区二区三区爱爱| 中文字幕一区二区三区在线不卡 | 亚洲第一狼人社区| 风流少妇一区二区| 欧美日本一区二区在线观看| 欧美经典一区二区三区| 图片区日韩欧美亚洲| 不卡一区二区在线| 欧美变态口味重另类| 樱花草国产18久久久久| 国产精品一区二区三区四区| 亚洲精品视频在线|