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

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

?? gd.c

?? 大國補丁后的nessus2.2.8的源代碼
?? C
?? 第 1 頁 / 共 4 頁
字號:
#include <stdio.h>#include <math.h>#include <string.h>#include <stdlib.h>#include "gd.h"#include "mtables.c"static void gdImageBrushApply(gdImagePtr im, int x, int y);static void gdImageTileApply(gdImagePtr im, int x, int y);gdImagePtr gdImageCreate(int sx, int sy){	int i;	gdImagePtr im;	im = (gdImage *) malloc(sizeof(gdImage));	/* NOW ROW-MAJOR IN GD 1.3 */	im->pixels = (unsigned char **) malloc(sizeof(unsigned char *) * sy);	im->polyInts = 0;	im->polyAllocated = 0;	im->brush = 0;	im->tile = 0;	im->style = 0;	for (i=0; (i<sy); i++) {		/* NOW ROW-MAJOR IN GD 1.3 */		im->pixels[i] = (unsigned char *) calloc(			sx, sizeof(unsigned char));	}		im->sx = sx;	im->sy = sy;	im->colorsTotal = 0;	im->transparent = (-1);	im->interlace = 0;	return im;}void gdImageDestroy(gdImagePtr im){	int i;	for (i=0; (i<im->sy); i++) {		free(im->pixels[i]);	}		free(im->pixels);	if (im->polyInts) {			free(im->polyInts);	}	if (im->style) {		free(im->style);	}	free(im);}int gdImageColorClosest(gdImagePtr im, int r, int g, int b){	int i;	long rd, gd, bd;	int ct = (-1);	long mindist = 0;	for (i=0; (i<(im->colorsTotal)); i++) {		long dist;		if (im->open[i]) {			continue;		}		rd = (im->red[i] - r);			gd = (im->green[i] - g);		bd = (im->blue[i] - b);		dist = rd * rd + gd * gd + bd * bd;		if ((i == 0) || (dist < mindist)) {			mindist = dist;				ct = i;		}	}	return ct;}int gdImageColorExact(gdImagePtr im, int r, int g, int b){	int i;	for (i=0; (i<(im->colorsTotal)); i++) {		if (im->open[i]) {			continue;		}		if ((im->red[i] == r) && 			(im->green[i] == g) &&			(im->blue[i] == b)) {			return i;		}	}	return -1;}int gdImageColorAllocate(gdImagePtr im, int r, int g, int b){	int i;	int ct = (-1);	for (i=0; (i<(im->colorsTotal)); i++) {		if (im->open[i]) {			ct = i;			break;		}	}		if (ct == (-1)) {		ct = im->colorsTotal;		if (ct == gdMaxColors) {			return -1;		}		im->colorsTotal++;	}	im->red[ct] = r;	im->green[ct] = g;	im->blue[ct] = b;	im->open[ct] = 0;	return ct;}void gdImageColorDeallocate(gdImagePtr im, int color){	/* Mark it open. */	im->open[color] = 1;}void gdImageColorTransparent(gdImagePtr im, int color){	im->transparent = color;}void gdImageSetPixel(gdImagePtr im, int x, int y, int color){	int p;	switch(color) {		case gdStyled:		if (!im->style) {			/* Refuse to draw if no style is set. */			return;		} else {			p = im->style[im->stylePos++];		}		if (p != (gdTransparent)) {			gdImageSetPixel(im, x, y, p);		}		im->stylePos = im->stylePos %  im->styleLength;		break;		case gdStyledBrushed:		if (!im->style) {			/* Refuse to draw if no style is set. */			return;		}		p = im->style[im->stylePos++];		if ((p != gdTransparent) && (p != 0)) {			gdImageSetPixel(im, x, y, gdBrushed);		}		im->stylePos = im->stylePos %  im->styleLength;		break;		case gdBrushed:		gdImageBrushApply(im, x, y);		break;		case gdTiled:		gdImageTileApply(im, x, y);		break;		default:		if (gdImageBoundsSafe(im, x, y)) {			/* NOW ROW-MAJOR IN GD 1.3 */			im->pixels[y][x] = color;		}		break;	}}static void gdImageBrushApply(gdImagePtr im, int x, int y){	int lx, ly;	int hy;	int hx;	int x1, y1, x2, y2;	int srcx, srcy;	if (!im->brush) {		return;	}	hy = gdImageSY(im->brush)/2;	y1 = y - hy;	y2 = y1 + gdImageSY(im->brush);		hx = gdImageSX(im->brush)/2;	x1 = x - hx;	x2 = x1 + gdImageSX(im->brush);	srcy = 0;	for (ly = y1; (ly < y2); ly++) {		srcx = 0;		for (lx = x1; (lx < x2); lx++) {			int p;			p = gdImageGetPixel(im->brush, srcx, srcy);			/* Allow for non-square brushes! */			if (p != gdImageGetTransparent(im->brush)) {				gdImageSetPixel(im, lx, ly,					im->brushColorMap[p]);			}			srcx++;		}		srcy++;	}	}		static void gdImageTileApply(gdImagePtr im, int x, int y){	int srcx, srcy;	int p;	if (!im->tile) {		return;	}	srcx = x % gdImageSX(im->tile);	srcy = y % gdImageSY(im->tile);	p = gdImageGetPixel(im->tile, srcx, srcy);	/* Allow for transparency */	if (p != gdImageGetTransparent(im->tile)) {		gdImageSetPixel(im, x, y,			im->tileColorMap[p]);	}}		int gdImageGetPixel(gdImagePtr im, int x, int y){	if (gdImageBoundsSafe(im, x, y)) {		/* NOW ROW-MAJOR IN GD 1.3 */		return im->pixels[y][x];	} else {		return 0;	}}/* Bresenham as presented in Foley & Van Dam */void gdImageLine(gdImagePtr im, int x1, int y1, int x2, int y2, int color){	int dx, dy, incr1, incr2, d, x, y, xend, yend, xdirflag, ydirflag;	dx = abs(x2-x1);	dy = abs(y2-y1);	if (dy <= dx) {		d = 2*dy - dx;		incr1 = 2*dy;		incr2 = 2 * (dy - dx);		if (x1 > x2) {			x = x2;			y = y2;			ydirflag = (-1);			xend = x1;		} else {			x = x1;			y = y1;			ydirflag = 1;			xend = x2;		}		gdImageSetPixel(im, x, y, color);		if (((y2 - y1) * ydirflag) > 0) {			while (x < xend) {				x++;				if (d <0) {					d+=incr1;				} else {					y++;					d+=incr2;				}				gdImageSetPixel(im, x, y, color);			}		} else {			while (x < xend) {				x++;				if (d <0) {					d+=incr1;				} else {					y--;					d+=incr2;				}				gdImageSetPixel(im, x, y, color);			}		}			} else {		d = 2*dx - dy;		incr1 = 2*dx;		incr2 = 2 * (dx - dy);		if (y1 > y2) {			y = y2;			x = x2;			yend = y1;			xdirflag = (-1);		} else {			y = y1;			x = x1;			yend = y2;			xdirflag = 1;		}		gdImageSetPixel(im, x, y, color);		if (((x2 - x1) * xdirflag) > 0) {			while (y < yend) {				y++;				if (d <0) {					d+=incr1;				} else {					x++;					d+=incr2;				}				gdImageSetPixel(im, x, y, color);			}		} else {			while (y < yend) {				y++;				if (d <0) {					d+=incr1;				} else {					x--;					d+=incr2;				}				gdImageSetPixel(im, x, y, color);			}		}	}}static void dashedSet(gdImagePtr im, int x, int y, int color,	int *onP, int *dashStepP);void gdImageDashedLine(gdImagePtr im, int x1, int y1, int x2, int y2, int color){	int dx, dy, incr1, incr2, d, x, y, xend, yend, xdirflag, ydirflag;	int dashStep = 0;	int on = 1;	dx = abs(x2-x1);	dy = abs(y2-y1);	if (dy <= dx) {		d = 2*dy - dx;		incr1 = 2*dy;		incr2 = 2 * (dy - dx);		if (x1 > x2) {			x = x2;			y = y2;			ydirflag = (-1);			xend = x1;		} else {			x = x1;			y = y1;			ydirflag = 1;			xend = x2;		}		dashedSet(im, x, y, color, &on, &dashStep);		if (((y2 - y1) * ydirflag) > 0) {			while (x < xend) {				x++;				if (d <0) {					d+=incr1;				} else {					y++;					d+=incr2;				}				dashedSet(im, x, y, color, &on, &dashStep);			}		} else {			while (x < xend) {				x++;				if (d <0) {					d+=incr1;				} else {					y--;					d+=incr2;				}				dashedSet(im, x, y, color, &on, &dashStep);			}		}			} else {		d = 2*dx - dy;		incr1 = 2*dx;		incr2 = 2 * (dx - dy);		if (y1 > y2) {			y = y2;			x = x2;			yend = y1;			xdirflag = (-1);		} else {			y = y1;			x = x1;			yend = y2;			xdirflag = 1;		}		dashedSet(im, x, y, color, &on, &dashStep);		if (((x2 - x1) * xdirflag) > 0) {			while (y < yend) {				y++;				if (d <0) {					d+=incr1;				} else {					x++;					d+=incr2;				}				dashedSet(im, x, y, color, &on, &dashStep);			}		} else {			while (y < yend) {				y++;				if (d <0) {					d+=incr1;				} else {					x--;					d+=incr2;				}				dashedSet(im, x, y, color, &on, &dashStep);			}		}	}}static void dashedSet(gdImagePtr im, int x, int y, int color,	int *onP, int *dashStepP){	int dashStep = *dashStepP;	int on = *onP;	dashStep++;	if (dashStep == gdDashSize) {		dashStep = 0;		on = !on;	}	if (on) {		gdImageSetPixel(im, x, y, color);	}	*dashStepP = dashStep;	*onP = on;}	int gdImageBoundsSafe(gdImagePtr im, int x, int y){	return (!(((y < 0) || (y >= im->sy)) ||		((x < 0) || (x >= im->sx))));}void gdImageChar(gdImagePtr im, gdFontPtr f, int x, int y, 	int c, int color){	int cx, cy;	int px, py;	int fline;	cx = 0;	cy = 0;	if ((c < f->offset) || (c >= (f->offset + f->nchars))) {		return;	}	fline = (c - f->offset) * f->h * f->w;	for (py = y; (py < (y + f->h)); py++) {		for (px = x; (px < (x + f->w)); px++) {			if (f->data[fline + cy * f->w + cx]) {				gdImageSetPixel(im, px, py, color);				}			cx++;		}		cx = 0;		cy++;	}}void gdImageCharUp(gdImagePtr im, gdFontPtr f, 	int x, int y, int c, int color){	int cx, cy;	int px, py;	int fline;	cx = 0;	cy = 0;	if ((c < f->offset) || (c >= (f->offset + f->nchars))) {		return;	}	fline = (c - f->offset) * f->h * f->w;	for (py = y; (py > (y - f->w)); py--) {		for (px = x; (px < (x + f->h)); px++) {			if (f->data[fline + cy * f->w + cx]) {				gdImageSetPixel(im, px, py, color);				}			cy++;		}		cy = 0;		cx++;	}}void gdImageString(gdImagePtr im, gdFontPtr f, 	int x, int y, unsigned char *s, int color){	int i;	int l;	l = strlen((char*)s);	for (i=0; (i<l); i++) {		gdImageChar(im, f, x, y, s[i], color);		x += f->w;	}}void gdImageStringUp(gdImagePtr im, gdFontPtr f, 	int x, int y, unsigned char *s, int color){	int i;	int l;	l = strlen((char*)s);	for (i=0; (i<l); i++) {		gdImageCharUp(im, f, x, y, s[i], color);		y -= f->w;	}}static int strlen16(unsigned short *s);void gdImageString16(gdImagePtr im, gdFontPtr f, 	int x, int y, unsigned short *s, int color){	int i;	int l;	l = strlen16(s);	for (i=0; (i<l); i++) {		gdImageChar(im, f, x, y, s[i], color);		x += f->w;	}}void gdImageStringUp16(gdImagePtr im, gdFontPtr f, 	int x, int y, unsigned short *s, int color){	int i;	int l;	l = strlen16(s);	for (i=0; (i<l); i++) {		gdImageCharUp(im, f, x, y, s[i], color);		y -= f->w;	}}static int strlen16(unsigned short *s){	int len = 0;	while (*s) {		s++;		len++;	}	return len;}/* s and e are integers modulo 360 (degrees), with 0 degrees  being the rightmost extreme and degrees changing clockwise.  cx and cy are the center in pixels; w and h are the horizontal   and vertical diameter in pixels. Nice interface, but slow, since  I don't yet use Bresenham (I'm using an inefficient but  simple solution with too much work going on in it; generalizing  Bresenham to ellipses and partial arcs of ellipses is non-trivial,  at least for me) and there are other inefficiencies (small circles  do far too much work). */void gdImageArc(gdImagePtr im, int cx, int cy, int w, int h, int s, int e, int color){	int i;	int lx = 0, ly = 0;	int w2, h2;	w2 = w/2;	h2 = h/2;	while (e < s) {		e += 360;	}	for (i=s; (i <= e); i++) {		int x, y;		x = ((long)cost[i % 360] * (long)w2 / costScale) + cx; 		y = ((long)sint[i % 360] * (long)h2 / sintScale) + cy;		if (i != s) {			gdImageLine(im, lx, ly, x, y, color);			}		lx = x;		ly = y;	}}#if 0	/* Bresenham octant code, which I should use eventually */	int x, y, d;	x = 0;	y = w;	d = 3-2*w;	while (x < y) {		gdImageSetPixel(im, cx+x, cy+y, color);		if (d < 0) {			d += 4 * x + 6;		} else {			d += 4 * (x - y) + 10;			y--;		}		x++;	}	if (x == y) {		gdImageSetPixel(im, cx+x, cy+y, color);	}#endifvoid gdImageFillToBorder(gdImagePtr im, int x, int y, int border, int color){	int lastBorder;	/* Seek left */	int leftLimit, rightLimit;	int i;	leftLimit = (-1);	if (border < 0) {		/* Refuse to fill to a non-solid border */		return;	}	for (i = x; (i >= 0); i--) {		if (gdImageGetPixel(im, i, y) == border) {			break;		}		gdImageSetPixel(im, i, y, color);		leftLimit = i;	}	if (leftLimit == (-1)) {		return;	}	/* Seek right */	rightLimit = x;	for (i = (x+1); (i < im->sx); i++) {			if (gdImageGetPixel(im, i, y) == border) {			break;		}		gdImageSetPixel(im, i, y, color);		rightLimit = i;	}	/* Look at lines above and below and start paints */	/* Above */	if (y > 0) {		lastBorder = 1;		for (i = leftLimit; (i <= rightLimit); i++) {			int c;			c = gdImageGetPixel(im, i, y-1);			if (lastBorder) {				if ((c != border) && (c != color)) {						gdImageFillToBorder(im, i, y-1, 						border, color);							lastBorder = 0;				}			} else if ((c == border) || (c == color)) {				lastBorder = 1;			}		}	}	/* Below */	if (y < ((im->sy) - 1)) {		lastBorder = 1;		for (i = leftLimit; (i <= rightLimit); i++) {			int c;			c = gdImageGetPixel(im, i, y+1);			if (lastBorder) {				if ((c != border) && (c != color)) {						gdImageFillToBorder(im, i, y+1, 						border, color);							lastBorder = 0;				}			} else if ((c == border) || (c == color)) {				lastBorder = 1;			}		}	}}

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
在线视频一区二区三区| 亚洲1区2区3区4区| 欧美一级国产精品| 精品免费国产二区三区| 91精品91久久久中77777| 欧美日韩国产首页在线观看| 日韩一级大片在线| 亚洲三级在线看| 中文字幕视频一区| 午夜精品久久久久久久99樱桃| 精品一区二区三区免费视频| 波多野结衣亚洲一区| 在线不卡a资源高清| 国产精品久久一级| 久久精品国产亚洲5555| 91最新地址在线播放| 国产日本欧美一区二区| 偷拍与自拍一区| 91亚洲男人天堂| 国产欧美日韩在线视频| 日韩国产欧美在线播放| 91麻豆免费视频| 亚洲色大成网站www久久九九| 久久不见久久见免费视频7| 欧美亚洲综合网| 国产三级三级三级精品8ⅰ区| 五月激情六月综合| 一本色道久久加勒比精品| 精品成人一区二区三区| 日本不卡一二三| 欧美午夜影院一区| 国产精品乱人伦中文| 日韩av电影一区| 欧美卡1卡2卡| 亚洲电影第三页| 91福利国产精品| 久久精品人人做人人爽人人 | 五月天婷婷综合| 91蜜桃视频在线| 欧美一区二区三区小说| 亚洲亚洲人成综合网络| 色欧美日韩亚洲| 亚洲欧美日韩中文字幕一区二区三区| 国产露脸91国语对白| 久久丝袜美腿综合| 国产一区二区调教| 欧美大胆人体bbbb| 激情丁香综合五月| 日韩三级中文字幕| 裸体一区二区三区| 久久综合九色综合97婷婷女人| 热久久久久久久| 欧美无砖专区一中文字| 日本午夜一本久久久综合| 欧美女孩性生活视频| 亚洲美女免费在线| 欧美精品少妇一区二区三区| 亚洲超碰97人人做人人爱| 91色在线porny| 亚洲激情图片qvod| 欧美午夜宅男影院| 奇米综合一区二区三区精品视频 | 日韩电影一区二区三区四区| 欧美色图激情小说| 免费在线看一区| 久久久国产精品麻豆| 高清国产一区二区| 亚洲欧美日本在线| 日韩欧美国产高清| 亚洲成人手机在线| 这里只有精品视频在线观看| 久久国产免费看| 国产精品色婷婷| 91小视频免费观看| 午夜一区二区三区在线观看| 日韩精品一区二区三区三区免费 | 麻豆久久久久久| 精品1区2区在线观看| 亚洲色图一区二区三区| 国产精品国产自产拍高清av| 91福利在线播放| 亚洲精品久久久蜜桃| 欧美一级欧美一级在线播放| 极品瑜伽女神91| 亚洲欧洲韩国日本视频| 日韩视频不卡中文| aaa欧美色吧激情视频| 国产综合色产在线精品| 一区二区三区四区蜜桃| 日韩一区二区三区在线观看| 成人在线综合网| 亚洲日本免费电影| 精品国产3级a| 欧美色手机在线观看| 国产九色sp调教91| 一区二区三区91| 欧美激情一区二区三区全黄| 欧美日韩精品欧美日韩精品| 国产麻豆精品theporn| 中文字幕一区二区三区视频| 欧美成人女星排行榜| 在线免费观看视频一区| 国产精品一二三四区| 亚洲激情图片一区| 亚洲人成网站色在线观看| 26uuu欧美| 99九九99九九九视频精品| 黄网站免费久久| 五月天中文字幕一区二区| 国产午夜精品在线观看| 欧美欧美欧美欧美| 欧洲在线/亚洲| 国产.欧美.日韩| 免费成人在线网站| 日本不卡视频在线| 亚洲一级片在线观看| 欧美一三区三区四区免费在线看 | 欧美主播一区二区三区| 成人精品鲁一区一区二区| 日韩成人精品在线| 一个色在线综合| 亚洲天堂网中文字| 久久只精品国产| 久久久影院官网| 日韩一区二区三区在线观看| 4438成人网| 精品成人在线观看| 2014亚洲片线观看视频免费| 欧美一区二区大片| 久久蜜桃av一区二区天堂 | 岛国一区二区三区| 懂色av一区二区三区免费观看| 蜜臀av性久久久久蜜臀aⅴ| 日韩中文字幕麻豆| 亚洲综合一区二区精品导航| 亚洲图片欧美激情| 亚洲天堂2016| 一区二区高清视频在线观看| 一区二区三区精品久久久| 亚洲久本草在线中文字幕| 亚洲大片免费看| 日本不卡一二三区黄网| 日韩—二三区免费观看av| 亚洲天堂久久久久久久| 亚洲精品伦理在线| 亚洲综合视频在线观看| 免费在线看成人av| 国精品**一区二区三区在线蜜桃| 国产一区亚洲一区| 91麻豆精品91久久久久同性| 欧美精品tushy高清| 欧美精品日日鲁夜夜添| 美女视频黄久久| 菠萝蜜视频在线观看一区| 欧美在线不卡视频| 欧美日韩一区高清| 精品精品国产高清一毛片一天堂| 欧美国产欧美综合| 亚洲一区二区精品视频| 国产伦精一区二区三区| 欧美亚洲综合另类| 欧美激情在线看| 亚洲成年人影院| 成人18视频在线播放| 91精品视频网| 亚洲女同ⅹxx女同tv| 精品一区二区三区蜜桃| 色天天综合色天天久久| 久久精品亚洲乱码伦伦中文| 亚洲国产成人91porn| 国产69精品久久99不卡| 日韩欧美一区电影| 亚洲一区二三区| av成人老司机| 久久精品亚洲精品国产欧美kt∨ | 捆绑调教一区二区三区| 色婷婷av一区二区| 国产精品久久久99| 国产精品一区二区免费不卡| 欧美一三区三区四区免费在线看| 亚洲黄网站在线观看| 国产精品18久久久久久久久久久久 | 精品美女一区二区三区| 性欧美大战久久久久久久久| 成人爱爱电影网址| 国产欧美视频一区二区三区| 麻豆国产一区二区| 欧美一区二区三区公司| 首页国产丝袜综合| 在线免费观看日本欧美| 亚洲色图制服诱惑| 99久久精品国产麻豆演员表| 国产三级一区二区三区| 国产一区二区三区在线观看免费视频| 欧美日产在线观看| 午夜视频在线观看一区二区三区| 91香蕉视频mp4| 裸体一区二区三区| 欧美一级专区免费大片| 国产精品网站在线播放|