casa  $Rev:20696$
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines
Public Member Functions | Protected Member Functions | Protected Attributes | Private Member Functions | Private Attributes
casa::PixelCanvas Class Reference

Base class defining interface to pixel-based output devices. More...

#include <PixelCanvas.h>

Inheritance diagram for casa::PixelCanvas:
casa::GLPixelCanvas casa::PSPixelCanvas

List of all members.

Public Member Functions

virtual ~PixelCanvas ()
void addRefreshEventHandler (const PCRefreshEH &eh)
 add event handlers
void addMotionEventHandler (const PCMotionEH &eh)
void addPositionEventHandler (const PCPositionEH &eh)
void removeRefreshEventHandler (const PCRefreshEH &eh)
 remove event handlers
void removeMotionEventHandler (const PCMotionEH &eh)
void removePositionEventHandler (const PCPositionEH &eh)
void callRefreshEventHandlers (Display::RefreshReason reason)
 call event handlers
void callMotionEventHandlers (Int x, Int y, uInt state)
void callPositionEventHandlers (Display::KeySym keysym, Bool keystate, Int x, Int y, uInt state)
virtual void enableMotionEvents ()=0
 enabling/disabling of event tracking
virtual void disableMotionEvents ()=0
virtual void enablePositionEvents ()=0
virtual void disablePositionEvents ()=0
virtual Bool supportsLists ()=0
 Does this canvas support cached display lists? The user of the canvas should always check this, because undefined behaviour can result when an attempt is made to use a list on a PixelCanvas which does not support lists.
virtual uInt newList ()=0
 begin caching display commands - return list ID
virtual void endList ()=0
 end caching display commands
virtual void drawList (uInt list)=0
 (Cacheable) recall cached display commands
virtual void translateAllLists (Int xt, Int yt)=0
 translate all lists
virtual void translateList (uInt list, Int xt, Int yt)=0
 translate the list
virtual void deleteList (uInt list)=0
 remove list from cache
virtual void deleteLists ()=0
 flush all lists from the cache
virtual Bool validList (uInt list)=0
 return True if the list exists
virtual Bool setFont (const String &fontName)=0
 (Cacheable) Set the font to the recognizable font name
virtual Bool setFont (DLFont *)
 TODO: These should become abstract Set the font via the DisplayLibrary Font class.
virtual Bool setFont (const String &, const Int)
 Set the font to font name / size.
virtual void drawText (Int x, Int y, const String &text, Display::TextAlign alignment=Display::AlignCenter)=0
 (Cacheable) Draw text using that font aligned in some way to the position
virtual void drawText (Int, Int, const String &, const Float &, Display::TextAlign=Display::AlignCenter)
 TODO This should become abstract - NYI in GLPixelCanvas currently Draw text at a specified angle.
virtual Int textWidth (const String &)
 TODO : This should become abstract Determine the width / height of a string of text based on current settings.
virtual Int textHeight (const String &)
virtual void drawImage (const Matrix< uInt > &data, Int x, Int y)=0
 (Cacheable) Draw an array of 2D color data as a raster image for zoom = <1,1>
virtual void drawImage (const Matrix< Int > &data, Int x, Int y)=0
virtual void drawImage (const Matrix< uLong > &data, Int x, Int y)=0
virtual void drawImage (const Matrix< Float > &data, Int x, Int y)=0
virtual void drawImage (const Matrix< Double > &data, Int x, Int y)=0
virtual void drawImage (const Int &, const Int &, const Matrix< uInt > &, const Matrix< Bool > &, Bool=False)
 (Cacheable) Draw an array of 2D color data as a raster image, taking note of the Bool mask.
virtual void drawImage (const Matrix< uInt > &data, Int x, Int y, uInt xzoom, uInt yzoom)=0
 (Cacheable) Draw an array of 2D color data as a raster image for any positive integer zoom
virtual void drawImage (const Matrix< Int > &data, Int x, Int y, uInt xzoom, uInt yzoom)=0
virtual void drawImage (const Matrix< uLong > &data, Int x, Int y, uInt xzoom, uInt yzoom)=0
virtual void drawImage (const Matrix< Float > &data, Int x, Int y, uInt xzoom, uInt yzoom)=0
virtual void drawImage (const Matrix< Double > &data, Int x, Int y, uInt xzoom, uInt yzoom)=0
virtual void drawImage (const Matrix< uInt > &data, const Int &x, const Int &y, const Display::ColorComponent &colorcomponent)=0
 (Cacheable) Draw a component of a multi-channel image, storing it in buffers until flushComponentImages() is called.
virtual void bufferComponent (const Matrix< uInt > &data, const Int &x, const Int &y, const Display::ColorComponent &colorcomponent)=0
 Fill one of the channel buffers.
virtual void flushComponentBuffers ()=0
 (NOT CACHEABLE!) Flush the component buffers.
virtual void drawPoint (Int x1, Int y1)=0
 (Cacheable) Draw a single point using current color
virtual void drawPoint (Float x1, Float y1)=0
virtual void drawPoint (Double x1, Double y1)=0
virtual void drawPoints (const Matrix< Int > &verts)=0
 (Cacheable) Draw N points specified as a Nx2 matrix
virtual void drawPoints (const Matrix< Float > &verts)=0
virtual void drawPoints (const Matrix< Double > &verts)=0
virtual void drawPoints (const Vector< Int > &x1, const Vector< Int > &y1)=0
 (Cacheable) Draw a bunch of points using current color
virtual void drawPoints (const Vector< Float > &x1, const Vector< Float > &y1)=0
virtual void drawPoints (const Vector< Double > &x1, const Vector< Double > &y1)=0
virtual void drawLine (Int x1, Int y1, Int x2, Int y2)=0
 (Cacheable) Draw a single line using current color
virtual void drawLine (Float x1, Float y1, Float x2, Float y2)=0
virtual void drawLine (Double x1, Double y1, Double x2, Double y2)=0
virtual void drawLines (const Matrix< Int > &verts)=0
 (Cacheable) Draw N/2 lines from an Nx2 matrix
virtual void drawLines (const Matrix< Float > &verts)=0
virtual void drawLines (const Matrix< Double > &verts)=0
virtual void drawLines (const Vector< Int > &x1, const Vector< Int > &y1, const Vector< Int > &x2, const Vector< Int > &y2)=0
 (Cacheable) Draw a bunch of unrelated lines using current color
virtual void drawLines (const Vector< Float > &x1, const Vector< Float > &y1, const Vector< Float > &x2, const Vector< Float > &y2)=0
virtual void drawLines (const Vector< Double > &x1, const Vector< Double > &y1, const Vector< Double > &x2, const Vector< Double > &y2)=0
virtual void drawPolyline (const Vector< Int > &x1, const Vector< Int > &y1)=0
 (Cacheable) Draw a single connected line between the points given
virtual void drawPolyline (const Vector< Float > &x1, const Vector< Float > &y1)=0
virtual void drawPolyline (const Vector< Double > &x1, const Vector< Double > &y1)=0
virtual void drawPolyline (const Matrix< Int > &verts)=0
 (Cacheable) Draw N-1 connected lines from Nx2 matrix of vertices
virtual void drawPolyline (const Matrix< Float > &verts)=0
virtual void drawPolyline (const Matrix< Double > &verts)=0
virtual void drawMarker (const Int &x1, const Int &y1, const Display::Marker &marker, const Int &pixelHeight)
 Draw a "marker".
virtual void drawMarker (const Float &x1, const Float &y1, const Display::Marker &marker, const Int &pixelHeight)
virtual void drawMarker (const Double &x1, const Double &y1, const Display::Marker &marker, const Int &pixelHeight)
virtual void drawPolygon (const Vector< Int > &x1, const Vector< Int > &y1)=0
 (Cacheable) Draw a closed polygon
virtual void drawPolygon (const Vector< Float > &x1, const Vector< Float > &y1)=0
virtual void drawPolygon (const Vector< Double > &x1, const Vector< Double > &y1)=0
virtual void drawFilledPolygon (const Vector< Int > &x1, const Vector< Int > &y1)=0
 (Cacheable) Draw and fill a closed polygon
virtual void drawFilledPolygon (const Vector< Float > &x1, const Vector< Float > &y1)=0
virtual void drawFilledPolygon (const Vector< Double > &x1, const Vector< Double > &y1)=0
virtual void drawPolygon (const Matrix< Int > &verts)=0
 (Cacheable) Draw a closed N-sided polygon from Nx2 matrix of vertices
virtual void drawPolygon (const Matrix< Float > &verts)=0
virtual void drawPolygon (const Matrix< Double > &verts)=0
virtual void drawRectangle (Int x1, Int y1, Int x2, Int y2)=0
 (Cacheable) Draw a rectangle
virtual void drawRectangle (Float x1, Float y1, Float x2, Float y2)=0
virtual void drawRectangle (Double x1, Double y1, Double x2, Double y2)=0
virtual void drawFilledRectangle (Int x1, Int y1, Int x2, Int y2)=0
 (Cacheable) Draw a filled rectangle
virtual void drawFilledRectangle (Float x1, Float y1, Float x2, Float y2)=0
virtual void drawFilledRectangle (Double x1, Double y1, Double x2, Double y2)=0
virtual void drawColoredPoints (const Vector< Int > &x1, const Vector< Int > &y1, const Vector< uInt > &colors)=0
 (Cacheable) Draw a set of points, specifying a color per point to be drawn.
virtual void drawColoredPoints (const Vector< Float > &x1, const Vector< Float > &y1, const Vector< uInt > &colors)=0
virtual void drawColoredPoints (const Vector< Double > &x1, const Vector< Double > &y1, const Vector< uInt > &colors)=0
virtual void drawColoredPoints (const Matrix< Int > &xy, const Vector< uInt > &colors)
virtual void drawColoredPoints (const Matrix< Float > &xy, const Vector< uInt > &colors)
virtual void drawColoredPoints (const Matrix< Double > &xy, const Vector< uInt > &colors)
virtual void drawColoredLines (const Vector< Int > &x1, const Vector< Int > &y1, const Vector< Int > &x2, const Vector< Int > &y2, const Vector< uInt > &colors)=0
 (Cacheable) Draw a set of lines, specifying a color per line to be drawn.
virtual void drawColoredLines (const Vector< Float > &x1, const Vector< Float > &y1, const Vector< Float > &x2, const Vector< Float > &y2, const Vector< uInt > &colors)=0
virtual void drawColoredLines (const Vector< Double > &x1, const Vector< Double > &y1, const Vector< Double > &x2, const Vector< Double > &y2, const Vector< uInt > &colors)=0
virtual void drawEllipse (const Float &cx, const Float &cy, const Float &smajor, const Float &sminor, const Float &pangle, Bool outline=True, Float xstretch=1., Float ystretch=1.)
 Draw a single ellipse using the current pen (ie.
virtual void drawColoredEllipses (const Matrix< Float > &centres, const Vector< Float > &smajor, const Vector< Float > &sminor, const Vector< Float > &pangle, const Vector< uInt > &colors, const Float &scale=1.0, const Bool &outline=True)
 Draw a set of colored ellipses, possibly with borders.
void bufferPoint (Float x, Float y)
 vector primitive buffering
void bufferLine (Float x1, Float y1, Float x2, Float y2)
void bufferPolylinePoint (Float x, Float y)
void bufferPolygonPoint (Float x, Float y)
void flushBuffer ()
virtual void setDrawFunction (Display::DrawFunction function)=0
 Set Graphics Attributes Options for functions with enum argument listed in DisplayEnums .
virtual void setForeground (uLong color)=0
virtual void setBackground (uLong color)=0
virtual void setLineWidth (Float width)=0
 virtual void setLineWidth(uInt width) = 0;
virtual void setLineStyle (Display::LineStyle style)=0
virtual void setCapStyle (Display::CapStyle style)=0
virtual void setJoinStyle (Display::JoinStyle style)=0
virtual void setFillStyle (Display::FillStyle style)=0
virtual void setFillRule (Display::FillRule rule)=0
virtual void setArcMode (Display::ArcMode mode)=0
virtual Display::DrawFunction getDrawFunction () const =0
 Get Graphics Attributes.
virtual uLong getForeground () const =0
virtual uLong getBackground () const =0
virtual Float getLineWidth () const =0
 virtual uInt getLineWidth() const = 0;
virtual Display::LineStyle getLineStyle () const =0
virtual Display::CapStyle getCapStyle () const =0
virtual Display::JoinStyle getJoinStyle () const =0
virtual Display::FillStyle getFillStyle () const =0
virtual Display::FillRule getFillRule () const =0
virtual Display::ArcMode getArcMode () const =0
virtual Bool enable (Display::Option option)=0
 (Cacheable) Option Control Options listed in DisplayEnums
virtual Bool disable (Display::Option option)=0
virtual void setImageCacheStrategy (Display::ImageCacheStrategy strategy)=0
 Control the image-caching strategy.
virtual Display::ImageCacheStrategy imageCacheStrategy () const =0
virtual void setClipWindow (Int x1, Int y1, Int x2, Int y2)=0
 (Cacheable) Setup the clip window.
virtual void getClipWindow (Int &x1, Int &y1, Int &x2, Int &y2)=0
void redraw ()
 (Not Cacheable) Redraw the window
virtual void refresh (const Display::RefreshReason &reason=Display::UserCommand, const Bool &explicitrequest=True)=0
virtual void flush ()=0
 Cause display to flush any graphics commands not yet drawn.
virtual void clear ()=0
 (Cacheable) Clear the window using the background color
virtual void clear (Int x1, Int y1, Int x2, Int y2)=0
virtual void setClearColor (uInt colorIndex)=0
 (Cacheable) Set the color to use for clearing the display
virtual void setClearColor (const String &colorname)=0
virtual void setClearColor (float r, float g, float b)=0
virtual uInt clearColor () const =0
 (Not Cacheable) Get the current color to use for clearing the display.
virtual void getClearColor (float &r, float &g, float &b) const =0
virtual void setDeviceForegroundColor (const String colorname)=0
 Get/set the current foreground/background colors.
virtual String deviceForegroundColor () const =0
virtual void setDeviceBackgroundColor (const String colorname)=0
virtual String deviceBackgroundColor () const =0
virtual uInt width () const =0
 Return the width of the PixelCanvas in pixels.
virtual uInt height () const =0
 Return the height of the PixelCanvas in pixels.
virtual uInt depth () const =0
 Return the depth of the PixelCanvas in bits.
virtual void pixelDensity (Float &xdpi, Float &ydpi) const =0
 Get the pixel density (in dots per inch [dpi]) of the PixelCanvas.
virtual void setColor (uInt colorIndex)=0
 (Cacheable) Set current color (works in RGB or colormap mode)
virtual void setColor (const String &colorname)=0
virtual void setRGBColor (float r, float g, float b)=0
virtual void setHSVColor (float h, float s, float v)
virtual Bool getColorComponents (const String &colorname, Float &r, Float &g, Float &b)=0
 Get color components in range 0 to 1 without actually allocating the color.
virtual uInt color () const =0
 (Not Cacheable) Returns the current color as a color index
virtual void getColor (float &r, float &g, float &b) const =0
 (Not Cacheable) Retuns the current color as an RGB triple
virtual Bool getColor (Int x, Int y, uInt &color)=0
 (Not Cacheable) Get color index value (works in RGB or colormap mode)
virtual Bool getRGBColor (Int x, Int y, float &r, float &g, float &b)=0
virtual Bool getHSVColor (Int x, Int y, float &h, float &s, float &v)
virtual Bool resize (uInt, uInt, Bool=True)
 (Not Cacheable) resize request.
virtual Bool resizeColorTable (uInt newSize)=0
 (Not Cacheable) resize the colortable by requesting a new number of cells
virtual Bool resizeColorTable (uInt nReds, uInt nGreens, uInt nBlues)=0
 (Not Cacheable) resize the colortable by requesting a new RGB/HSV cube
virtual PixelCanvasColorTablepcctbl () const =0
 Need a mechanism to return the PixelCanvasColorTable so drawing functions within classes can operate.
virtual void setPcctbl (PixelCanvasColorTable *pcctbl)=0
void setColormap (Colormap *map)
 (Not Cacheable) set/get the current colormap.
Colormapcolormap () const
Bool colormapRegistered ()
void registerColormap (Colormap *dcmap, Float weight=1.0)
 register a colormap to the pixelcanvas.
void registerColormap (Colormap *cmap, Colormap *cmapToReplace)
 Register the cmap Colormap on the PixelCanvas, replacing the cmapToReplace Colormap if possible.
void unregisterColormap (Colormap *dcmap)
 unregister a colormap from a pixelcanvas.
uInt getColormapSize () const
 return the size of the current colormap
void mapToColor (Array< uChar > &outArray, const Array< uChar > &inArray, Bool rangeCheck=False)
 map [0,N-1] into colorpixels, where N is the current colormap size The values are returned as unsigned integers in their respective array.
void mapToColor (Array< uShort > &outArray, const Array< uShort > &inArray, Bool rangeCheck=False)
void mapToColor (Array< uInt > &outArray, const Array< uInt > &inArray, Bool rangeCheck=False)
void mapToColor (Array< uLong > &outArray, const Array< uLong > &inArray, Bool rangeCheck=False)
void mapToColor (Array< uChar > &inOutArray, Bool rangeCheck=False)
 same as above except the matrix is operated on in place.
void mapToColor (Array< uShort > &inOutArray, Bool rangeCheck=False)
void mapToColor (Array< uInt > &inOutArray, Bool rangeCheck=False)
void mapToColor (Array< uLong > &inOutArray, Bool rangeCheck=False)
void mapToColor3 (Array< uLong > &out, const Array< Float > &chan1in, const Array< Float > &chan2in, const Array< Float > &chan3in)
 Multi-Channel functions that combine separate array channels into a single array of output colors for use with functions that take color values.
void mapToColor3 (Array< uLong > &out, const Array< Double > &chan1in, const Array< Double > &chan2in, const Array< Double > &chan3in)
virtual void mapToColor3 (Array< uLong > &out, const Array< uInt > &chan1in, const Array< uInt > &chan2in, const Array< uInt > &chan3in)
 This one maps values between 0 and the integer maximum value for each channel into a single output image suitable for PixelCanvas::drawImage.
virtual void pushMatrix ()=0
 save/restore the current translation.
virtual void popMatrix ()=0
virtual void loadIdentity ()=0
 zero the current translation
virtual void translate (Int xt, Int yt)=0
 translation functions translate applies a relative translation to the current matrix and can be used to position graphics.
virtual void getTranslation (Int &xt, Int &yt) const =0
virtual Int xTranslation () const =0
virtual Int yTranslation () const =0
Display::DrawBuffer drawBuffer () const
 return the drawing buffer, the target destination for graphics
virtual void setDrawBuffer (Display::DrawBuffer buf)=0
 (Not cacheable) set the draw buffer
virtual void copyBackBufferToFrontBuffer ()=0
 buffer memory exchanges (Not cacheable)
virtual void copyFrontBufferToBackBuffer ()=0
virtual void swapBuffers ()=0
virtual void copyBackBufferToFrontBuffer (Int x1, Int y1, Int x2, Int y2)=0
 partial buffer memory exchanges.
virtual void copyFrontBufferToBackBuffer (Int x1, Int y1, Int x2, Int y2)=0
virtual void swapBuffers (Int x1, Int y1, Int x2, Int y2)=0
Display::DrawMode drawMode () const
 return the drawmode (Compile or Draw) Compile drawmode means that a display list is currently being built Draw drawmode means that drawing commands are not cached but instead are sent to the display.
Display::ColorModel colorModel () const
 return the colorModel used for multichannel color
void setColorModel (Display::ColorModel colorModel)
 Set the input color model for multichannel color.
Bool refreshActive () const
 return True if the refresh is active (Added for X11PixelCanvas DefaultBuffer)
virtual Bool refreshAllowed () const
 return True if refresh is allowed right now...
virtual Float pixelScaling () const

Protected Member Functions

 PixelCanvas ()
 Abstract base class idiom.
 PixelCanvas (PixelCanvasColorTable *pcctbl)
void setDrawMode (Display::DrawMode mode)
 Only allowed by derived classes.
void setDrawBuffer_ (Display::DrawBuffer buf)
 Also allowed only by derived classes.

Protected Attributes

Bool defaultColormapActive_
 True if the PixelCanvas was the one who registered the existing colortable.

Private Member Functions

Matrix< FloatgetMarker (const Display::Marker &marker, const Float &pixelHeight)

Private Attributes

Colormapcolormap_
 This is the current colormap.
Display::DrawMode drawMode_
 This is the current drawing mode.
Display::DrawBuffer drawBuffer_
 The current drawing buffer.
Display::ColorModel colorModel_
 The current color cube model to be used for all multichannel color mapping.
Bool refreshActive_
 True if refresh is active.
uInt nRegisteredColormaps_
 Number of colormaps registered by external clients.
List< void * > refreshEHList_
 This is the list of registered refresh EventHandlers.
List< void * > motionEHList_
 This is the list of registered motion EventHandlers.
List< void * > positionEHList_
 This is the list of registered position EventHandlers.
PCVGBuffer vgbuf_
 The PCVGBuffer is used to accumulate lines and points until flushed (or the buffer is full)

Detailed Description

Base class defining interface to pixel-based output devices.

Prerequisite

Etymology

PixelCanvas is the mechanism for drawing on the screen.

Synopsis

The philosophy of the PixelCanvas is to provide flexible fast interface to an underlying graphics system in terms of integer pixel positions and color values. The interface should be as simple as possible and not demand complicated structures on its interface.

The PixelCanvas performs minimal management, leaving up to the derived classes for most of the work required to interface to the underlying graphics library. To make it flexible, the fundamental interface accepts pointers to arrays of all the scalar AIPS++ types. The Bool type is not acceptable at the PixelCanvas level because it cannot be used to represent a color index, as are the two complex number types.

To make it fast, a caching mechanism is used to allow display lists to be created in the format native to the underlying graphics library. The caching works like OpenGL display lists.

To create a display list:

  1. Call the function newList() which will return a list id. You need to store the returned id somewhere so that it may be recalled later.
  2. Perform some drawing commands. These commands are output-only commands that change the state of the PixelCanvas or draw some graphics or other function that affects the canvas.
  3. Call the function endList()

To recall the drawing commands:

  1. Call drawList(), passing the list id as the parameter

To delete the list, call deleteList(), with the id

The PixelCanvas maintains a translation stack which may be driven by calls to translate and calls to pushMatrix, popMatrix.

The translation stack is an effective way to draw the same graphic in different places:

    uInt myGraphic = newList();
    ..\.
    endList();
    Matrix m(n,2);
    for (uInt i = 0; i < n; i++)
      {
        pc->pushMatrix();
        pc->translate(m(i,0), m(i,1));
        pc->drawList(myGraphic);
        pc->popMatrix();
      }

Images are most correctly drawn through the following sequence of operations

  1. Obtain the size of the current colormap with getColormapSize()
  2. scale your data to fit in the range of [0,size-1];
  3. call mapToColor() to get a proper color image (which you may consider saving).
  4. call drawImage()

You may find that a class derived from WCDataScaleHandler , such as WCLinearScaleHandler may be useful in step #2 above.

mapToColor is also useful for transforming values that are associated with vector graphics as well (e.g., contour lines).

The PixelCanvas layer is quite thin. Most functionality is implemented in the derived classes.

Motivation

Want a generic interface to possibly a variety of graphics hardware types. Want base class to maintain callback lists

Example

see the Display test directory

Definition at line 157 of file PixelCanvas.h.


Constructor & Destructor Documentation

virtual casa::PixelCanvas::~PixelCanvas ( ) [virtual]

Abstract base class idiom.


Member Function Documentation

add event handlers

virtual void casa::PixelCanvas::bufferComponent ( const Matrix< uInt > &  data,
const Int x,
const Int y,
const Display::ColorComponent colorcomponent 
) [pure virtual]

Fill one of the channel buffers.

Implemented in casa::PSPixelCanvas, and casa::GLPixelCanvas.

void casa::PixelCanvas::bufferLine ( Float  x1,
Float  y1,
Float  x2,
Float  y2 
) [inline]

Definition at line 508 of file PixelCanvas.h.

References casa::PCVGBuffer::accumLine(), and vgbuf_.

void casa::PixelCanvas::bufferPoint ( Float  x,
Float  y 
) [inline]

vector primitive buffering

Definition at line 506 of file PixelCanvas.h.

References casa::PCVGBuffer::accumPoint(), and vgbuf_.

void casa::PixelCanvas::bufferPolygonPoint ( Float  x,
Float  y 
) [inline]

Definition at line 512 of file PixelCanvas.h.

References casa::PCVGBuffer::accumPolygonPoint(), and vgbuf_.

void casa::PixelCanvas::bufferPolylinePoint ( Float  x,
Float  y 
) [inline]

Definition at line 510 of file PixelCanvas.h.

References casa::PCVGBuffer::accumPolylinePoint(), and vgbuf_.

void casa::PixelCanvas::callPositionEventHandlers ( Display::KeySym  keysym,
Bool  keystate,
Int  x,
Int  y,
uInt  state 
)

call event handlers

virtual void casa::PixelCanvas::clear ( ) [pure virtual]

(Cacheable) Clear the window using the background color

Implemented in casa::PSPixelCanvas, and casa::GLPixelCanvas.

virtual void casa::PixelCanvas::clear ( Int  x1,
Int  y1,
Int  x2,
Int  y2 
) [pure virtual]
virtual uInt casa::PixelCanvas::clearColor ( ) const [pure virtual]

(Not Cacheable) Get the current color to use for clearing the display.

Implemented in casa::PSPixelCanvas, and casa::GLPixelCanvas.

virtual uInt casa::PixelCanvas::color ( ) const [pure virtual]

(Not Cacheable) Returns the current color as a color index

Implemented in casa::PSPixelCanvas, and casa::GLPixelCanvas.

Definition at line 670 of file PixelCanvas.h.

References colormap_.

Definition at line 671 of file PixelCanvas.h.

References colormap_, casa::PixelCanvasColorTable::member(), and pcctbl().

return the colorModel used for multichannel color

Definition at line 808 of file PixelCanvas.h.

References colorModel_.

virtual void casa::PixelCanvas::copyBackBufferToFrontBuffer ( ) [pure virtual]

buffer memory exchanges (Not cacheable)

Implemented in casa::PSPixelCanvas, and casa::GLPixelCanvas.

virtual void casa::PixelCanvas::copyBackBufferToFrontBuffer ( Int  x1,
Int  y1,
Int  x2,
Int  y2 
) [pure virtual]

partial buffer memory exchanges.

(x1,y1 are blc, x2,y2 are trc)

Implemented in casa::PSPixelCanvas, and casa::GLPixelCanvas.

virtual void casa::PixelCanvas::copyFrontBufferToBackBuffer ( ) [pure virtual]
virtual void casa::PixelCanvas::copyFrontBufferToBackBuffer ( Int  x1,
Int  y1,
Int  x2,
Int  y2 
) [pure virtual]
virtual void casa::PixelCanvas::deleteList ( uInt  list) [pure virtual]

remove list from cache

Implemented in casa::PSPixelCanvas, and casa::GLPixelCanvas.

virtual void casa::PixelCanvas::deleteLists ( ) [pure virtual]

flush all lists from the cache

Implemented in casa::PSPixelCanvas, and casa::GLPixelCanvas.

virtual uInt casa::PixelCanvas::depth ( ) const [pure virtual]

Return the depth of the PixelCanvas in bits.

Implemented in casa::PSPixelCanvas, and casa::GLPixelCanvas.

virtual String casa::PixelCanvas::deviceBackgroundColor ( ) const [pure virtual]
virtual String casa::PixelCanvas::deviceForegroundColor ( ) const [pure virtual]
virtual Bool casa::PixelCanvas::disable ( Display::Option  option) [pure virtual]
virtual void casa::PixelCanvas::disableMotionEvents ( ) [pure virtual]
virtual void casa::PixelCanvas::disablePositionEvents ( ) [pure virtual]

return the drawing buffer, the target destination for graphics

Definition at line 782 of file PixelCanvas.h.

References drawBuffer_.

virtual void casa::PixelCanvas::drawColoredEllipses ( const Matrix< Float > &  centres,
const Vector< Float > &  smajor,
const Vector< Float > &  sminor,
const Vector< Float > &  pangle,
const Vector< uInt > &  colors,
const Float scale = 1.0,
const Bool outline = True 
) [virtual]

Draw a set of colored ellipses, possibly with borders.

The x and y locations must given, along with semi-major and semi-minor axes, and position angle measured in degrees positive from the x axis in a counter-clockwise direction. The size of the ellipses is globally scaled by the scale factor, and if outline is True, then each ellipse will have an outline in the current pen color.

virtual void casa::PixelCanvas::drawColoredLines ( const Vector< Int > &  x1,
const Vector< Int > &  y1,
const Vector< Int > &  x2,
const Vector< Int > &  y2,
const Vector< uInt > &  colors 
) [pure virtual]

(Cacheable) Draw a set of lines, specifying a color per line to be drawn.

Implemented in casa::PSPixelCanvas, and casa::GLPixelCanvas.

virtual void casa::PixelCanvas::drawColoredLines ( const Vector< Float > &  x1,
const Vector< Float > &  y1,
const Vector< Float > &  x2,
const Vector< Float > &  y2,
const Vector< uInt > &  colors 
) [pure virtual]
virtual void casa::PixelCanvas::drawColoredLines ( const Vector< Double > &  x1,
const Vector< Double > &  y1,
const Vector< Double > &  x2,
const Vector< Double > &  y2,
const Vector< uInt > &  colors 
) [pure virtual]
virtual void casa::PixelCanvas::drawColoredPoints ( const Vector< Int > &  x1,
const Vector< Int > &  y1,
const Vector< uInt > &  colors 
) [pure virtual]

(Cacheable) Draw a set of points, specifying a color per point to be drawn.

Implemented in casa::PSPixelCanvas, and casa::GLPixelCanvas.

virtual void casa::PixelCanvas::drawColoredPoints ( const Vector< Float > &  x1,
const Vector< Float > &  y1,
const Vector< uInt > &  colors 
) [pure virtual]
virtual void casa::PixelCanvas::drawColoredPoints ( const Vector< Double > &  x1,
const Vector< Double > &  y1,
const Vector< uInt > &  colors 
) [pure virtual]
virtual void casa::PixelCanvas::drawColoredPoints ( const Matrix< Int > &  xy,
const Vector< uInt > &  colors 
) [inline, virtual]

Reimplemented in casa::PSPixelCanvas, and casa::GLPixelCanvas.

Definition at line 431 of file PixelCanvas.h.

References casa::Matrix< T >::column(), and drawColoredPoints().

Referenced by drawColoredPoints().

virtual void casa::PixelCanvas::drawColoredPoints ( const Matrix< Float > &  xy,
const Vector< uInt > &  colors 
) [inline, virtual]

Reimplemented in casa::PSPixelCanvas, and casa::GLPixelCanvas.

Definition at line 434 of file PixelCanvas.h.

References casa::Matrix< T >::column(), and drawColoredPoints().

Referenced by drawColoredPoints().

virtual void casa::PixelCanvas::drawColoredPoints ( const Matrix< Double > &  xy,
const Vector< uInt > &  colors 
) [inline, virtual]

Reimplemented in casa::PSPixelCanvas, and casa::GLPixelCanvas.

Definition at line 437 of file PixelCanvas.h.

References casa::Matrix< T >::column(), and drawColoredPoints().

Referenced by drawColoredPoints().

virtual void casa::PixelCanvas::drawEllipse ( const Float cx,
const Float cy,
const Float smajor,
const Float sminor,
const Float pangle,
Bool  outline = True,
Float  xstretch = 1.,
Float  ystretch = 1. 
) [virtual]

Draw a single ellipse using the current pen (ie.

color, thickness, style). The x and y location must be given, along with the semi-major and -minor axis lengths, and the position angle measured in degrees positive from the x axis in a counter-clockwise direction. If outline is False, the ellipse is solid filled, else it is just outlined. xstretch, ystretch should be left defaulted to 1 in most cases; see usage example in WorldCanvas::drawBeamEllipse(), where they are used to stretch a beam ellipse when the display is also linearly stretched away from the aspect ratio natural to the sky projection. They multiply the relative x and y screen coordinates of ellipse points, before they are added to cx and cy. xstretch, ystretch can be negative (though smajor, sminor normally would not be).

virtual void casa::PixelCanvas::drawFilledPolygon ( const Vector< Int > &  x1,
const Vector< Int > &  y1 
) [pure virtual]

(Cacheable) Draw and fill a closed polygon

Implemented in casa::PSPixelCanvas, and casa::GLPixelCanvas.

virtual void casa::PixelCanvas::drawFilledPolygon ( const Vector< Float > &  x1,
const Vector< Float > &  y1 
) [pure virtual]
virtual void casa::PixelCanvas::drawFilledPolygon ( const Vector< Double > &  x1,
const Vector< Double > &  y1 
) [pure virtual]
virtual void casa::PixelCanvas::drawFilledRectangle ( Int  x1,
Int  y1,
Int  x2,
Int  y2 
) [pure virtual]

(Cacheable) Draw a filled rectangle

Implemented in casa::PSPixelCanvas, and casa::GLPixelCanvas.

virtual void casa::PixelCanvas::drawFilledRectangle ( Float  x1,
Float  y1,
Float  x2,
Float  y2 
) [pure virtual]
virtual void casa::PixelCanvas::drawFilledRectangle ( Double  x1,
Double  y1,
Double  x2,
Double  y2 
) [pure virtual]
virtual void casa::PixelCanvas::drawImage ( const Matrix< uInt > &  data,
Int  x,
Int  y 
) [pure virtual]

(Cacheable) Draw an array of 2D color data as a raster image for zoom = <1,1>

Implemented in casa::PSPixelCanvas, and casa::GLPixelCanvas.

virtual void casa::PixelCanvas::drawImage ( const Matrix< Int > &  data,
Int  x,
Int  y 
) [pure virtual]
virtual void casa::PixelCanvas::drawImage ( const Matrix< uLong > &  data,
Int  x,
Int  y 
) [pure virtual]
virtual void casa::PixelCanvas::drawImage ( const Matrix< Float > &  data,
Int  x,
Int  y 
) [pure virtual]
virtual void casa::PixelCanvas::drawImage ( const Matrix< Double > &  data,
Int  x,
Int  y 
) [pure virtual]
virtual void casa::PixelCanvas::drawImage ( const Int ,
const Int ,
const Matrix< uInt > &  ,
const Matrix< Bool > &  ,
Bool  = False 
) [inline, virtual]

(Cacheable) Draw an array of 2D color data as a raster image, taking note of the Bool mask.

Set opaqueMask to True to draw masked pixels in the background color; otherwise they will be transparent (letting whatever was drawn previously at that point show through).

Reimplemented in casa::PSPixelCanvas, and casa::GLPixelCanvas.

Definition at line 264 of file PixelCanvas.h.

virtual void casa::PixelCanvas::drawImage ( const Matrix< uInt > &  data,
Int  x,
Int  y,
uInt  xzoom,
uInt  yzoom 
) [pure virtual]

(Cacheable) Draw an array of 2D color data as a raster image for any positive integer zoom

Implemented in casa::PSPixelCanvas, and casa::GLPixelCanvas.

virtual void casa::PixelCanvas::drawImage ( const Matrix< Int > &  data,
Int  x,
Int  y,
uInt  xzoom,
uInt  yzoom 
) [pure virtual]
virtual void casa::PixelCanvas::drawImage ( const Matrix< uLong > &  data,
Int  x,
Int  y,
uInt  xzoom,
uInt  yzoom 
) [pure virtual]
virtual void casa::PixelCanvas::drawImage ( const Matrix< Float > &  data,
Int  x,
Int  y,
uInt  xzoom,
uInt  yzoom 
) [pure virtual]
virtual void casa::PixelCanvas::drawImage ( const Matrix< Double > &  data,
Int  x,
Int  y,
uInt  xzoom,
uInt  yzoom 
) [pure virtual]
virtual void casa::PixelCanvas::drawImage ( const Matrix< uInt > &  data,
const Int x,
const Int y,
const Display::ColorComponent colorcomponent 
) [pure virtual]

(Cacheable) Draw a component of a multi-channel image, storing it in buffers until flushComponentImages() is called.

Implemented in casa::PSPixelCanvas, and casa::GLPixelCanvas.

virtual void casa::PixelCanvas::drawLine ( Int  x1,
Int  y1,
Int  x2,
Int  y2 
) [pure virtual]

(Cacheable) Draw a single line using current color

Implemented in casa::PSPixelCanvas, and casa::GLPixelCanvas.

virtual void casa::PixelCanvas::drawLine ( Float  x1,
Float  y1,
Float  x2,
Float  y2 
) [pure virtual]
virtual void casa::PixelCanvas::drawLine ( Double  x1,
Double  y1,
Double  x2,
Double  y2 
) [pure virtual]
virtual void casa::PixelCanvas::drawLines ( const Matrix< Int > &  verts) [pure virtual]

(Cacheable) Draw N/2 lines from an Nx2 matrix

Implemented in casa::PSPixelCanvas, and casa::GLPixelCanvas.

virtual void casa::PixelCanvas::drawLines ( const Matrix< Float > &  verts) [pure virtual]
virtual void casa::PixelCanvas::drawLines ( const Matrix< Double > &  verts) [pure virtual]
virtual void casa::PixelCanvas::drawLines ( const Vector< Int > &  x1,
const Vector< Int > &  y1,
const Vector< Int > &  x2,
const Vector< Int > &  y2 
) [pure virtual]

(Cacheable) Draw a bunch of unrelated lines using current color

Implemented in casa::PSPixelCanvas, and casa::GLPixelCanvas.

virtual void casa::PixelCanvas::drawLines ( const Vector< Float > &  x1,
const Vector< Float > &  y1,
const Vector< Float > &  x2,
const Vector< Float > &  y2 
) [pure virtual]
virtual void casa::PixelCanvas::drawLines ( const Vector< Double > &  x1,
const Vector< Double > &  y1,
const Vector< Double > &  x2,
const Vector< Double > &  y2 
) [pure virtual]
virtual void casa::PixelCanvas::drawList ( uInt  list) [pure virtual]

(Cacheable) recall cached display commands

Implemented in casa::PSPixelCanvas, and casa::GLPixelCanvas.

virtual void casa::PixelCanvas::drawMarker ( const Int x1,
const Int y1,
const Display::Marker marker,
const Int pixelHeight 
) [virtual]

Draw a "marker".

See Display for a list of available markers.

virtual void casa::PixelCanvas::drawMarker ( const Float x1,
const Float y1,
const Display::Marker marker,
const Int pixelHeight 
) [virtual]
virtual void casa::PixelCanvas::drawMarker ( const Double x1,
const Double y1,
const Display::Marker marker,
const Int pixelHeight 
) [virtual]

return the drawmode (Compile or Draw) Compile drawmode means that a display list is currently being built Draw drawmode means that drawing commands are not cached but instead are sent to the display.

This command is controlled by the caching state using newList()

Definition at line 805 of file PixelCanvas.h.

References drawMode_.

virtual void casa::PixelCanvas::drawPoint ( Int  x1,
Int  y1 
) [pure virtual]

(Cacheable) Draw a single point using current color

Implemented in casa::PSPixelCanvas, and casa::GLPixelCanvas.

virtual void casa::PixelCanvas::drawPoint ( Float  x1,
Float  y1 
) [pure virtual]
virtual void casa::PixelCanvas::drawPoint ( Double  x1,
Double  y1 
) [pure virtual]
virtual void casa::PixelCanvas::drawPoints ( const Matrix< Int > &  verts) [pure virtual]

(Cacheable) Draw N points specified as a Nx2 matrix

Implemented in casa::PSPixelCanvas, and casa::GLPixelCanvas.

virtual void casa::PixelCanvas::drawPoints ( const Matrix< Float > &  verts) [pure virtual]
virtual void casa::PixelCanvas::drawPoints ( const Matrix< Double > &  verts) [pure virtual]
virtual void casa::PixelCanvas::drawPoints ( const Vector< Int > &  x1,
const Vector< Int > &  y1 
) [pure virtual]

(Cacheable) Draw a bunch of points using current color

Implemented in casa::PSPixelCanvas, and casa::GLPixelCanvas.

virtual void casa::PixelCanvas::drawPoints ( const Vector< Float > &  x1,
const Vector< Float > &  y1 
) [pure virtual]
virtual void casa::PixelCanvas::drawPoints ( const Vector< Double > &  x1,
const Vector< Double > &  y1 
) [pure virtual]
virtual void casa::PixelCanvas::drawPolygon ( const Vector< Int > &  x1,
const Vector< Int > &  y1 
) [pure virtual]

(Cacheable) Draw a closed polygon

Implemented in casa::PSPixelCanvas, and casa::GLPixelCanvas.

virtual void casa::PixelCanvas::drawPolygon ( const Vector< Float > &  x1,
const Vector< Float > &  y1 
) [pure virtual]
virtual void casa::PixelCanvas::drawPolygon ( const Vector< Double > &  x1,
const Vector< Double > &  y1 
) [pure virtual]
virtual void casa::PixelCanvas::drawPolygon ( const Matrix< Int > &  verts) [pure virtual]

(Cacheable) Draw a closed N-sided polygon from Nx2 matrix of vertices

Implemented in casa::PSPixelCanvas, and casa::GLPixelCanvas.

virtual void casa::PixelCanvas::drawPolygon ( const Matrix< Float > &  verts) [pure virtual]
virtual void casa::PixelCanvas::drawPolygon ( const Matrix< Double > &  verts) [pure virtual]
virtual void casa::PixelCanvas::drawPolyline ( const Vector< Int > &  x1,
const Vector< Int > &  y1 
) [pure virtual]

(Cacheable) Draw a single connected line between the points given

Implemented in casa::PSPixelCanvas, and casa::GLPixelCanvas.

virtual void casa::PixelCanvas::drawPolyline ( const Vector< Float > &  x1,
const Vector< Float > &  y1 
) [pure virtual]
virtual void casa::PixelCanvas::drawPolyline ( const Vector< Double > &  x1,
const Vector< Double > &  y1 
) [pure virtual]
virtual void casa::PixelCanvas::drawPolyline ( const Matrix< Int > &  verts) [pure virtual]

(Cacheable) Draw N-1 connected lines from Nx2 matrix of vertices

Implemented in casa::PSPixelCanvas, and casa::GLPixelCanvas.

virtual void casa::PixelCanvas::drawPolyline ( const Matrix< Float > &  verts) [pure virtual]
virtual void casa::PixelCanvas::drawPolyline ( const Matrix< Double > &  verts) [pure virtual]
virtual void casa::PixelCanvas::drawRectangle ( Int  x1,
Int  y1,
Int  x2,
Int  y2 
) [pure virtual]

(Cacheable) Draw a rectangle

Implemented in casa::PSPixelCanvas, and casa::GLPixelCanvas.

virtual void casa::PixelCanvas::drawRectangle ( Float  x1,
Float  y1,
Float  x2,
Float  y2 
) [pure virtual]
virtual void casa::PixelCanvas::drawRectangle ( Double  x1,
Double  y1,
Double  x2,
Double  y2 
) [pure virtual]
virtual void casa::PixelCanvas::drawText ( Int  x,
Int  y,
const String text,
Display::TextAlign  alignment = Display::AlignCenter 
) [pure virtual]

(Cacheable) Draw text using that font aligned in some way to the position

Implemented in casa::PSPixelCanvas, and casa::GLPixelCanvas.

virtual void casa::PixelCanvas::drawText ( Int  ,
Int  ,
const String ,
const Float ,
Display::TextAlign  = Display::AlignCenter 
) [inline, virtual]

TODO This should become abstract - NYI in GLPixelCanvas currently Draw text at a specified angle.

Reimplemented in casa::PSPixelCanvas.

Definition at line 234 of file PixelCanvas.h.

virtual Bool casa::PixelCanvas::enable ( Display::Option  option) [pure virtual]

(Cacheable) Option Control Options listed in DisplayEnums

Implemented in casa::PSPixelCanvas, and casa::GLPixelCanvas.

virtual void casa::PixelCanvas::enableMotionEvents ( ) [pure virtual]

enabling/disabling of event tracking

Implemented in casa::PSPixelCanvas, and casa::GLPixelCanvas.

virtual void casa::PixelCanvas::enablePositionEvents ( ) [pure virtual]
virtual void casa::PixelCanvas::endList ( ) [pure virtual]

end caching display commands

Implemented in casa::PSPixelCanvas, and casa::GLPixelCanvas.

virtual void casa::PixelCanvas::flush ( ) [pure virtual]

Cause display to flush any graphics commands not yet drawn.

Implemented in casa::PSPixelCanvas, and casa::GLPixelCanvas.

void casa::PixelCanvas::flushBuffer ( ) [inline]

Definition at line 514 of file PixelCanvas.h.

References casa::PCVGBuffer::flush(), and vgbuf_.

virtual void casa::PixelCanvas::flushComponentBuffers ( ) [pure virtual]

(NOT CACHEABLE!) Flush the component buffers.

Implemented in casa::PSPixelCanvas, and casa::GLPixelCanvas.

virtual Display::ArcMode casa::PixelCanvas::getArcMode ( ) const [pure virtual]
virtual uLong casa::PixelCanvas::getBackground ( ) const [pure virtual]
virtual Display::CapStyle casa::PixelCanvas::getCapStyle ( ) const [pure virtual]
virtual void casa::PixelCanvas::getClearColor ( float &  r,
float &  g,
float &  b 
) const [pure virtual]
virtual void casa::PixelCanvas::getClipWindow ( Int x1,
Int y1,
Int x2,
Int y2 
) [pure virtual]
virtual void casa::PixelCanvas::getColor ( float &  r,
float &  g,
float &  b 
) const [pure virtual]

(Not Cacheable) Retuns the current color as an RGB triple

Implemented in casa::PSPixelCanvas, and casa::GLPixelCanvas.

virtual Bool casa::PixelCanvas::getColor ( Int  x,
Int  y,
uInt color 
) [pure virtual]

(Not Cacheable) Get color index value (works in RGB or colormap mode)

Implemented in casa::PSPixelCanvas, and casa::GLPixelCanvas.

virtual Bool casa::PixelCanvas::getColorComponents ( const String colorname,
Float r,
Float g,
Float b 
) [pure virtual]

Get color components in range 0 to 1 without actually allocating the color.

This is needed to set up other devices, for example PgPlot.

Implemented in casa::PSPixelCanvas, and casa::GLPixelCanvas.

return the size of the current colormap

Definition at line 689 of file PixelCanvas.h.

References colormap_, casa::PixelCanvasColorTable::getColormapSize(), and pcctbl().

Get Graphics Attributes.

Implemented in casa::PSPixelCanvas, and casa::GLPixelCanvas.

virtual Display::FillRule casa::PixelCanvas::getFillRule ( ) const [pure virtual]
virtual Display::FillStyle casa::PixelCanvas::getFillStyle ( ) const [pure virtual]
virtual uLong casa::PixelCanvas::getForeground ( ) const [pure virtual]
virtual Bool casa::PixelCanvas::getHSVColor ( Int  x,
Int  y,
float &  h,
float &  s,
float &  v 
) [virtual]

Reimplemented in casa::PSPixelCanvas.

virtual Display::JoinStyle casa::PixelCanvas::getJoinStyle ( ) const [pure virtual]
virtual Display::LineStyle casa::PixelCanvas::getLineStyle ( ) const [pure virtual]
virtual Float casa::PixelCanvas::getLineWidth ( ) const [pure virtual]

virtual uInt getLineWidth() const = 0;

Implemented in casa::PSPixelCanvas, and casa::GLPixelCanvas.

Matrix<Float> casa::PixelCanvas::getMarker ( const Display::Marker marker,
const Float pixelHeight 
) [private]
virtual Bool casa::PixelCanvas::getRGBColor ( Int  x,
Int  y,
float &  r,
float &  g,
float &  b 
) [pure virtual]
virtual void casa::PixelCanvas::getTranslation ( Int xt,
Int yt 
) const [pure virtual]
virtual uInt casa::PixelCanvas::height ( ) const [pure virtual]

Return the height of the PixelCanvas in pixels.

Implemented in casa::PSPixelCanvas, and casa::GLPixelCanvas.

virtual void casa::PixelCanvas::loadIdentity ( ) [pure virtual]

zero the current translation

Implemented in casa::PSPixelCanvas, and casa::GLPixelCanvas.

void casa::PixelCanvas::mapToColor ( Array< uChar > &  outArray,
const Array< uChar > &  inArray,
Bool  rangeCheck = False 
) [inline]

map [0,N-1] into colorpixels, where N is the current colormap size The values are returned as unsigned integers in their respective array.


Tip: The choice of what type to use should be guided by the number of graphics bitplanes available; For most systems with 8-bit color, uChar is optimal; Some systems with 12 bits per pixel with an alpha channel may require using the uLong;


Warning: uChar type may not have enough bits to hold the pixel index on some high-end graphics systems

Warning: uShort type may not have enough bits to hold the pixel index on some high-end graphics systems

Definition at line 705 of file PixelCanvas.h.

References colormap_, casa::PixelCanvasColorTable::mapToColor(), and pcctbl().

void casa::PixelCanvas::mapToColor ( Array< uShort > &  outArray,
const Array< uShort > &  inArray,
Bool  rangeCheck = False 
) [inline]

Definition at line 708 of file PixelCanvas.h.

References colormap_, casa::PixelCanvasColorTable::mapToColor(), and pcctbl().

void casa::PixelCanvas::mapToColor ( Array< uInt > &  outArray,
const Array< uInt > &  inArray,
Bool  rangeCheck = False 
) [inline]

Definition at line 711 of file PixelCanvas.h.

References colormap_, casa::PixelCanvasColorTable::mapToColor(), and pcctbl().

void casa::PixelCanvas::mapToColor ( Array< uLong > &  outArray,
const Array< uLong > &  inArray,
Bool  rangeCheck = False 
) [inline]

Definition at line 714 of file PixelCanvas.h.

References colormap_, casa::PixelCanvasColorTable::mapToColor(), and pcctbl().

void casa::PixelCanvas::mapToColor ( Array< uChar > &  inOutArray,
Bool  rangeCheck = False 
) [inline]

same as above except the matrix is operated on in place.

Only unsigned values make sense here.

Definition at line 722 of file PixelCanvas.h.

References colormap_, casa::PixelCanvasColorTable::mapToColor(), and pcctbl().

void casa::PixelCanvas::mapToColor ( Array< uShort > &  inOutArray,
Bool  rangeCheck = False 
) [inline]

Definition at line 724 of file PixelCanvas.h.

References colormap_, casa::PixelCanvasColorTable::mapToColor(), and pcctbl().

void casa::PixelCanvas::mapToColor ( Array< uInt > &  inOutArray,
Bool  rangeCheck = False 
) [inline]

Definition at line 726 of file PixelCanvas.h.

References colormap_, casa::PixelCanvasColorTable::mapToColor(), and pcctbl().

void casa::PixelCanvas::mapToColor ( Array< uLong > &  inOutArray,
Bool  rangeCheck = False 
) [inline]

Definition at line 728 of file PixelCanvas.h.

References colormap_, casa::PixelCanvasColorTable::mapToColor(), and pcctbl().

void casa::PixelCanvas::mapToColor3 ( Array< uLong > &  out,
const Array< Float > &  chan1in,
const Array< Float > &  chan2in,
const Array< Float > &  chan3in 
)

Multi-Channel functions that combine separate array channels into a single array of output colors for use with functions that take color values.

These two functions accept color values from [0-1] for each channel. The colorModel is compared with the model of the PixelCanvasColorTable and is used to perform the correct mapping.

void casa::PixelCanvas::mapToColor3 ( Array< uLong > &  out,
const Array< Double > &  chan1in,
const Array< Double > &  chan2in,
const Array< Double > &  chan3in 
)
virtual void casa::PixelCanvas::mapToColor3 ( Array< uLong > &  out,
const Array< uInt > &  chan1in,
const Array< uInt > &  chan2in,
const Array< uInt > &  chan3in 
) [virtual]

This one maps values between 0 and the integer maximum value for each channel into a single output image suitable for PixelCanvas::drawImage.

virtual uInt casa::PixelCanvas::newList ( ) [pure virtual]

begin caching display commands - return list ID

Implemented in casa::PSPixelCanvas, and casa::GLPixelCanvas.

virtual PixelCanvasColorTable* casa::PixelCanvas::pcctbl ( ) const [pure virtual]

Need a mechanism to return the PixelCanvasColorTable so drawing functions within classes can operate.

Implemented in casa::PSPixelCanvas, and casa::GLPixelCanvas.

Referenced by colormapRegistered(), getColormapSize(), and mapToColor().

virtual void casa::PixelCanvas::pixelDensity ( Float xdpi,
Float ydpi 
) const [pure virtual]

Get the pixel density (in dots per inch [dpi]) of the PixelCanvas.

Implemented in casa::PSPixelCanvas, and casa::GLPixelCanvas.

virtual Float casa::PixelCanvas::pixelScaling ( ) const [inline, virtual]

Reimplemented in casa::PSPixelCanvas.

Definition at line 819 of file PixelCanvas.h.

virtual void casa::PixelCanvas::popMatrix ( ) [pure virtual]
virtual void casa::PixelCanvas::pushMatrix ( ) [pure virtual]

save/restore the current translation.

This is called pushMatrix because eventually we may want scaling or rotation to play a modest role here.

Implemented in casa::PSPixelCanvas, and casa::GLPixelCanvas.

void casa::PixelCanvas::redraw ( ) [inline]

(Not Cacheable) Redraw the window

Reimplemented in casa::GLPixelCanvas.

Definition at line 570 of file PixelCanvas.h.

References refresh().

virtual void casa::PixelCanvas::refresh ( const Display::RefreshReason reason = Display::UserCommand,
const Bool explicitrequest = True 
) [pure virtual]

Implemented in casa::PSPixelCanvas, and casa::GLPixelCanvas.

Referenced by redraw().

return True if the refresh is active (Added for X11PixelCanvas DefaultBuffer)

Definition at line 814 of file PixelCanvas.h.

References refreshActive_.

virtual Bool casa::PixelCanvas::refreshAllowed ( ) const [inline, virtual]

return True if refresh is allowed right now...

Reimplemented in casa::GLPixelCanvas.

Definition at line 817 of file PixelCanvas.h.

References casa::True.

void casa::PixelCanvas::registerColormap ( Colormap dcmap,
Float  weight = 1.0 
)

register a colormap to the pixelcanvas.

Registration counts are remembered, so that map A is guaranteed to be available as long as the number of register(A)'s exceed the number of unregister(A)'s. Requests are forwarded to the PixelCanvas' PixelCanvasColorTable.

void casa::PixelCanvas::registerColormap ( Colormap cmap,
Colormap cmapToReplace 
)

Register the cmap Colormap on the PixelCanvas, replacing the cmapToReplace Colormap if possible.

remove event handlers

virtual Bool casa::PixelCanvas::resize ( uInt  ,
uInt  ,
Bool  = True 
) [inline, virtual]

(Not Cacheable) resize request.

returns true if window was resized. Will refresh if doCallbacks is True.

Reimplemented in casa::PSPixelCanvas, and casa::GLPixelCanvas.

Definition at line 645 of file PixelCanvas.h.

References casa::False.

virtual Bool casa::PixelCanvas::resizeColorTable ( uInt  newSize) [pure virtual]

(Not Cacheable) resize the colortable by requesting a new number of cells

Implemented in casa::PSPixelCanvas, and casa::GLPixelCanvas.

virtual Bool casa::PixelCanvas::resizeColorTable ( uInt  nReds,
uInt  nGreens,
uInt  nBlues 
) [pure virtual]

(Not Cacheable) resize the colortable by requesting a new RGB/HSV cube

Implemented in casa::PSPixelCanvas, and casa::GLPixelCanvas.

virtual void casa::PixelCanvas::setArcMode ( Display::ArcMode  mode) [pure virtual]
virtual void casa::PixelCanvas::setBackground ( uLong  color) [pure virtual]
virtual void casa::PixelCanvas::setCapStyle ( Display::CapStyle  style) [pure virtual]
virtual void casa::PixelCanvas::setClearColor ( uInt  colorIndex) [pure virtual]

(Cacheable) Set the color to use for clearing the display

Implemented in casa::PSPixelCanvas, and casa::GLPixelCanvas.

virtual void casa::PixelCanvas::setClearColor ( const String colorname) [pure virtual]
virtual void casa::PixelCanvas::setClearColor ( float  r,
float  g,
float  b 
) [pure virtual]
virtual void casa::PixelCanvas::setClipWindow ( Int  x1,
Int  y1,
Int  x2,
Int  y2 
) [pure virtual]

(Cacheable) Setup the clip window.

The clip window, when enabled, allows a user to clip all graphics output to a rectangular region on the screen.

Implemented in casa::PSPixelCanvas, and casa::GLPixelCanvas.

virtual void casa::PixelCanvas::setColor ( uInt  colorIndex) [pure virtual]

(Cacheable) Set current color (works in RGB or colormap mode)

Implemented in casa::PSPixelCanvas, and casa::GLPixelCanvas.

virtual void casa::PixelCanvas::setColor ( const String colorname) [pure virtual]

(Not Cacheable) set/get the current colormap.

Undefined behavior results from setting the colormap to a map that is not registered. This cannot be cached because it affects the result of getColormapSize(). Remember that once data is mapped with mapToColor, it is no longer important to worry about which colormap is active for purposes of drawing the image or vectors. colormapRegistered() can be used to determine whether the currently set colormap() is indeed registered/installed (i.e., color cells have been allocated within the pcctbl).

Set the input color model for multichannel color.

virtual void casa::PixelCanvas::setDeviceBackgroundColor ( const String  colorname) [pure virtual]
virtual void casa::PixelCanvas::setDeviceForegroundColor ( const String  colorname) [pure virtual]

Get/set the current foreground/background colors.

These colors should be used when the special Strings "foreground" and "background" are given for a color.

Implemented in casa::PSPixelCanvas, and casa::GLPixelCanvas.

virtual void casa::PixelCanvas::setDrawBuffer ( Display::DrawBuffer  buf) [pure virtual]

(Not cacheable) set the draw buffer

Implemented in casa::PSPixelCanvas, and casa::GLPixelCanvas.

void casa::PixelCanvas::setDrawBuffer_ ( Display::DrawBuffer  buf) [inline, protected]

Also allowed only by derived classes.

Definition at line 831 of file PixelCanvas.h.

References drawBuffer_.

virtual void casa::PixelCanvas::setDrawFunction ( Display::DrawFunction  function) [pure virtual]

Set Graphics Attributes Options for functions with enum argument listed in DisplayEnums .

Implemented in casa::PSPixelCanvas, and casa::GLPixelCanvas.

void casa::PixelCanvas::setDrawMode ( Display::DrawMode  mode) [inline, protected]

Only allowed by derived classes.

Definition at line 828 of file PixelCanvas.h.

References drawMode_.

virtual void casa::PixelCanvas::setFillRule ( Display::FillRule  rule) [pure virtual]
virtual void casa::PixelCanvas::setFillStyle ( Display::FillStyle  style) [pure virtual]
virtual Bool casa::PixelCanvas::setFont ( const String fontName) [pure virtual]

(Cacheable) Set the font to the recognizable font name

Implemented in casa::PSPixelCanvas, and casa::GLPixelCanvas.

virtual Bool casa::PixelCanvas::setFont ( DLFont ) [inline, virtual]

TODO: These should become abstract Set the font via the DisplayLibrary Font class.

Reimplemented in casa::PSPixelCanvas.

Definition at line 220 of file PixelCanvas.h.

References casa::False.

virtual Bool casa::PixelCanvas::setFont ( const String ,
const Int   
) [inline, virtual]

Set the font to font name / size.

Reimplemented in casa::PSPixelCanvas.

Definition at line 224 of file PixelCanvas.h.

References casa::False.

virtual void casa::PixelCanvas::setForeground ( uLong  color) [pure virtual]
virtual void casa::PixelCanvas::setHSVColor ( float  h,
float  s,
float  v 
) [virtual]

Reimplemented in casa::PSPixelCanvas.

virtual void casa::PixelCanvas::setImageCacheStrategy ( Display::ImageCacheStrategy  strategy) [pure virtual]

Control the image-caching strategy.

Implemented in casa::PSPixelCanvas, and casa::GLPixelCanvas.

virtual void casa::PixelCanvas::setJoinStyle ( Display::JoinStyle  style) [pure virtual]
virtual void casa::PixelCanvas::setLineStyle ( Display::LineStyle  style) [pure virtual]
virtual void casa::PixelCanvas::setLineWidth ( Float  width) [pure virtual]

virtual void setLineWidth(uInt width) = 0;

Implemented in casa::PSPixelCanvas, and casa::GLPixelCanvas.

virtual void casa::PixelCanvas::setPcctbl ( PixelCanvasColorTable pcctbl) [pure virtual]
virtual void casa::PixelCanvas::setRGBColor ( float  r,
float  g,
float  b 
) [pure virtual]
virtual Bool casa::PixelCanvas::supportsLists ( ) [pure virtual]

Does this canvas support cached display lists? The user of the canvas should always check this, because undefined behaviour can result when an attempt is made to use a list on a PixelCanvas which does not support lists.

Implemented in casa::PSPixelCanvas, and casa::GLPixelCanvas.

virtual void casa::PixelCanvas::swapBuffers ( ) [pure virtual]
virtual void casa::PixelCanvas::swapBuffers ( Int  x1,
Int  y1,
Int  x2,
Int  y2 
) [pure virtual]
virtual Int casa::PixelCanvas::textHeight ( const String ) [inline, virtual]

Definition at line 245 of file PixelCanvas.h.

virtual Int casa::PixelCanvas::textWidth ( const String ) [inline, virtual]

TODO : This should become abstract Determine the width / height of a string of text based on current settings.

Definition at line 243 of file PixelCanvas.h.

virtual void casa::PixelCanvas::translate ( Int  xt,
Int  yt 
) [pure virtual]

translation functions translate applies a relative translation to the current matrix and can be used to position graphics.

Together with pushMatrix and popMatrix it can be used to build heirarchical scenes.

Implemented in casa::PSPixelCanvas, and casa::GLPixelCanvas.

virtual void casa::PixelCanvas::translateAllLists ( Int  xt,
Int  yt 
) [pure virtual]

translate all lists

Implemented in casa::PSPixelCanvas, and casa::GLPixelCanvas.

virtual void casa::PixelCanvas::translateList ( uInt  list,
Int  xt,
Int  yt 
) [pure virtual]

translate the list

Implemented in casa::PSPixelCanvas, and casa::GLPixelCanvas.

unregister a colormap from a pixelcanvas.

Unregistering the current map may result in undefined behavior.

virtual Bool casa::PixelCanvas::validList ( uInt  list) [pure virtual]

return True if the list exists

Implemented in casa::PSPixelCanvas, and casa::GLPixelCanvas.

virtual uInt casa::PixelCanvas::width ( ) const [pure virtual]

Return the width of the PixelCanvas in pixels.

Implemented in casa::PSPixelCanvas, and casa::GLPixelCanvas.

virtual Int casa::PixelCanvas::xTranslation ( ) const [pure virtual]
virtual Int casa::PixelCanvas::yTranslation ( ) const [pure virtual]

Member Data Documentation

This is the current colormap.

Definition at line 841 of file PixelCanvas.h.

Referenced by colormap(), colormapRegistered(), getColormapSize(), and mapToColor().

The current color cube model to be used for all multichannel color mapping.

Definition at line 851 of file PixelCanvas.h.

Referenced by colorModel().

True if the PixelCanvas was the one who registered the existing colortable.

Definition at line 835 of file PixelCanvas.h.

The current drawing buffer.

Definition at line 847 of file PixelCanvas.h.

Referenced by drawBuffer(), and setDrawBuffer_().

This is the current drawing mode.

Definition at line 844 of file PixelCanvas.h.

Referenced by drawMode(), and setDrawMode().

This is the list of registered motion EventHandlers.

Definition at line 862 of file PixelCanvas.h.

Number of colormaps registered by external clients.

Definition at line 857 of file PixelCanvas.h.

This is the list of registered position EventHandlers.

Definition at line 864 of file PixelCanvas.h.

True if refresh is active.

Definition at line 854 of file PixelCanvas.h.

Referenced by refreshActive().

This is the list of registered refresh EventHandlers.

Definition at line 860 of file PixelCanvas.h.

The PCVGBuffer is used to accumulate lines and points until flushed (or the buffer is full)

Definition at line 868 of file PixelCanvas.h.

Referenced by bufferLine(), bufferPoint(), bufferPolygonPoint(), bufferPolylinePoint(), and flushBuffer().


The documentation for this class was generated from the following file: