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

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

?? 2.txt

?? 該代碼適用于嵌入式開發(fā)
?? TXT
?? 第 1 頁 / 共 3 頁
字號:
/* * $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)  {    /* 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;  const Pattern *pattern = patterns[P_Index];    /* goto line y */  dest += dest_y * dest_units_per_line;    /* goto UNIT-offset x */  dest += dest_x / 8;  /* determine number of affected units per line */    dest_n = (dest_x + w + 8 - 1) / 8 - dest_x / 8;  /* determine PIXEL-offsets */  dest_off = dest_x % 8;    /* make masks to mask out untouchable destination */  dest_beg_mask = ~((unsigned char)(-1) >> dest_off);  dest_end_mask = (unsigned char)(-1) >> ((dest_off + w) % 8);  if (dest_end_mask == (unsigned char)(-1)) {    /* bit stupid */    dest_end_mask = 0;  }    for (y = 0; y < h; y++) {    // process one line    register unsigned char *dp;    register unsigned char mask = 0;    unsigned char s=pattern->data[(dest_y+y)%pattern->height], d;    dp = dest;    for (x = 0; x < dest_n; x++, dp++) {      // 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);    }    dest += dest_units_per_line;  }}short initgraph(void){  struct fb_var_screeninfo screeninfo;    screen_fd = open("/dev/fb0", O_RDWR);  if (screen_fd == -1)   	{      perror("Unable to open frame buffer device /dev/fb0");      return 0;	 }  if (ioctl(screen_fd, FBIOGET_VSCREENINFO, &screeninfo)==-1) {      perror("Unable to retrieve framebuffer information");      return 0;          }  //screen_width = screeninfo.xres_virtual;  screen_width = 240;//screeninfo.xres_virtual;  //screen_height = screeninfo.yres_virtual;  screen_height = 320;//screeninfo.yres_virtual;  //lyk modified it  //E_Font	= (unsigned char*)(screeninfo.english_font);  //printf("E_Font Address %x %x\n",E_Font,screeninfo.english_font);  //if(!E_Font) 	  //E_Font=(unsigned char*)(0x8804);	  //E_Font=(unsigned char*)(0x8812);   E_Font=fontdata_8x16;//(unsigned char*)(0x0004a690);  screen_ptr = mmap(NULL, ((screen_height * screen_width*2)/4096+1)*4096, PROT_READ|PROT_WRITE, /*0*/MAP_SHARED, screen_fd, 0);   if (screen_ptr==MAP_FAILED) {              perror("Unable to mmap frame buffer");	      close(screen_fd);	      return 0;       }    C_Font=fopen(CHINESE_FONT_FILE,"rb");    if(!C_Font)  	{	 perror("Unable to open Chinese font file");	 close(screen_fd);	 return 0;	}  Color=1;	    return 1;}void closegraph(){  if(screen_fd!=-1) {	close(screen_fd);  }  if(C_Font)	  fclose(C_Font);}void clearscreen(){	memset(screen_ptr,0,screen_width*screen_height*2);}void draw_xbm(short sx, short sy, short width, short height, char* pixel){	short i, j, k, t,l=(width>>=3)*height,m,wid=screen_width>>3;	short d,off;	char *loc=screen_ptr+(off=((sy*screen_width+sx)>>3));          for(k=0,i=0;i<height;i++,k+=wid)          for(j=0;(j<width)&&(j<20);j++) 	{	      d=0;	      for(m=0;m<8;m++)	        if(pixel[k+j]&masktab[m]) d|=masktab[7-m];	      t=k+j;              if((t+off)>=3200) return;	      loc[t]=d;			       	    	}}void draw_bmp(short sx, short sy, short rwidth, short height, char* pixel)

?? 快捷鍵說明

復(fù)制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
麻豆精品新av中文字幕| 免费人成网站在线观看欧美高清| 欧美日韩卡一卡二| 国产成人精品免费看| 午夜亚洲国产au精品一区二区| 欧美精品一区二区三区蜜桃视频| 色88888久久久久久影院野外| 精品一区二区影视| 亚洲一区二区在线播放相泽| 国产日韩欧美高清在线| 欧美性生交片4| 91在线精品一区二区三区| 国产中文字幕一区| 午夜欧美大尺度福利影院在线看| 国产精品美女久久久久久久网站| 91精品国产色综合久久久蜜香臀| www.亚洲在线| 成人国产精品免费观看视频| 久久精品久久精品| 日韩综合一区二区| 亚洲国产精品精华液网站| 亚洲丝袜美腿综合| 国产精品午夜免费| 久久久亚洲精品一区二区三区| 欧美日本一区二区| 欧美日韩高清影院| 欧美午夜精品理论片a级按摩| 99久久精品免费精品国产| 国产91在线|亚洲| 国产高清成人在线| 高清在线成人网| 国产美女一区二区三区| 九一九一国产精品| 久久精品国产第一区二区三区| 天天色 色综合| 午夜影视日本亚洲欧洲精品| 一区二区三区精品视频| 亚洲一区在线视频| 亚洲国产综合色| 午夜电影网一区| 日韩影院免费视频| 奇米综合一区二区三区精品视频| 日本亚洲最大的色成网站www| 免费在线欧美视频| 精品写真视频在线观看| 黑人精品欧美一区二区蜜桃| 国产精一区二区三区| 成人午夜短视频| 99久久婷婷国产综合精品| caoporn国产一区二区| 91麻豆福利精品推荐| 欧美性色黄大片手机版| 欧美日韩国产一级片| 欧美一级片免费看| 精品国产免费久久| 国产精品视频第一区| 亚洲美女在线国产| 图片区小说区国产精品视频| 奇米精品一区二区三区在线观看 | 亚洲欧美综合另类在线卡通| 欧美激情中文不卡| 亚洲激情欧美激情| 偷窥国产亚洲免费视频| 久久精品国产一区二区| 国产91丝袜在线观看| 色综合天天狠狠| 制服丝袜在线91| 国产欧美一区视频| 亚洲欧美电影一区二区| 亚洲.国产.中文慕字在线| 国模套图日韩精品一区二区| 成人国产精品免费网站| 欧美日韩国产美| 久久欧美一区二区| 一片黄亚洲嫩模| 国产最新精品精品你懂的| 色婷婷综合久久久| 日韩区在线观看| 中文字幕五月欧美| 麻豆国产精品一区二区三区| 成人小视频在线观看| 欧美日韩免费不卡视频一区二区三区| www日韩大片| 亚洲精品成人少妇| 国产成人午夜精品影院观看视频| 在线视频综合导航| 久久精品男人天堂av| 一区二区三区在线观看视频| 另类小说图片综合网| 在线观看日韩电影| 欧美国产日本韩| 蜜臀久久99精品久久久久久9| 99久久综合精品| 久久综合999| 日韩av电影天堂| 91色九色蝌蚪| 国产无一区二区| 美日韩黄色大片| 在线观看三级视频欧美| 国产欧美一区在线| 精品一区二区三区蜜桃| 欧美系列在线观看| 中文字幕亚洲一区二区va在线| 美腿丝袜在线亚洲一区 | 在线国产电影不卡| 国产视频一区二区在线| 奇米色一区二区| 欧美日本韩国一区| 亚洲精品视频免费看| 成人黄色在线看| 日韩欧美高清一区| 亚洲一级电影视频| 日本道色综合久久| 综合av第一页| 成人av在线电影| 久久久精品天堂| 国内精品久久久久影院薰衣草| 91.com在线观看| 亚洲二区视频在线| 色视频一区二区| 亚洲欧美视频在线观看| 成人av电影在线播放| 国产精品视频免费看| 成人免费视频caoporn| 久久人人爽人人爽| 精品在线免费观看| 欧美成人性战久久| 久久精品国内一区二区三区| 欧美疯狂性受xxxxx喷水图片| 亚洲综合丁香婷婷六月香| 日本道在线观看一区二区| 亚洲色图一区二区| 91免费观看视频在线| 综合色天天鬼久久鬼色| 91在线视频18| 亚洲综合免费观看高清在线观看| 成人性生交大合| 亚洲同性gay激情无套| 色天天综合久久久久综合片| 亚洲精品中文在线影院| 欧美丝袜丝nylons| 亚洲电影一级黄| 91精品欧美久久久久久动漫 | 91精品国产综合久久婷婷香蕉| 亚洲国产精品久久久久秋霞影院 | 97久久精品人人做人人爽 | 亚洲精选免费视频| 欧美性猛交xxxx黑人交| 婷婷一区二区三区| 欧美一区二区三区爱爱| 久久精品国产精品亚洲精品 | 日韩精品一二三四| 91精品国产综合久久久久久| 蜜臀av性久久久久蜜臀aⅴ流畅| 精品国产一区二区三区四区四| 国产伦精品一区二区三区免费| 久久天天做天天爱综合色| 成人国产免费视频| 亚洲国产视频一区| 精品国产麻豆免费人成网站| 国产成人精品aa毛片| 亚洲免费观看高清在线观看| 欧美精品粉嫩高潮一区二区| 狠狠色狠狠色合久久伊人| 亚洲视频狠狠干| 欧美丰满一区二区免费视频| 国产自产2019最新不卡| 亚洲日穴在线视频| 91精品国产欧美一区二区18 | 欧美自拍丝袜亚洲| 久久综合综合久久综合| 国产精品久久久久aaaa| 欧美日韩国产综合草草| 国产精品一二三区| 亚洲国产aⅴ天堂久久| 久久久久久免费网| 欧美性色黄大片| 国产麻豆精品久久一二三| 夜夜嗨av一区二区三区| 精品三级av在线| 91福利在线播放| 国产一区二区精品久久91| 亚洲乱码日产精品bd| 26uuu国产电影一区二区| 欧美亚洲一区二区在线观看| 加勒比av一区二区| 亚洲无人区一区| 中文字幕av免费专区久久| 欧美精品在线视频| 99久久久无码国产精品| 韩国三级在线一区| 夜夜嗨av一区二区三区四季av | 国产视频一区二区三区在线观看| 欧美日韩视频专区在线播放| 国产1区2区3区精品美女| 日本午夜精品一区二区三区电影| 中文字幕综合网| 久久伊人蜜桃av一区二区| 91精品免费在线观看| 日本高清不卡一区|