⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 xwindow.h

📁 snake算法
💻 H
字号:
/****************************************************************************
 File Name  : xwindow.h
 Purpose    : header file for xwindow.c
 Release    : Version 1.0
 Date	    : Aug 31,1995

GSNAKE API is jointly developed by the Information Technology Institute (ITI), Singapore, and the School of Applied Science, Nanyang Technological
University (NTU), Singapore. 

These software programs are available to the user without any license or royalty fees. Permission is hereby granted to use, copy, modify, and distribute this software and its documentation for any purpose. ITI and NTU gives no warranty, express, implied, or statuary for the software and/or documentation provided, including, without limitation, waranty of merchantibility and warranty of fitness for a particular purpose. The software provided hereunder is on an "as is"  basis, and ITI and NTU has no obligation to provide maintenance, support, updates, enhancements, or modifications.

GSNAKE API is available for any UNIX compatible system. User feedback, bugs, or software and manual suggestions should be sent via electronic mail to one of the following, who may or may not act on them as he/she desires :

		asschan@ntu.ac.sg
		kflai@iti.gov.sg

***************************************************************************/

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


/* ---------- function exported by xwindow.c ---------- */

/*
 * raise an X Window of specified width and height, either by initializing
 * a new window or by resizing the current window
 */
extern void xwin_raiseWindow(short width, short height) ;

/*
 * close and free resources of current Window
 */
extern void xwin_close(void);

/*
 * create and return an XImage structure from a raster image, with specified
 * magnifying ratio
 */
extern XImage *xwin_creatXimage(float *data, short height, 
		short width, unsigned char magnify);

/*
 * dump the specified XImage onto the current window
 */
extern void xwin_drawImg(XImage *ximg, int xoffset=0, int yoffset=0);

/*
 * initialize the object by specifying significant points (click)
 */
extern void xwin_InitSnakeClick(
                        short *row, short *col, short *numpts);

/*
 * initialize the object by specifying significant points (drag)
 */
extern void xwin_InitSnakeDrag(
                        short *row, short *col, short *numpts, int spacing);

/* move a point to new location */
extern xwin_MovePoint(XImage *ximg, short Xsrc, short Ysrc, 
		short Xdest, short Ydest, int img_offx=0, int img_offy=0);

/* set expand ration */
extern void xwin_setexpandratio(short expand, unsigned char blowup);

/* draw point */
void xwin_DrawPoint(short row, short col);

/* clr point */
void xwin_clrpoint( XImage *ximg, short col, short row );

/* draw line */
void xwin_DrawLine(short x1, short y1, short x2, short y2, 
	unsigned char blowup );

/*
 * change default window title
 */
extern void xwin_setTitle(char *title);

/* draw box with left top and right bottom co-ordinates */

extern void xwin_DrawRect(int x1,int y1,int x2,int y2,int mag=1);

/* Rubber banding rectangle to select region */

extern void xwin_SelRegion( int *sx, int *sy, int *length, int *height);

/* Move points in list of points with mouse */
extern void xwin_ShapeContour(XImage *ximg,
			      double *row, double *col,short numpts );

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -