PSPixelCanvas.h

Classes

PSPixelCanvas -- Implementation of the PixelCanvas for PostScript devices. (full description)

class PSPixelCanvas : public PixelCanvas

Interface

Public Members
PSPixelCanvas(PSDriver *ps, PSPixelCanvasColorTable * )
virtual ~PSPixelCanvas()
virtual void enableMotionEvents()
virtual void disableMotionEvents()
virtual void enablePositionEvents()
virtual void disablePositionEvents()
virtual Bool supportsLists()
virtual uInt newList()
virtual void endList()
virtual void drawList(uInt list)
virtual void translateAllLists(Int xt, Int yt)
virtual void translateList(uInt list, Int xt, Int yt)
virtual void deleteList(uInt list)
virtual void deleteLists()
virtual Bool validList(uInt list)
virtual Bool setFont(const String &fontName, const Int size)
virtual Bool setFont(DLFont* font)
virtual Bool setFont(const String &fontName)
virtual void drawText(Int x, Int y, const String &text, Display::TextAlign alignment = Display::AlignCenter)
virtual void drawText(Int x, Int y, const String &text, const Float& angle, Display::TextAlign alignment = Display::AlignCenter)
virtual void drawImage(const Matrix<uInt> &data, Int x, Int y)
virtual void drawImage(const Matrix<Int> &data, Int x, Int y)
virtual void drawImage(const Matrix<uLong> &data, Int x, Int y)
virtual void drawImage(const Matrix<Float> &data, Int x, Int y)
virtual void drawImage(const Matrix<Double> &data, Int x, Int y)
virtual void drawImage(const Int &x, const Int &y, const Matrix<uInt> &data, const Matrix<Bool> &mask)
virtual void drawImage(const Matrix<uInt> &data, Int x, Int y, uInt xzoom, uInt yzoom)
virtual void drawImage(const Matrix<Int> &data, Int x, Int y, uInt xzoom, uInt yzoom)
virtual void drawImage(const Matrix<uLong> &data, Int x, Int y, uInt xzoom, uInt yzoom)
virtual void drawImage(const Matrix<Float> &data, Int x, Int y, uInt xzoom, uInt yzoom)
virtual void drawImage(const Matrix<Double> &data, Int x, Int y, uInt xzoom, uInt yzoom)
virtual void drawImage(const Matrix<uInt> &data, const Int &x, const Int &y, const Display::ColorComponent &colorcomponent)
void bufferComponent(const Matrix<uInt> &data, const Int &x, const Int &y, const Display::ColorComponent &colorcomponent)
void flushComponentBuffers()
virtual void drawPoint(Int x1, Int y1)
virtual void drawPoint(Float x1, Float y1)
virtual void drawPoint(Double x1, Double y1)
virtual void drawPoints(const Matrix<Int> &verts)
virtual void drawPoints(const Matrix<Float> &verts)
virtual void drawPoints(const Matrix<Double> &verts)
virtual void drawPoints(const Vector<Int> &x1, const Vector<Int> &y1)
virtual void drawPoints(const Vector<Float> &x1, const Vector<Float> &y1)
virtual void drawPoints(const Vector<Double> &x1, const Vector<Double> &y1)
virtual void drawLine(Int x1, Int y1, Int x2, Int y2)
virtual void drawLine(Float x1, Float y1, Float x2, Float y2)
virtual void drawLine(Double x1, Double y1, Double x2, Double y2)
virtual void drawLines(const Matrix<Int> &verts)
virtual void drawLines(const Matrix<Float> &verts)
virtual void drawLines(const Matrix<Double> &verts)
virtual void drawLines(const Vector<Int> &x1, const Vector<Int> &y1, const Vector<Int> &x2, const Vector<Int> &y2)
virtual void drawLines(const Vector<Float> &x1, const Vector<Float> &y1, const Vector<Float> &x2, const Vector<Float> &y2)
virtual void drawLines(const Vector<Double> &x1, const Vector<Double> &y1, const Vector<Double> &x2, const Vector<Double> &y2)
virtual void drawPolyline(const Vector<Int> &x1, const Vector<Int> &y1)
virtual void drawPolyline(const Vector<Float> &x1, const Vector<Float> &y1)
virtual void drawPolyline(const Vector<Double> &x1, const Vector<Double> &y1)
virtual void drawPolylines(const Vector<Int> &x1, const Vector<Int> &y1, const int close=0, const int fill=0)
virtual void drawPolylines(const Vector<Float> &x1, const Vector<Float> &y1, const int close=0, const int fill=0)
virtual void drawPolylines(const Vector<Double> &x1, const Vector<Double> &y1, const int close=0, const int fill=0)
virtual void drawPolyline(const Matrix<Int> &verts)
virtual void drawPolyline(const Matrix<Float> &verts)
virtual void drawPolyline(const Matrix<Double> &verts)
virtual void drawPolylines(const Matrix<Int> &verts, const int close=0, const int fill=0)
virtual void drawPolylines(const Matrix<Float> &verts, const int close=0, const int fill=0)
virtual void drawPolylines(const Matrix<Double> &verts, const int close=0, const int fill=0)
virtual void drawPolygon(const Vector<Int> &x1, const Vector<Int> &y1)
virtual void drawPolygon(const Vector<Float> &x1, const Vector<Float> &y1)
virtual void drawPolygon(const Vector<Double> &x1, const Vector<Double> &y1)
virtual void drawFilledPolygon(const Vector<Int> &x1, const Vector<Int> &y1)
virtual void drawFilledPolygon(const Vector<Float> &x1, const Vector<Float> &y1)
virtual void drawFilledPolygon(const Vector<Double> &x1, const Vector<Double> &y1)
virtual void drawPolygon(const Matrix<Int> &verts)
virtual void drawPolygon(const Matrix<Float> &verts)
virtual void drawPolygon(const Matrix<Double> &verts)
virtual void drawRectangle(Int x1, Int y1, Int x2, Int y2, const int fill)
virtual void drawRectangle(Float x1, Float y1, Float x2, Float y2, const int fill)
virtual void drawRectangle(Double x1, Double y1, Double x2, Double y2, const int fill)
virtual void drawRectangle(Int x1, Int y1, Int x2, Int y2)
virtual void drawRectangle(Float x1, Float y1, Float x2, Float y2)
virtual void drawRectangle(Double x1, Double y1, Double x2, Double y2)
virtual void drawFilledRectangle(Int x1, Int y1, Int x2, Int y2)
virtual void drawFilledRectangle(Float x1, Float y1, Float x2, Float y2)
virtual void drawFilledRectangle(Double x1, Double y1, Double x2, Double y2)
virtual void drawColoredPoints(const Vector<Int> &x1, const Vector<Int> &y1, const Vector<uInt> &colors)
virtual void drawColoredPoints(const Vector<Float> &x1, const Vector<Float> &y1, const Vector<uInt> &colors)
virtual void drawColoredPoints(const Vector<Double> &x1, const Vector<Double> &y1, const Vector<uInt> &colors)
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)
virtual void drawColoredLines(const Vector<Float> &x1, const Vector<Float> &y1, const Vector<Float> &x2, const Vector<Float> &y2, const Vector<uInt> &colors)
virtual void drawColoredLines(const Vector<Double> &x1, const Vector<Double> &y1, const Vector<Double> &x2, const Vector<Double> &y2, const Vector<uInt> &colors)
virtual void setDrawFunction(Display::DrawFunction function)
virtual void setForeground(uLong color)
virtual void setBackground(uLong color)
virtual void setLineWidth(Float width)
void lineWidth(Float width)
float lineWidth()const
virtual void setLineStyle(Display::LineStyle style)
virtual void setCapStyle(Display::CapStyle style)
virtual void setJoinStyle(Display::JoinStyle style)
virtual void setFillStyle(Display::FillStyle style)
virtual void setFillRule(Display::FillRule rule)
virtual void setArcMode(Display::ArcMode mode)
virtual Display::DrawFunction getDrawFunction() const
virtual uLong getForeground() const
virtual uLong getBackground() const
virtual Float getLineWidth() const
virtual Display::LineStyle getLineStyle() const
virtual Display::CapStyle getCapStyle() const
virtual Display::JoinStyle getJoinStyle() const
virtual Display::FillStyle getFillStyle() const
virtual Display::FillRule getFillRule() const
virtual Display::ArcMode getArcMode() const
virtual Bool enable(Display::Option option)
virtual Bool disable(Display::Option option)
virtual void setImageCacheStrategy(Display::ImageCacheStrategy strategy)
virtual Display::ImageCacheStrategy imageCacheStrategy() const
virtual void setClipWindow(Int x1, Int y1, Int x2, Int y2)
virtual void getClipWindow(Int &x1, Int &y1, Int &x2, Int &y2)
virtual void refresh(const Display::RefreshReason &reason = Display::UserCommand, const Bool &explicitrequest = True)
virtual void flush()
virtual void clear()
virtual void clear(Int x1, Int y1, Int x2, Int y2)
virtual void setClearColor(uInt colorIndex)
virtual void setClearColor(const String &colorname)
virtual void setClearColor(float r, float g, float b)
virtual uInt clearColor() const
virtual void getClearColor(float &r, float &g, float &b) const
virtual uInt width() const
virtual uInt height() const
virtual uInt depth() const
virtual void pixelDensity(Float &xdpi, Float &ydpi) const
virtual void setColor(uInt colorIndex)
virtual void setColor(const String &colorname)
virtual void setRGBColor(float r, float g, float b)
virtual void setHSVColor(float h, float s, float v)
virtual uInt color() const
virtual void getColor(float &r, float &g, float &b) const
virtual Bool getColorComponents(const String &colorname, Float &r, Float &g, Float &b)
virtual Bool getColor(Int x, Int y, uInt &color)
virtual Bool getRGBColor(Int x, Int y, float &r, float &g, float &b)
virtual Bool getHSVColor(Int x, Int y, float &h, float &s, float &v)
virtual void setDeviceForegroundColor(const String colorname)
virtual String deviceForegroundColor() const
virtual void setDeviceBackgroundColor(const String colorname)
virtual String deviceBackgroundColor() const
virtual Bool resize(uInt reqXSize, uInt reqYSize, Bool doCallbacks = True)
virtual Bool resizeColorTable(uInt newSize)
virtual Bool resizeColorTable(uInt nReds, uInt nGreens, uInt nBlues)
virtual PixelCanvasColorTable * pcctbl() const
virtual void setPcctbl(PixelCanvasColorTable * pcctbl)
PSPixelCanvasColorTable *PSpcctbl()const
virtual void pushMatrix()
virtual void popMatrix()
virtual void loadIdentity()
virtual void translate(Int xt, Int yt)
virtual void getTranslation(Int &xt, Int &yt) const
virtual Int xTranslation() const
virtual Int yTranslation() const
virtual void setDrawBuffer(Display::DrawBuffer buf)
virtual void copyBackBufferToFrontBuffer()
virtual void copyFrontBufferToBackBuffer()
virtual void swapBuffers()
virtual void copyBackBufferToFrontBuffer(Int x1, Int y1, Int x2, Int y2)
virtual void copyFrontBufferToBackBuffer(Int x1, Int y1, Int x2, Int y2)
virtual void swapBuffers(Int x1, Int y1, Int x2, Int y2)
void drawPSImage(const int x, const int y, const int iwidth, const int iheight, const float xzoom, const float yzoom, const uShort *data, const int bpc, const Display::ColorModel=Display::Index)
void setResolution(const float xres, const float yres, const PSDriver::Dimension = PSDriver::INCHES)
void getResolution(float &xres, float &yres, const PSDriver::Dimension = PSDriver::INCHES)const
void smooth(const Bool smth)
Bool smooth()const
Bool annotate()const
void annotate(const Bool a)
virtual Float pixelScaling() const
Private Members
void pspcinit(PSDriver *ps, PSPixelCanvasColorTable * )
void clearRectangle(const float x0, const float y0, const float x1, const float y1)
void note(const char *)
void note(const char *, const uLong)

Description

Prerequisite

Etymology

PSPixelCanvas is a mechanism for drawing on paper.

Motivation

Synopsis

PSPixelCanvas implements PixelCanvas for PostScript output. See Example for example usage.

Example

  1. Create an output stream.
  2. Create a PSDriver choosing a page type (letter, A4, etc.). (PSDriver can take a filename as an argument instead of an ostream). See: PSDriver for more on creating PSDrivers..
  3. Create PSPixelCanvasColorTable
  4. Create PSPixelCanvas
  5. Draw something pretty.
  6. Delete everything and close the stream.
    TipNeither PSPixelCanvasColorTable nor PSPixelCanvas delete their PSDriver.
    
    PSDriver *psd = new PSDriver("test.ps", PSDriver::LETTER);
    PSPixelCanvasColorTable *pscct = new PSPixelCanvasColorTable(psd);
    PSPixelCanvas psc = new PSPixelCanvas( psd, pscct);
     ... (a miracle happens).
    delete psc;
    delete pscct;
    delete psd;
    

TipSince PostScript does not deal in in pixels, PSPixelCanvas assumes an adjustable number of pixels per inch. (Currently 1200dpi). Use the setResolution function to change this if the calling progam can't handle a 128M pixel display.

To Do

Member Description

PSPixelCanvas(PSDriver *ps, PSPixelCanvasColorTable * )

virtual ~PSPixelCanvas()

virtual void enableMotionEvents()
virtual void disableMotionEvents()
virtual void enablePositionEvents()
virtual void disablePositionEvents()

enabling/disabling of event tracking

virtual Bool supportsLists()

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()

begin caching display commands - return list ID

virtual void endList()

end caching display commands

virtual void drawList(uInt list)

(Cacheable) recall cached display commands

virtual void translateAllLists(Int xt, Int yt)

translate all lists

virtual void translateList(uInt list, Int xt, Int yt)

translate the list

virtual void deleteList(uInt list)

remove list from cache

virtual void deleteLists()

flush all lists from the cache

virtual Bool validList(uInt list)

return True if the list exists

virtual Bool setFont(const String &fontName, const Int size)

(Cacheable) Set the font to the PostScript font name and size.

virtual Bool setFont(DLFont* font)

virtual Bool setFont(const String &fontName)

(Cacheable) Set the font to the PostScript font name.

virtual void drawText(Int x, Int y, const String &text, Display::TextAlign alignment = Display::AlignCenter)

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

virtual void drawText(Int x, Int y, const String &text, const Float& angle, Display::TextAlign alignment = Display::AlignCenter)

virtual void drawImage(const Matrix<uInt> &data, Int x, Int y)
virtual void drawImage(const Matrix<Int> &data, Int x, Int y)
virtual void drawImage(const Matrix<uLong> &data, Int x, Int y)
virtual void drawImage(const Matrix<Float> &data, Int x, Int y)
virtual void drawImage(const Matrix<Double> &data, Int x, Int y)

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

virtual void drawImage(const Int &x, const Int &y, const Matrix<uInt> &data, const Matrix<Bool> &mask)

virtual void drawImage(const Matrix<uInt> &data, Int x, Int y, uInt xzoom, uInt yzoom)
virtual void drawImage(const Matrix<Int> &data, Int x, Int y, uInt xzoom, uInt yzoom)
virtual void drawImage(const Matrix<uLong> &data, Int x, Int y, uInt xzoom, uInt yzoom)
virtual void drawImage(const Matrix<Float> &data, Int x, Int y, uInt xzoom, uInt yzoom)
virtual void drawImage(const Matrix<Double> &data, Int x, Int y, uInt xzoom, uInt yzoom)

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

virtual void drawImage(const Matrix<uInt> &data, const Int &x, const Int &y, const Display::ColorComponent &colorcomponent)

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

void bufferComponent(const Matrix<uInt> &data, const Int &x, const Int &y, const Display::ColorComponent &colorcomponent)

Fill one of the channel buffers.

void flushComponentBuffers()

(NOT CACHEABLE!) Flush the component buffers.

virtual void drawPoint(Int x1, Int y1)
virtual void drawPoint(Float x1, Float y1)
virtual void drawPoint(Double x1, Double y1)

(Cacheable) Draw a single point using current color

virtual void drawPoints(const Matrix<Int> &verts)
virtual void drawPoints(const Matrix<Float> &verts)
virtual void drawPoints(const Matrix<Double> &verts)

(Cacheable) Draw N points specified as a Nx2 matrix

virtual void drawPoints(const Vector<Int> &x1, const Vector<Int> &y1)
virtual void drawPoints(const Vector<Float> &x1, const Vector<Float> &y1)
virtual void drawPoints(const Vector<Double> &x1, const Vector<Double> &y1)

(Cacheable) Draw a bunch of points using current color

virtual void drawLine(Int x1, Int y1, Int x2, Int y2)
virtual void drawLine(Float x1, Float y1, Float x2, Float y2)
virtual void drawLine(Double x1, Double y1, Double x2, Double y2)

(Cacheable) Draw a single line using current color

virtual void drawLines(const Matrix<Int> &verts)
virtual void drawLines(const Matrix<Float> &verts)
virtual void drawLines(const Matrix<Double> &verts)

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

virtual void drawLines(const Vector<Int> &x1, const Vector<Int> &y1, const Vector<Int> &x2, const Vector<Int> &y2)
virtual void drawLines(const Vector<Float> &x1, const Vector<Float> &y1, const Vector<Float> &x2, const Vector<Float> &y2)
virtual void drawLines(const Vector<Double> &x1, const Vector<Double> &y1, const Vector<Double> &x2, const Vector<Double> &y2)

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

virtual void drawPolyline(const Vector<Int> &x1, const Vector<Int> &y1)
virtual void drawPolyline(const Vector<Float> &x1, const Vector<Float> &y1)
virtual void drawPolyline(const Vector<Double> &x1, const Vector<Double> &y1)

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

virtual void drawPolylines(const Vector<Int> &x1, const Vector<Int> &y1, const int close=0, const int fill=0)
virtual void drawPolylines(const Vector<Float> &x1, const Vector<Float> &y1, const int close=0, const int fill=0)
virtual void drawPolylines(const Vector<Double> &x1, const Vector<Double> &y1, const int close=0, const int fill=0)

virtual void drawPolyline(const Matrix<Int> &verts)
virtual void drawPolyline(const Matrix<Float> &verts)
virtual void drawPolyline(const Matrix<Double> &verts)

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

virtual void drawPolylines(const Matrix<Int> &verts, const int close=0, const int fill=0)
virtual void drawPolylines(const Matrix<Float> &verts, const int close=0, const int fill=0)
virtual void drawPolylines(const Matrix<Double> &verts, const int close=0, const int fill=0)

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

virtual void drawPolygon(const Vector<Int> &x1, const Vector<Int> &y1)
virtual void drawPolygon(const Vector<Float> &x1, const Vector<Float> &y1)
virtual void drawPolygon(const Vector<Double> &x1, const Vector<Double> &y1)

(Cacheable) Draw a closed polygon

virtual void drawFilledPolygon(const Vector<Int> &x1, const Vector<Int> &y1)
virtual void drawFilledPolygon(const Vector<Float> &x1, const Vector<Float> &y1)
virtual void drawFilledPolygon(const Vector<Double> &x1, const Vector<Double> &y1)

(Cacheable) Draw and fill a closed polygon

virtual void drawPolygon(const Matrix<Int> &verts)
virtual void drawPolygon(const Matrix<Float> &verts)
virtual void drawPolygon(const Matrix<Double> &verts)

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

virtual void drawRectangle(Int x1, Int y1, Int x2, Int y2, const int fill)
virtual void drawRectangle(Float x1, Float y1, Float x2, Float y2, const int fill)
virtual void drawRectangle(Double x1, Double y1, Double x2, Double y2, const int fill)

(Cacheable) Draw a rectangle

virtual void drawRectangle(Int x1, Int y1, Int x2, Int y2)
virtual void drawRectangle(Float x1, Float y1, Float x2, Float y2)
virtual void drawRectangle(Double x1, Double y1, Double x2, Double y2)

(Cacheable) Draw a rectangle

virtual void drawFilledRectangle(Int x1, Int y1, Int x2, Int y2)
virtual void drawFilledRectangle(Float x1, Float y1, Float x2, Float y2)
virtual void drawFilledRectangle(Double x1, Double y1, Double x2, Double y2)

(Cacheable) Draw a filled rectangle

virtual void drawColoredPoints(const Vector<Int> &x1, const Vector<Int> &y1, const Vector<uInt> &colors)
virtual void drawColoredPoints(const Vector<Float> &x1, const Vector<Float> &y1, const Vector<uInt> &colors)
virtual void drawColoredPoints(const Vector<Double> &x1, const Vector<Double> &y1, const Vector<uInt> &colors)
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)

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

virtual void drawColoredLines(const Vector<Int> &x1, const Vector<Int> &y1, const Vector<Int> &x2, const Vector<Int> &y2, const Vector<uInt> &colors)
virtual void drawColoredLines(const Vector<Float> &x1, const Vector<Float> &y1, const Vector<Float> &x2, const Vector<Float> &y2, const Vector<uInt> &colors)
virtual void drawColoredLines(const Vector<Double> &x1, const Vector<Double> &y1, const Vector<Double> &x2, const Vector<Double> &y2, const Vector<uInt> &colors)

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

virtual void setLineWidth(Float width)

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

virtual void setLineWidth(uInt width);

virtual void setDrawFunction(Display::DrawFunction function)
virtual void setForeground(uLong color)
virtual void setBackground(uLong color)
void lineWidth(Float width)
float lineWidth()const
virtual void setLineStyle(Display::LineStyle style)
virtual void setCapStyle(Display::CapStyle style)
virtual void setJoinStyle(Display::JoinStyle style)
virtual void setFillStyle(Display::FillStyle style)
virtual void setFillRule(Display::FillRule rule)
virtual void setArcMode(Display::ArcMode mode)

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

virtual Float getLineWidth() const

Get Graphics Attributes

virtual Display::DrawFunction getDrawFunction() const
virtual uLong getForeground() const
virtual uLong getBackground() const
virtual Display::LineStyle getLineStyle() const
virtual Display::CapStyle getCapStyle() const
virtual Display::JoinStyle getJoinStyle() const
virtual Display::FillStyle getFillStyle() const
virtual Display::FillRule getFillRule() const
virtual Display::ArcMode getArcMode() const

Get Graphics Attributes

virtual Bool enable(Display::Option option)
virtual Bool disable(Display::Option option)

(Cacheable) Option Control Options listed in DisplayEnums

virtual void setImageCacheStrategy(Display::ImageCacheStrategy strategy)

Control the image-caching strategy

virtual Display::ImageCacheStrategy imageCacheStrategy() const

virtual void setClipWindow(Int x1, Int y1, Int x2, Int y2)
virtual void getClipWindow(Int &x1, Int &y1, Int &x2, Int &y2)

(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. Once set, it is only possible to REDUCE the size of the current clip window, not increase it.

virtual void refresh(const Display::RefreshReason &reason = Display::UserCommand, const Bool &explicitrequest = True)

(Not Cacheable) Redraw the window

virtual void flush()

Cause display to flush any graphics commands not yet drawn

virtual void clear()
virtual void clear(Int x1, Int y1, Int x2, Int y2)

(Cacheable) Clear the window using the background color

virtual void setClearColor(uInt colorIndex)
virtual void setClearColor(const String &colorname)
virtual void setClearColor(float r, float g, float b)

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

virtual uInt clearColor() const

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

virtual void getClearColor(float &r, float &g, float &b) const

virtual uInt width() const

Return the width of the PSPixelCanvas in pixels

virtual uInt height() const

Return the height of the PSPixelCanvas in pixels

virtual uInt depth() const

Return the depth of the PSPixelCanvas in bits

virtual void pixelDensity(Float &xdpi, Float &ydpi) const

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

virtual void setColor(uInt colorIndex)
virtual void setColor(const String &colorname)
virtual void setRGBColor(float r, float g, float b)
virtual void setHSVColor(float h, float s, float v)

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

virtual uInt color() const

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

virtual void getColor(float &r, float &g, float &b) const

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

virtual Bool getColorComponents(const String &colorname, Float &r, Float &g, Float &b)

virtual Bool getColor(Int x, Int y, uInt &color)
virtual Bool getRGBColor(Int x, Int y, float &r, float &g, float &b)
virtual Bool getHSVColor(Int x, Int y, float &h, float &s, float &v)

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

virtual void setDeviceForegroundColor(const String colorname)
virtual String deviceForegroundColor() const
virtual void setDeviceBackgroundColor(const String colorname)
virtual String deviceBackgroundColor() const

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

virtual Bool resizeColorTable(uInt newSize)

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

virtual Bool resizeColorTable(uInt nReds, uInt nGreens, uInt nBlues)

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

virtual PixelCanvasColorTable * pcctbl() const

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

virtual Bool resize(uInt reqXSize, uInt reqYSize, Bool doCallbacks = True)
virtual void setPcctbl(PixelCanvasColorTable * pcctbl)
PSPixelCanvasColorTable *PSpcctbl()const

virtual void pushMatrix()
virtual void popMatrix()

save/restore the current translation. This is called pushMatrix because eventually we may want scaling or rotation to play a modest role here.

virtual void loadIdentity()

zero the current translation

virtual void translate(Int xt, Int yt)
virtual void getTranslation(Int &xt, Int &yt) const
virtual Int xTranslation() const
virtual Int yTranslation() const

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.

virtual void setDrawBuffer(Display::DrawBuffer buf)

(Not cacheable) set the draw buffer None of the buffer routines are supported.

virtual void copyBackBufferToFrontBuffer()
virtual void copyFrontBufferToBackBuffer()
virtual void swapBuffers()

buffer memory exchanges (Not cacheable)

virtual void copyBackBufferToFrontBuffer(Int x1, Int y1, Int x2, Int y2)
virtual void copyFrontBufferToBackBuffer(Int x1, Int y1, Int x2, Int y2)
virtual void swapBuffers(Int x1, Int y1, Int x2, Int y2)

partial buffer memory exchanges. (x1,y1 are blc, x2,y2 are trc)

void drawPSImage(const int x, const int y, const int iwidth, const int iheight, const float xzoom, const float yzoom, const uShort *data, const int bpc, const Display::ColorModel=Display::Index)

PSPixelCanvas specific misc. functions.

Draw a scaled image on PostScript canvas.

void setResolution(const float xres, const float yres, const PSDriver::Dimension = PSDriver::INCHES)
void getResolution(float &xres, float &yres, const PSDriver::Dimension = PSDriver::INCHES)const

Set/get declared resolution in pixels per supplied dimension.

void smooth(const Bool smth)
Bool smooth()const

Whether to enable pixel interpolation for drawImage().

Bool annotate()const
void annotate(const Bool a)

Whether to put tracing comments in the output.

virtual Float pixelScaling() const

void pspcinit(PSDriver *ps, PSPixelCanvasColorTable * )

void clearRectangle(const float x0, const float y0, const float x1, const float y1)

void note(const char *)
void note(const char *, const uLong)

Used in annotating output file.