TLIB documentation
 

tlDisplay Class Reference

List of all members.


Detailed Description

Image display and event management class.

Provides a window to render images, as well as simple event management (mouse and keyboard input).

Public Member Functions

 tlDisplay ()
 tlDisplay (int x, int y)
 tlDisplay (char *name)
 tlDisplay (char *name, int x, int y)
virtual ~tlDisplay ()
bool getVisible ()
int getID ()
int getWidth ()
int getHeight ()
int setPos (int x, int y)
int resize (int width, int height)
int close ()
int show ()
int hide ()
int display (tlHist *hist)
int display (tlHist2D *hist)

Static Public Member Functions

static int queryEvent ()
static int event ()
static int getLastEvent ()
static tlDisplaygetLastDisplay ()
static tlPointgetMouse ()
static int getMouse (tlPoint *point)
static tlPointgetMouseDown ()
static int getMouseDown (tlPoint *point)
static tlPointgetMouseUp ()
static int getMouseUp (tlPoint *point)
static tlPointgetMouseDouble ()
static int getMouseDouble (tlPoint *point)
static tlRectgetMouseRect ()
static int getMouseRect (tlRect *rect)
static char getKeyDown ()
static char getKeyUp ()
static int setMousePos (int x, int y)
static char waitKey ()
static void waitMouse ()


Constructor & Destructor Documentation

tlDisplay::tlDisplay (  ) 

Default constructor.

Note:
See error management for details.

tlDisplay::tlDisplay ( int  x,
int  y 
)

Constructor, specifies window position on the screen.

Parameters:
x initial window X position [pix]
y initial window Y position [pix]
Note:
See error management for details.

tlDisplay::tlDisplay ( char *  name  ) 

Constructor.

Parameters:
name window name (displayed in title bar)
Note:
See error management for details.

tlDisplay::tlDisplay ( char *  name,
int  x,
int  y 
)

Constructor, specifies both position and window name.

Parameters:
name window name (displayed in title bar)
x initial window X position [pix]
y initial window Y position [pix]
Note:
See error management for details.

tlDisplay::~tlDisplay (  )  [virtual]

Destructor.

Note:
See error management for details.


Member Function Documentation

bool tlDisplay::getVisible (  )  [inline]

Return window state (visible or hidden).

int tlDisplay::getID (  )  [inline]

Return window ID tag.

int tlDisplay::getWidth (  )  [inline]

Return window height (displayable area without borders).

int tlDisplay::getHeight (  )  [inline]

Return window width (displayable area without borders).

int tlDisplay::setPos ( int  x,
int  y 
)

Reposition the window and the display area.

Parameters:
x new display area (upper-left corner) X position
y new display area (upper-left corner) Y position
Returns:
0 on success, -1 otherwise.
See error management for details.

int tlDisplay::resize ( int  width,
int  height 
)

Resize the window and the display area.

Parameters:
width new display area width
height new display area height
Returns:
0 on success, -1 otherwise.
See error management for details.

int tlDisplay::close (  ) 

Close and destroys the window.

Returns:
0 on success, -1 otherwise.
See error management for details.

int tlDisplay::show (  ) 

Make window visible.

Returns:
0 on success, -1 otherwise.
See error management for details.

int tlDisplay::hide (  ) 

Make window invisible.

Returns:
0 on success, -1 otherwise.
See error management for details.

int tlDisplay::display ( tlHist hist  ) 

Display a histogram in the display area.

Parameters:
hist the histogram to display
Returns:
0 on success, -1 otherwise.
See error management for details.

int tlDisplay::display ( tlHist2D hist  ) 

Display a 2D histogram in the display area.

Parameters:
hist the 2D histogram to display
Returns:
0 on success, -1 otherwise.
See error management for details.

int tlDisplay::queryEvent ( void   )  [static]

Check if an event has occured and is in the event queue.

Returns:
TL_EVENT if an event occured,
TL_NO_EVENT otherwise.

int tlDisplay::event ( void   )  [static]

Process TL library windows events; result is stored in TL specific data structure. This is a blocking function.

Returns:
TL_EVENT status (see tlDisplay.h for details)

int tlDisplay::getLastEvent (  )  [static]

Return last received event. Is set to TL_NO_EVENT once called.

Returns:
TL_EVENT status (see tlDisplay.h for details)
TL_NO_EVENT if there is no new event

tlDisplay * tlDisplay::getLastDisplay (  )  [static]

Return a pointer to the display that generated the last processed event.

Returns:
a pointer to the display that received the last event (as given by tl_event_get_last),
NULL if no display is associated with the event.

tlPoint * tlDisplay::getMouse (  )  [static]

Get mouse click coordonates. User can be in *any* TL window. Use tlDisplay::getLastDisplay() to retrieve the window that currently "has" the mouse.

Returns:
A pointer to a copy of a tlPoint object.
Note:
It is the responsibility of the programmer to delete the point after use.
See also:
tlDisplay::getMouse (tlPoint *point)

tlDisplay::getMouse ( tlPoint point  )  [static]

Get mouse click coordonates. User can be in *any* TL window. Use tlDisplay::getLastDisplay() to retrieve the window that currently "has" the mouse.

Parameters:
point [out] a valid pointer to a point structure to receive the coordonates.
Returns:
A pointer to a tlPoint object.

tlPoint * tlDisplay::getMouseDown (  )  [static]

Get mouse coordonates when button is pressed. User can be in *any* TL window. Use tlDisplay::getLastDisplay() to retrieve the window that currently "has" the mouse.

Returns:
A pointer to a copy of a tlPoint object.
Note:
It is the responsibility of the programmer to delete the point after use.
See also:
tlDisplay::getMouseDown (tlPoint *point)

tlDisplay::getMouseDown ( tlPoint point  )  [static]

Get mouse coordonates when button is pressed. User can be in *any* TL window. Use tlDisplay::getLastDisplay() to retrieve the window that currently "has" the mouse.

Parameters:
point [out] a valid pointer to a point structure to receive the coordonates.
Returns:
A pointer to a tlPoint object.

tlPoint * tlDisplay::getMouseUp (  )  [static]

Get mouse coordonates when button is released. User can be in *any* TL window. Use tlDisplay::getLastDisplay() to retrieve the window that currently "has" the mouse.

Returns:
A pointer to a copy of a tlPoint object.
Note:
It is the responsibility of the programmer to delete the point after use.
See also:
tlDisplay::getMouseUp (tlPoint *point)

tlDisplay::getMouseUp ( tlPoint point  )  [static]

Get mouse coordonates when button is released. User can be in *any* TL window. Use tlDisplay::getLastDisplay() to retrieve the window that currently "has" the mouse.

Parameters:
point [out] a valid pointer to a point structure to receive the coordonates.
Returns:
A pointer to a tlPoint object.

tlPoint * tlDisplay::getMouseDouble (  )  [static]

Get mouse double click coordonates. User can be in *any* TL window. Use tlDisplay::getLastDisplay() to retrieve the window that currently "has" the mouse.

Returns:
A pointer to a copy of a tlPoint object.
Note:
It is the responsibility of the programmer to delete the point after use.
See also:
tlDisplay::getMouseDouble (tlPoint *point)

tlDisplay::getMouseDouble ( tlPoint point  )  [static]

Get mouse double click coordonates. User can be in *any* TL window. Use tlDisplay::getLastDisplay() to retrieve the window that currently "has" the mouse.

Parameters:
point [out] a valid pointer to a point structure to receive the coordonates.
Returns:
A pointer to a tlPoint object.

tlRect * tlDisplay::getMouseRect (  )  [static]

Get mouse defined rectangle coordonates. User can be in *any* TL window. Use tlDisplay::getLastDisplay() to retrieve the window that currently "has" the mouse.

Returns:
A pointer to a copy of a tlRect object.
Note:
It is the responsibility of the programmer to delete the rect after use.
See also:
tlDisplay::getMouseRect (tlRect *rect)

tlDisplay::getMouseRect ( tlRect rect  )  [static]

Get mouse defined rectangle coordonates. User can be in *any* TL window. Use tlDisplay::getLastDisplay() to retrieve the window that currently "has" the mouse.

Parameters:
rect [out] a valid pointer to a point structure to receive the coordonates.
Returns:
A pointer to a tlRect object.

char tlDisplay::getKeyDown (  )  [static]

Get keycode for keyboard downstroke.

Returns:
The character ASCII code.

char tlDisplay::getKeyUp (  )  [static]

Get keycode for keyboard uptroke.

Returns:
The character ASCII code.

int tlDisplay::setMousePos ( int  x,
int  y 
) [static]

Warp the mouse pointer to an absolute screen position. (x, y) = (0, 0) = top-left corner

Parameters:
x absolute screen X position
y absolute screen Y position
Returns:
0 on success, -1 otherwise.
See error management for details.

char tlDisplay::waitKey (  )  [static]

Wait for a key to be pressed on the keyboard.

Returns:
The character entered by the user.

void tlDisplay::waitMouse (  )  [static]

Wait for the user to click in a window.


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

TLIB documentation - generated on 7 May 2008
Please address any questions to seb@tuyphon.com
(C) 2001-2008 - S. Grange
(C) 2001-2007 - VRAI Group, EPFL
All Rights Reserved.