TLIB documentation
 

tlRect Class Reference

Inheritance diagram for tlRect:

Inheritance graph
[legend]
Collaboration diagram for tlRect:

Collaboration graph
[legend]

List of all members.


Detailed Description

Rectangle object.

One of the most commonly used objects in TLIB is the tlRect object. The tlRect object contains simple rectangular data (position, size) and routines to duplicate, move and resize it. It is used mostly to define a ROI (Region Of Interest, i.e. to limit the image processing to a given portion of an image), leading to shorter execution times.

Public Member Functions

 tlRect ()
 tlRect (int x, int y, int width, int height)
virtual ~tlRect ()
int set (int x, int y, int width, int height)
int collapse (int dsize)
int expand (int dsize)
int setCenter (int x, int y)
int copy (tlRect *rect)
int copyTo (tlRect *rect)
tlRectcopy ()
int intersect (tlRect *rect)
int setSize (int width, int height, int depth=255)
int setLocation (int x, int y, int disp=0)
int setLocation (tlPoint *point)
int shift (int dx, int dy, int ddisp=0)
int setWorldLocation (float wx, float wy, float wz)
tlLocationtoLocation ()
int toLocation (tlLocation *location)

Public Attributes

int width
int height
int depth
int x
int y
int disp
float wx
float wy
float wz


Constructor & Destructor Documentation

tlRect::tlRect (  ) 

Constructor, initialize all members to 0.

Note:
See error management for details.

tlRect::tlRect ( int  x,
int  y,
int  width,
int  height 
)

Constructor, initialize all members to the desired value.

Parameters:
x rectangle upper-left corner x position [pix]
y rectangle upper-left corner y position [pix]
width rectangle width [pix]
height rectangle height [pix]
Note:
See error management for details.

tlRect::~tlRect (  )  [virtual]

Destructor.

Note:
See error management for details.


Member Function Documentation

int tlRect::set ( int  x,
int  y,
int  width,
int  height 
)

Set rectangle member values.

Parameters:
x rectangle upper-left corner x position [pix]
y rectangle upper-left corner y position [pix]
width rectangle width [pix]
height rectangle height [pix]
Returns:
0 on success, -1 otherwise.
See error management for details.

int tlRect::collapse ( int  dsize  ) 

Evenly shrinks the rectangle around its center.

Parameters:
dsize width/height decrease [pix]
Returns:
0 on success, -1 otherwise.
See error management for details.

int tlRect::expand ( int  dsize  ) 

Evenly expands the rectangle around its center

Parameters:
dsize width/height decrease [pix]
Returns:
0 on success, -1 otherwise.
See error management for details.

int tlRect::setCenter ( int  x,
int  y 
)

Set the location of the rectangle center.

Parameters:
x rectangle center x position [pix]
y rectangle center corner y position [pix]
Returns:
0 on success, -1 otherwise.
See error management for details.

Reimplemented in tlMask.

int tlRect::copy ( tlRect rect  ) 

Copy the rectangle parameters from another tlRect object.

Parameters:
rect the rectangle that should be copied
Returns:
0 on success, -1 otherwise.
See error management for details.
See also:
copy(), copyTo(tlRect *rect)

int tlRect::copyTo ( tlRect rect  ) 

Copy rectangle parameters to another rect object

Parameters:
rect the rectangle that should contained copied parameters
Returns:
0 on success, -1 otherwise.
See error management for details.
See also:
copy (), copy (tlRect *rect)

tlRect * tlRect::copy (  ) 

Create a copy of the rectangle.

Returns:
A pointer to the new (copied) rectangle.
Warning:
The new rectangle is allocated. Do not forget to deallocate it using delete when done with it.
See also:
copy(tlRect *rect), copyTo (tlRect *rect)

int tlRect::intersect ( tlRect rect  ) 

Check if a given rectangle intesects with the current object.

Parameters:
rect the rectangle to check for intersection
Returns:
1 if rectangles intersect, 0 if not, -1 on error.
See error management for details.

int tlSize::setSize ( int  width,
int  height,
int  depth = 255 
) [inherited]

Set the size object parameters.

Parameters:
width object width
height object height
depth object disparity range size
Returns:
0 on success, -1 otherwise.
See error management for details.

int tlLocation::setLocation ( int  x,
int  y,
int  disp = 0 
) [inherited]

Set the location object parameters.

Parameters:
x x location of the object [pix]
y y location of the object [pix]
disp disparity of the object [disp]
Returns:
0 on success, -1 otherwise.
See error management for details.

int tlLocation::setLocation ( tlPoint point  )  [inherited]

Set the location object parameters.

Parameters:
point tlPoint object
Returns:
0 on success, -1 otherwise.
See error management for details.

int tlLocation::shift ( int  dx,
int  dy,
int  ddisp = 0 
) [inherited]

Shift the object location.

Parameters:
dx shift along x axis [pix]
dy shift along y axis [pix]
ddisp disparity shift [disp]
Returns:
0 on success, -1 otherwise.
See error management for details.

int tlLocation::setWorldLocation ( float  wx,
float  wy,
float  wz 
) [inherited]

Set the world location object parameters.

Parameters:
wx world X location
wy world Y location
wz world Z location
Returns:
0 on success, -1 otherwise.
See error management for details.

tlLocation * tlLocation::toLocation (  )  [inherited]

Get a copy of the location of the object.

Returns:
A pointer to a tlLocation object containing the data.
Note:
It is the responsibility of the programmer to delete the object returned.

int tlLocation::toLocation ( tlLocation location  )  [inherited]

Get the location of the object.

Parameters:
location [out] tlLocation object that will receive the data
Returns:
0 on success, -1 otherwise.
See error management for details.


Member Data Documentation

int tlSize::width [inherited]

width of the object inheriting from tlSize.

int tlSize::height [inherited]

height of the object inheriting from tlSize.

int tlSize::depth [inherited]

disparity range size of the object inheriting from tlSize.

int tlLocation::x [inherited]

X location of the object [pix].

int tlLocation::y [inherited]

Y location of the object [pix].

int tlLocation::disp [inherited]

Disparity of the object [disp].

int tlLocation::wx [inherited]

X location of the object in real-world coordonates [m].

int tlLocation::wy [inherited]

Y location of the object in real-world coordonates [m].

int tlLocation::wz [inherited]

Z location of the object in real-world coordonates [m].


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.