CVBpy 15.0
RectLT Class Reference

Rectangle object. More...

Inherits object.

Public Member Functions

bool contains (self, cvb.Point2D point)
 Checks if this rectangle contains a point. More...
 
cvb.RectLT create (float left=0.0, float top=0.0, float right=0.0, float bottom=0.0)
 Default rectangle. More...
 
cvb.RectLT create (cvb.Point2D location, cvb.Size2D size)
 Constructor for a rectangle with location and size. More...
 

Properties

 bottom = property
 float: Gets or sets the bottom of the rectangle.
 
 coordinate_system = property
 int: Indicates the coordinate system in which this object is being measured (when used as an area of interest, see cvb.CoordinateSystemType).
 
 height = property
 float: Gets or sets the height of the rectangle.
 
 is_valid = property
 bool: Checks if the rectangle is valid.
 
 left = property
 float: Gets or sets the leftmost point of the rectangle.
 
 location = property
 cvb.Point2D: Gets or sets the location of the top left corner of the rectangle.
 
 right = property
 float: Gets or sets rightmost point of the rectangle.
 
 size = property
 cvb.Size2D: Gets or sets the size of the rectangle.
 
 top = property
 float: Gets or sets top of the rectangle.
 
 width = property
 float: Gets or sets the width of the rectangle.
 

Detailed Description

Rectangle object.

In contrast to the Rect class this class uses left top of each pixel as anchor point. Therefore right and bottom are not included(i.e. width = right - left and height = bottom - top).

Supports the same arguments as cvb.RectLT.create.

Parameters

*args : Any Parameters like cvb.RectLT.create.

**kwargs : Any Parameters like cvb.RectLT.create.

Member Function Documentation

◆ contains()

bool contains (   self,
cvb.Point2D  point 
)

Checks if this rectangle contains a point.

Parameters

point : cvb.Point2D Point to check.

Returns

bool True if the point is inside this rectangle, False otherwise.

◆ create() [1/2]

cvb.RectLT create ( cvb.Point2D  location,
cvb.Size2D  size 
)

Constructor for a rectangle with location and size.

Parameters

location : cvb.Point2D Location of the rectangle.

size : cvb.Size2D Size of the rectangle.

Returns

cvb.RectLT New rectangle.

◆ create() [2/2]

cvb.RectLT create ( float   left = 0.0,
float   top = 0.0,
float   right = 0.0,
float   bottom = 0.0 
)

Default rectangle.

Parameters

left : float Leftmost point of the rectangle.

top : float Topmost point of the rectangle.

right : float Rightmost point of the rectangle.

bottom : float Bottom point of the rectangle.

Returns

cvb.RectLT New rectangle.