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

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

?? graphic.c

?? GUI例程
?? C
?? 第 1 頁 / 共 2 頁
字號(hào):
/* * $Id: graphic.c,v 1.2 1999/11/12 13:03:26 till Exp $ * * Graphics primitive drawing functions * derived from: graphic.c Pixy Graphic Library * derived from: lissa.c: Graphics demos * * Copyright (C) 2001  Chen Yang <support@hhcn.com> * Copyright (C) 1999  Till Krech <till@snafu.de> * Copyright (C) 1998  Kenneth Albanowski <kjahds@kjahds.com> * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * The code in this file is partially based on Kenneth Albanowskis work * for the lissa graphics demo. *//******************Notice*********************************** * The Default Font size for ASCII Font is 8x16 * The Default Font size of Chinese Font is 16x16 ***********************************************************/#include <sys/types.h>#include <sys/stat.h>#include <linux/fb.h>#include <stdio.h>#include <unistd.h>#include <fcntl.h>#include <sys/mman.h>#include "mathf.h"#include "font_8x16.h"#include "gui.h"/*Define the correct Chinese Font File Path*/#define CHINESE_FONT_FILE "/font/hanzi"typedef struct {    unsigned short height;    unsigned char data[0];} Pattern;const Pattern _BlackPattern ={  1,    {~0}};const Pattern _WhitePattern ={  1,  { 0 }};const Pattern _DarkGreyPattern ={  2,  {    (unsigned char)0x55555555,    (unsigned char)0xCCCCCCCC  }};const Pattern _LightGreyPattern ={  4,  {    (unsigned char)0x88888888,    (unsigned char)0x00000000,    (unsigned char)0x22222222,    (unsigned char)0x00000000,  }};const Pattern _MicroPengPattern ={  16,  {    0x3c,0x7e,0x56,0xaa,0x86,0x4e,0x7b,0xc3,0x83,0x83,0xc3,0xc7,0xbd,0x99,0x99,    0xff  }};static const Pattern *patterns[] = {  /* This must correspond to the enum in pixy.h! */  &_BlackPattern,  &_WhitePattern,  &_DarkGreyPattern,  &_LightGreyPattern,  &_MicroPengPattern,};static short masktab[]={0x80,0x40,0x20,0x10,0x08,0x04,0x02,0x01};static int screen_fd=-1;FILE *C_Font;unsigned char * screen_ptr=(unsigned char*)(0x0400),*E_Font=(unsigned char*)(0x8500);static short screen_width=160,screen_height=160;static short WinSX,WinSY,WinEX,WinEY;static unsigned short X,Y,Color,P_Index,Mode=MODE_SRC;//CopyMode pixy_copy_mode = Mode_SRC;inline void setpixel(short x, short y, short color){    if ((x<0) || (x>=screen_width) || (y<0) || (y>=screen_height))		return;    {	       	unsigned char * loc = screen_ptr + ((y * screen_width*2 + x*2 ));	if (color){		*loc =0xff;*(loc+1)=0xff;	}else{		*loc = 0x0;*(loc+1)=0x0;	}			/*	short mask = masktab[(x&7)];    	unsigned char * loc = screen_ptr + ((y * screen_width + x )>>3);		if (color)			*loc |= mask;		else			*loc &= ~mask;	*/    }}/* Abrash's take on the simplest Bresenham line-drawing algorithm.  * * This isn't especially efficient, as we aren't combining the bit-mask * logic and addresses with the line drawing code, never mind higher * level optimizations like run-length slicing, etc. * */static inline void draw_xish_line(short x, short y, short dx, short dy, short xdir){	short dyX2=dy+dy;	short dyX2mdxX2=dyX2-(dx+dx);	short error=dyX2-dx;		setpixel(x, y, Color);	while (dx--) {		if (error >= 0) {			y++;			error += dyX2mdxX2;		} else {			error += dyX2;		}		x += xdir;		setpixel(x,y,Color);	}}static inline void draw_yish_line(short x, short y, short dx, short dy,short xdir){	short dxX2=dx + dx;	short dxX2mdyX2=dxX2-(dy+dy);	short error=dxX2-dy;		setpixel(x, y, Color);	while (dy--) {		if (error >= 0) {			x+= xdir;			error += dxX2mdyX2;		} else {			error += dxX2;		}		y++;		setpixel(x,y, Color);	}}void line(short x1, short y1, short x2, short y2){	short dx,dy;		if ( y1 > y2) {		short t = y1;		y1 = y2;		y2 = t;		t = x1;		x1 = x2;		x2 = t;	}		dx = x2-x1;	dy = y2-y1;		if (dx > 0) {		if (dx > dy)			draw_xish_line(x1, y1, dx, dy, 1);		else			draw_yish_line(x1, y1, dx, dy, 1);	} else {		dx = -dx;		if (dx > dy)			draw_xish_line(x1, y1, dx, dy, -1);		else			draw_yish_line(x1, y1, dx, dy, -1);	}		}/* One of Abrash's ellipse algorithms  */void ellipse(short x, short y, short a, short b){	short wx, wy;	short thresh;	short asq = a * a;	short bsq = b * b;	short xa, ya;		setpixel(x, y+b, Color);	setpixel(x, y-b, Color);		wx = 0;	wy = b;	xa = 0;	ya = asq * 2 * b;	thresh = asq / 4 - asq * b;		for (;;) {		thresh += xa + bsq;				if (thresh >= 0) {			ya -= asq * 2;			thresh -= ya;			wy--;		}				xa += bsq * 2;		wx++;				if (xa >= ya)		  break;						setpixel(x+wx, y-wy, Color);		setpixel(x-wx, y-wy, Color);		setpixel(x+wx, y+wy, Color);		setpixel(x-wx, y+wy, Color);	}		setpixel(x+a, y, Color);	setpixel(x-a, y, Color);		wx = a;	wy = 0;	xa = (bsq * a) << 1;		ya = 0;	thresh = (bsq >> 2) - bsq * a;		for (;;) {		thresh += ya + asq;				if (thresh >= 0) {			xa -= bsq + bsq;			thresh = thresh - xa;			wx--;		}				ya += asq + asq;		wy++;				if (ya > xa)		  break;		 		setpixel(x+wx, y-wy, Color);		setpixel(x-wx, y-wy, Color);		setpixel(x+wx, y+wy, Color);		setpixel(x-wx, y+wy, Color);	}}inline void h_line(int x1,int x2,int y){ static short ftab[]={0xff,0x7f,0x3f,0x1f,0x0f,0x7,0x3,0x1}; static short btab[]={0x0,0x80,0xc0,0xe0,0xf0,0xf8,0xfc,0xfe}; short count;  count=(x2-x1)>>3; if(count>1) {  unsigned char *loc;    loc=screen_ptr+((y*screen_width+x1)>>3);    if(Color)  {    *(loc)|=ftab[x1&7];         memset(loc+1,0xff,count-1);   *(loc+count)|= ftab[7-(x2&7)];  }   else   {    *loc &=btab[x1&7];    memset(loc+1,0,count-1);      *(loc+count)&=ftab[(x2&7)+1];   } }  else    line(x1, y, x2, y);	  }/* Composites */void rectangle(short x1, short y1, short x2, short y2){	line(x1, y1, x2, y1);	line(x2, y1, x2, y2);	line(x2, y2, x1, y2);	line(x1, y2, x1, y1);}void bar(short x1,short y1,short x2,short y2){		for(;y1<y2;y1++)		h_line(x1,x2,y1);}inline void clip_screen(short in_x, short in_y, short in_w, short in_h, short *out_x, short *out_y, short *out_w, short *out_h) {  short swp;  if (in_w < 0) {    in_x += in_w;    in_w = -in_w;  }  if (in_h < 0) {    in_y += in_h;    in_h = -in_h;  }  if (in_x < 0) {    in_w -= in_x;    in_x = 0;  }  if (in_y < 0) {    in_h -= in_y;    in_y = 0;  }  if (in_w > screen_width) {    in_w = screen_width;  }  if (in_h > screen_height) {    in_h = screen_height;  }  if (in_w < 0) {    in_w = 0;  }  if (in_h < 0) {    in_h = 0;  }  *out_x = in_x;  *out_y = in_y;  *out_w = in_w;  *out_h = in_h;}		void patternfill( short dest_x,		 short dest_y, 		 short w,		 short h,		 unsigned char*dest,		 short dest_units_per_line);void  fillrect(short x1, short y1, short x2, short y2){	short x, y, w, h;	clip_screen(x1, y1, x2-x1, y2-y1, &x, &y, &w, &h); 	patternfill(x, y, w, h, screen_ptr, screen_width>>3);}void bitblt(		 short src_x,		 short src_y,		 short w,		 short h,		 short dest_x,		 short dest_y, 		 unsigned char *src,		 short src_units_per_line, 		 unsigned char *dest,		 short dest_units_per_line		 ) {  /* todo: clip */  register char dx;  unsigned short x,y;  unsigned char src_off, dest_off;  short dest_n;  unsigned char dest_beg_mask, dest_end_mask;    /* goto line y */  src += src_y * src_units_per_line;  dest += dest_y * dest_units_per_line;    /* goto UNIT-offset x */  src += src_x >>3;  dest += dest_x >>3;  /* determine number of affected units per line */    dest_n = ((dest_x + w + 8 - 1) >>3) - (dest_x >>3);  /* determine PIXEL-offsets */  src_off = src_x & 7;  dest_off = dest_x & 7;  dx = dest_off - src_off;    /* make masks to mask out untouchable destination */  dest_beg_mask = ~((unsigned char)(-1) >> dest_off);  dest_end_mask = (unsigned char)(-1) >> ((dest_off + w) & 7);  if (dest_end_mask == (unsigned char)(-1)) {    /* bit stupid */    dest_end_mask = 0;  }  //printf("dx=%d\n", dx);  //dump_unit("dest_beg_mask", dest_beg_mask);  //dump_unit("dest_end_mask", dest_end_mask);  for (y = 0; y < h; y++) {    // process one line    register unsigned char *sp;    register unsigned char *dp;    register unsigned char mask = 0;    register unsigned char left, right;    unsigned char s, d;    sp = src;    dp = dest;    for (x = 0; x < dest_n; x++, sp++, dp++) {      // process one unit      if (dx < 0) {	// first, don't care about masks	left = *sp << (-dx);	right = *(sp+1) >> (8 + dx);      } else if (dx > 0) {	// first, don't care about masks	left = *(sp-1) << (8-dx);	right = *(sp) >> (dx);      } else {	left = *sp;	right = 0;      }      s = left | right;      // combine with destination      switch (Mode) {      case MODE_SRC:      default:	d = s;	break;      case MODE_NOT_SRC:	d = ~s;	break;      case MODE_SRC_OR_DST:	d = *dp | s;	break;      case MODE_SRC_AND_DST:	d = *dp & s;	break;      case MODE_SRC_XOR_DST:	d = *dp ^ s;	break;      case MODE_NOT_SRC_OR_DST:	d = *dp | ~s;	break;      case MODE_NOT_SRC_AND_DST:	d = *dp & ~s;	break;      case MODE_NOT_SRC_XOR_DST:	d = *dp ^ ~s;	break;      case MODE_SRC_OR_NOT_DST:	d = ~*dp | s;	break;      case MODE_SRC_AND_NOT_DST:	d = ~*dp & s;	break;      case MODE_SRC_XOR_NOT_DST:	d = ~*dp ^ ~s;	break;      }      mask = 0;      if (x == 0) {	mask |= dest_beg_mask;      }      if (x == dest_n-1) {	mask |= dest_end_mask;      }      *dp = (*dp & mask) | (d & ~mask);    }    src += src_units_per_line;    dest += dest_units_per_line;  }}void patternfill( short dest_x,		 short dest_y, 		 short w,		 short h,		 unsigned char*dest,		 short dest_units_per_line)  {

?? 快捷鍵說明

復(fù)制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號(hào) Ctrl + =
減小字號(hào) Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
久久一日本道色综合| 欧美mv和日韩mv的网站| 91精品国产91热久久久做人人| 国产网红主播福利一区二区| 中文字幕一区二区三区色视频| 蜜桃av一区二区在线观看| 一本一本大道香蕉久在线精品| 欧美一卡在线观看| 亚洲色图都市小说| 激情五月婷婷综合网| 欧美三级视频在线观看| 国产精品大尺度| 国产在线不卡一区| 欧美大片顶级少妇| 丝袜美腿亚洲色图| 日韩欧美国产小视频| 一区二区三区精品久久久| 国产真实乱偷精品视频免| 91精品综合久久久久久| 亚洲3atv精品一区二区三区| 91在线精品一区二区三区| 久久精品亚洲麻豆av一区二区| 久久精品二区亚洲w码| 欧美精品日韩综合在线| 亚洲v中文字幕| 精品1区2区3区| 亚洲精品写真福利| 一本久道久久综合中文字幕| 国产精品毛片久久久久久久| 成人视屏免费看| 中文字幕av一区二区三区高| 福利视频网站一区二区三区| 欧美国产精品v| 成人网在线播放| 中文字幕免费一区| 国产成人综合在线播放| 欧美激情一区二区三区在线| 蜜臀va亚洲va欧美va天堂| 精品久久人人做人人爰| 国内一区二区在线| 久久久99久久精品欧美| 高清在线不卡av| 国产精品美日韩| 91色九色蝌蚪| 亚洲制服丝袜av| 欧美肥大bbwbbw高潮| 蜜臀av性久久久久蜜臀aⅴ| 日韩女优制服丝袜电影| 国产精品中文字幕欧美| 一区免费观看视频| 欧美色图在线观看| 久久精品99国产精品| 国产精品美女一区二区| 欧美日韩专区在线| 毛片一区二区三区| 久久婷婷国产综合精品青草| 波多野结衣中文字幕一区| 亚洲午夜电影网| 亚洲精品一区二区三区影院 | 国产精品萝li| 92国产精品观看| 免费人成精品欧美精品| 欧美国产一区二区| 欧美四级电影网| 国产精品一二三四| 美女在线观看视频一区二区| 欧美日韩成人在线一区| 国产精品亚洲人在线观看| 一区二区成人在线观看| 日韩三级中文字幕| 91视视频在线观看入口直接观看www | 欧美视频在线一区二区三区| 欧美a级一区二区| 中文字幕在线观看不卡| 欧美一卡二卡在线观看| 色综合久久六月婷婷中文字幕| 日本一区中文字幕| 国产精品青草久久| 日韩欧美一区二区久久婷婷| jlzzjlzz欧美大全| 日本成人在线不卡视频| 国产精品福利影院| 欧美一区二区三区不卡| 一本色道综合亚洲| 国产高清精品网站| 亚洲一区二区三区四区在线观看 | 97超碰欧美中文字幕| 美女脱光内衣内裤视频久久影院| 中文字幕一区二区三区av| 91精品国产入口| 色婷婷av一区二区三区软件| 国产精品一区专区| 久久国产欧美日韩精品| 亚洲www啪成人一区二区麻豆| 国产精品传媒入口麻豆| 久久综合久久鬼色| 日韩西西人体444www| 欧美亚洲日本一区| 不卡区在线中文字幕| 久久精品国产成人一区二区三区 | 裸体在线国模精品偷拍| 亚洲自拍偷拍网站| 中文字幕佐山爱一区二区免费| 91精品国产一区二区三区| 色av成人天堂桃色av| 国产成人免费在线视频| 精品午夜久久福利影院| 国产98色在线|日韩| 精品一区二区三区视频在线观看 | 91视频com| 成人性生交大片免费看在线播放| 韩国精品主播一区二区在线观看 | 综合久久一区二区三区| 久久久久久久久97黄色工厂| 成人晚上爱看视频| 国产精品一区二区久久不卡| 亚洲3atv精品一区二区三区| 亚洲精品视频免费观看| 中文字幕一区免费在线观看| 国产午夜亚洲精品羞羞网站| 2017欧美狠狠色| 国产欧美精品在线观看| 久久精品欧美一区二区三区不卡| 久久先锋影音av鲁色资源| 欧美三级视频在线播放| 欧美性欧美巨大黑白大战| 色婷婷综合久色| 欧美亚洲一区三区| 日韩亚洲欧美综合| 日韩免费一区二区| 6080国产精品一区二区| 日韩欧美一级片| 久久精品男人天堂av| 日韩限制级电影在线观看| 欧美成人在线直播| 欧美激情在线观看视频免费| 亚洲免费观看高清完整版在线 | 一区二区三区中文在线| 午夜激情一区二区三区| 狠狠色丁香久久婷婷综合_中| 国产精品夜夜嗨| 欧美专区在线观看一区| 欧美成人精品1314www| 国产校园另类小说区| 亚洲一本大道在线| 国产一区二区三区最好精华液| 97精品超碰一区二区三区| 欧美一级理论性理论a| 国产精品天天摸av网| 亚洲电影一区二区| 99精品视频中文字幕| 欧美日韩一级二级三级| 久久色在线观看| 亚洲国产日产av| 精品午夜久久福利影院| 日本高清不卡aⅴ免费网站| 欧美xxxx老人做受| 亚洲伦在线观看| 狠狠色伊人亚洲综合成人| 91国产精品成人| 日本一区二区三区四区| 日韩av电影免费观看高清完整版| 成人黄色av网站在线| 日韩一卡二卡三卡四卡| 亚洲男人的天堂在线aⅴ视频| 美女网站色91| 色拍拍在线精品视频8848| 日韩一区二区精品| 国产精品视频线看| 国产一区视频网站| 欧美伊人精品成人久久综合97 | 国产精品国产a级| 亚洲一区av在线| 成a人片国产精品| 91丨九色丨尤物| 国产人伦精品一区二区| 热久久久久久久| 欧美久久高跟鞋激| 亚洲风情在线资源站| 成人免费的视频| 国产精品污污网站在线观看| 国产综合成人久久大片91| 欧美日韩在线电影| 一区二区三区**美女毛片| 高清不卡在线观看| 国产亚洲一二三区| 成人av免费观看| 国产精品素人视频| 国产成人综合亚洲网站| 久久先锋资源网| 国产一区二区免费视频| 337p日本欧洲亚洲大胆色噜噜| 日本亚洲一区二区| 在线综合亚洲欧美在线视频| 亚洲国产一区在线观看| 欧美视频在线观看一区二区| 一区二区欧美国产| 欧美在线999| 日韩精品免费视频人成| 欧美高清精品3d|