
#include <GUI/XWindow.H>
Inheritance diagram for XWindow:


Use this class to create an window on your screen and display an image. It will use shared memory between us and the X server if supported by the X server and the display is local. Resizing is not allowed; so any image passed to drawImage() must have dimensions that match those specified at onstruction of the XWindow.
Definition at line 61 of file XWindow.H.
Public Member Functions | |
| XWindow (const Dims &dims=Dims(320, 240), const int x=-1, const int y=-1, const char *title="USC Neuromorphic Vision") | |
| Constructor: create, display and map the window. | |
| virtual | ~XWindow () |
| Destructor. | |
| void | setVisible (const bool v) |
| Change the window's visibility (map or unmap it as needed). | |
| bool | isVisible (const bool v) const |
| Check whether the window is currently mapped (i.e. visible on screen). | |
| void | setPosition (const int x, const int y) |
| Set the position of an XWindow. | |
| Point2D< int > | getPosition () |
| Get the position of an XWindow. | |
| void | drawImage (const Image< PixRGB< byte > > &img, const int x=0, const int y=0, const bool resizeWindow=false) |
| Draw an image into the XWindow. | |
| void | drawImage (const Image< byte > &img, const int x=0, const int y=0, const bool resizeWindow=false) |
| Draw an image into the XWindow. | |
| void | drawImage (const Image< float > &img, const int x=0, const int y=0, bool normalize=true, const bool resizeWindow=false) |
| Draw an image into the XWindow. | |
| void | drawRgbLayout (const Layout< PixRGB< byte > > &layout, const int x=0, const int y=0, const bool resizeWindow=false) |
| Draw an image layout into the XWindow. | |
| void | drawGrayLayout (const Layout< byte > &layout, const int x=0, const int y=0, const bool resizeWindow=false) |
| Draw an image layout into the XWindow. | |
| const char * | getTitle () const |
| Get the window title. | |
| void | setTitle (const char *title) |
| set the title bar to a new string | |
| Dims | getDims () const |
| return the dimensions of this window | |
| void | setDims (const Dims &dims) |
| change the dimensions of this window | |
Wrappers around X11 Xlib calls | |
We wrap these calls, rather than exposing a Display* and Window directly, so that we can get the threading issues right; namely, we need to lock a global mutex each time any window wants to use the Display*, since multiple threads may be running and accessing the Display*. | |
| void | selectInput (long event_mask) const |
| Calls XSelectInput(). | |
| Atom | setWMProtocol (const char *atomname) const |
| Calls XInternAtom() followed by XSetWMProtocols(). | |
| Bool | checkMaskEvent (long event_mask, XEvent *event) const |
| Calls XCheckWindowEvent(). | |
| Bool | checkTypedEvent (int event_type, XEvent *event) const |
| Calls XCheckTypedWindowEvent(). | |
Protected Member Functions | |
| void | redrawImage () |
Classes | |
| struct | XWinImage |
|
||||||||||||||||||||
|
Constructor: create, display and map the window.
Definition at line 542 of file XWindow.C. References disp, display_init(), display_init_once, g_display, Dims::h(), Dims::isEmpty(), LDEBUG, LFATAL, LOCK_DISPLAY, and Dims::w(). |
|
|
Destructor.
Definition at line 767 of file XWindow.C. References g_display, LDEBUG, LOCK_DISPLAY, and rutz::shared_ptr< T >::reset(). |
|
||||||||||||
|
Calls XCheckWindowEvent(). Note that XCheckWindowEvent() is just like XCheckMaskEvent(), but restricted to a specific Window) Definition at line 836 of file XWindow.C. References g_display, and LOCK_DISPLAY. |
|
||||||||||||
|
Calls XCheckTypedWindowEvent().
Definition at line 843 of file XWindow.C. References g_display, and LOCK_DISPLAY. |
|
||||||||||||||||||||
|
Draw an image layout into the XWindow. This is equivalent to drawImage(layout.render()), but is implemented more efficiently by avoiding an intermediate copy rendered of the image.
Definition at line 759 of file XWindow.C. Referenced by ImageDisplayStream::writeFrame(). |
|
||||||||||||||||||||||||
|
Draw an image into the XWindow.
Definition at line 733 of file XWindow.C. References drawImage(), Image< T >::getDims(), image, inplaceClamp(), inplaceNormalize(), and setDims(). |
|
||||||||||||||||||||
|
Draw an image into the XWindow.
Definition at line 708 of file XWindow.C. References ASSERT, g_display, Image< T >::getDims(), Image< T >::getHeight(), Image< T >::getWidth(), h, Dims::h(), LOCK_DISPLAY, redrawImage(), setDims(), w, and Dims::w(). |
|
||||||||||||||||||||
|
Draw an image into the XWindow.
Definition at line 683 of file XWindow.C. References ASSERT, g_display, h, Dims::h(), LOCK_DISPLAY, redrawImage(), setDims(), w, and Dims::w(). Referenced by MbariResultViewer::displayImage(), displayPartImage(), drawImage(), ENV_SHOWIMG(), getPartImage(), getPrimeLev(), learnImage(), main(), processSalCue(), showFeatures(), showHist(), SHOWIMG(), showProb(), SeaBee3Simulator::simLoop(), IRobotSim::simLoop(), SubSim::simLoop(), BeoBotSim::simLoop(), train(), updateDisplay(), BeoPilot::updateGUI(), ImageDisplayStream::writeFrame(), and XWinManaged::XWinManaged(). |
|
||||||||||||||||||||
|
Draw an image layout into the XWindow. This is equivalent to drawImage(layout.render()), but is implemented more efficiently by avoiding an intermediate copy rendered of the image.
Definition at line 751 of file XWindow.C. Referenced by main(), and ImageDisplayStream::writeFrame(). |
|
|
return the dimensions of this window
Definition at line 799 of file XWindow.C. Referenced by MbariResultViewer::displayImage(), and main(). |
|
|
Get the position of an XWindow.
Definition at line 673 of file XWindow.C. References g_display, and LOCK_DISPLAY. Referenced by setVisible(). |
|
|
Get the window title.
|
|
|
Check whether the window is currently mapped (i.e. visible on screen).
|
|
|
Calls XSelectInput().
Definition at line 816 of file XWindow.C. References g_display, and LOCK_DISPLAY. |
|
|
change the dimensions of this window
Definition at line 805 of file XWindow.C. References LOCK_DISPLAY. Referenced by drawImage(), and main(). |
|
||||||||||||
|
Set the position of an XWindow.
Definition at line 665 of file XWindow.C. References g_display, and LOCK_DISPLAY. |
|
|
set the title bar to a new string
Definition at line 656 of file XWindow.C. References g_display, and LOCK_DISPLAY. Referenced by MbariResultViewer::displayImage(). |
|
|
Change the window's visibility (map or unmap it as needed).
Definition at line 620 of file XWindow.C. References g_display, getPosition(), Point2D< T >::i, Point2D< T >::j, LINFO, and LOCK_DISPLAY. |
|
|
Calls XInternAtom() followed by XSetWMProtocols().
Definition at line 824 of file XWindow.C. References g_display, LFATAL, and LOCK_DISPLAY. |
1.4.4