PoDoFo 0.9.20
PoDoFo::Rect Class Referencefinal

#include <Rect.h>

Public Member Functions

 Rect ()
 
 Rect (double x, double y, double width, double height)
 
 Rect (const Rect &rhs)=default
 
void ToArray (PdfArray &arr) const
 
std::string ToString () const
 
void Intersect (const Rect &rect)
 
double GetLeft () const
 
double GetBottom () const
 
double GetRight () const
 
double GetTop () const
 

Static Public Member Functions

static Rect FromCorners (double x1, double y1, double x2, double y2)
 
static Rect FromArray (const PdfArray &arr)
 

Detailed Description

A rectangle defined by position and size

Constructor & Destructor Documentation

◆ Rect() [1/3]

Rect::Rect ( )

Create an empty rectangle with bottom=left=with=height=0

◆ Rect() [2/3]

Rect::Rect ( double x,
double y,
double width,
double height )

Create a rectangle with a given size and position

◆ Rect() [3/3]

PoDoFo::Rect::Rect ( const Rect & rhs)
default

Copy constructor

Member Function Documentation

◆ FromArray()

Rect Rect::FromArray ( const PdfArray & arr)
static

Create a Rect from a the 4 values in the array

Parameters
arrthe array to load the values from

◆ FromCorners()

Rect Rect::FromCorners ( double x1,
double y1,
double x2,
double y2 )
static

Create a Rect from a couple of arbitrary points

Returns
the created Rect

◆ GetBottom()

double PoDoFo::Rect::GetBottom ( ) const
inline

Get the bottom coordinate of the rectangle

◆ GetLeft()

double PoDoFo::Rect::GetLeft ( ) const
inline

Get the left coordinate of the rectangle

◆ GetRight()

double Rect::GetRight ( ) const

Get the right coordinate of the rectangle

◆ GetTop()

double Rect::GetTop ( ) const

Get the top coordinate of the rectangle

◆ Intersect()

void Rect::Intersect ( const Rect & rect)

Intersect with another rect

Parameters
rectthe rect to intersect with

◆ ToArray()

void Rect::ToArray ( PdfArray & arr) const

Converts the rectangle into an array

Parameters
varthe array to store the Rect

◆ ToString()

string Rect::ToString ( ) const

Returns a string representation of the Rect

Returns
std::string representation as [ left bottom right top ]