29 """! Initialise the display
30 \param display The display object that we're providing the implementation for
31 \param frame an identifier for this display
32 \param verbose be chatty?
41 """!Close the display, cleaning up any allocated resources"""
43 print "virtual[%s]._close()" % (self.display.frame)
46 """!Enable or disable buffering of writes to the display
47 \param enable True or False, as appropriate
50 print "virtual[%s]._buffer(%s)" % (self.display.frame, enable)
52 def _dot(self, symb, c, r, size, ctype, *args, **kwargs):
53 """!Draw symbol a symbol at (c, r)
54 \param symb The desired symbol. See dot() for details
55 \param c (x) column position
56 \param r (y) row position
57 \param size Size of symbol, in pixels
58 \param ctype The desired colour, either e.g. afw.display.RED or a colour name known to X11
61 print "virtual[%s]._dot('%s', %.2f, %.2f, size=%g, ctype=%s, %s, %s)" % \
62 (self.display.frame, symb, c, r, size, ctype, args, kwargs)
65 """!Draw line defined by the list points
66 \param symb A list of 0-indexed positions (x, y)
67 \param ctype The desired colour, either e.g. afw.display.RED or a colour name known to X11
70 print "virtual[%s]._drawLines(%s, ctype=%s)" % (self.display.frame, points, ctype)
73 """!Erase all glyphs drawn on display
76 print "virtual[%s]._erase()" % (self.display.frame)
79 """!Flush any I/O buffers
82 print "virtual[%s]._flush()" % self.display.frame
86 print "setCallback %s -> %s" % (what, func)
89 """Return an event generated by a keypress or mouse click
91 from interface
import Event
95 print "virtual[%s]._getEvent() -> %s" % (self.display.frame, ev)
100 """Return the mask transparency for a display
103 print "virtual[%s]._getMaskTransparency()" % self.display.frame
105 def _mtv(self, image, wcs=None, mask=None, title=""):
106 """Display an image and maybe a mask overlay on a display
107 \param image afwImage.Image to display
108 \param mask afwImage.Mask to display
109 \param wcs A Wcs to associate with data
110 \param title Name to display with the data
113 print "virtual[%s]._mtv(image=%s, mask=%s, wcs=%s, title=\"%s\")" % \
114 (self.display.frame,
"Image" if image
else None,
115 "Mask" if mask
else None,
"Wcs" if wcs
else None, title)
118 """Set the transparency of a maskplane
119 \param transparency The desired transparency, in the range [0, 100]
120 \param maskplane The maskplane to set (None: all)
123 print "virtual[%s]._setMaskTransparency(%g, maskplane=\"%s\")" % (self.display.frame, transparency, maskplane)
125 def _scale(self, algorithm, min, max, unit=None, *args, **kwargs):
126 """Set the scaling from DN to displayed pixels
127 \param algorithm Scaling algorithm (e.g. linear)
128 \param min The minimum value of the stretch (or "zscale" or "minmax")
129 \param max The maximum value of the stretch
130 \param unit Units for min and max (e.g. Percent, Absolute, Sigma)
131 \param *args Optional arguments
132 \param **kwargs Optional keyword arguments
135 print "virtual[%s]._scale(%s, %s, %s, %s, %s, %s)" % (self.display.frame, algorithm,
136 min, max, unit, args, kwargs)
139 """Show the requested display
142 print "virtual[%s]._show()" % self.display.frame
145 """Pan to (colc, rowc)
146 \param c Desired column (x) position
147 \param r Desired row (y) position
150 print "virtual[%s]._pan(%.2f, %.2f)" % (self.display.frame, r, c)
154 \param zoomfac Zoom factor to use
157 print "virtual[%s]._zoom(%g)" % (self.display.frame, zoomfac)
def _flush
Flush any I/O buffers.
def _dot
Draw symbol a symbol at (c, r)
def __init__
Initialise the display.
A class to handle events such as key presses in image display windows.
def _buffer
Enable or disable buffering of writes to the display.
def _erase
Erase all glyphs drawn on display.
def _close
Close the display, cleaning up any allocated resources.
def _drawLines
Draw line defined by the list points.