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

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

?? display-x11.c

?? 絕對好的源碼
?? C
字號:
/***************************************************************************** * x264: h264 encoder ***************************************************************************** * Copyright (C) 2005 x264 project * * Author: Tuukka Toivonen <tuukkat@ee.oulu.fi> * * 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. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111, USA. *****************************************************************************/#include <X11/Xlib.h>#include <X11/Xutil.h>#include <stdio.h>#include <string.h>#include "display.h"static long event_mask = ConfigureNotify|ExposureMask|KeyPressMask|ButtonPressMask|StructureNotifyMask|ResizeRedirectMask;static Display *disp_display = NULL;static struct disp_window {	int init;	Window window;} disp_window[10];static inline void disp_chkerror(int cond, char *e) {	if (!cond) return;	fprintf(stderr, "error: %s\n", e ? e : "?");	abort();}static void disp_init_display(void) {	Visual *visual;	int dpy_class;	int screen;	int dpy_depth;	if (disp_display != NULL) return;	memset(&disp_window, 0, sizeof(disp_window));	disp_display = XOpenDisplay("");	disp_chkerror(!disp_display, "no display");	screen = DefaultScreen(disp_display);	visual = DefaultVisual(disp_display, screen);	dpy_class = visual->class;	dpy_depth = DefaultDepth(disp_display, screen);	disp_chkerror(!((dpy_class == TrueColor && dpy_depth == 32)		|| (dpy_class == TrueColor && dpy_depth == 24)		|| (dpy_class == TrueColor && dpy_depth == 16)		|| (dpy_class == PseudoColor && dpy_depth == 8)),		"requires 8 bit PseudoColor or 16/24/32 bit TrueColor display");}static void disp_init_window(int num, int width, int height, const unsigned char *tit) {	XSizeHints *shint;	XSetWindowAttributes xswa;	XEvent xev;	int screen = DefaultScreen(disp_display);	Visual *visual = DefaultVisual (disp_display, screen);	unsigned int fg, bg;	unsigned int mask;	char title[200];	Window window;	int dpy_depth;	if (tit) {		snprintf(title, 200, "%s: %i/disp", tit, num);	} else {		snprintf(title, 200, "%i/disp", num);	}	shint = XAllocSizeHints();	disp_chkerror(!shint, "memerror");	shint->min_width = shint->max_width = shint->width = width;	shint->min_height = shint->max_height = shint->height = height;	shint->flags = PSize | PMinSize | PMaxSize;	disp_chkerror(num<0 || num>=10, "bad win num");	if (!disp_window[num].init) {		disp_window[num].init = 1;		bg = WhitePixel(disp_display, screen);		fg = BlackPixel(disp_display, screen);		dpy_depth = DefaultDepth(disp_display, screen);		if (dpy_depth==32 || dpy_depth==24 || dpy_depth==16) {			mask |= CWColormap;			xswa.colormap = XCreateColormap(disp_display, DefaultRootWindow(disp_display), visual, AllocNone);		}		xswa.background_pixel = bg;		xswa.border_pixel = fg;		xswa.backing_store = Always;		xswa.backing_planes = -1;		xswa.bit_gravity = NorthWestGravity;		mask = CWBackPixel | CWBorderPixel | CWBackingStore | CWBackingPlanes | CWBitGravity;		window = XCreateWindow(disp_display, DefaultRootWindow(disp_display),				shint->x, shint->y, shint->width, shint->height,				1, dpy_depth, InputOutput, visual, mask, &xswa);		disp_window[num].window = window;		XSelectInput(disp_display, window, event_mask);		XSetStandardProperties(disp_display, window, title, title, None, NULL, 0, shint);	/* Tell other applications about this window */		XMapWindow(disp_display, window);							/* Map window. */		do {											/* Wait for map. */			XNextEvent(disp_display, &xev);		} while (xev.type!=MapNotify || xev.xmap.event!=window);		//XSelectInput(disp_display, window, KeyPressMask);					/*  XSelectInput(display, window, NoEventMask);*/	}	window = disp_window[num].window;	XSetStandardProperties(disp_display, window, title, title, None, NULL, 0, shint);		/* Tell other applications about this window */	XResizeWindow(disp_display, window, width, height);	XSync(disp_display, 1);	XFree(shint);}void disp_sync(void) {	XSync(disp_display, 1);}void disp_setcolor(unsigned char *name) {	int screen;	GC gc;	XColor c_exact, c_nearest;	Colormap cm;	Status st;	screen = DefaultScreen(disp_display);	gc = DefaultGC(disp_display, screen);		/* allocate colors */	cm = DefaultColormap(disp_display, screen);	st = XAllocNamedColor(disp_display, cm, name, &c_nearest, &c_exact);	disp_chkerror(st!=1, "XAllocNamedColor error");	XSetForeground(disp_display, gc, c_nearest.pixel);}void disp_gray(int num, char *data, int width, int height, int stride, const unsigned char *tit) {	Visual *visual;	XImage *ximage;	unsigned char *image;	int y,x,pixelsize;	char dummy;	int t = 1;	int dpy_depth;	int screen;	GC gc;	//XEvent xev;	disp_init_display();	disp_init_window(num, width, height, tit);	screen = DefaultScreen(disp_display);	visual = DefaultVisual(disp_display, screen);	dpy_depth = DefaultDepth(disp_display, screen);	ximage = XCreateImage(disp_display, visual, dpy_depth, ZPixmap, 0, &dummy, width, height, 8, 0);	disp_chkerror(!ximage, "no ximage");	if (*(char *)&t == 1) {		ximage->byte_order = LSBFirst;		ximage->bitmap_bit_order = LSBFirst;	} else {		ximage->byte_order = MSBFirst;		ximage->bitmap_bit_order = MSBFirst;	}	pixelsize = dpy_depth>8 ? sizeof(int) : sizeof(unsigned char);	image = malloc(width * height * pixelsize);	disp_chkerror(!image, "malloc failed");	for (y=0; y<height; y++) for (x=0; x<width; x++) {		memset(&image[(width*y + x)*pixelsize], data[y*stride+x], pixelsize);	}	ximage->data = image;	gc = DefaultGC(disp_display, screen);	/* allocate colors *///	XUnmapWindow(disp_display, disp_window[num].window);							/* Map window. *///	XMapWindow(disp_display, disp_window[num].window);							/* Map window. */	XPutImage(disp_display, disp_window[num].window, gc, ximage, 0, 0, 0, 0, width, height);//		do {											/* Wait for map. *///			XNextEvent(disp_display, &xev);//		} while (xev.type!=MapNotify || xev.xmap.event!=disp_window[num].window);	XPutImage(disp_display, disp_window[num].window, gc, ximage, 0, 0, 0, 0, width, height);	XDestroyImage(ximage);	XSync(disp_display, 1);}void disp_gray_zoom(int num, char *data, int width, int height, int stride, const unsigned char *tit, int zoom) {	unsigned char *dataz;	int y,x,y0,x0;	dataz = malloc(width*zoom * height*zoom);	disp_chkerror(!dataz, "malloc");	for (y=0; y<height; y++) for (x=0; x<width; x++) {		for (y0=0; y0<zoom; y0++) for (x0=0; x0<zoom; x0++) {			dataz[(y*zoom + y0)*width*zoom + x*zoom + x0] = data[y*stride+x];		}	}	disp_gray(num, dataz, width*zoom, height*zoom, width*zoom, tit);	free(dataz);}void disp_point(int num, int x1, int y1) {	int screen;	GC gc;	screen = DefaultScreen(disp_display);	gc = DefaultGC(disp_display, screen);		/* allocate colors */	XDrawPoint(disp_display, disp_window[num].window, gc, x1, y1);//	XSync(disp_display, 1);}void disp_line(int num, int x1, int y1, int x2, int y2) {	int screen;	GC gc;	screen = DefaultScreen(disp_display);	gc = DefaultGC(disp_display, screen);		/* allocate colors */	XDrawLine(disp_display, disp_window[num].window, gc, x1, y1, x2, y2);//	XSync(disp_display, 1);}void disp_rect(int num, int x1, int y1, int x2, int y2) {	int screen;	GC gc;	screen = DefaultScreen(disp_display);	gc = DefaultGC(disp_display, screen);		/* allocate colors */	XDrawRectangle(disp_display, disp_window[num].window, gc, x1, y1, x2-x1, y2-y1);//	XSync(disp_display, 1);}

?? 快捷鍵說明

復(fù)制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
久久精品免费在线观看| 欧美日韩1234| 国产成人一区二区精品非洲| 蜜桃视频第一区免费观看| 天堂va蜜桃一区二区三区漫画版| 亚洲综合区在线| 亚洲一区电影777| 肉色丝袜一区二区| 日本不卡免费在线视频| 奇米四色…亚洲| 九色综合狠狠综合久久| 国产精品资源站在线| 国产成人精品一区二区三区四区 | 欧美日韩精品电影| 欧美性色黄大片| 欧美精品三级日韩久久| 在线不卡中文字幕| 国产一区二区三区综合| 亚洲国产精品一区二区尤物区| 亚洲成人免费av| 国产精品影视在线观看| 精品亚洲免费视频| 国产凹凸在线观看一区二区| 不卡欧美aaaaa| 91国产福利在线| 制服丝袜亚洲精品中文字幕| 欧美mv日韩mv亚洲| 日本一区二区视频在线观看| 亚洲精品视频在线| 午夜精品久久一牛影视| 久久精品国产澳门| 国产v日产∨综合v精品视频| 91福利国产成人精品照片| 69堂精品视频| 久久久久久久久久久99999| 亚洲色欲色欲www| 丝袜亚洲另类欧美综合| 国产成人综合在线| 在线一区二区观看| 欧美成人乱码一区二区三区| 亚洲国产成人午夜在线一区| 亚洲第一精品在线| 国产精品一区不卡| 91成人免费网站| 亚洲天堂成人在线观看| 久久久精品影视| 亚洲激情网站免费观看| 免费在线看一区| 成人精品免费看| 欧美日韩精品一区二区| 日本一区二区成人| 日韩精品电影在线| 本田岬高潮一区二区三区| 欧美军同video69gay| 国产精品无码永久免费888| 国产欧美精品国产国产专区| 一区二区三区成人| 国产老妇另类xxxxx| 欧美午夜影院一区| 亚洲国产精品成人综合| 日韩va亚洲va欧美va久久| 成人av高清在线| 日韩三级视频在线看| 亚洲综合久久久久| 成人午夜av影视| 日韩精品一区国产麻豆| 亚洲欧美日韩国产手机在线| 国产毛片精品一区| 欧美美女网站色| 亚洲视频在线一区二区| 日韩视频在线观看一区二区| 欧美不卡一区二区| 亚洲午夜影视影院在线观看| 成人理论电影网| www久久精品| 人人精品人人爱| 欧美日韩黄色一区二区| 国产精品二三区| 国产91精品露脸国语对白| 91精品国产麻豆| 亚洲国产美女搞黄色| 99久久er热在这里只有精品15| 亚洲精品一区二区三区蜜桃下载| 亚洲成av人片在线观看| 色狠狠一区二区| 日韩一区中文字幕| 成人福利在线看| 国产亚洲欧美日韩日本| 麻豆精品精品国产自在97香蕉| 欧美日韩一卡二卡| 一区二区三区在线播放| 色综合天天综合网天天狠天天 | 亚洲乱码国产乱码精品精98午夜| 国产成人av福利| 国产人妖乱国产精品人妖| 国产精品资源网| 久久综合网色—综合色88| 狠狠色狠狠色合久久伊人| 99久久久精品| 国产精品美女www爽爽爽| 麻豆成人综合网| 日韩精品一区二区三区视频播放| 首页国产欧美久久| 8x8x8国产精品| 日本中文一区二区三区| 欧美一区午夜精品| 麻豆精品国产91久久久久久| 精品国产三级电影在线观看| 美日韩一区二区三区| 精品久久久影院| 国产精品自拍三区| 国产女主播一区| 91日韩精品一区| 亚洲一区视频在线观看视频| 欧美日韩国产成人在线免费| 天天综合日日夜夜精品| 日韩精品在线网站| 国产成人精品影院| 18涩涩午夜精品.www| 色综合久久综合网| 午夜精品福利一区二区三区av| 欧美精品在线一区二区三区| 免费国产亚洲视频| 欧美精品一区二区三区久久久| 国产成人精品影视| 亚洲激情校园春色| 欧美男同性恋视频网站| 美女视频黄 久久| 国产亲近乱来精品视频| 99精品视频中文字幕| 午夜精品福利一区二区三区av| 日韩午夜激情电影| 成人免费视频国产在线观看| 亚洲精品视频在线看| 欧美一区二区三区在线| 国产精品911| 亚洲午夜久久久久久久久电影院| 日韩欧美成人午夜| 成人av高清在线| 视频一区欧美日韩| 国产欧美日韩三级| 欧美性欧美巨大黑白大战| 麻豆精品视频在线观看视频| 国产精品丝袜在线| 91精品在线麻豆| 成人免费的视频| 丝瓜av网站精品一区二区| 久久一夜天堂av一区二区三区| 99精品一区二区三区| 欧美aaaaa成人免费观看视频| 中文字幕二三区不卡| 欧美人妇做爰xxxⅹ性高电影| 国产黄色成人av| 午夜精品一区在线观看| 国产精品婷婷午夜在线观看| 欧美挠脚心视频网站| 成人激情图片网| 蜜桃视频在线观看一区二区| 亚洲人吸女人奶水| 精品国精品自拍自在线| 欧美伊人久久久久久久久影院| 黄色小说综合网站| 亚洲一区在线观看免费| 中文字幕第一区二区| 在线成人高清不卡| 91色乱码一区二区三区| 精品影视av免费| 亚洲国产人成综合网站| 国产精品久久久一区麻豆最新章节| 337p亚洲精品色噜噜| 91黄视频在线| www.性欧美| 国产精品资源在线看| 免费欧美高清视频| 亚洲国产一区二区视频| 中文字幕在线观看不卡视频| 精品国产伦一区二区三区观看方式| 色菇凉天天综合网| 成人综合婷婷国产精品久久蜜臀 | 日韩精品亚洲专区| 欧美经典一区二区| 欧美一激情一区二区三区| 色婷婷综合久久久久中文| 从欧美一区二区三区| 国产一区福利在线| 麻豆中文一区二区| 午夜久久久久久久久| 一区二区三区四区在线播放| 国产精品无码永久免费888| 久久网站最新地址| 欧美变态口味重另类| 91精品欧美福利在线观看| 在线观看视频91| 色综合一区二区| 成人污视频在线观看| 国产91综合网| 国产黄人亚洲片| 高潮精品一区videoshd| 国产精品一区二区无线| 国产一区999|