Public Member Functions | Public Attributes | List of all members
dai::Rect Struct Reference

#include <Rect.hpp>

Public Member Functions

float area () const
 
Point2f bottomRight () const
 
bool contains (const Point2f &pt) const
 
Rect denormalize (int destWidth, int destHeight) const
 
bool empty () const
 
bool isNormalized () const
 
Rect normalize (int srcWidth, int srcHeight) const
 
Rectoperator= (const Rect &r)=default
 
Rectoperator= (Rect &&r)=default
 
 Rect ()=default
 
 Rect (const Point2f &org, const Size2f &sz)
 
 Rect (const Point2f &pt1, const Point2f &pt2)
 
 Rect (const Rect &r)
 
 Rect (float x, float y, float width, float height)
 
Size2f size () const
 
Point2f topLeft () const
 

Public Attributes

float height = 0.0f
 
float width = 0.0f
 
float x = 0.0f
 
float y = 0.0f
 

Detailed Description

Rect structure

x,y coordinates together with width and height that define a rectangle. Can be either normalized [0,1] or absolute representation.

Definition at line 18 of file Rect.hpp.

Constructor & Destructor Documentation

◆ Rect() [1/5]

dai::Rect::Rect ( )
default

◆ Rect() [2/5]

dai::Rect::Rect ( float  x,
float  y,
float  width,
float  height 
)
inline

Definition at line 21 of file Rect.hpp.

◆ Rect() [3/5]

dai::Rect::Rect ( const Rect r)
inline

Definition at line 22 of file Rect.hpp.

◆ Rect() [4/5]

dai::Rect::Rect ( const Point2f org,
const Size2f sz 
)
inline

Definition at line 23 of file Rect.hpp.

◆ Rect() [5/5]

dai::Rect::Rect ( const Point2f pt1,
const Point2f pt2 
)
inline

Definition at line 24 of file Rect.hpp.

Member Function Documentation

◆ area()

float dai::Rect::area ( ) const
inline

Area (width*height) of the rectangle

Definition at line 53 of file Rect.hpp.

◆ bottomRight()

Point2f dai::Rect::bottomRight ( ) const
inline

The bottom-right corner

Definition at line 39 of file Rect.hpp.

◆ contains()

bool dai::Rect::contains ( const Point2f pt) const
inline

Checks whether the rectangle contains the point.

Definition at line 67 of file Rect.hpp.

◆ denormalize()

Rect dai::Rect::denormalize ( int  destWidth,
int  destHeight 
) const
inline

Denormalize rectangle.

Parameters
destWidthDestination frame width.
destHeightDestination frame height.

Definition at line 84 of file Rect.hpp.

◆ empty()

bool dai::Rect::empty ( ) const
inline

True if rectangle is empty.

Definition at line 60 of file Rect.hpp.

◆ isNormalized()

bool dai::Rect::isNormalized ( ) const
inline

Whether rectangle is normalized (coordinates in [0,1] range) or not.

Definition at line 74 of file Rect.hpp.

◆ normalize()

Rect dai::Rect::normalize ( int  srcWidth,
int  srcHeight 
) const
inline

Normalize rectangle.

Parameters
srcWidthSource frame width.
srcHeightSource frame height.

Definition at line 96 of file Rect.hpp.

◆ operator=() [1/2]

Rect& dai::Rect::operator= ( const Rect r)
default

◆ operator=() [2/2]

Rect& dai::Rect::operator= ( Rect &&  r)
default

◆ size()

Size2f dai::Rect::size ( ) const
inline

Size (width, height) of the rectangle

Definition at line 46 of file Rect.hpp.

◆ topLeft()

Point2f dai::Rect::topLeft ( ) const
inline

The top-left corner.

Definition at line 32 of file Rect.hpp.

Member Data Documentation

◆ height

float dai::Rect::height = 0.0f

Definition at line 107 of file Rect.hpp.

◆ width

float dai::Rect::width = 0.0f

Definition at line 106 of file Rect.hpp.

◆ x

float dai::Rect::x = 0.0f

Definition at line 104 of file Rect.hpp.

◆ y

float dai::Rect::y = 0.0f

Definition at line 105 of file Rect.hpp.


The documentation for this struct was generated from the following file:


depthai
Author(s): Martin Peterlin
autogenerated on Sat Mar 22 2025 02:58:20