VIA - Volumetric Image Analysis

VImageVieP.h

00001 /*
00002  *  $Id: VImageVieP.h 3177 2008-04-01 14:47:24Z karstenm $
00003  *
00004  *  This file contains private definitions used by the VImageView widget.
00005  */
00006 
00007 #ifndef V_VImageVieP_h
00008 #define V_VImageVieP_h 1
00009 
00010 /*
00011  *  Copyright 1993, 1994 University of British Columbia
00012  *
00013  *  Permission to use, copy, modify, distribute, and sell this software and its
00014  *  documentation for any purpose is hereby granted without fee, provided that
00015  *  the above copyright notice appears in all copies and that both that
00016  *  copyright notice and this permission notice appear in supporting
00017  *  documentation. UBC makes no representations about the suitability of this
00018  *  software for any purpose. It is provided "as is" without express or
00019  *  implied warranty.
00020  *
00021  *  Authors: Arthur Pope, Daniel Ko, Dan Razzell,
00022  *           UBC Laboratory for Computational Intelligence
00023  */
00024 
00025 /* From the X Windows libraries: */
00026 #include <X11/IntrinsicP.h>
00027 
00028 /* Class public header file: */
00029 #include "viaio/VImageView.h"
00030 
00031 /* Superclass private header file: */
00032 #include <X11/Xaw/SimpleP.h>
00033 
00034 /* From the Vista library: */
00035 #include "viaio/VImage.h"
00036 #include "viaio/colormap.h"
00037 
00038 /* For portability: */
00039 #include <X11/Xfuncproto.h>
00040 
00041 #ifdef __cplusplus
00042 extern "C" {
00043 #endif
00044 
00045 
00046 /*
00047  *  Class record.
00048  */
00049 
00050 typedef struct {
00051     int empty;
00052 } VImageViewClassPart;
00053 
00054 typedef struct V_ImageViewClassRec {
00055     CoreClassPart core_class;
00056     VImageViewClassPart v_image_view_class;
00057 } VImageViewClassRec;
00058 
00059 extern VImageViewClassRec vImageViewClassRec;
00060 
00061 
00062 /*
00063  *  Instance record.
00064  */
00065 
00066 typedef struct {
00067 
00068     /* Resources: */
00069     Boolean absolute;           /* 1: grey shade = abs pixel value */
00070     int band;                   /* band to be displayed */
00071     int column_center;          /* column-coord. of zoom center */
00072     Cursor cursor;              /* cursor to display over image */
00073     XtCallbackList expose_callback; /* callbacks to draw over image */
00074     VImage image;               /* image to be displayed */
00075     XtCallbackList input_callback; /* callbacks to handle input */
00076     XtCallbackList move_zoom_center_callback; /* callbacks to handle  
00077                                                  move zoom center */
00078     Boolean proportion;         /* 1: maintain image proportions */
00079     Boolean resize;             /* 1: adjust widget size to image's */
00080     int row_center;             /* row-coord. of zoom center */
00081     Boolean use_pixmap;         /* cache image in pixmap at server */
00082     VColormap v_colormap;       /* info to guide color rendering */
00083     XtCallbackList zoom_in_callback; /* callbacks to handle zoom in */
00084     int zoom_level;             /* zoom level */
00085     XtCallbackList zoom_out_callback; /* callbacks to handle zoom out */
00086  
00087     /* Private state: */
00088     VBoolean render_needed;     /* image must yet be rendered */
00089     VFloat pixel_aspect_ratio;  /* image's pixel aspect ratio attribute */
00090     VBoolean is_color;          /* image is to be interpreted as RGB color */
00091     XImage *ximage;
00092     Pixmap pixmap;              /* pixmap used to cache image at server */
00093     unsigned int alloced_height;/* dimensions of alloc'ed ximage and pixmap */
00094     unsigned int alloced_width;
00095     GC gc;                      /* GC for drawing to pixmap, window */
00096     struct V_Port {             /* portion of image currently shown: */
00097         int first_row;          /*   top left image row and column */
00098         int first_column;
00099         int nrows;              /*   numbers of image rows and columns */
00100         int ncolumns;
00101         unsigned int height;    /*   portion of window occupied */
00102         unsigned int width;
00103     } port;
00104     VBoolean free_vcolormap;    /* 1: widget created is VColormap */
00105     Window busy_window;         /* mapped when widget is busy */
00106 } VImageViewPart;
00107 
00108 typedef struct V_ImageViewRec {
00109     CorePart core;
00110     VImageViewPart viv;
00111 } VImageViewRec;
00112 
00113 
00114 /* Declarations of private functions: */
00115 
00116 extern XImage *V_RenderVToX (
00117 #if NeedFunctionPrototypes
00118     VImageViewWidget    /* vw */                             
00119 #endif
00120 );
00121 
00122 #ifdef __cplusplus
00123 }
00124 #endif
00125 
00126 #endif /* V_VImageVieP_h */