home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: Graphics / Graphics.zip / xfitsvew.zip / XFITSview / imagedisp.h < prev    next >
C/C++ Source or Header  |  1996-03-27  |  5KB  |  94 lines

  1. /* imagedisp (image display widget) header file */
  2. /*-----------------------------------------------------------------------
  3. *  Copyright (C) 1996
  4. *  Associated Universities, Inc. Washington DC, USA.
  5. *  This program is free software; you can redistribute it and/or
  6. *  modify it under the terms of the GNU General Public License as
  7. *  published by the Free Software Foundation; either version 2 of
  8. *  the License, or (at your option) any later version.
  9. *
  10. *  This program is distributed in the hope that it will be useful,
  11. *  but WITHOUT ANY WARRANTY; without even the implied warranty of
  12. *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  13. *  GNU General Public License for more details.
  14. *-----------------------------------------------------------------------*/
  15. #include "xfitsview.h"
  16. #ifndef IMAGEDISP_H
  17. #define IMAGEDISP_H
  18. #define CONTROLWIDTH 150 /* width of control panel */
  19. typedef struct {
  20. /* display information */
  21.     XtAppContext   app;       /* program application context */
  22.     Widget         parent;    /* main program window */
  23.     Widget         shell;     /* highest level form */
  24.     Widget         display;   /* form container widget */
  25.     GC             gc;        /* graphics context */
  26.     Widget         canvas;    /* canvas work widget */
  27.     Widget         goober;    /* widget the size of the full window */
  28.     Cursor         cursor;    /* Cursor for image display, Null = standard */
  29.     XImage         *work;     /* ZPixmap for zooming current screen */
  30.     int            workNx;    /* X dimension of work ZPixmap  */
  31.     int            workNy;    /* Y dimension of work ZPixmap  */
  32.     Widget         hscroll;   /* horizonal scroll scale */
  33.     int            hscr_vis;  /* 1=> hscroll visible, 0=not */
  34.     int            hscr_max;  /* hscroll maximum value   */
  35.     int            hscr_min;  /* hscroll minimum value   */
  36.     int            hscr_half; /* half width of display in x (im. pixels)*/
  37.     Widget         vscroll;   /* vertical scroll scale */
  38.     int            vscr_vis;  /* 1=> vscroll visible, 0=not */
  39.     int            vscr_max;  /* hscroll maximum value   */
  40.     int            vscr_min;  /* hscroll minimum value   */
  41.     int            vscr_half; /* half width of display in y */
  42.     int            disp_wid;  /* display width */
  43.     int            disp_hei;  /* display height */
  44.     
  45. /* image information */
  46.     int            zoom;      /* zoom factor, neg = zoom out */
  47.     int            scrollx;   /* center "x" pixel in display */
  48.     int            scrolly;   /* center "y" pixel in display */
  49.     int            iXCorn;    /* x corner pixel in display */
  50.     int            iYCorn;    /* y corner pixel in display */
  51. /* color mapping information */
  52.     int            depth;     /* number of bits in display */
  53.     int            ncolors;   /* number of colors in color table */
  54.     unsigned long  colut[MAXCOLOR]; /* translation table for pixel values 
  55.                        to color index */
  56.     Colormap       cmap;       /* Windows color map */
  57.     unsigned short red[MAXCOLOR], green[MAXCOLOR], blue[MAXCOLOR]; /* default
  58.                                     colortable */
  59.     Widget         BriScroll; /* Brightness control scroll bar */
  60.     Widget         ConScroll; /* Contrast control scroll bar */
  61.     short          value[2];  /* Brightness and contrast scroll bar values */
  62.     Widget         Info1;     /* First information line on control panel */
  63.     Widget         Info2;     /* Second information line on control panel */
  64.     Widget         Info3;     /* Third information line on control panel */
  65.     Widget         Info4;     /* Fourth information line on control panel */
  66.     Widget         Info5;     /* Fifth information line on control panel */
  67.     Widget         Info6;     /* sixth information line on control panel */
  68.     Widget         Info7;     /* seventhth information line on control panel */
  69.     int            showInfo;  /* if True show pixel information */
  70. } ImageDisplay;
  71.  
  72. /* prototypes */
  73. /* create initialize display */
  74. ImageDisplay* MakeDisplay (Widget parent, Widget shell);
  75. /* set display parameters for current image and force expose to redraw */
  76. void ResetDisplay (ImageDisplay *IDdata);
  77. /* set size and location of display after display and */
  78. /* image sizes are known - sets up scroll bars   */
  79. void SetDisplay (ImageDisplay* IDdata);
  80. /* draw image */
  81. void PaintImage (ImageDisplay* IDdata);
  82. /* callbacks */
  83. void FitPosCB (Widget w, XtPointer clientData, XtPointer callData);
  84. void ImageResizeCB (Widget w, XtPointer clientData, XtPointer callData);
  85. void Zoom25CB (Widget w, XtPointer clientData, XtPointer callData);
  86. void Zoom50CB (Widget w, XtPointer clientData, XtPointer callData);
  87. void Zoom100CB (Widget w, XtPointer clientData, XtPointer callData);
  88. void Zoom200CB (Widget w, XtPointer clientData, XtPointer callData);
  89. void Zoom400CB (Widget w, XtPointer clientData, XtPointer callData);
  90. void Zoom800CB (Widget w, XtPointer clientData, XtPointer callData);
  91. void Zoom1600CB (Widget w, XtPointer clientData, XtPointer callData);
  92.  
  93. #endif /* IMAGEDISP */ 
  94.