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

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

?? viz2d-f77.c

?? xy時域有限差分的fortran數值模擬 xy時域有限差分的fortran數值模擬
?? C
?? 第 1 頁 / 共 2 頁
字號:
	if( ncolors > 256 ) ncolors = 256;
	pixels = (unsigned long *)calloc(sizeof(unsigned long),ncolors+1);
		/* I'm not sure what these plane_masks do, I don't use them */
	nplanes = 0;
	plane_masks = (unsigned long *)calloc(sizeof(unsigned long),nplanes+1);
	if( XAllocColorCells( theDisplay, theDefaultColormap, True,
				plane_masks, nplanes, pixels, ncolors ) ){
			/* Figure out how many colors we can actually use */
		colors_created = *request_colors;
		colormapsize = theDefaultVisual->map_entries;
		mapstart = (int)pixels[0];
		colorcell_defs =
			(XColor *)calloc( sizeof(XColor),colors_created+1 );
		colors_to_store = colors_created;
		aColormap = theDefaultColormap;
		aVisual = theDefaultVisual;
		defstart = 0;
	}else{
		/* Couldn't allocate enough default colormap entries so, */
			/* make our own colormap */
            vinfo_mask = VisualClassMask;
            vinfo_template.class = PseudoColor;
            vlist = XGetVisualInfo( theDisplay,
                        vinfo_mask, &vinfo_template, &nitems );
	    if( !vlist ){
		fprintf(stderr,"\nERROR: No PseudoColor visuals found.\n");
		return 0;
	    }
	    aVisual = vlist->visual;
	    aColormap = XCreateColormap(theDisplay, aWindow, aVisual, AllocAll);
	    colormap_created = TRUE;
		/* Copy the first entries of the server's default colormap */
	    colormapsize = aVisual->map_entries;
	    colors_to_copy = MAX_COLORS_TO_COPY;
	    if( colormapsize < colors_to_copy ) colors_to_copy = colormapsize;
            theDefColorDefs = (XColor *)calloc(sizeof(XColor),colors_to_copy);
            for( iii=0; iii<colors_to_copy; iii++ ){
                theDefColorDefs[iii].pixel = iii;
            }
            XQueryColors(theDisplay, theDefaultColormap,
					theDefColorDefs, colors_to_copy);
		/* Now copy in the first N default colormap entries */
            colorcell_defs = (XColor *)calloc(sizeof(XColor),colormapsize+1);
		/* Initialize my colorcell definition array */
            for( iii=0; iii<colormapsize; iii++ ){
                colorcell_defs[iii].pixel = iii;
		colorcell_defs[iii].red = 0;
		colorcell_defs[iii].green = 0;
		colorcell_defs[iii].blue = 0;
		colorcell_defs[iii].flags = 0;
            }
	    for( iii=0; iii<colors_to_copy; iii++ ){
		colorcell_defs[iii].pixel = iii;
		colorcell_defs[iii].red = theDefColorDefs[iii].red;
		colorcell_defs[iii].green = theDefColorDefs[iii].green;
		colorcell_defs[iii].blue = theDefColorDefs[iii].blue;
		colorcell_defs[iii].flags = theDefColorDefs[iii].flags;
	    }
		/* Figure out how many colors we can actually use */
	    colors_created = *request_colors;
	    if( colors_created > 256 ) colors_created = 256;
	    if( colors_created > colormapsize ) colors_created = colormapsize;
	    mapstart = colormapsize - colors_created;
	    colors_to_store = colormapsize;
	    defstart = mapstart;
	}
		/* Now calculate the colormaps depending on request */
		/* HERE a programmer may want to customize or add colormaps */
	if( *colormap_type == 2 ){
			/* Create the Blue to Red colormap */
		delta = (int)(MAX_INTENSITY/(colors_created-1));
		an8bitFlag = DoRed | DoGreen | DoBlue;
		for( iii=0; iii<colors_created; iii++ ){
			colorcell_defs[iii+defstart].pixel = iii + mapstart;
			colorcell_defs[iii+defstart].red = iii * delta;
			colorcell_defs[iii+defstart].green = 0;
			colorcell_defs[iii+defstart].blue =
					MAX_INTENSITY - (iii * delta);
			colorcell_defs[iii+defstart].flags = an8bitFlag;
		}
	}else if( *colormap_type == 3 ){
			/* Create the Blue to Green to Red colormap */
		delta = (int)(2*(MAX_INTENSITY/(colors_created-1)));
		an8bitFlag = DoRed | DoGreen | DoBlue;
		midmap = colors_created/2;
		for( iii=0; iii<midmap; iii++ ){
			colorcell_defs[iii+defstart].pixel = iii + mapstart;
			colorcell_defs[iii+defstart].red = 0;
			colorcell_defs[iii+defstart].green = iii * delta;
			colorcell_defs[iii+defstart].blue =
					MAX_INTENSITY - (iii * delta);
			colorcell_defs[iii+defstart].flags = an8bitFlag;
		}
		for( iii=midmap; iii<colors_created; iii++ ){
			colorcell_defs[iii+defstart].pixel = iii + mapstart;
			colorcell_defs[iii+defstart].red = (iii-midmap)*delta;
			colorcell_defs[iii+defstart].green =
					MAX_INTENSITY - ((iii-midmap)*delta);
			colorcell_defs[iii+defstart].blue = 0;
			colorcell_defs[iii+defstart].flags = an8bitFlag;
		}
	}else{
			/* Create the grayscale colormap */
		delta = (int)(MAX_INTENSITY/(colors_created-1));
		an8bitFlag = DoRed | DoGreen | DoBlue;
		for( iii=0; iii<colors_created; iii++ ){
			colorcell_defs[iii+defstart].pixel = iii + mapstart;
			colorcell_defs[iii+defstart].red = iii * delta;
			colorcell_defs[iii+defstart].green = iii * delta;
			colorcell_defs[iii+defstart].blue = iii * delta;
			colorcell_defs[iii+defstart].flags = an8bitFlag;
		}
	}
        XStoreColors( theDisplay, aColormap, colorcell_defs, colors_to_store );
        XInstallColormap( theDisplay, aColormap );
        XSetWindowColormap( theDisplay, aWindow, aColormap );
	XFlush( theDisplay );
		/* Create and display the key buffer (the bottom color ramp) */
	if( *display_key ){
		for( iii=0; iii<KEY_HEIGHT; iii++ ){
		    for( jjj=0; jjj<width; jjj++ ){
			key_buffer[iii*width+jjj] = mapstart +
			    (int)((jjj*colors_created)/width);
		    }
		}
		keyImage = XCreateImage( theDisplay, aVisual, theDepth,
			ZPixmap, 0, key_buffer, width, KEY_HEIGHT, 8, 0 );
		XPutImage( theDisplay, aWindow, theGC, keyImage,
			0,0,0,height+3, width,KEY_HEIGHT );
	}
	XFlush( theDisplay );
	viz2d_was_initialized = 1;
	return 1;
}

/*
 *	quit_viz2d()
 *
 *      This subroutine is called when the program is finished
 *      with the viz2d window.  It removes the window and frees
 *      the memory that was allocated by viz2d only if init_viz2d()
 *	successfully created things.
 */

quit_viz2d_()
{
	if( viz2d_was_initialized ){
		cfree( trans_buffer );
		cfree( key_buffer );
		cfree( colorcell_defs );
		XDestroyImage( keyImage );
		if( colormap_created ) XFreeColormap( theDisplay, aColormap );
		XCloseDisplay( theDisplay );
	}
}

/*
 *	initX()
 *
 *	This function is not used by the user.  It is used by the init_viz2d()
 *	function to initialize X windows.
 */

int initX()
{
	theDisplay = XOpenDisplay( NULL );
	if( theDisplay == NULL ){
		fprintf(stderr,"ERROR: Can't open connection to %s\n",
			XDisplayName( NULL ) );
		return 0;
	}
	theScreen = DefaultScreen( theDisplay );
	theDepth = DefaultDepth( theDisplay, theScreen );
	theBlackPixel = BlackPixel( theDisplay, theScreen );
	theWhitePixel = WhitePixel( theDisplay, theScreen );
	return 1;
}

/*
 *	openWindow()
 *
 *	This function is not used by the user.  It is used by the init_viz2d()
 *	function to create an X window.
 */

Window openWindow( x, y, width, height, flag, theNewGC )
int	x, y, width, height, flag;
GC	*theNewGC;
{
XSetWindowAttributes	theWindowAttributes;
XSizeHints	theSizeHints;
unsigned long	theWindowMask;
Window	theNewWindow;
Pixmap	theIconPixmap;
XWMHints	theWMHints;
	theWindowAttributes.border_pixel = theWhitePixel;
	theWindowAttributes.background_pixel = theBlackPixel;
	theWindowAttributes.override_redirect = False;
	theWindowMask = CWBackPixel | CWBorderPixel | CWOverrideRedirect;

	theNewWindow = XCreateWindow( theDisplay,
		RootWindow( theDisplay, theScreen ),
		x, y, width, height,
		BORDER_WIDTH, theDepth, InputOutput,
		CopyFromParent,
		theWindowMask,
		&theWindowAttributes );

	theIconPixmap = XCreateBitmapFromData( theDisplay, theNewWindow,
		icon_viz50x50_bits,
		icon_viz50x50_width,
		icon_viz50x50_height );

	theWMHints.icon_pixmap = theIconPixmap;
	theWMHints.initial_state = NormalState;
	theWMHints.flags = IconPixmapHint | StateHint;

	XSetWMHints( theDisplay, theNewWindow, &theWMHints );

	theSizeHints.flags = PPosition | PSize;
	theSizeHints.x = x;
	theSizeHints.y = y;
	theSizeHints.width = width;
	theSizeHints.height = height;

	XSetNormalHints( theDisplay, theNewWindow, &theSizeHints );

	if( createGC(theNewWindow, theNewGC ) == 0 ){
		XDestroyWindow( theDisplay, theNewWindow );
		return( (Window) 0 );
	}

	XMapWindow( theDisplay, theNewWindow );

	XFlush( theDisplay );
	return( theNewWindow );
}

/*
 *	createGC()
 *
 *	This function is not used by the user.  It is used by the openWindow()
 *	function to create a graphics context to be associated with the
 *	new window.
 */

createGC( theNewWindow, theNewGC )
Window theNewWindow;
GC	*theNewGC;
{
XGCValues	theGCValues;
	*theNewGC = XCreateGC( theDisplay, theNewWindow,
		(unsigned long) 0, &theGCValues );
	if( *theNewGC == 0 ){
		return 0;
	}else{
		XSetForeground( theDisplay, *theNewGC, theWhitePixel );
		XSetBackground( theDisplay, *theNewGC, theBlackPixel );
		return( 1 );
	}
}



?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
国产麻豆精品theporn| 亚洲色图清纯唯美| 欧美久久一二三四区| 色狠狠一区二区| 不卡的av在线播放| 91在线国内视频| 91福利国产成人精品照片| 色吊一区二区三区| 91麻豆精品国产无毒不卡在线观看| 欧美主播一区二区三区美女| 欧美伊人久久大香线蕉综合69 | 蜜桃视频一区二区三区| 日日摸夜夜添夜夜添亚洲女人| 午夜av一区二区三区| 午夜精品久久久久久久99水蜜桃| 午夜久久久影院| 精品夜夜嗨av一区二区三区| 激情久久久久久久久久久久久久久久| 国产乱人伦偷精品视频免下载| 国产成人精品免费在线| 日本大香伊一区二区三区| 欧美色视频在线观看| 日韩美女久久久| 精品免费日韩av| 国产精品亲子伦对白| 一区二区欧美视频| 麻豆免费精品视频| 色综合久久六月婷婷中文字幕| 欧美在线影院一区二区| 日韩欧美色电影| 国产精品福利影院| 日本在线不卡视频一二三区| 精品一区在线看| 91在线视频观看| 日韩一卡二卡三卡国产欧美| 中文字幕一区在线| 久久成人av少妇免费| 91在线丨porny丨国产| 精品久久久久香蕉网| 日韩一区在线免费观看| 蜜桃在线一区二区三区| www.av精品| 精品国产一区二区三区四区四| 亚洲视频一区二区在线| 久久er99热精品一区二区| 色噜噜狠狠色综合中国| 久久久午夜电影| 日韩精品电影一区亚洲| 国产欧美日韩视频在线观看| 久久久国产一区二区三区四区小说| 一二三区精品视频| 国产成人av在线影院| 7777精品伊人久久久大香线蕉经典版下载 | 91丨国产丨九色丨pron| 欧美sm极限捆绑bd| 午夜a成v人精品| 91黄色激情网站| 国产精品美女久久久久久久久久久 | 有码一区二区三区| 大白屁股一区二区视频| 欧美精品一区二区三区视频| 亚洲午夜久久久| 99久久精品免费观看| 久久久久久久电影| 免费不卡在线视频| 欧美日韩一区二区在线视频| 中文字幕一区二区三区不卡| 国产成人免费高清| 久久网这里都是精品| 久久福利资源站| 欧美草草影院在线视频| 日韩国产精品久久久久久亚洲| 在线欧美日韩精品| 亚洲一区在线视频观看| 在线亚洲高清视频| 亚洲大片精品永久免费| 欧美在线不卡视频| 亚洲成人第一页| 欧美一级在线观看| 老鸭窝一区二区久久精品| 日韩一区二区免费电影| 蜜臀av一区二区三区| 欧美videofree性高清杂交| 麻豆91精品91久久久的内涵| 日韩三级精品电影久久久 | 成人国产精品免费| 亚洲欧洲无码一区二区三区| av成人老司机| 亚洲aⅴ怡春院| 欧美一区二区三区视频| 精品一区二区三区免费| 欧美日韩国产一二三| 91麻豆蜜桃一区二区三区| 亚洲精品免费电影| 欧美精品久久一区| 蜜桃视频在线观看一区| 国产网红主播福利一区二区| 成人激情文学综合网| 亚洲麻豆国产自偷在线| 在线观看亚洲a| 美日韩一级片在线观看| 久久蜜桃香蕉精品一区二区三区| 国产白丝网站精品污在线入口| 国产精品麻豆网站| 欧美视频精品在线| 国产在线播精品第三| 亚洲人成精品久久久久久 | 奇米影视在线99精品| 久久这里只精品最新地址| 国产福利精品导航| 亚洲黄一区二区三区| 日韩一区二区不卡| av亚洲精华国产精华精华 | 天天操天天干天天综合网| 精品久久久久久久久久久久包黑料 | 国产成人综合在线播放| 亚洲精品老司机| 国产偷国产偷亚洲高清人白洁 | 免费在线欧美视频| 亚洲日本护士毛茸茸| 欧美一卡二卡在线| 99精品视频一区| 免费欧美高清视频| 一区二区三区国产豹纹内裤在线| 精品日韩在线一区| 91久久人澡人人添人人爽欧美| 精品一区精品二区高清| 亚洲123区在线观看| 国产精品久久久久久久久晋中| 在线电影院国产精品| 成人精品在线视频观看| 奇米777欧美一区二区| 一区二区日韩电影| 中文字幕日韩av资源站| 精品美女一区二区| 欧美精品国产精品| 91久久精品日日躁夜夜躁欧美| 国产做a爰片久久毛片| 天天影视涩香欲综合网| 亚洲视频图片小说| 国产精品乱码一区二区三区软件 | 国产成a人亚洲| 韩国成人精品a∨在线观看| 午夜国产精品一区| 亚洲午夜视频在线观看| 亚洲精品日产精品乱码不卡| 中文文精品字幕一区二区| 久久亚洲捆绑美女| 精品国产免费人成在线观看| 日韩一区二区免费在线电影| 欧美一区永久视频免费观看| 欧美另类变人与禽xxxxx| 久久午夜国产精品| 欧美一区二区在线视频| 欧美日韩一卡二卡三卡| 欧美日韩第一区日日骚| 欧美性欧美巨大黑白大战| 色婷婷综合五月| 欧美三片在线视频观看| 在线观看欧美日本| 欧美精品久久久久久久多人混战| 精品视频在线免费| 91精品福利在线一区二区三区 | 国产老妇另类xxxxx| 久久99热这里只有精品| 国产精品一区不卡| 懂色av一区二区在线播放| 福利视频网站一区二区三区| 国产69精品久久久久毛片| 成人黄色在线看| 色婷婷精品大视频在线蜜桃视频 | 亚洲男人天堂一区| 亚洲成人黄色影院| 免播放器亚洲一区| 国v精品久久久网| 色美美综合视频| 91 com成人网| 欧美激情艳妇裸体舞| 亚洲欧美日韩一区二区| 日产欧产美韩系列久久99| 国产精品一二三四区| 91亚洲永久精品| 欧美日韩在线播| 久久久久99精品一区| 最新欧美精品一区二区三区| 亚洲成国产人片在线观看| 捆绑调教美女网站视频一区| 不卡高清视频专区| 日韩一区二区不卡| 亚洲乱码日产精品bd | 久久久久国产成人精品亚洲午夜| 亚洲欧美日韩成人高清在线一区| 亚洲精品日韩综合观看成人91| 麻豆国产精品777777在线| 91在线无精精品入口| 精品国产伦一区二区三区免费 | 日韩一区二区三区视频在线| 国产女主播视频一区二区| 午夜免费久久看| 91亚洲精华国产精华精华液|