28 #ifndef DISPLAY_PIXELCANVAS_H
29 #define DISPLAY_PIXELCANVAS_H
40 template <
class T>
class Vector;
41 template <
class T>
class Matrix;
302 &colorcomponent) = 0;
595 virtual void flush() = 0;
599 virtual void clear() = 0;
612 virtual void getClearColor(
float &r,
float &g,
float &b)
const = 0;
637 virtual void setRGBColor(
float r,
float g,
float b) = 0;
638 virtual void setHSVColor(
float h,
float s,
float v);
651 virtual void getColor(
float &r,
float &g,
float &b)
const = 0;
Display::DrawBuffer drawBuffer() const
return the drawing buffer, the target destination for graphics
virtual void setDrawFunction(Display::DrawFunction function)=0
Set Graphics Attributes Options for functions with enum argument listed in DisplayEnums.
virtual casacore::Bool validList(casacore::uInt list)=0
return true if the list exists
virtual void setHSVColor(float h, float s, float v)
std::list< void * > motionEHList_
This is the list of registered motion EventHandlers.
virtual void drawColoredPoints(const casacore::Vector< casacore::Int > &x1, const casacore::Vector< casacore::Int > &y1, const casacore::Vector< casacore::uInt > &colors)=0
(Cacheable) Draw a set of points, specifying a color per point to be drawn.
virtual Display::JoinStyle getJoinStyle() const =0
A class designed to manage several representations of the same font.
virtual void getClipWindow(casacore::Int &x1, casacore::Int &y1, casacore::Int &x2, casacore::Int &y2)=0
std::vector< double > Vector
virtual casacore::Bool setFont(const casacore::String &fontName)=0
(Cacheable) Set the font to the recognizable font name
Vector< T > column(size_t j)
Returns a reference to the j'th column.
Abstract interface to underlying graphics library's colortable.
virtual casacore::Bool disable(Display::Option option)=0
virtual void setPcctbl(PixelCanvasColorTable *pcctbl)=0
void removePositionEventHandler(const PCPositionEH &eh)
virtual casacore::Bool getHSVColor(casacore::Int x, casacore::Int y, float &h, float &s, float &v)
WorldCanvas Event Handler for managing events.
void mapToColor(casacore::Array< casacore::uLong > &inOutArray, casacore::Bool rangeCheck=false)
virtual void swapBuffers()=0
virtual void translateList(casacore::uInt list, casacore::Int xt, casacore::Int yt)=0
translate the list
virtual casacore::Bool getRGBColor(casacore::Int x, casacore::Int y, float &r, float &g, float &b)=0
virtual void drawPolyline(const casacore::Vector< casacore::Int > &x1, const casacore::Vector< casacore::Int > &y1)=0
(Cacheable) Draw a single connected line between the points given
virtual void drawRectangle(casacore::Int x1, casacore::Int y1, casacore::Int x2, casacore::Int y2)=0
(Cacheable) Draw a rectangle
virtual void enablePositionEvents()=0
virtual void setDeviceForegroundColor(const casacore::String colorname)=0
Get/set the current foreground/background colors.
virtual void setColor(casacore::uInt colorIndex)=0
(Cacheable) Set current color (works in RGB or colormap mode)
virtual casacore::uLong getForeground() const =0
virtual Display::FillRule getFillRule() const =0
virtual void drawImage(const casacore::Matrix< casacore::uInt > &data, casacore::Int x, casacore::Int y)=0
(Cacheable) Draw an array of 2D color data as a raster image for zoom = <1,1>
virtual casacore::Bool setFont(const casacore::String &, const casacore::Int)
Set the font to font name / size.
virtual Display::ArcMode getArcMode() const =0
virtual void setForeground(casacore::uLong color)=0
virtual void copyFrontBufferToBackBuffer()=0
virtual void setCapStyle(Display::CapStyle style)=0
Option
PixelCanvas Options.
virtual void setBackground(casacore::uLong color)=0
virtual Display::DrawFunction getDrawFunction() const =0
Get Graphics Attributes.
virtual casacore::Bool refreshAllowed() const
return true if refresh is allowed right now...
virtual Display::CapStyle getCapStyle() const =0
Display::ColorModel colorModel_
The current color cube model to be used for all multichannel color mapping.
virtual void translateAllLists(casacore::Int xt, casacore::Int yt)=0
translate all lists
casacore::uInt getColormapSize(const Colormap *cmap) const
Return the allocation size of some Colormap.
virtual void getTranslation(casacore::Int &xt, casacore::Int &yt) const =0
virtual casacore::Bool enable(Display::Option option)=0
(Cacheable) Option Control Options listed in DisplayEnums
DrawBuffer
PixelCanvas target drawing destination.
casacore::Bool refreshActive() const
return true if the refresh is active (Added for X11PixelCanvas DefaultBuffer)
virtual casacore::Int yTranslation() const =0
virtual void clear()=0
(Cacheable) Clear the window using the background color
virtual PixelCanvasColorTable * pcctbl() const =0
Need a mechanism to return the PixelCanvasColorTable so drawing functions within classes can operate...
virtual void drawFilledRectangle(casacore::Int x1, casacore::Int y1, casacore::Int x2, casacore::Int y2)=0
(Cacheable) Draw a filled rectangle
casacore::Matrix< casacore::Float > getMarker(const Display::Marker &marker, const casacore::Float &pixelHeight)
virtual void setArcMode(Display::ArcMode mode)=0
virtual void drawList(casacore::uInt list)=0
(Cacheable) recall cached display commands
FillRule
Fill Rule Xlib programming guide, pg.132.
virtual void translate(casacore::Int xt, casacore::Int yt)=0
translation functions translate applies a relative translation to the current matrix and can be used ...
Display::ColorModel colorModel() const
return the colorModel used for multichannel color
virtual void deleteList(casacore::uInt list)=0
remove list from cache
void callRefreshEventHandlers(Display::RefreshReason reason)
call event handlers
virtual void copyBackBufferToFrontBuffer()=0
buffer memory exchanges (Not cacheable)
casacore::Bool refreshActive_
true if refresh is active
virtual void drawImage(const casacore::Int &, const casacore::Int &, const casacore::Matrix< casacore::uInt > &, const casacore::Matrix< casacore::Bool > &, casacore::Bool=false)
(Cacheable) Draw an array of 2D color data as a raster image, taking note of the casacore::Bool mask...
virtual casacore::Bool resize(casacore::uInt, casacore::uInt, casacore::Bool=true)
(Not Cacheable) resize request.
virtual void disablePositionEvents()=0
virtual casacore::Int textWidth(const casacore::String &)
TODO : This should become abstract Determine the width / height of a string of text based on current ...
void mapToColor(casacore::Array< casacore::uInt > &outArray, const casacore::Array< casacore::uInt > &inArrayRed, const casacore::Array< casacore::uInt > &inArrayGreen, const casacore::Array< casacore::uInt > &inArrayBlue)
virtual void disableMotionEvents()=0
virtual void getClearColor(float &r, float &g, float &b) const =0
Base class defining interface to pixel-based output devices.
void bufferPolygonPoint(casacore::Float x, casacore::Float y)
ABSTRACT CLASSES Deliberately vague to be general enough to allow for many different types of data
CapStyle
Controls the appearance of thick lines near their endpoints.
reference point aligned to center of text
virtual Display::LineStyle getLineStyle() const =0
casacore::uInt nRegisteredColormaps_
Number of colormaps registered by external clients.
std::list< void * > positionEHList_
This is the list of registered position EventHandlers.
ColorComponent
Color components.
void mapToColor(casacore::Array< casacore::uChar > &outArray, const casacore::Array< casacore::uChar > &inArray, casacore::Bool rangeCheck=false)
map [0,N-1] into colorpixels, where N is the current colormap size The values are returned as unsigne...
void mapToColor(casacore::Array< casacore::uChar > &inOutArray, casacore::Bool rangeCheck=false)
same as above except the matrix is operated on in place.
virtual casacore::String deviceForegroundColor() const =0
virtual void setDrawBuffer(Display::DrawBuffer buf)=0
(Not cacheable) set the draw buffer
virtual casacore::Bool resizeColorTable(casacore::uInt newSize)=0
(Not Cacheable) resize the colortable by requesting a new number of cells
virtual void pixelDensity(casacore::Float &xdpi, casacore::Float &ydpi) const =0
Get the pixel density (in dots per inch [dpi]) of the PixelCanvas.
void mapToColor(casacore::Array< casacore::uInt > &inOutArray, casacore::Bool rangeCheck=false)
virtual void getColor(float &r, float &g, float &b) const =0
(Not Cacheable) Retuns the current color as an RGB triple
virtual casacore::uInt newList()=0
begin caching display commands - return list ID
virtual Display::FillStyle getFillStyle() const =0
void bufferLine(casacore::Float x1, casacore::Float y1, casacore::Float x2, casacore::Float y2)
Display::DrawMode drawMode() const
return the drawmode (Compile or Draw) Compile drawmode means that a display list is currently being b...
PixelCanvas()
Abstract base class idiom.
void addPositionEventHandler(const PCPositionEH &eh)
std::list< void * > refreshEHList_
This is the list of registered refresh EventHandlers.
void setColormap(Colormap *map)
(Not Cacheable) set/get the current colormap.
virtual casacore::uLong getBackground() const =0
void callPositionEventHandlers(Display::KeySym keysym, casacore::Bool keystate, casacore::Int x, casacore::Int y, casacore::uInt state)
virtual void drawText(casacore::Int, casacore::Int, const casacore::String &, const casacore::Float &, Display::TextAlign=Display::AlignCenter)
TODO This should become abstract - NYI in GLPixelCanvas currently Draw text at a specified angle...
void setDrawBuffer_(Display::DrawBuffer buf)
Also allowed only by derived classes.
void bufferPolylinePoint(casacore::Float x, casacore::Float y)
Display::DrawMode drawMode_
This is the current drawing mode.
virtual void drawPoint(casacore::Int x1, casacore::Int y1)=0
(Cacheable) Draw a single point using current color
virtual void setRGBColor(float r, float g, float b)=0
virtual void loadIdentity()=0
zero the current translation
void removeMotionEventHandler(const PCMotionEH &eh)
virtual void setFillRule(Display::FillRule rule)=0
virtual void popMatrix()=0
bool Bool
Define the standard types used by Casacore.
void unregisterColormap(Colormap *dcmap)
unregister a colormap from a pixelcanvas.
virtual void setImageCacheStrategy(Display::ImageCacheStrategy strategy)=0
Control the image-caching strategy.
virtual void drawLines(const casacore::Matrix< casacore::Int > &verts)=0
(Cacheable) Draw N/2 lines from an Nx2 matrix
virtual void setFillStyle(Display::FillStyle style)=0
casacore::uInt getColormapSize() const
return the size of the current colormap
PixelCanvas Event Handler for managing keyboard and mouse button events.
void mapToColor(casacore::Array< casacore::uShort > &inOutArray, casacore::Bool rangeCheck=false)
virtual void setClipWindow(casacore::Int x1, casacore::Int y1, casacore::Int x2, casacore::Int y2)=0
(Cacheable) Setup the clip window.
void removeRefreshEventHandler(const PCRefreshEH &eh)
remove event handlers
virtual void bufferComponent(const casacore::Matrix< casacore::uInt > &data, const casacore::Int &x, const casacore::Int &y, const Display::ColorComponent &colorcomponent)=0
Fill one of the channel buffers.
virtual casacore::Int xTranslation() const =0
virtual void drawFilledPolygon(const casacore::Vector< casacore::Int > &x1, const casacore::Vector< casacore::Int > &y1)=0
(Cacheable) Draw and fill a closed polygon
casacore::Bool defaultColormapActive_
true if the PixelCanvas was the one who registered the existing colortable
void mapToColor(casacore::Array< casacore::uShort > &outArray, const casacore::Array< casacore::uShort > &inArray, casacore::Bool rangeCheck=false)
virtual casacore::Float getLineWidth() const =0
virtual casacore::uInt getLineWidth() const = 0;
virtual void drawColoredEllipses(const casacore::Matrix< casacore::Float > ¢res, const casacore::Vector< casacore::Float > &smajor, const casacore::Vector< casacore::Float > &sminor, const casacore::Vector< casacore::Float > &pangle, const casacore::Vector< casacore::uInt > &colors, const casacore::Float &scale=1.0, const casacore::Bool &outline=true)
Draw a set of colored ellipses, possibly with borders.
virtual void endList()=0
end caching display commands
void addMotionEventHandler(const PCMotionEH &eh)
virtual void setLineWidth(casacore::Float width)=0
virtual void setLineWidth(casacore::uInt width) = 0;
void bufferPoint(casacore::Float x, casacore::Float y)
vector primitive buffering
FillStyle
Controls fill style.
virtual void drawMarker(const casacore::Int &x1, const casacore::Int &y1, const Display::Marker &marker, const casacore::Int &pixelHeight)
Draw a "marker".
void mapToColor(casacore::Array< casacore::uLong > &outArray, const casacore::Array< casacore::uLong > &inArray, casacore::Bool rangeCheck=false)
void accumPolylinePoint(casacore::Float x, casacore::Float y)
add point to polyline
void registerColormap(Colormap *dcmap, casacore::Float weight=1.0)
register a colormap to the pixelcanvas.
void mapToColor3(casacore::Array< casacore::uLong > &out, const casacore::Array< casacore::Float > &chan1in, const casacore::Array< casacore::Float > &chan2in, const casacore::Array< casacore::Float > &chan3in)
Multi-Channel functions that combine separate array channels into a single array of output colors for...
casacore::Bool colormapRegistered()
RefreshReason
Callback reasons for PCRefreshEvent and WCRefreshEvent.
Describes a method of generating a table of colors.
virtual void drawPoints(const casacore::Matrix< casacore::Int > &verts)=0
(Cacheable) Draw N points specified as a Nx2 matrix
DrawMode
PixelCanvas Drawing Modes.
virtual casacore::uInt height() const =0
Return the height of the PixelCanvas in pixels.
void flush()
flush the buffer
virtual void deleteLists()=0
flush all lists from the cache
virtual void drawColoredLines(const casacore::Vector< casacore::Int > &x1, const casacore::Vector< casacore::Int > &y1, const casacore::Vector< casacore::Int > &x2, const casacore::Vector< casacore::Int > &y2, const casacore::Vector< casacore::uInt > &colors)=0
(Cacheable) Draw a set of lines, specifying a color per line to be drawn.
virtual Display::ImageCacheStrategy imageCacheStrategy() const =0
virtual void setJoinStyle(Display::JoinStyle style)=0
Colormap * colormap() const
virtual void refresh(const Display::RefreshReason &reason=Display::UserCommand, const casacore::Bool &explicitrequest=true)=0
casacore::Bool member(const Colormap *cmap) const
Return whether or not a data colormap is used by this pixel canvas.
virtual void mapToColor(const Colormap *map, casacore::Array< casacore::uChar > &outArray, const casacore::Array< casacore::uChar > &inArray, casacore::Bool rangeCheck=true) const =0
map [0,N-1] into colorpixels, where N is the current colormap size The values are returned as unsigne...
virtual void drawPolygon(const casacore::Vector< casacore::Int > &x1, const casacore::Vector< casacore::Int > &y1)=0
(Cacheable) Draw a closed polygon
Display::DrawBuffer drawBuffer_
The current drawing buffer.
virtual void drawLine(casacore::Int x1, casacore::Int y1, casacore::Int x2, casacore::Int y2)=0
(Cacheable) Draw a single line using current color
String: the storage and methods of handling collections of characters.
void setColorModel(Display::ColorModel colorModel)
Set the input color model for multichannel color.
PCVGBuffer vgbuf_
The PCVGBuffer is used to accumulate lines and points until flushed (or the buffer is full) ...
virtual void setLineStyle(Display::LineStyle style)=0
Colormap * colormap_
This is the current colormap.
virtual void drawColoredPoints(const casacore::Matrix< casacore::Double > &xy, const casacore::Vector< casacore::uInt > &colors)
virtual void setDeviceBackgroundColor(const casacore::String colorname)=0
void mapToColor(casacore::Array< casacore::uInt > &outArray, const casacore::Array< casacore::uInt > &inArray, casacore::Bool rangeCheck=false)
ImageCacheStrategy
How to cache images when displaying them on client-server graphics systems.
virtual void flushComponentBuffers()=0
(NOT CACHEABLE!) Flush the component buffers.
virtual void setClearColor(casacore::uInt colorIndex)=0
(Cacheable) Set the color to use for clearing the display
void accumPolygonPoint(casacore::Float x, casacore::Float y)
add point to polygon
virtual casacore::Int textHeight(const casacore::String &)
virtual void enableMotionEvents()=0
enabling/disabling of event tracking
DrawFunction
PixelCanvas Drawing Logical Functions.
virtual void mapToColorRGB(const Colormap *map, casacore::Array< casacore::uInt > &outArray, const casacore::Array< casacore::uInt > &inArrayRed, const casacore::Array< casacore::uInt > &inArrayGreen, const casacore::Array< casacore::uInt > &inArrayBlue) const
PixelCanvas Event Handler for managing pointer motion events.
virtual void drawColoredPoints(const casacore::Matrix< casacore::Float > &xy, const casacore::Vector< casacore::uInt > &colors)
virtual casacore::Bool getColorComponents(const casacore::String &colorname, casacore::Float &r, casacore::Float &g, casacore::Float &b)=0
Get color components in range 0 to 1 without actually allocating the color.
KeySym
Keysyms for PixelCanvas keyboard events.
void setDrawMode(Display::DrawMode mode)
Only allowed by derived classes.
void accumPoint(casacore::Float x, casacore::Float y)
add point
void accumLine(casacore::Float x1, casacore::Float y1, casacore::Float x2, casacore::Float y2)
add line
virtual casacore::uInt width() const =0
Return the width of the PixelCanvas in pixels.
void redraw()
(Not Cacheable) Redraw the window
JoinStyle
Controls the appearance of two joined lines.
void callMotionEventHandlers(casacore::Int x, casacore::Int y, casacore::uInt state)
virtual casacore::Bool supportsLists()=0
Does this canvas support cached display lists? The user of the canvas should always check this...
virtual void flush()=0
Cause display to flush any graphics commands not yet drawn.
virtual void drawText(casacore::Int x, casacore::Int y, const casacore::String &text, Display::TextAlign alignment=Display::AlignCenter)=0
(Cacheable) Draw text using that font aligned in some way to the position
void addRefreshEventHandler(const PCRefreshEH &eh)
add event handlers
virtual void drawColoredPoints(const casacore::Matrix< casacore::Int > &xy, const casacore::Vector< casacore::uInt > &colors)
ColorModel
Different ways of handling color on the display.
virtual casacore::uInt depth() const =0
Return the depth of the PixelCanvas in bits.
virtual void pushMatrix()=0
save/restore the current translation.
virtual casacore::uInt color() const =0
(Not Cacheable) Returns the current color as a color index
virtual casacore::Bool setFont(DLFont *)
TODO: These should become abstract Set the font via the DisplayLibrary Font class.
virtual casacore::uInt clearColor() const =0
(Not Cacheable) Get the current color to use for clearing the display.
User told PixelCanvas to refresh via PixelCanvas refresh()
LineStyle
Style of line to use.
virtual void drawEllipse(const casacore::Float &cx, const casacore::Float &cy, const casacore::Float &smajor, const casacore::Float &sminor, const casacore::Float &pangle, casacore::Bool outline=true, casacore::Float xstretch=1., casacore::Float ystretch=1.)
Draw a single ellipse using the current pen (ie.
#define casacore
<X11/Intrinsic.h> #defines true, false, casacore::Bool, and String.
virtual casacore::Float pixelScaling() const
virtual casacore::String deviceBackgroundColor() const =0