Main Page   Namespace List   Alphabetical List   Compound List   File List   Compound Members   File Members  

cdl2.h

Go to the documentation of this file.
00001 /*  
00002  *  CDL.H -- Global definitions for the Client Display Library.
00003  */
00004 
00005 #ifndef _CDL_Defined
00006 #define _CDL_Defined
00007 
00008 #define CDL_VERSION     "Client Display Library V1.7 04/28/99"
00009 
00010 /* Declare prototypes if using ANSI C */
00011 #ifdef  CDL_ANSIC
00012 #define ANSI_FUNC
00013 #endif
00014 
00015 #define MAX_FBCONFIG     128            /* max size of FB config table  */
00016 #define MAX_FRAMES        16            /* max frames support by server */
00017 #define DEF_CONTRAST    0.25            /* default zscale contrast      */
00018 #define DEF_NSAMPLE      600            /* default number of samples    */
00019 #define DEF_NSAMPLINES    -1            /* default no. of sample lines  */
00020 #define INDEF           -999            /* INDEF value flag             */
00021 
00022 
00023 /* Include private definitions when compiling linrary sources. */
00024 #ifdef   CDL_LIBRARY_SOURCE
00025 #include "eps.h"
00026 #include "cdlP.h"
00027 #endif
00028 
00029 /* Frame buffer selection code. */
00030 #define FB_AUTO         -1              /* autoconfig the frame buffer  */
00031 
00032 /* Types of greyscale transformations. */
00033 #define CDL_UNITARY       0             /* values map without change    */
00034 #define CDL_LINEAR        1             /* linear mapping               */
00035 #define CDL_LOG           2             /* logarithmic mapping  */
00036 
00037 /* Overlay colors. */
00038 #define C_BLACK         202             /* Static overlay color defs    */
00039 #define C_WHITE         203
00040 #define C_RED           204
00041 #define C_GREEN         205
00042 #define C_BLUE          206
00043 #define C_YELLOW        207
00044 #define C_CYAN          208
00045 #define C_MAGENTA       209
00046 #define C_CORAL         210
00047 #define C_MAROON        211
00048 #define C_ORANGE        212
00049 #define C_KHAKI         213
00050 #define C_ORCHID        214
00051 #define C_TURQUOISE     215
00052 #define C_VIOLET        216
00053 #define C_WHEAT         217
00054 
00055 #define M_FILL             1            /* Overlay point mark types.    */
00056 #define M_POINT            2
00057 #define M_BOX              4
00058 #define M_PLUS             8
00059 #define M_CROSS           16
00060 #define M_DIAMOND         32
00061 #define M_CIRCLE          64
00062 #define M_STAR           128
00063 #define M_HLINE          256
00064 #define M_VLINE          512
00065 #define M_HBLINE        1024
00066 #define M_VBLINE        2048
00067 
00068 #define F_ROMAN            0            /* Font types.                  */
00069 #define F_GREEK            1
00070 #define F_FUTURA           2
00071 #define F_TIMES            3
00072 #define F_BOLD             4
00073 
00074 #define L_SOLID            0            /* Polyline attribute values.   */
00075 #define L_DASHED           1
00076 #define L_DOTTED           2
00077 #define L_DOTDASH          3
00078 #define L_HOLLOW           4
00079 #define L_SHADOW           5
00080 
00081 
00082 /* Local type definitions. */
00083 typedef struct CDL      *CDLPtr;
00084 typedef struct Marker   *MarkerPtr;
00085 
00086 
00087 #ifndef AIXV3
00088 #ifndef OSF1
00089 typedef unsigned char   uchar;
00090 #endif
00091 #endif
00092 
00093 
00094 
00095 /*  The main CDL package structure.
00096  */
00097 struct CDL {
00098 #ifdef   CDL_LIBRARY_SOURCE
00099         IMDPtr  imd;                    /* IMD package pointer  */
00100         int     memModel;               /* Memory model to use  */
00101 #endif
00102 
00103         int     frame;                  /* display frame number */
00104         int     fbconfig;               /* fb config number     */
00105         int     fbwidth;                /* current FB width     */
00106         int     fbheight;               /* current FB height    */
00107         int     fbnf;                   /* current FB nframes   */
00108 
00109         float   contrast;               /* zscale contrast value*/
00110         int     nsample;                /* opt. sample points   */
00111         int     nsamplines;             /* opt. sample lines    */
00112 
00113         int     im_nx;                  /* current image width  */
00114         int     im_ny;                  /* current image height */
00115 
00116         /* Overlay graphics attributes.                         */
00117         int     font;                   /* overlay text font    */
00118         int     textwidth;              /* text width           */
00119         int     linewidth;              /* line width           */
00120         int     linestyle;              /* line style           */
00121 
00122         /* WCS descriptor stuff.                                */
00123         char    *imname;                /* image name           */
00124         char    *imtitle;               /* image title          */
00125         float   a, b, c, d;             /* WCS values           */
00126         float   tx, ty;                 /* translation values   */
00127         float   z1, z2;                 /* zscale values        */
00128         int     ztrans;                 /* Z trans type         */
00129 };
00130 
00131 
00132 /* A element of the display list describing the marker.  We throw in the
00133  * kitchen sinke here to cover all possible marker types, in reality only
00134  * a few of these are used for any given marker type.
00135  */
00136 struct Marker {
00137         short   type;                   /* marker type          */
00138         int     x, y;                   /* center coords        */
00139         int     number;                 /* label a point        */
00140         int     pt_type;                /* point type           */
00141         int     size;                   /* point marker size    */
00142         int     fill;                   /* fill marker          */
00143         int     color;                  /* marker color         */
00144         int     *xp, *yp;               /* coords               */
00145         int     npts;                   /* npts in array        */
00146         int     radius;                 /* circle radius        */
00147         int     nannuli;                /* num of annuli        */
00148         int     sep;                    /* annulus separation   */
00149         int     xrad, yrad;             /* ellipse axes         */
00150         float   ang;                    /* ellipse rotation     */
00151         float   txsize;                 /* text marker size     */
00152         char    *str;                   /* text marker string   */
00153         int     font;                   /* text font type       */
00154         int     textwidth;              /* text width           */
00155         int     linewidth;              /* line width           */
00156         int     linestyle;              /* line style           */
00157 
00158         int     nx, ny;                 /* marker region size   */
00159         int     lx, ly;                 /* marker LL corner     */
00160 
00161         unsigned char   *refpix;        /* orig image pixels    */
00162         unsigned char   *markpix;       /* marked image pixels  */
00163 
00164         MarkerPtr  back;                /* linked list pointers */
00165         MarkerPtr  next;
00166         int     markerID;               /* assigned id number   */
00167 };
00168 
00169 
00170 /* Marker types used internally. */
00171 #define MK_POINT        0
00172 #define MK_LINE         1
00173 #define MK_BOX          2
00174 #define MK_POLYLINE     3
00175 #define MK_POLYGON      4
00176 #define MK_CIRCLE       5
00177 #define MK_CIRCANN      6
00178 #define MK_ELLIPSE      7
00179 #define MK_ELLIPANN     8
00180 #define MK_TEXT         9
00181 
00182 
00183 /* Function definitions. */
00184 
00185 extern "C" {
00186 
00187 CDLPtr cdl_open(char *imtdev);
00188 int cdl_displayPix(CDLPtr cdl, uchar *pix, int nx, int ny, int bitpix, int frame, int fbconfig, int zscale);
00189 char cdl_readCursor(CDLPtr cdl, int sample, float *x, float *y, int *wcs, char *key);
00190 int cdl_setCursor(CDLPtr cdl, int x, int y, int wcs);
00191 int cdl_setWCS(CDLPtr cdl, char *imname, char *imtitle, float a, float b, float c, float d, float tx, float ty, float z1, float z2, int zt);
00192 int cdl_getWCS(CDLPtr cdl, char *name, char *title, float *a, float *b, float *c, float *d, float *tx, float *ty, float *z1, float *z2, int *zt);
00193 int cdl_clearFrame(CDLPtr cdl);
00194 void cdl_selectFB(CDLPtr cdl, int nx, int ny, int *fb, int *w, int *h, int *nf, int reset);
00195 void cdl_close(CDLPtr cdl);
00196 int cdl_readImage(CDLPtr cdl, uchar **pix, int *nx, int *ny);
00197 int cdl_readFrameBuffer(CDLPtr cdl, uchar **pix, int *nx, int *ny);
00198 void cdl_computeZscale(CDLPtr cdl, uchar *pix, int nx, int ny, int bitpix, float *z1, float *z2);
00199 void cdl_zscaleImage(CDLPtr cdl, uchar **pix, int nx, int ny, int bitpix, float z1, float z2);
00200 int cdl_printPix(CDLPtr cdl, char *cmd, uchar *pix, int nx, int ny, int annotate);
00201 int cdl_printPixToFile(CDLPtr cdl, char *fname, uchar *pix, int nx, int ny, int annotate);
00202 int cdl_readSubRaster(CDLPtr cdl, int lx, int ly, int nx, int ny, uchar **pix);
00203 int cdl_writeSubRaster(CDLPtr cdl, int lx, int ly, int nx, int ny, uchar *pix);
00204 void cdl_setFBConfig(CDLPtr cdl, int configno);
00205 void cdl_getFBConfig(CDLPtr cdl, int *configno, int *w, int *h, int *nframes);
00206 void cdl_lookupFBSize(CDLPtr cdl, int configno, int *w, int *h, int *nf);
00207 void cdl_setFrame(CDLPtr cdl, int frame);
00208 void cdl_setZTrans(CDLPtr cdl, int ztrans);
00209 void cdl_setZScale(CDLPtr cdl, float z1, float z2);
00210 void cdl_setSample(CDLPtr cdl, int nsample);
00211 void cdl_setSampleLines(CDLPtr cdl, int nlines);
00212 void cdl_setContrast(CDLPtr cdl, float contrast);
00213 void cdl_setName(CDLPtr cdl, char *imname);
00214 void cdl_setTitle(CDLPtr cdl, char *imtitle);
00215 void cdl_getFrame(CDLPtr cdl, int *frame);
00216 void cdl_getZTrans(CDLPtr cdl, int *ztrans);
00217 void cdl_getZScale(CDLPtr cdl, float *z1, float *z2);
00218 void cdl_getSample(CDLPtr cdl, int *nsample);
00219 void cdl_getSampleLines(CDLPtr cdl, int *nlines);
00220 void cdl_getContrast(CDLPtr cdl, float *contrast);
00221 void cdl_getName(CDLPtr cdl, char *imname);
00222 void cdl_getTitle(CDLPtr cdl, char *imtitle);
00223 void cdl_setDebug(int state);
00224 
00225 
00226 int cdl_mapFrame(CDLPtr cdl, int frame);
00227 int cdl_markCoordsFile(CDLPtr cdl, char *fname, int type, int size, int color, int label);
00228 int cdl_markPoint(CDLPtr cdl, int x, int y, int number, int size, int type, int color);
00229 int cdl_markPointLabel(CDLPtr cdl, int x, int y, char *label, int size, int type, int color);
00230 int cdl_markLine(CDLPtr cdl, int xs, int ys, int xe, int ye, int color);
00231 int cdl_markBox(CDLPtr cdl, int lx, int ly, int ux, int uy, int fill, int color);
00232 int cdl_markPolygon(CDLPtr cdl, int xarray[], int yarray[], int npts, int fill, int color);
00233 int cdl_markPolyline(CDLPtr cdl, int *xarray, int *yarray, int npts, int color);
00234 int cdl_markCircle(CDLPtr cdl, int x, int y, int radius, int fill, int color);
00235 int cdl_markCircAnnuli(CDLPtr cdl, int x, int y, int radius, int nannuli, int sep, int color);
00236 int cdl_markEllipse(CDLPtr cdl, int x, int y, int xrad, int yrad, float rotang, int fill, int color);
00237 int cdl_markEllipAnnuli(CDLPtr cdl, int x, int y, int xrad, int yrad, float ang, int nannuli, int sep, int color);
00238 int cdl_markText(CDLPtr cdl, int x, int y, char *str, float size, float angle, int color);
00239 void cdl_setFont(CDLPtr cdl, int font);
00240 void cdl_setTextWidth(CDLPtr cdl, int width);
00241 void cdl_setLineWidth(CDLPtr cdl, int width);
00242 void cdl_setLineStyle(CDLPtr cdl, int style);
00243 int cdl_deleteMark(CDLPtr cdl, int x, int y);
00244 int cdl_clearOverlay(CDLPtr cdl);
00245 int cdl_redrawOverlay(CDLPtr cdl);
00246 void cdl_beginDList(int frame);
00247 void cdl_drawDList(int frame);
00248 void cdl_clearDList(int frame);
00249 void cdl_endDList(int frame, int flush);
00250 int cdl_doTextMarker(int x, int y, char *string, float size, float angle, int color, int width, int font, uchar *pix, int lx, int ly, int nx, int ny);
00251 int cdl_freeDisplayList(CDLPtr cdl, MarkerPtr head);
00252 
00253 int cdl_displayFITS(CDLPtr cdl, char *fname, int frame, int fbconfig, int zscale);
00254 int cdl_isFITS(char *fname);
00255 int cdl_readFITS(char *fname, uchar **pix, int *nx, int *ny, int *bitpix,
00256 char *title);
00257 
00258 int cdl_displayIRAF(CDLPtr cdl, char *fname, int band, int frame, int
00259 fbconfig, int zscale);
00260 int cdl_isIRAF(char *fname);
00261 int cdl_readIRAF(char *fname, int band, uchar **pix, int *nx, int *ny, int *bitpix, char *title);
00262 
00263 
00264 }
00265 
00266 
00267 #ifdef CDL_LIBRARY_SOURCE
00268 #include "cdlProto.h"
00269 #endif
00270 
00271 /* _CDL_Defined */
00272 #endif

Generated at Tue Oct 22 12:41:53 2002 for maskdesign by doxygen1.2.8.1 written by Dimitri van Heesch, © 1997-2001