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

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

?? graphic.c

?? Linux下在LCD上顯示圖片的程序 現可顯示大分辨圖片640×480
?? C
?? 第 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 "hanzi"#define ScreenHeight 480#define ScreenWidth 640typedef 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,};//unsigned char getbit[8]={0x80,0x40,0x20,0x10,0x08,0x04,0x02,0x01}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=240,screen_height=320;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);	//	printf("Color1inline=%d\n",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  fillrectangle(short x1, short y1, short x2, short y2){	short x, y, w, h,i,j;	//clip_screen(x1, y1, x2-x1, y2-y1, &x, &y, &w, &h); 	//patternfill(x, y, w, h, screen_ptr, screen_width>>3);        for(i=x1;i<x2;i++)	for(j=y1;j<y2;j++)		{setpixel(i, j, 1);  			}}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;  

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
久久国产夜色精品鲁鲁99| 久久精品视频一区| 91视频你懂的| 成人福利在线看| 国产成人免费在线观看| 国产精品自拍av| 国产精品123| 成人动漫中文字幕| gogo大胆日本视频一区| eeuss鲁片一区二区三区在线观看 eeuss鲁片一区二区三区在线看 | 国产精品美女久久久久av爽李琼| 久久在线免费观看| 久久久www免费人成精品| 久久精品男人的天堂| 国产精品乱人伦中文| 自拍偷拍亚洲综合| 亚洲成人一二三| 国产在线不卡一区| 不卡一二三区首页| 欧美亚洲自拍偷拍| 91精品在线免费| 久久色在线视频| 18成人在线观看| 日韩精品成人一区二区三区| 另类小说视频一区二区| 国产.欧美.日韩| 91丨国产丨九色丨pron| 欧美日韩美少妇| 精品久久国产老人久久综合| 欧美国产在线观看| 亚洲国产精品尤物yw在线观看| 日本不卡一二三| 国产乱人伦精品一区二区在线观看| 国产不卡视频一区二区三区| 91国偷自产一区二区三区观看| 8x福利精品第一导航| 国产亚洲一本大道中文在线| 国产精品成人免费| 蜜桃视频免费观看一区| 成人污污视频在线观看| 欧美亚洲一区二区在线| 久久综合九色欧美综合狠狠| 亚洲视频免费在线| 久久精品国产色蜜蜜麻豆| 91女人视频在线观看| 欧美一区二区三区在线视频 | 欧美日韩在线一区二区| 国产婷婷色一区二区三区四区 | jizz一区二区| 精品国产制服丝袜高跟| 一区二区三区资源| 国产露脸91国语对白| 91麻豆精品国产91久久久使用方法| 久久亚洲精华国产精华液| 亚洲一区二区av电影| 风间由美性色一区二区三区| 日韩一区二区三区电影在线观看| 亚洲欧美日韩国产中文在线| 国产成人在线观看| 欧美成人猛片aaaaaaa| 亚洲第一久久影院| 91成人免费在线| 国产精品初高中害羞小美女文| 黄页网站大全一区二区| 欧美一二三四在线| 亚洲bt欧美bt精品| 欧美视频一区二区三区四区 | 久久国产生活片100| 欧美三区在线观看| 亚洲午夜电影在线| 国产sm精品调教视频网站| 日韩女优电影在线观看| 天天影视涩香欲综合网| 67194成人在线观看| 亚洲a一区二区| 欧美一级高清片在线观看| 日韩专区中文字幕一区二区| 欧美性猛片xxxx免费看久爱| 亚洲国产wwwccc36天堂| 欧美日韩aaaaaa| 蜜桃精品视频在线观看| 精品少妇一区二区三区视频免付费 | 国产在线视视频有精品| 久久影院电视剧免费观看| 狠狠色综合日日| 国产欧美日韩精品一区| av综合在线播放| 一区二区三区美女视频| 欧美日韩日本视频| 麻豆精品一区二区综合av| 久久亚洲精品小早川怜子| 高清不卡在线观看| 一区二区久久久| 欧美一区二区免费| 国产成人亚洲综合a∨婷婷图片 | 欧美亚洲一区二区在线| 日韩精品一区第一页| 亚洲精品一区二区三区影院 | 欧美性大战xxxxx久久久| 日韩黄色片在线观看| 日韩午夜在线观看视频| 国产成人综合在线播放| 亚洲毛片av在线| 精品国产一区二区在线观看| 波多野结衣的一区二区三区| 亚洲午夜成aⅴ人片| 久久久天堂av| 欧美日韩一区二区三区视频| 国产一区二区三区在线看麻豆| 成人免费在线视频| 欧美一区二区国产| www.亚洲国产| 毛片av一区二区| 中文字幕视频一区二区三区久| 欧美精品视频www在线观看| 欧美a一区二区| 亚洲久本草在线中文字幕| 日韩欧美中文一区| 91国模大尺度私拍在线视频| 激情久久五月天| 亚洲无人区一区| 亚洲国产精品成人综合色在线婷婷| 欧美三片在线视频观看| av在线不卡免费看| 美女视频黄a大片欧美| 亚洲免费三区一区二区| 久久综合国产精品| 欧美一区二视频| 在线视频国产一区| 成人影视亚洲图片在线| 男人操女人的视频在线观看欧美| 亚洲欧美综合网| 欧美韩日一区二区三区四区| 日韩一区二区免费在线电影| 日本高清不卡在线观看| 懂色av一区二区在线播放| 蜜桃视频在线观看一区二区| 亚洲国产精品久久不卡毛片| 中文字幕五月欧美| 亚洲国产精品99久久久久久久久| 日韩精品一区二区三区视频在线观看 | 欧美成人r级一区二区三区| 欧美亚洲自拍偷拍| 91黄色激情网站| 色8久久人人97超碰香蕉987| 成人久久18免费网站麻豆| 久久国产精品99久久久久久老狼 | 欧美日韩的一区二区| 91在线视频网址| caoporn国产一区二区| 成人精品免费看| 粉嫩绯色av一区二区在线观看 | 麻豆高清免费国产一区| 亚洲第一二三四区| 午夜欧美大尺度福利影院在线看| 亚洲在线视频免费观看| 亚洲精品欧美激情| 亚洲国产一区二区a毛片| 亚洲一区二区三区四区不卡| 亚洲欧美日韩成人高清在线一区| 亚洲视频在线一区| 亚洲综合免费观看高清完整版 | 中文字幕日本不卡| 亚洲人妖av一区二区| 亚洲欧美aⅴ...| 亚洲曰韩产成在线| 亚洲成人精品一区二区| 日本伊人精品一区二区三区观看方式| 日韩电影免费一区| 国产综合色在线| 粉嫩av一区二区三区| 91福利资源站| 日韩午夜在线影院| 国产精品入口麻豆原神| 亚洲欧洲日韩av| 一区二区三区国产精品| 日本三级韩国三级欧美三级| 久久99精品久久久| 丁香六月久久综合狠狠色| 91丨九色丨蝌蚪富婆spa| 欧美日韩午夜在线视频| 日韩欧美国产一区二区在线播放| 国产天堂亚洲国产碰碰| 亚洲综合成人网| 奇米影视一区二区三区小说| 成人av集中营| 欧美日本高清视频在线观看| 久久久.com| 亚洲高清免费观看高清完整版在线观看| 亚洲最新在线观看| 日韩成人一区二区| 成人免费黄色在线| 欧美一区二区在线看| 国产精品另类一区| 日本欧美一区二区在线观看| 丁香六月综合激情| 欧美变态凌虐bdsm| 亚洲黄色免费网站| 国产91高潮流白浆在线麻豆 | 99久久99久久精品国产片果冻|