Image Component Library (ICL)
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines
Public Member Functions | Public Attributes | Static Public Attributes
icl::utils::Rect32f Class Reference

Floating point precision implementation of the Rect class. More...

#include <Rect32f.h>

Inheritance diagram for icl::utils::Rect32f:
icl::markers::MarkerMetricsICL1::CR

List of all members.

Public Member Functions

 Rect32f ()
 default constructor
 Rect32f (float x, float y, float width, float height)
 creates a defined Rect32f
 Rect32f (const Point32f &p, const Size32f &s)
 creates a new Rect32f with specified offset and size
 Rect32f (const Rect32f &r)
 create a deep copy of a rect
 Rect32f (const Rect &rect)
 create a floating point rect from given int-valued rect
bool isNull () const
 checks wether the object instance is null, i.e. all elements are zero
bool operator== (const Rect32f &s) const
 checks if two rects are equal
bool operator!= (const Rect32f &s) const
 checks if two rects are not equal
Rect32f operator* (double d) const
 scales all parameters of the rect by a double value
Rect32f operator/ (double d) const
 scales all parameters of the rect by a double value
Rect32foperator+= (const Size32f &s)
 adds a size to the rects size
Rect32foperator-= (const Size32f &s)
 substracs a size to the rects size
Rect32foperator+= (const Point32f &p)
 adds a Point to the rects offset
Rect32foperator-= (const Point32f &p)
 substracts a Point to the rects offset
Rect32foperator*= (double d)
 scales all rect params inplace
Rect32foperator/= (double d)
 scales all rect params inplace
float getDim () const
 returns width*height
Rect32f operator& (const Rect32f &r) const
 intersection of two Rect32fs
Rect32foperator&= (const Rect32f &r)
 inplace intersection of two rects
Rect32f operator| (const Rect32f &r) const
 union of two Rect32fs
Rect32foperator|= (const Rect32f &r)
 inplace union of two rects
Rect32f normalized () const
 rects with negative sizes are normalized to Positive sizes
bool contains (const Rect32f &r) const
 returns if a Rect32f containes another rect
bool contains (float x, float y) const
 returns if the Rect32f contains a given point
Rect32fenlarge (float k)
 let the rect grow by k pixles into each direction
Rect32f enlarged (float k) const
 returns an enlarged instance of this rect
Point32f ul () const
 returns upper left point of the rect
Point32f ll () const
 returns lower left point of the rect
Point32f ur () const
 returns upper right point of the rect
Point32f lr () const
 returns lower right point of the rect
float left () const
 returns the left border position
float right () const
 returns the right border position
float bottom () const
 returns the position of the bottom border
float top () const
 returns the position of the upper border
Size32f getSize () const
 returns the size of the rect
Point32f center () const
 returns the center point of the rect
Rect32f transform (double xfac, double yfac) const
 multiplies the rect's x and width by xfac and y and height by yfac

Public Attributes

float x
float y
 !< x pos (upper left)
float width
 !< y pos (upper left)
float height
 !< width of the rect

Static Public Attributes

static const Rect32f null
 !< height of the rect

Detailed Description

Floating point precision implementation of the Rect class.


Constructor & Destructor Documentation

default constructor

icl::utils::Rect32f::Rect32f ( float  x,
float  y,
float  width,
float  height 
) [inline]

creates a defined Rect32f

icl::utils::Rect32f::Rect32f ( const Point32f p,
const Size32f s 
) [inline]

creates a new Rect32f with specified offset and size

icl::utils::Rect32f::Rect32f ( const Rect32f r) [inline]

create a deep copy of a rect

icl::utils::Rect32f::Rect32f ( const Rect rect) [inline]

create a floating point rect from given int-valued rect


Member Function Documentation

float icl::utils::Rect32f::bottom ( ) const [inline]

returns the position of the bottom border

returns the center point of the rect

bool icl::utils::Rect32f::contains ( const Rect32f r) const [inline]

returns if a Rect32f containes another rect

bool icl::utils::Rect32f::contains ( float  x,
float  y 
) const [inline]

returns if the Rect32f contains a given point

Rect32f& icl::utils::Rect32f::enlarge ( float  k) [inline]

let the rect grow by k pixles into each direction

if k<0 the rect becomes smaller E.g. Rect32f(10,10,90,90).enlarge(10) creates a Rect32f (0,0,100,100)

Parameters:
kamount of pixel the rectangle is enlarged by
Returns:
*this
Rect32f icl::utils::Rect32f::enlarged ( float  k) const [inline]

returns an enlarged instance of this rect

See also:
enlarge(float)
float icl::utils::Rect32f::getDim ( ) const [inline]

returns width*height

returns the size of the rect

bool icl::utils::Rect32f::isNull ( ) const [inline]

checks wether the object instance is null, i.e. all elements are zero

float icl::utils::Rect32f::left ( ) const [inline]

returns the left border position

Point32f icl::utils::Rect32f::ll ( ) const [inline]

returns lower left point of the rect

Point32f icl::utils::Rect32f::lr ( ) const [inline]

returns lower right point of the rect

rects with negative sizes are normalized to Positive sizes

e.g. the rect (5,5,-5,-5) is normalized to (0,0,5,5)

bool icl::utils::Rect32f::operator!= ( const Rect32f s) const [inline]

checks if two rects are not equal

Rect32f icl::utils::Rect32f::operator& ( const Rect32f r) const [inline]

intersection of two Rect32fs

Rect32f& icl::utils::Rect32f::operator&= ( const Rect32f r) [inline]

inplace intersection of two rects

Rect32f icl::utils::Rect32f::operator* ( double  d) const [inline]

scales all parameters of the rect by a double value

Rect32f& icl::utils::Rect32f::operator*= ( double  d) [inline]

scales all rect params inplace

Rect32f& icl::utils::Rect32f::operator+= ( const Size32f s) [inline]

adds a size to the rects size

Rect32f& icl::utils::Rect32f::operator+= ( const Point32f p) [inline]

adds a Point to the rects offset

Rect32f& icl::utils::Rect32f::operator-= ( const Size32f s) [inline]

substracs a size to the rects size

Rect32f& icl::utils::Rect32f::operator-= ( const Point32f p) [inline]

substracts a Point to the rects offset

Rect32f icl::utils::Rect32f::operator/ ( double  d) const [inline]

scales all parameters of the rect by a double value

Rect32f& icl::utils::Rect32f::operator/= ( double  d) [inline]

scales all rect params inplace

bool icl::utils::Rect32f::operator== ( const Rect32f s) const [inline]

checks if two rects are equal

Rect32f icl::utils::Rect32f::operator| ( const Rect32f r) const [inline]

union of two Rect32fs

Rect32f& icl::utils::Rect32f::operator|= ( const Rect32f r) [inline]

inplace union of two rects

float icl::utils::Rect32f::right ( ) const [inline]

returns the right border position

float icl::utils::Rect32f::top ( ) const [inline]

returns the position of the upper border

Rect32f icl::utils::Rect32f::transform ( double  xfac,
double  yfac 
) const [inline]

multiplies the rect's x and width by xfac and y and height by yfac

Point32f icl::utils::Rect32f::ul ( ) const [inline]

returns upper left point of the rect

Point32f icl::utils::Rect32f::ur ( ) const [inline]

returns upper right point of the rect


Member Data Documentation

!< width of the rect

!< height of the rect

static null instance (0,0,0,0)

!< y pos (upper left)

!< x pos (upper left)


The documentation for this class was generated from the following file:
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines