Main Page   Class Hierarchy   Alphabetical List   Compound List   Compound Members  

prapi::XWindows Class Reference

#include <XWindows.h>

List of all members.


Detailed Description

A class for displaying images on an X screen.


Static Public Methods

template<class T> util::Threaddisplay (const util::Matrix< T > &img, bool waitUserInput=false, std::string title="PRAPI Image Display") throw (XException&)
 Display an image on an X window.


Member Function Documentation

template<class T>
util::Thread * prapi::XWindows::display const util::Matrix< T > &    img,
bool    waitUserInput = false,
std::string    title = "PRAPI Image Display"
throw (XException&) [static]
 

Display an image on an X window.

A window is created on the default display, with its default visual. If the waitUserInput flag is set to true, the call blocks until a key or a mouse button is pressed, and NULL is returned. If it is false, a separate thread is created, which waits until the window closes. A pointer to this thread is returned. The caller is responsible for joining the thread (Thread::join()) and for deleting the pointer. An exception is thrown if an error occurs. Make sure that the depth of the given color (or gray-scale) values is eight bits. An example:

 Matrix<Color<int,3> > clrImg(...);
 Thread* thread = XWindows::display(clrImg);
 thread.join();
 delete thread;
 
Parameters:
img  the image to be displayed
waitUserInput  if true, the call blocks and returns NULL.
title  the title of the display window Otherwise, it does not block and returns a pointer to a thread.


The documentation for this class was generated from the following file:
Documentation generated on 11.09.2003 with Doxygen.
The documentation is copyrighted material.
Copyright © Topi Mäenpää 2003. All rights reserved.