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

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

?? viz2d-f77.c

?? xy時域有限差分的fortran數(shù)值模擬 xy時域有限差分的fortran數(shù)值模擬
?? C
?? 第 1 頁 / 共 2 頁
字號:
/*
 *      viz2d-f77.c				Revision 1.2 (8-30-91)
 *						by Jeff 'Lockheed' Sheffel
 *
 *      viz2d-f77 is a package of functions written in C with a Fortran
 *      interface.  This package of functions allows a Fortrash programmer
 *      to display 8-bit bitmap data in an X11 window.  The programmer
 *      interface is via three simple functions:
 *
 *      call init_viz2d( width, height, colormap_type, colormap_size,
 *			 display_key )
 *
 *              The first two parameters are 'width' of the data and 'height'
 *              of the data.  'width' and 'height' will be the width and
 *              height of the window and the data.  The 'colormap-type' is an
 *              integer code with 1=gray-scale, 2=blue-to-red, and
 *              3=blue-to-green-to-red.  The 'colormap_size' is a request for
 *              the number of colors to display the data.  If the
 *		'display_key' parameter is non-zero, then a gradient of the 
 *		colors representing the data values from 0 to 255 is
 *		included at the bottom of the window.
 *
 *      	init_viz2d() returns 0 upon failure and 1 upon success.  Failure
 *      	may result upon failure to connect to the server (inwhich case
 *      	the user is told) or failure to open a window or failure to
 *      	create a colormap (which must be of type PseudoColor - this
 *		could be modified).
 *
 *      call viz2d( buffer )
 *
 *              This subroutine displays the bitmap data in the window that
 *              was created by init_viz2d().  The argument 'buffer' is a
 *              pointer to an 8-bit (character) array of data.  The width and
 *              height of the buffer must match the width and height as
 *              specified in the call to init_viz2d().
 *
 *      call 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.  quit_viz2d() may
 *		be called even if init_viz2d() failed.
 *
 *	viz2d USAGE:
 *
 *	init_viz2d() must be called before the displaying routine viz2d()
 *	can be called.  Any 'colormap-size' between 2 and 256 may specified.
 *	Since the 8-bit data can only take on values between 0 and 256, more
 *	than 256 colors would not be useful.  If 256 is selected and a
 *	virtual colormap of that size is supported by the server, then all
 *	possible values of the data will be represented by a unique color.
 *	If fewer than 256 is selected or a virtual colormap of less than
 *	256 colors is supported, then in the viz2d() routine, all of
 *	the currently passed data in the buffer is scaled (squeezed) such
 *	that each color represents more than one data value.  The init_viz2d()
 *	routine will ensure that the most colors will be displayed if too
 *	many colors were selected and can not be supported.  In such cases of
 *	filling an entire colormap, the server's default colormap will be
 *	temporarily over-written and normal screen colors will temporarily
 *	be lost (but controlled by mouse cursor movement).
 *
 *	To avoid core dumps, do not call viz2d() unless viz2d_init() returns
 *	a non-zero value (1). For example,
 *
 *		if( init_viz2d( 200, 200, 3, 128, 1 ) ) then
 *			do while( keep_displaying_data )
 *				call calculate_data( buffer )
 *				call viz2d( buffer )
 *			end do
 *		endif
 *		call quit_viz2d
 *
 *	viz2d COMPILATION:
 *
 *	After including viz2d routines in a Fortrash program (my_viz2d.f),
 *	then compile with:
 *
 *		f77 my_viz2d.f viz2d-f77.c -lX11 -lm
 *
 */

#include <X11/Xlib.h>
#include <X11/Xutil.h>
#include <X11/Xatom.h>
#include <stdio.h>

#define BORDER_WIDTH	5
#define MAX_COLORS_TO_COPY 32	/* # colors to copy from default colormap, */
				/*	# colors may be changed */
#define MAX_INTENSITY 65535	/* X Color RGB max intensity (2**16) */
#define KEY_HEIGHT 20		/* Height of key (color ramp) */
#define	TRUE 1
#define	FALSE 0

Display	*theDisplay;			/* for eg. "unix:0.0" */
int	 theScreen;			/* Which screen on the display */
int	 theDepth;			/* Number of color planes */
unsigned long	theBlackPixel;
unsigned long	theWhitePixel;
GC		theGC;			/* An X graphics context */
Visual		*aVisual;
int		colormapsize;
int		colors_created;		/* # colors in colormap for viz2d */
XImage		*anImage;		/* The viz2d image */
XImage		*keyImage = NULL;	/* The optional bottom color key */
Window		aWindow;		/* The viz2d window */
int		width, height;		/* The viz2d window width & height */
int		mapstart;		/* Viz2d colormap entries start */
char		*trans_buffer = NULL;	/* Temp. buffer used in viz2d */
char		*key_buffer = NULL;	/* Data buffer used for keyImage */
Colormap	aColormap;		/* The created viz2d colormap */
XColor		*colorcell_defs = NULL;	/* Viz2d colormap definitions */
int		colormap_created = FALSE;
int		viz2d_was_initialized = FALSE;

#define icon_viz50x50_width 50
#define icon_viz50x50_height 50
static char icon_viz50x50_bits[] = {
   0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
   0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xf8, 0x3f, 0x00,
   0x00, 0x00, 0x00, 0x00, 0x08, 0x20, 0x03, 0x00, 0x00, 0x00, 0x00, 0x48,
   0x25, 0x3c, 0x00, 0x00, 0x00, 0x00, 0x08, 0x20, 0xc0, 0x03, 0x00, 0x00,
   0x00, 0xa8, 0x2a, 0x00, 0x3c, 0x00, 0x00, 0x00, 0x08, 0x20, 0x00, 0xc0,
   0x03, 0x00, 0x00, 0x48, 0x25, 0x00, 0x00, 0x3c, 0x00, 0x00, 0x08, 0x20,
   0x00, 0x00, 0xc0, 0x01, 0x00, 0xa8, 0x2a, 0x00, 0x00, 0x00, 0x00, 0x00,
   0x08, 0x20, 0xc0, 0xff, 0xff, 0x0f, 0x00, 0x48, 0x25, 0x40, 0x40, 0x00,
   0x0c, 0x00, 0x08, 0x20, 0x40, 0xe0, 0x00, 0x0e, 0x00, 0xa8, 0x2a, 0x40,
   0xf0, 0x01, 0x0f, 0x00, 0x08, 0x20, 0x40, 0xf8, 0x83, 0x0f, 0x00, 0x08,
   0x20, 0x40, 0xfc, 0xc7, 0x0f, 0x00, 0xf8, 0x3f, 0xc0, 0xfe, 0xef, 0x0f,
   0x00, 0x00, 0x00, 0xc0, 0xff, 0xff, 0x0f, 0x00, 0x10, 0x00, 0xc0, 0xfe,
   0xef, 0x0f, 0x00, 0x20, 0x00, 0x40, 0xfc, 0xc7, 0x0f, 0x00, 0x20, 0x00,
   0x40, 0xf8, 0x83, 0x0f, 0x00, 0x40, 0x00, 0x40, 0xf0, 0x01, 0x0f, 0x00,
   0x80, 0x00, 0x40, 0xe0, 0x00, 0x0e, 0x00, 0x00, 0x01, 0x40, 0x40, 0x00,
   0x0c, 0x00, 0x00, 0x01, 0x40, 0xe0, 0x00, 0x0e, 0x00, 0x00, 0x02, 0x40,
   0xf0, 0x01, 0x0f, 0x00, 0x00, 0x04, 0x40, 0xf8, 0x83, 0x0f, 0x00, 0x00,
   0x08, 0x40, 0xfc, 0xc7, 0x0f, 0x00, 0x00, 0x08, 0xc0, 0xfe, 0xef, 0x0f,
   0x00, 0x00, 0x10, 0xc0, 0xff, 0xff, 0x0f, 0x00, 0x00, 0x20, 0xc0, 0xfe,
   0xef, 0x0f, 0x00, 0x00, 0x20, 0x40, 0xfc, 0xc7, 0x0f, 0x00, 0x00, 0x40,
   0x40, 0xf8, 0x83, 0x0f, 0x00, 0x00, 0x80, 0x40, 0xf0, 0x01, 0x0f, 0x00,
   0x00, 0x00, 0x41, 0xe0, 0x00, 0x0e, 0x00, 0x00, 0x00, 0x41, 0x40, 0x00,
   0x0c, 0x00, 0x00, 0x00, 0x42, 0xe0, 0x00, 0x0c, 0x00, 0x00, 0x00, 0x44,
   0xf0, 0x01, 0x0e, 0x00, 0x00, 0x00, 0x48, 0xf8, 0x03, 0x0f, 0x00, 0x00,
   0x00, 0x48, 0xfc, 0x87, 0x0f, 0x00, 0x00, 0x00, 0xd0, 0xfe, 0xcf, 0x0f,
   0x00, 0x00, 0x00, 0xc0, 0xff, 0xff, 0x0f, 0x00, 0x00, 0x00, 0x00, 0x00,
   0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
   0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
   0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
   0x00, 0x00};

/*
 *	viz2d()
 *
 *      This subroutine displays the bitmap data in the window that
 *      was created by init_viz2d().  The argument 'buffer' is a
 *      pointer to an 8-bit (character) array of data.  The width and
 *      height of the buffer must match the width and height as
 *      specified in the call to init_viz2d().
 *
 *	If a 256 color colormap is used, then viz2d() simply blasts the
 *	image to the window.  But if less than 256 colors are used, then
 *	the data is contracted down into 'trans_buffer'.  This will
 *	obviously create minute errors in the image representation.
 */

viz2d_( buffer )
char *buffer;
{
int	iii, ival;
float	scaledown, fval;
	if( colors_created < colormapsize ){
		/* Must contract the data since less than 256 colors */
	    scaledown = 256.0/(float)colors_created;
	    for(iii=0; iii<width*height; iii++){
		trans_buffer[iii] =
		    (unsigned char)( (((unsigned char)buffer[iii])/scaledown) +
						mapstart );
	    }
	    anImage = XCreateImage( theDisplay, aVisual, theDepth, ZPixmap, 0,
			trans_buffer, width, height, 8, 0 );
	}else{
		/* No need to use the translation buffer */
	    anImage = XCreateImage( theDisplay, aVisual, theDepth, ZPixmap, 0,
			buffer, width, height, 8, 0 );
	}
	XPutImage( theDisplay, aWindow, theGC, anImage, 0,0,0,0, width,height );
	XDestroyImage( anImage );
	XFlush( theDisplay );
}

/*
 *	init_viz2d()
 *
 *      The first two parameters are 'width' of the data and 'height'
 *      of the data.  'width' and 'height' will be the width and
 *      height of the window and the data.  The 'colormap-type' is an
 *      integer code with 1=gray-scale, 2=blue-to-red, and
 *      3=blue-to-green-to-red.  The 'colormap-size' is a request for
 *      the number of colors to display the data.  If 'display_key' is
 *	non-zero, then a color key representing the data values 0 to 255
 *	will be displayed at the bottom of the viz2d window.
 *
 *	init_viz2d() will first try to allocate (write) entries from
 *	the (server's) default colormap.  If this is successful, then the
 *	server doesn't have to swap our colormap in and out and the viz2d
 *	window will not go black when the cursor is not in our window.
 *
 *	init_viz2d() returns 0 upon failure and 1 upon success.  Failure
 *	may result upon failure to connect to the server (inwhich case 
 *	the user is told) or failure to open a window or failure to
 *	create a colormap (which must be of type PseudoColor - this could
 *	be modified).
 *
 *	POTENTIAL MODIFICATIONS:
 *	1) Don't fail if can't create a colormap of type PseudoColor,
 *	2) Add or modify different colormaps (this may be desired change
 *		by joe-blow programmer if he is not satisfied with my
 *		colormaps).
 *	3) Read in colormaps (pallets) created by the ximage program.
 */

int init_viz2d_(request_width, request_height, colormap_type, request_colors,
			display_key)
int     *request_width, *request_height, *colormap_type, *request_colors,
			*display_key;
{
Window	openWindow();
Colormap theDefaultColormap;
XSetWindowAttributes attrib;
int	nitems, iii, jjj;
XVisualInfo *vlist, vinfo_template;
Visual	*theDefaultVisual;
int	colors_to_copy;		/* # colors to copy from default colormap */
int	delta;			/* Step size in our colormap definitions */
int	midmap;			/* Midpoint of our colormap */
int	defstart;		/* Start index into colormap definitions */
int	colors_to_store;	/* # colors to write to colormap */
long	vinfo_mask;		/* Visual information mask */
char	an8bitFlag;
XColor	*theDefColorDefs;
unsigned long	*plane_masks;	/* Plane masks for XAllocColorCells, not used?*/
unsigned int	nplanes;	/* # planes for XAllocColorCells, not used?*/
unsigned long	*pixels;	/* Returned pixel values from XAllocColorCells*/
unsigned int	ncolors;	/* # of requested colors in XAllocColorCells */
	if( !initX() ) return 0;
		/* Create the transformation buffer (oversized) */
	width = *request_width;
	height = *request_height;
        trans_buffer = (char *)calloc(sizeof(char),width*height+width+height);
		/* Create a window of the requested data size */
	if( *display_key ){
		/* but a slightly larger window if a colorkey is requested */
		aWindow = openWindow( 200, 200, width, height+KEY_HEIGHT+3,
				0, &theGC );	 /* 0 = NOT popup */
		key_buffer = (char *)calloc(sizeof(char),width*(KEY_HEIGHT+1));
	}else{
		aWindow = openWindow( 200, 200, width, height,
				0, &theGC );	 /* 0 = NOT popup */
	}
	XSetIconName( theDisplay, aWindow, "2D fd-td" );
	XStoreName( theDisplay, aWindow, "2D fd-td" );
	sleep(1);		/* Must wait or graphics won't work?? */
	theDefaultVisual = DefaultVisual( theDisplay, theScreen );
	theDefaultColormap = DefaultColormap(theDisplay, theScreen);
		/* 1st try to allocate colors from server's default colormap */
	ncolors = *request_colors;

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
欧美激情综合在线| 一区二区三区精密机械公司| 欧美中文一区二区三区| 国模娜娜一区二区三区| 亚洲午夜三级在线| 中文在线免费一区三区高中清不卡| 欧美日韩性生活| www.欧美日韩国产在线| 精品中文字幕一区二区| 亚洲成av人片一区二区| 成人欧美一区二区三区小说| 国产午夜精品福利| 日韩欧美国产高清| 欧美日本不卡视频| 91高清在线观看| 99久久国产综合精品女不卡 | 国产麻豆精品theporn| 丝袜美腿亚洲一区| 亚洲美女区一区| 国产精品剧情在线亚洲| 久久伊人蜜桃av一区二区| 欧美日韩激情在线| 欧美亚洲另类激情小说| 91在线视频播放地址| 成人精品小蝌蚪| 国产激情91久久精品导航 | 天天av天天翘天天综合网 | 欧美大白屁股肥臀xxxxxx| 欧美日韩在线电影| 欧美色综合网站| 欧美日韩中文另类| 欧美天天综合网| 日本道免费精品一区二区三区| 亚洲免费资源在线播放| 成人动漫在线一区| 国产sm精品调教视频网站| 国产精品亚洲一区二区三区在线| 韩国女主播成人在线观看| 黄色小说综合网站| 国产精品小仙女| 成年人网站91| 99精品视频一区| 91久久精品一区二区三| 欧美在线免费视屏| 欧美日韩精品系列| 精品少妇一区二区三区| ww亚洲ww在线观看国产| 中文字幕av一区 二区| 中文字幕一区二区三区在线观看| 日韩毛片在线免费观看| 一区二区在线观看免费视频播放| 亚洲高清不卡在线| 乱中年女人伦av一区二区| 韩国三级中文字幕hd久久精品| 国产一区二区三区免费看 | 午夜精品免费在线观看| 视频在线观看国产精品| 欧美性感一区二区三区| 欧美日韩一区二区三区不卡| 粉嫩久久99精品久久久久久夜| 91猫先生在线| 国产自产视频一区二区三区| 国产大陆亚洲精品国产| 95精品视频在线| 538prom精品视频线放| 久久久综合九色合综国产精品| 国产亚洲视频系列| 亚洲欧美另类小说| 日本视频中文字幕一区二区三区| 久久电影网电视剧免费观看| 成人久久18免费网站麻豆| 欧美日韩一区二区三区不卡| 精品国产一区二区精华| 亚洲色图欧美在线| 日本伊人色综合网| 不卡的av电影| 9191精品国产综合久久久久久| 久久精品男人天堂av| 一级精品视频在线观看宜春院| 日本视频在线一区| aaa欧美日韩| 日韩欧美一区电影| 亚洲精选视频免费看| 蜜臀va亚洲va欧美va天堂 | www日韩大片| 亚洲人xxxx| 精品一区二区精品| 91免费版pro下载短视频| 日韩一区二区视频在线观看| 日韩理论片网站| 久久99国产精品尤物| 色综合激情久久| 久久久精品人体av艺术| 日韩二区三区四区| 99re亚洲国产精品| 久久网站最新地址| 日韩高清电影一区| 国产日产欧美一区二区视频| 五月天视频一区| 91在线视频观看| 国产人成亚洲第一网站在线播放 | 国产精品国产三级国产普通话99| 日日骚欧美日韩| 色婷婷综合久久久久中文一区二区 | 暴力调教一区二区三区| 日韩亚洲欧美一区| 亚洲午夜久久久久久久久电影网 | 成人美女视频在线观看18| 日韩一卡二卡三卡| 亚洲国产视频一区二区| 91一区二区在线| 中文字幕欧美区| 国产一区二区三区四区五区入口| 91精品欧美一区二区三区综合在| 亚洲在线观看免费| 色视频一区二区| 中文字幕日韩精品一区 | 欧美精品123区| 亚洲夂夂婷婷色拍ww47 | 精品国产乱码久久久久久夜甘婷婷| 一区二区三区精品在线| 91在线国产观看| 国产亚洲精品福利| 国产成人免费视频一区| 久久久精品影视| 国产精品亚洲第一| 国产亚洲一区二区三区| 国产精品亚洲а∨天堂免在线| 精品电影一区二区| 国内精品久久久久影院一蜜桃| 日韩视频永久免费| 久久99精品一区二区三区三区| 欧美福利电影网| 天天综合色天天综合| 4438成人网| 三级成人在线视频| 日韩欧美色电影| 久久国产生活片100| 精品国产一区二区三区久久久蜜月 | 亚洲视频狠狠干| 成人18视频在线播放| 亚洲视频一区二区在线| 色综合中文字幕| 亚洲一区二区三区自拍| 欧美精品粉嫩高潮一区二区| 日本视频一区二区三区| 欧美成va人片在线观看| 国产成人一级电影| √…a在线天堂一区| 在线看不卡av| 视频在线观看国产精品| 26uuu另类欧美亚洲曰本| 丰满岳乱妇一区二区三区| 中文字幕一区av| 欧美日韩国产一二三| 日韩不卡手机在线v区| 国产人妖乱国产精品人妖| www.日本不卡| 婷婷丁香激情综合| 2021中文字幕一区亚洲| 99久久国产综合色|国产精品| 亚洲一区免费视频| 日韩免费福利电影在线观看| 国产a精品视频| 亚洲高清不卡在线观看| 久久女同精品一区二区| 高清国产午夜精品久久久久久| 亚洲欧美日韩电影| 日韩欧美久久一区| 成人av资源在线观看| 首页综合国产亚洲丝袜| 亚洲精品一区二区三区精华液 | 欧美日韩国产成人在线91 | 欧美色综合网站| 国产综合成人久久大片91| 亚洲免费伊人电影| 日韩欧美不卡一区| 97久久人人超碰| 美女mm1313爽爽久久久蜜臀| 国产精品盗摄一区二区三区| 91麻豆精品国产| 99re这里只有精品首页| 另类的小说在线视频另类成人小视频在线 | 99久久99久久综合| 免费成人av资源网| 亚洲欧美激情在线| 精品91自产拍在线观看一区| 色婷婷亚洲综合| 国产成人久久精品77777最新版本| 亚洲综合激情小说| 国产视频911| 日韩一区二区高清| 欧美午夜影院一区| 成人av网站在线观看免费| 蜜桃一区二区三区在线| 亚洲最新视频在线观看| 欧美国产日韩精品免费观看| 精品久久久久久久久久久久包黑料| 欧洲一区二区三区免费视频| 成人污污视频在线观看|