VIA - Volumetric Image Analysis
VImageVieP.h
1 /*
2  * $Id: VImageVieP.h 3177 2008-04-01 14:47:24Z karstenm $
3  *
4  * This file contains private definitions used by the VImageView widget.
5  */
6 
7 #ifndef V_VImageVieP_h
8 #define V_VImageVieP_h 1
9 
10 /*
11  * Copyright 1993, 1994 University of British Columbia
12  *
13  * Permission to use, copy, modify, distribute, and sell this software and its
14  * documentation for any purpose is hereby granted without fee, provided that
15  * the above copyright notice appears in all copies and that both that
16  * copyright notice and this permission notice appear in supporting
17  * documentation. UBC makes no representations about the suitability of this
18  * software for any purpose. It is provided "as is" without express or
19  * implied warranty.
20  *
21  * Authors: Arthur Pope, Daniel Ko, Dan Razzell,
22  * UBC Laboratory for Computational Intelligence
23  */
24 
25 /* From the X Windows libraries: */
26 #include <X11/IntrinsicP.h>
27 
28 /* Class public header file: */
29 #include "viaio/VImageView.h"
30 
31 /* Superclass private header file: */
32 #include <X11/Xaw/SimpleP.h>
33 
34 /* From the Vista library: */
35 #include "viaio/VImage.h"
36 #include "viaio/colormap.h"
37 
38 /* For portability: */
39 #include <X11/Xfuncproto.h>
40 
41 #ifdef __cplusplus
42 extern "C" {
43 #endif
44 
45 
46 /*
47  * Class record.
48  */
49 
50 typedef struct {
51  int empty;
52 } VImageViewClassPart;
53 
54 typedef struct V_ImageViewClassRec {
55  CoreClassPart core_class;
56  VImageViewClassPart v_image_view_class;
57 } VImageViewClassRec;
58 
59 extern VImageViewClassRec vImageViewClassRec;
60 
61 
62 /*
63  * Instance record.
64  */
65 
66 typedef struct {
67 
68  /* Resources: */
69  Boolean absolute; /* 1: grey shade = abs pixel value */
70  int band; /* band to be displayed */
71  int column_center; /* column-coord. of zoom center */
72  Cursor cursor; /* cursor to display over image */
73  XtCallbackList expose_callback; /* callbacks to draw over image */
74  VImage image; /* image to be displayed */
75  XtCallbackList input_callback; /* callbacks to handle input */
76  XtCallbackList move_zoom_center_callback; /* callbacks to handle
77  move zoom center */
78  Boolean proportion; /* 1: maintain image proportions */
79  Boolean resize; /* 1: adjust widget size to image's */
80  int row_center; /* row-coord. of zoom center */
81  Boolean use_pixmap; /* cache image in pixmap at server */
82  VColormap v_colormap; /* info to guide color rendering */
83  XtCallbackList zoom_in_callback; /* callbacks to handle zoom in */
84  int zoom_level; /* zoom level */
85  XtCallbackList zoom_out_callback; /* callbacks to handle zoom out */
86 
87  /* Private state: */
88  VBoolean render_needed; /* image must yet be rendered */
89  VFloat pixel_aspect_ratio; /* image's pixel aspect ratio attribute */
90  VBoolean is_color; /* image is to be interpreted as RGB color */
91  XImage *ximage;
92  Pixmap pixmap; /* pixmap used to cache image at server */
93  unsigned int alloced_height;/* dimensions of alloc'ed ximage and pixmap */
94  unsigned int alloced_width;
95  GC gc; /* GC for drawing to pixmap, window */
96  struct V_Port { /* portion of image currently shown: */
97  int first_row; /* top left image row and column */
98  int first_column;
99  int nrows; /* numbers of image rows and columns */
100  int ncolumns;
101  unsigned int height; /* portion of window occupied */
102  unsigned int width;
103  } port;
104  VBoolean free_vcolormap; /* 1: widget created is VColormap */
105  Window busy_window; /* mapped when widget is busy */
106 } VImageViewPart;
107 
108 typedef struct V_ImageViewRec {
109  CorePart core;
110  VImageViewPart viv;
111 } VImageViewRec;
112 
113 
114 /* Declarations of private functions: */
115 
116 extern XImage *V_RenderVToX (
117 #if NeedFunctionPrototypes
118  VImageViewWidget /* vw */
119 #endif
120 );
121 
122 #ifdef __cplusplus
123 }
124 #endif
125 
126 #endif /* V_VImageVieP_h */