casa  5.7.0-16
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
PSPixelCanvas.h
Go to the documentation of this file.
1 //# PSPixelCanvas.h: implementation of PixelCanvas for PostScript devices
2 //# Copyright (C) 1999,2000,2001,2002,2003
3 //# Associated Universities, Inc. Washington DC, USA.
4 //#
5 //# This library is free software; you can redistribute it and/or modify it
6 //# under the terms of the GNU Library General Public License as published by
7 //# the Free Software Foundation; either version 2 of the License, or (at your
8 //# option) any later version.
9 //#
10 //# This library is distributed in the hope that it will be useful, but WITHOUT
11 //# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
12 //# FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library General Public
13 //# License for more details.
14 //#
15 //# You should have received a copy of the GNU Library General Public License
16 //# along with this library; if not, write to the Free Software Foundation,
17 //# Inc., 675 Massachusetts Ave, Cambridge, MA 02139, USA.
18 //#
19 //# Correspondence concerning AIPS++ should be addressed as follows:
20 //# Internet email: aips2-request@nrao.edu.
21 //# Postal address: AIPS++ Project Office
22 //# National Radio Astronomy Observatory
23 //# 520 Edgemont Road
24 //# Charlottesville, VA 22903-2475 USA
25 //#
26 //# $Id$
27 
28 #ifndef TRIALDISPLAY_PSPIXELCANVAS_H
29 #define TRIALDISPLAY_PSPIXELCANVAS_H
30 
31 #include <casa/aips.h>
32 #include <casa/Arrays/Vector.h>
33 #include <casa/Arrays/Matrix.h>
41 #include <display/Display/DLFont.h>
42 
43 namespace casa { //# NAMESPACE CASA - BEGIN
44 
45 // <summary>
46 // Implementation of the PixelCanvas for PostScript devices.
47 // </summary>
48 //
49 // <prerequisite>
50 // <ol>
51 // <li> <linkto class="PixelCanvas">PixelCanvas</linkto>
52 // <li> <linkto class="PSPixelCanvasColorTable">PSPixelCanvasColorTable</linkto>
53 // <li> <linkto class="PSDriver">PSDriver</linkto>
54 // </ol>
55 // </prerequisite>
56 // <use visibility=export>
57 //
58 // <etymology>
59 // PSPixelCanvas is a mechanism for drawing on paper.
60 // </etymology>
61 //
62 
63 //
64 // <motivation>
65 // </motivation>
66 //
67 // <synopsis>
68 // PSPixelCanvas implements <linkto class="PixelCanvas">PixelCanvas</linkto>
69 // for PostScript output. See
70 // <linkto class="PSPixelCanvas#Example">Example</linkto> for example
71 // usage.
72 // </synopsis>
73 
74 //<a name="Example"></a>
75 // <example>
76 // <ol>
77 // <li> Create an output stream.
78 // <li> Create a PSDriver choosing a page type (letter, A4, etc.).
79 // (PSDriver can take a filename as an argument instead of an ostream).
80 // See: <linkto class="PSDriver#Synopsis">PSDriver</linkto> for more on
81 // creating PSDrivers..
82 // <li> Create PSPixelCanvasColorTable
83 // <li> Create PSPixelCanvas
84 // <li> Draw something pretty.
85 // <li> Delete everything and close the stream.
86 // <note role=tip>Neither PSPixelCanvasColorTable nor PSPixelCanvas delete
87 // their PSDriver.</note>
88 // </ol>
89 // <srcblock>
90 //
91 // PSDriver *psd = new PSDriver("test.ps", PSDriver::LETTER);
92 // PSPixelCanvasColorTable *pscct = new PSPixelCanvasColorTable(psd);
93 // PSPixelCanvas psc = new PSPixelCanvas( psd, pscct);
94 // ... (a miracle happens).
95 // delete psc;
96 // delete pscct;
97 // delete psd;
98 // </srcblock>
99 //
100 // <note role=tip>Since PostScript does not deal in in pixels, PSPixelCanvas
101 // assumes an adjustable number of pixels per inch. (Currently 1200dpi).
102 // Use the setResolution function to change this if the calling progam
103 // can't handle a 128M pixel display.</note>
104 // </example>
105 //
106 // <todo>
107 // <ol>
108 // <li> Lots of 'get' functions. Some don't make sense for PostScript.
109 // Others haven't been done yet.
110 // <li> Events.
111 // <li> Partial support for X11 color names is hacked in. Doing it
112 // 'correctly' would require changing the constructors.
113 // <li> No display list support.
114 // <li> Foreground/background/clear color support is in. However, these
115 // and many other routines don't really support RGB mode yet.
116 // <li> See: <linkto class="PSDriver#ToDo">PSDriver</linkto> for another list.
117 // </ol>
118 // </todo>
119  class PSPixelCanvas : public PixelCanvas {
120  public:
122  virtual ~PSPixelCanvas();
123 
124  // enabling/disabling of event tracking
125  // <group>
126  virtual void enableMotionEvents();
127  virtual void disableMotionEvents();
128  virtual void enablePositionEvents();
129  virtual void disablePositionEvents();
130  // </group>
131 
132  // Does this canvas support cached display lists? The user of the
133  // canvas should always check this, because undefined behaviour can
134  // result when an attempt is made to use a list on a PixelCanvas
135  // which does not support lists.
137  return false;
138  }
139 
140  // begin caching display commands - return list ID
141  virtual casacore::uInt newList();
142  // end caching display commands
143  virtual void endList();
144  // (Cacheable) recall cached display commands
145  virtual void drawList(casacore::uInt list);
146  // translate all lists
147  virtual void translateAllLists(casacore::Int xt, casacore::Int yt);
148  // translate the list
149  virtual void translateList(casacore::uInt list, casacore::Int xt, casacore::Int yt);
150  // remove list from cache
151  virtual void deleteList(casacore::uInt list);
152  // flush all lists from the cache
153  virtual void deleteLists();
154  // return true if the list exists
156 
157  // (Cacheable) Set the font to the PostScript font name and size.
158  virtual casacore::Bool setFont(const casacore::String &fontName, const casacore::Int size);
159  virtual casacore::Bool setFont(DLFont* font) {
160  return setFont(font->getPSValue(), font->getSize());
161  }
162 
163  // (Cacheable) Set the font to the PostScript font name.
164  virtual casacore::Bool setFont(const casacore::String &fontName);
165  // (Cacheable) Draw text using that font aligned in some way to the
166  // position
167  virtual void drawText(casacore::Int x, casacore::Int y, const casacore::String &text,
169  virtual void drawText(casacore::Int x, casacore::Int y, const casacore::String &text, const casacore::Float& angle,
171  // (Cacheable) Draw an array of 2D color data as a raster image for zoom = <1,1>
172  // <group>
178  // </group>
179  // <group>
180  // Draw a 2D color image with masking.
181  // (opaqueMask ignored; (unfortunately,) PSPixelcanvas always draws
182  // _opaque_ masks).
183  virtual void drawImage(const casacore::Int &x, const casacore::Int &y,
186  casacore::Bool opaqueMask=false);
187  // </group>
188 
189  // (Cacheable) Draw an array of 2D color data as a raster image for any positive integer zoom
190  // <group>
192  casacore::uInt xzoom, casacore::uInt yzoom);
194  casacore::uInt xzoom, casacore::uInt yzoom);
196  casacore::uInt xzoom, casacore::uInt yzoom);
198  casacore::uInt xzoom, casacore::uInt yzoom);
200  casacore::uInt xzoom, casacore::uInt yzoom);
201  // </group>
202 
203  // (Cacheable) Draw a component of a multi-channel image, storing it
204  // in buffers until flushComponentImages() is called.
205  virtual void drawImage(const casacore::Matrix<casacore::uInt> &data, const casacore::Int &x, const casacore::Int &y,
206  const Display::ColorComponent &colorcomponent);
207 
208  // Fill one of the channel buffers.
210  const casacore::Int &x, const casacore::Int &y,
211  const Display::ColorComponent &colorcomponent);
212 
213  // (NOT CACHEABLE!) Flush the component buffers.
214  void flushComponentBuffers();
215 
216  // (Cacheable) Draw a single point using current color
217  // <group>
218  virtual void drawPoint(casacore::Int x1, casacore::Int y1);
219  virtual void drawPoint(casacore::Float x1, casacore::Float y1);
220  virtual void drawPoint(casacore::Double x1, casacore::Double y1);
221  // </group>
222 
223  // (Cacheable) Draw N points specified as a Nx2 matrix
224  // <group>
225  virtual void drawPoints(const casacore::Matrix<casacore::Int> &verts);
226  virtual void drawPoints(const casacore::Matrix<casacore::Float> &verts);
227  virtual void drawPoints(const casacore::Matrix<casacore::Double> &verts);
228  // </group>
229 
230  // (Cacheable) Draw a bunch of points using current color
231  // <group>
234  virtual void drawPoints(const casacore::Vector<casacore::Double> &x1,
236  // </group>
237 
238  // (Cacheable) Draw a single line using current color
239  // <group>
240  virtual void drawLine(casacore::Int x1, casacore::Int y1, casacore::Int x2, casacore::Int y2);
243  // </group>
244 
245  // (Cacheable) Draw N/2 lines from an Nx2 matrix
246  // <group>
247  virtual void drawLines(const casacore::Matrix<casacore::Int> &verts);
248  virtual void drawLines(const casacore::Matrix<casacore::Float> &verts);
249  virtual void drawLines(const casacore::Matrix<casacore::Double> &verts);
250  // </group>
251 
252  // (Cacheable) Draw a bunch of unrelated lines using current color
253  // <group>
260  // </group>
261 
262  // (Cacheable) Draw a single connected line between the points given
263  // <group>
265  virtual void drawPolyline(const casacore::Vector<casacore::Float> &x1,
267  virtual void drawPolyline(const casacore::Vector<casacore::Double> &x1,
269  // </group>
270  // <group>
272  const int close=0, const int fill=0);
273  virtual void drawPolylines(const casacore::Vector<casacore::Float> &x1,
275  const int close=0, const int fill=0);
276  virtual void drawPolylines(const casacore::Vector<casacore::Double> &x1,
278  const int close=0, const int fill=0);
279  // </group>
280 
281  // (Cacheable) Draw N-1 connected lines from Nx2 matrix of vertices
282  // <group>
283  virtual void drawPolyline(const casacore::Matrix<casacore::Int> &verts);
284  virtual void drawPolyline(const casacore::Matrix<casacore::Float> &verts);
285  virtual void drawPolyline(const casacore::Matrix<casacore::Double> &verts);
286  // </group>
287 
288  // (Cacheable) Draw N-1 connected lines from Nx2 matrix of vertices
289  // <group>
290  virtual void drawPolylines(const casacore::Matrix<casacore::Int> &verts,
291  const int close=0, const int fill=0);
292  virtual void drawPolylines(const casacore::Matrix<casacore::Float> &verts,
293  const int close=0, const int fill=0);
294  virtual void drawPolylines(const casacore::Matrix<casacore::Double> &verts,
295  const int close=0, const int fill=0);
296  // </group>
297 
298  // (Cacheable) Draw a closed polygon
299  // <group>
302  virtual void drawPolygon(const casacore::Vector<casacore::Double> &x1,
304  // </group>
305 
306  // (Cacheable) Draw and fill a closed polygon
307  // <group>
308  virtual void drawFilledPolygon(const casacore::Vector<casacore::Int> &x1,
314  // </group>
315 
316  // (Cacheable) Draw a closed N-sided polygon from Nx2 matrix of vertices
317  // <group>
318  virtual void drawPolygon(const casacore::Matrix<casacore::Int> &verts);
319  virtual void drawPolygon(const casacore::Matrix<casacore::Float> &verts);
320  virtual void drawPolygon(const casacore::Matrix<casacore::Double> &verts);
321  // </group>
322 
323  // (Cacheable) Draw a rectangle
324  // <group>
325  virtual void drawRectangle(casacore::Int x1, casacore::Int y1, casacore::Int x2, casacore::Int y2, const int fill);
327  const int fill);
329  const int fill);
330  // </group>
331 
332  // (Cacheable) Draw a rectangle
333  // <group>
337  // </group>
338 
339  // (Cacheable) Draw a filled rectangle
340  // <group>
344  casacore::Double y2);
345  // </group>
346 
347  // (Cacheable) Draw a set of points, specifying a color per point to be drawn.
348  // <group>
349  virtual void drawColoredPoints(const casacore::Vector<casacore::Int> &x1,
351  const casacore::Vector<casacore::uInt> &colors);
354  const casacore::Vector<casacore::uInt> &colors);
357  const casacore::Vector<casacore::uInt> &colors);
358  virtual void drawColoredPoints(const casacore::Matrix<casacore::Int> &xy,
359  const casacore::Vector<casacore::uInt> &colors);
361  const casacore::Vector<casacore::uInt> &colors);
363  const casacore::Vector<casacore::uInt> &colors);
364  // </group>
365 
366  // (Cacheable) Draw a set of lines, specifying a color per line to be drawn.
367  // <group>
368  virtual void drawColoredLines(const casacore::Vector<casacore::Int> &x1,
372  const casacore::Vector<casacore::uInt> &colors);
377  const casacore::Vector<casacore::uInt> &colors);
382  const casacore::Vector<casacore::uInt> &colors);
383  // </group>
384 
385  // Set Graphics Attributes
386  // Options for functions with enum argument
387  // listed in <linkto class=Display>DisplayEnums</linkto>
388  // <group>
389  virtual void setDrawFunction(Display::DrawFunction function);
390  virtual void setForeground(casacore::uLong color);
391  virtual void setBackground(casacore::uLong color);
392  //virtual void setLineWidth(casacore::uInt width);
393  virtual void setLineWidth(casacore::Float width);
395  float lineWidth()const {
396  return lineWidth_;
397  }
398  virtual void setLineStyle(Display::LineStyle style);
399  virtual void setCapStyle(Display::CapStyle style);
400  virtual void setJoinStyle(Display::JoinStyle style);
401  virtual void setFillStyle(Display::FillStyle style);
402  virtual void setFillRule(Display::FillRule rule);
403  virtual void setArcMode(Display::ArcMode mode);
404  // </group>
405 
406  // Get Graphics Attributes
407  // <group>
408  virtual Display::DrawFunction getDrawFunction() const;
409  virtual casacore::uLong getForeground() const;
410  virtual casacore::uLong getBackground() const;
411  //#virtual casacore::uInt getLineWidth() const;
412  virtual casacore::Float getLineWidth() const;
413  virtual Display::LineStyle getLineStyle() const;
414  virtual Display::CapStyle getCapStyle() const;
415  virtual Display::JoinStyle getJoinStyle() const;
416  virtual Display::FillStyle getFillStyle() const;
417  virtual Display::FillRule getFillRule() const;
418  virtual Display::ArcMode getArcMode() const;
419  // </group>
420 
421  // (Cacheable) Option Control
422  // Options listed in <linkto class=Display>DisplayEnums</linkto>
423  // <group>
424  virtual casacore::Bool enable(Display::Option option);
425  virtual casacore::Bool disable(Display::Option option);
426  // </group>
427 
428  // Control the image-caching strategy
429  virtual void setImageCacheStrategy(Display::ImageCacheStrategy strategy);
431 
432  // (Cacheable) Setup the clip window. The clip window, when enabled, allows
433  // a user to clip all graphics output to a rectangular region on
434  // the screen.
435  // Once set, it is only possible to REDUCE the size of the current clip
436  // window, not increase it.
437  // <group>
439  virtual void getClipWindow(casacore::Int &x1, casacore::Int &y1, casacore::Int &x2, casacore::Int &y2);
440  // </group>
441 
442  // (Not Cacheable) Redraw the window
443  // <group>
444  virtual void refresh(const Display::RefreshReason &reason =
446  const casacore::Bool &explicitrequest = true);
447  // </group>
448 
449  // Cause display to flush any graphics commands not yet drawn
450  virtual void flush();
451 
452  // (Cacheable) Clear the window using the background color
453  // <group>
454  virtual void clear();
455  virtual void clear(casacore::Int x1, casacore::Int y1, casacore::Int x2, casacore::Int y2);
456  // </group>
457 
458  // (Cacheable) Set the color to use for clearing the display
459  // <group>
460  virtual void setClearColor(casacore::uInt colorIndex);
461  virtual void setClearColor(const casacore::String &colorname);
462  virtual void setClearColor(float r, float g, float b);
463  // </group>
464 
465  // (Not Cacheable) Get the current color to use for clearing the display.
466  virtual casacore::uInt clearColor() const;
467  virtual void getClearColor(float &r, float &g, float &b) const;
468 
469  // Return the width of the PSPixelCanvas in pixels
470  virtual casacore::uInt width() const;
471  // Return the height of the PSPixelCanvas in pixels
472  virtual casacore::uInt height() const;
473  // Return the depth of the PSPixelCanvas in bits
474  virtual casacore::uInt depth() const;
475 
476  // Get the pixel density (in dots per inch [dpi]) of the PixelCanvas
477  virtual void pixelDensity(casacore::Float &xdpi, casacore::Float &ydpi) const;
478 
479  // (Cacheable) Set current color (works in RGB or colormap mode)
480  // <group>
481  virtual void setColor(casacore::uInt colorIndex);
482  virtual void setColor(const casacore::String &colorname);
483  virtual void setRGBColor(float r, float g, float b);
484  virtual void setHSVColor(float h, float s, float v);
485  // </group>
486 
487  // (Not Cacheable) Returns the current color as a color index
488  virtual casacore::uInt color() const;
489 
490  // (Not Cacheable) Retuns the current color as an RGB triple
491  virtual void getColor(float &r, float &g, float &b) const;
492  virtual casacore::Bool getColorComponents(const casacore::String &colorname,
494  // (Not Cacheable) Get color index value (works in RGB or colormap mode)
495  // <group>
497  virtual casacore::Bool getRGBColor(casacore::Int x, casacore::Int y, float &r, float &g, float &b);
498  virtual casacore::Bool getHSVColor(casacore::Int x, casacore::Int y, float &h, float &s, float &v);
499  // </group>
500  // Get/set the current foreground/background colors. These colors
501  // should be used when the special Strings "foreground" and "background"
502  // are given for a color.
503  // <group>
504  virtual void setDeviceForegroundColor(const casacore::String colorname);
505  virtual casacore::String deviceForegroundColor() const;
506  virtual void setDeviceBackgroundColor(const casacore::String colorname);
507  virtual casacore::String deviceBackgroundColor() const;
508  // </group>
509 
510  // <group>
511  // (Not Cacheable) resize request. returns true if window was resized.
512  // Will refresh if doCallbacks is true.
513  virtual casacore::Bool resize(casacore::uInt reqXSize, casacore::uInt reqYSize, casacore::Bool doCallbacks = true);
514 
515  // (Not Cacheable) resize the colortable by requesting a new number of cells
517 
518  // (Not Cacheable) resize the colortable by requesting a new RGB/HSV cube
520 
521  // Need a mechanism to return the PSPixelCanvasColorTable so
522  // drawing functions within classes can operate.
523  virtual PixelCanvasColorTable * pcctbl() const;
524 
525  virtual void setPcctbl(PixelCanvasColorTable * pcctbl);
527  return pcct_;
528  }
529  // </group>
530 
531  // save/restore the current translation. This is called pushMatrix because
532  // eventually we may want scaling or rotation to play a modest
533  // role here.
534  // <group>
535  virtual void pushMatrix();
536  virtual void popMatrix();
537  // </group>
538  // zero the current translation
539  virtual void loadIdentity();
540 
541  // translation functions
542  // translate applies a relative translation to the current matrix and
543  // can be used to position graphics. Together with pushMatrix and
544  // popMatrix it can be used to build heirarchical scenes.
545  // <group>
546  virtual void translate(casacore::Int xt, casacore::Int yt);
547  virtual void getTranslation(casacore::Int &xt, casacore::Int &yt) const;
548  virtual casacore::Int xTranslation() const;
549  virtual casacore::Int yTranslation() const;
550  // </group>
551 
552  // (Not cacheable) set the draw buffer
553  // None of the buffer routines are supported.
554  virtual void setDrawBuffer(Display::DrawBuffer buf);
555  // buffer memory exchanges
556  // (Not cacheable)
557  // <group>
558  virtual void copyBackBufferToFrontBuffer();
559  virtual void copyFrontBufferToBackBuffer();
560  virtual void swapBuffers();
561  // </group>
562 
563  // partial buffer memory exchanges. (x1,y1 are blc, x2,y2 are trc)
564  // <group>
568  // </group>
569 
570 //# ////////////////////////////////////////////////////////////////
571  // PSPixelCanvas specific misc. functions.
572 
573 //# // Converts from "pixels" to points.
574 //# //<group>
575 //# inline float xToPoints(const double x)const{return (float)(x*xppp_);}
576 //# inline float yToPoints(const double y)const{return (float)(y*yppp_);}
577 //# //</group>
578 //# // Convert from points to pixels.
579 //# //<group>
580 //# inline double pointsToX(const float x)const{return (double)(x/xppp_);}
581 //# inline double pointsToY(const float y)const{return (double)(y/yppp_);}
582 //# //</group>
583 
584  // Draw a scaled image on PostScript canvas.
585  void drawPSImage(const int x, const int y,
586  const int iwidth, const int iheight,
587  const float xzoom, const float yzoom,
588  const casacore::uShort *data, const int bpc,
590  // Set/get declared resolution in pixels per supplied dimension.
591 //<group>
592  void setResolution(const float xres, const float yres,
594  void getResolution(float &xres, float &yres,
596 //</group>
597  // Whether to enable pixel interpolation for drawImage().
598 //<group>
599  void smooth(const casacore::Bool smth) {
600  smooth_ = smth;
601  }
603  return smooth_;
604  }
605 //</group>
606  // Whether to put tracing comments in the output.
607 //<group>
609  return annotate_;
610  }
611  void annotate(const casacore::Bool a) {
612  annotate_ = a;
613  }
614 //</group>
615 
616  virtual casacore::Float pixelScaling() const;
617 
618 //# ////////////////////////////////////////////////////////////////
619 
620  protected:
621 
622 
623  private:
625  void clearRectangle(const float x0, const float y0,
626  const float x1, const float y1);
627 // Used in annotating output file.
628 //<group>
629  void note(const char *);
630  void note(const char *, const casacore::uLong);
631 //</group>
632  private:
635  float xppp_, yppp_; // # Of points per pixel.
636  float lineWidth_;
645  // Color indexes the three colors we know about.
647  float xt_, yt_;
653  // Component support
657  casacore::uShort *itsComponents; // Length = 3*width*height.
658  };
659 
660 
661 } //# NAMESPACE CASA - END
662 
663 #endif
void annotate(const casacore::Bool a)
virtual void refresh(const Display::RefreshReason &reason=Display::UserCommand, const casacore::Bool &explicitrequest=true)
(Not Cacheable) Redraw the window
virtual void drawFilledRectangle(casacore::Int x1, casacore::Int y1, casacore::Int x2, casacore::Int y2)
(Cacheable) Draw a filled rectangle
Display::FillRule fillRule_
A class designed to manage several representations of the same font.
Definition: DLFont.h:70
int Int
Definition: aipstype.h:50
virtual casacore::uInt newList()
begin caching display commands - return list ID
virtual void enableMotionEvents()
enabling/disabling of event tracking
virtual Display::ImageCacheStrategy imageCacheStrategy() const
Abstract interface to underlying graphics library&#39;s colortable.
virtual casacore::uInt depth() const
Return the depth of the PSPixelCanvas in bits.
virtual void drawImage(const casacore::Matrix< casacore::uInt > &data, casacore::Int x, casacore::Int y)
(Cacheable) Draw an array of 2D color data as a raster image for zoom = &lt;1,1&gt;
virtual void drawPolyline(const casacore::Vector< casacore::Int > &x1, const casacore::Vector< casacore::Int > &y1)
(Cacheable) Draw a single connected line between the points given
virtual casacore::Bool getColorComponents(const casacore::String &colorname, casacore::Float &r, casacore::Float &g, casacore::Float &b)
Get color components in range 0 to 1 without actually allocating the color.
virtual void setBackground(casacore::uLong color)
virtual void setRGBColor(float r, float g, float b)
virtual void swapBuffers()
casacore::Bool clipEnabled_
LatticeExprNode mask(const LatticeExprNode &expr)
This function returns the mask of the given expression.
virtual void getColor(float &r, float &g, float &b) const
(Not Cacheable) Retuns the current color as an RGB triple
virtual void copyBackBufferToFrontBuffer()
buffer memory exchanges (Not cacheable)
void bufferComponent(const casacore::Matrix< casacore::uInt > &data, const casacore::Int &x, const casacore::Int &y, const Display::ColorComponent &colorcomponent)
Fill one of the channel buffers.
virtual casacore::Bool validList(casacore::uInt list)
return true if the list exists
virtual casacore::uLong getBackground() const
virtual void disablePositionEvents()
virtual casacore::uInt width() const
Return the width of the PSPixelCanvas in pixels.
virtual void setJoinStyle(Display::JoinStyle style)
TextAlign
Text Alignment.
Definition: DisplayEnums.h:181
Low level interface between PSPixelCanvas{ColorTable} and PostScript.
Definition: PSDriver.h:109
virtual void setCapStyle(Display::CapStyle style)
virtual void setClipWindow(casacore::Int x1, casacore::Int y1, casacore::Int x2, casacore::Int y2)
(Cacheable) Setup the clip window.
Option
PixelCanvas Options.
Definition: DisplayEnums.h:290
virtual ~PSPixelCanvas()
virtual void setImageCacheStrategy(Display::ImageCacheStrategy strategy)
Control the image-caching strategy.
virtual casacore::Int yTranslation() const
virtual Display::LineStyle getLineStyle() const
virtual void translateList(casacore::uInt list, casacore::Int xt, casacore::Int yt)
translate the list
casacore::Float itsComponentY
virtual void setColor(casacore::uInt colorIndex)
(Cacheable) Set current color (works in RGB or colormap mode)
virtual casacore::uInt clearColor() const
(Not Cacheable) Get the current color to use for clearing the display.
virtual PixelCanvasColorTable * pcctbl() const
Need a mechanism to return the PSPixelCanvasColorTable so drawing functions within classes can operat...
virtual void drawColoredPoints(const casacore::Vector< casacore::Int > &x1, const casacore::Vector< casacore::Int > &y1, const casacore::Vector< casacore::uInt > &colors)
(Cacheable) Draw a set of points, specifying a color per point to be drawn.
DrawBuffer
PixelCanvas target drawing destination.
Definition: DisplayEnums.h:211
virtual void setDrawBuffer(Display::DrawBuffer buf)
(Not cacheable) set the draw buffer None of the buffer routines are supported.
void clearRectangle(const float x0, const float y0, const float x1, const float y1)
void note(const char *)
Used in annotating output file.
casacore::Bool smooth_
virtual void translateAllLists(casacore::Int xt, casacore::Int yt)
translate all lists
FillRule
Fill Rule Xlib programming guide, pg.132.
Definition: DisplayEnums.h:165
Display::FillStyle fillStyle_
virtual void setDeviceBackgroundColor(const casacore::String colorname)
void pspcinit(PSDriver *ps, PSPixelCanvasColorTable *)
casacore::uLong itsComponentHeight
casacore::uLong background_
virtual void setLineStyle(Display::LineStyle style)
virtual void copyFrontBufferToBackBuffer()
size_t size() const
Implementation of the PixelCanvas for PostScript devices.
casacore::Int getSize()
Return the current font as a post-script recognisable name casacore::String getPSValueNoSize();.
casacore::Bool annotate_
Base class defining interface to pixel-based output devices.
Definition: PixelCanvas.h:161
virtual casacore::Float pixelScaling() const
ABSTRACT CLASSES Deliberately vague to be general enough to allow for many different types of data
Definition: PlotData.h:48
virtual casacore::Bool setFont(DLFont *font)
TODO: These should become abstract Set the font via the DisplayLibrary Font class.
CapStyle
Controls the appearance of thick lines near their endpoints.
Definition: DisplayEnums.h:130
reference point aligned to center of text
Definition: DisplayEnums.h:183
virtual void setFillRule(Display::FillRule rule)
virtual void drawLines(const casacore::Matrix< casacore::Int > &verts)
(Cacheable) Draw N/2 lines from an Nx2 matrix
virtual void drawPolylines(const casacore::Vector< casacore::Int > &x1, const casacore::Vector< casacore::Int > &y1, const int close=0, const int fill=0)
virtual void drawList(casacore::uInt list)
(Cacheable) recall cached display commands
ColorComponent
Color components.
Definition: DisplayEnums.h:84
virtual void setArcMode(Display::ArcMode mode)
virtual void setClearColor(casacore::uInt colorIndex)
(Cacheable) Set the color to use for clearing the display
Display::LineStyle lineStyle_
casacore::Bool annotate() const
Whether to put tracing comments in the output.
virtual void getTranslation(casacore::Int &xt, casacore::Int &yt) const
virtual void flush()
Cause display to flush any graphics commands not yet drawn.
virtual casacore::Bool supportsLists()
Does this canvas support cached display lists? The user of the canvas should always check this...
virtual void drawFilledPolygon(const casacore::Vector< casacore::Int > &x1, const casacore::Vector< casacore::Int > &y1)
(Cacheable) Draw and fill a closed polygon
casacore::uShort * itsComponents
double Double
Definition: aipstype.h:55
virtual void loadIdentity()
zero the current translation
PSPixelCanvasColorTable * PSpcctbl() const
virtual Display::FillStyle getFillStyle() const
virtual void setDeviceForegroundColor(const casacore::String colorname)
Get/set the current foreground/background colors.
void drawPSImage(const int x, const int y, const int iwidth, const int iheight, const float xzoom, const float yzoom, const casacore::uShort *data, const int bpc, const Display::ColorModel=Display::Index)
PSPixelCanvas specific misc.
virtual Display::JoinStyle getJoinStyle() const
bool Bool
Define the standard types used by Casacore.
Definition: aipstype.h:42
virtual void drawLine(casacore::Int x1, casacore::Int y1, casacore::Int x2, casacore::Int y2)
(Cacheable) Draw a single line using current color
virtual casacore::Bool setFont(const casacore::String &fontName, const casacore::Int size)
(Cacheable) Set the font to the PostScript font name and size.
virtual void getClipWindow(casacore::Int &x1, casacore::Int &y1, casacore::Int &x2, casacore::Int &y2)
virtual void enablePositionEvents()
void smooth(const casacore::Bool smth)
Whether to enable pixel interpolation for drawImage().
virtual void pixelDensity(casacore::Float &xdpi, casacore::Float &ydpi) const
Get the pixel density (in dots per inch [dpi]) of the PixelCanvas.
Display::ArcMode arcMode_
void flushComponentBuffers()
(NOT CACHEABLE!) Flush the component buffers.
float Float
Definition: aipstype.h:54
virtual casacore::uInt height() const
Return the height of the PSPixelCanvas in pixels.
Display::CapStyle capStyle_
virtual casacore::String deviceBackgroundColor() const
virtual casacore::Int xTranslation() const
casacore::Float itsComponentX
Component support.
virtual void setDrawFunction(Display::DrawFunction function)
Set Graphics Attributes Options for functions with enum argument listed in DisplayEnums.
virtual void drawPolygon(const casacore::Vector< casacore::Int > &x1, const casacore::Vector< casacore::Int > &y1)
(Cacheable) Draw a closed polygon
unsigned long uLong
Definition: aipstype.h:53
virtual casacore::Bool resizeColorTable(casacore::uInt newSize)
(Not Cacheable) resize the colortable by requesting a new number of cells
void setResolution(const float xres, const float yres, const PSDriver::Dimension=PSDriver::INCHES)
Set/get declared resolution in pixels per supplied dimension.
virtual void clear()
(Cacheable) Clear the window using the background color
casacore::Bool haveClipInfo_
virtual void drawText(casacore::Int x, casacore::Int y, const casacore::String &text, Display::TextAlign alignment=Display::AlignCenter)
(Cacheable) Draw text using that font aligned in some way to the position
FillStyle
Controls fill style.
Definition: DisplayEnums.h:152
virtual Display::DrawFunction getDrawFunction() const
Get Graphics Attributes.
Display::JoinStyle joinStyle_
casacore::uLong foreground_
Color indexes the three colors we know about.
RefreshReason
Callback reasons for PCRefreshEvent and WCRefreshEvent.
Definition: DisplayEnums.h:267
float lineWidth() const
virtual void pushMatrix()
save/restore the current translation.
virtual void setHSVColor(float h, float s, float v)
virtual void deleteList(casacore::uInt list)
remove list from cache
PSPixelCanvasColorTable * pcct_
virtual void popMatrix()
casacore::uLong itsComponentWidth
virtual void drawPoints(const casacore::Matrix< casacore::Int > &verts)
(Cacheable) Draw N points specified as a Nx2 matrix
virtual void setPcctbl(PixelCanvasColorTable *pcctbl)
virtual Display::ArcMode getArcMode() const
virtual void disableMotionEvents()
casacore::Bool smooth() const
ArcMode
Arc Mode.
Definition: DisplayEnums.h:173
virtual casacore::Bool enable(Display::Option option)
(Cacheable) Option Control Options listed in DisplayEnums
String: the storage and methods of handling collections of characters.
Definition: String.h:223
virtual void drawRectangle(casacore::Int x1, casacore::Int y1, casacore::Int x2, casacore::Int y2, const int fill)
(Cacheable) Draw a rectangle
virtual casacore::uInt color() const
(Not Cacheable) Returns the current color as a color index
virtual void drawPoint(casacore::Int x1, casacore::Int y1)
(Cacheable) Draw a single point using current color
virtual void setFillStyle(Display::FillStyle style)
ColorIndex mode.
Definition: DisplayEnums.h:76
virtual void getClearColor(float &r, float &g, float &b) const
ImageCacheStrategy
How to cache images when displaying them on client-server graphics systems.
Definition: DisplayEnums.h:297
void getResolution(float &xres, float &yres, const PSDriver::Dimension=PSDriver::INCHES) const
virtual void setForeground(casacore::uLong color)
DrawFunction
PixelCanvas Drawing Logical Functions.
Definition: DisplayEnums.h:227
virtual void setLineWidth(casacore::Float width)
virtual void setLineWidth(casacore::uInt width);
casacore::uLong clearColor_
virtual casacore::String deviceForegroundColor() const
virtual void translate(casacore::Int xt, casacore::Int yt)
translation functions translate applies a relative translation to the current matrix and can be used ...
virtual void deleteLists()
flush all lists from the cache
virtual casacore::Bool getHSVColor(casacore::Int x, casacore::Int y, float &h, float &s, float &v)
casacore::String defaultBackgroundColorName_
PSPixelCanvas(PSDriver *ps, PSPixelCanvasColorTable *)
virtual casacore::Bool disable(Display::Option option)
JoinStyle
Controls the appearance of two joined lines.
Definition: DisplayEnums.h:142
Implementation of PixelCanvasColorTable for PostScript device.
casacore::String getPSValue()
Return the current font as a PS recognisable name, with the specific size &#39;tagged onto&#39; the end of it...
virtual void endList()
end caching display commands
virtual casacore::Float getLineWidth() const
virtual casacore::uInt getLineWidth() const = 0;
ColorModel
Different ways of handling color on the display.
Definition: DisplayEnums.h:74
virtual casacore::Bool resize(casacore::uInt reqXSize, casacore::uInt reqYSize, casacore::Bool doCallbacks=true)
(Not Cacheable) resize request.
casacore::String defaultForegroundColorName_
unsigned int uInt
Definition: aipstype.h:51
User told PixelCanvas to refresh via PixelCanvas refresh()
Definition: DisplayEnums.h:269
virtual Display::CapStyle getCapStyle() const
casacore::Int itsComponentBPC
virtual void drawColoredLines(const casacore::Vector< casacore::Int > &x1, const casacore::Vector< casacore::Int > &y1, const casacore::Vector< casacore::Int > &x2, const casacore::Vector< casacore::Int > &y2, const casacore::Vector< casacore::uInt > &colors)
(Cacheable) Draw a set of lines, specifying a color per line to be drawn.
virtual casacore::uLong getForeground() const
LineStyle
Style of line to use.
Definition: DisplayEnums.h:119
unsigned short uShort
Definition: aipstype.h:49
virtual Display::FillRule getFillRule() const
virtual casacore::Bool getRGBColor(casacore::Int x, casacore::Int y, float &r, float &g, float &b)