xwindow.h
Upload User: shhuayu888
Upload Date: 2013-03-28
Package Size: 1788k
Code Size: 3k
Category:

Windows Develop

Development Platform:

Unix_Linux

  1. /****************************************************************************
  2.  File Name  : xwindow.h
  3.  Purpose    : header file for xwindow.c
  4.  Release    : Version 1.0
  5.  Date     : Aug 31,1995
  6. GSNAKE API is jointly developed by the Information Technology Institute (ITI), Singapore, and the School of Applied Science, Nanyang Technological
  7. University (NTU), Singapore. 
  8. 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.
  9. 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 :
  10. asschan@ntu.ac.sg
  11. kflai@iti.gov.sg
  12. ***************************************************************************/
  13. #include <X11/Xlib.h>
  14. #include <X11/Xutil.h>
  15. /* ---------- function exported by xwindow.c ---------- */
  16. /*
  17.  * raise an X Window of specified width and height, either by initializing
  18.  * a new window or by resizing the current window
  19.  */
  20. extern void xwin_raiseWindow(short width, short height) ;
  21. /*
  22.  * close and free resources of current Window
  23.  */
  24. extern void xwin_close(void);
  25. /*
  26.  * create and return an XImage structure from a raster image, with specified
  27.  * magnifying ratio
  28.  */
  29. extern XImage *xwin_creatXimage(float *data, short height, 
  30. short width, unsigned char magnify);
  31. /*
  32.  * dump the specified XImage onto the current window
  33.  */
  34. extern void xwin_drawImg(XImage *ximg, int xoffset=0, int yoffset=0);
  35. /*
  36.  * initialize the object by specifying significant points (click)
  37.  */
  38. extern void xwin_InitSnakeClick(
  39.                         short *row, short *col, short *numpts);
  40. /*
  41.  * initialize the object by specifying significant points (drag)
  42.  */
  43. extern void xwin_InitSnakeDrag(
  44.                         short *row, short *col, short *numpts, int spacing);
  45. /* move a point to new location */
  46. extern xwin_MovePoint(XImage *ximg, short Xsrc, short Ysrc, 
  47. short Xdest, short Ydest, int img_offx=0, int img_offy=0);
  48. /* set expand ration */
  49. extern void xwin_setexpandratio(short expand, unsigned char blowup);
  50. /* draw point */
  51. void xwin_DrawPoint(short row, short col);
  52. /* clr point */
  53. void xwin_clrpoint( XImage *ximg, short col, short row );
  54. /* draw line */
  55. void xwin_DrawLine(short x1, short y1, short x2, short y2, 
  56. unsigned char blowup );
  57. /*
  58.  * change default window title
  59.  */
  60. extern void xwin_setTitle(char *title);
  61. /* draw box with left top and right bottom co-ordinates */
  62. extern void xwin_DrawRect(int x1,int y1,int x2,int y2,int mag=1);
  63. /* Rubber banding rectangle to select region */
  64. extern void xwin_SelRegion( int *sx, int *sy, int *length, int *height);
  65. /* Move points in list of points with mouse */
  66. extern void xwin_ShapeContour(XImage *ximg,
  67.       double *row, double *col,short numpts );