| libpgf 7.21.2 PGF - Progressive Graphics File

Public Member Functions | Public Attributes | List of all members
PGFRect Struct Reference

Rectangle. More...

`#include <PGFtypes.h>`

## Public Member Functions
| PGFRect ()
| Standard constructor. More...
| PGFRect (UINT32 x, UINT32 y, UINT32 width, UINT32 height)
UINT32 | Width () const
UINT32 | Height () const
bool | IsInside (UINT32 x, UINT32 y) const

## Public Attributes
UINT32 | left
UINT32 | top
UINT32 | right
UINT32 | bottom

## Detailed Description

Rectangle.

Rectangle

Author
  C. Stamm

Definition at line 224 of file PGFtypes.h.

## Constructor & Destructor Documentation

## ◆ PGFRect() [1/2]

PGFRect::PGFRect | ( |  | ) |
| inline

Standard constructor.

Definition at line 228 of file PGFtypes.h.

228 : left(0), top(0), right(0), bottom(0) {}
PGFRect::right
UINT32 right
Definition: PGFtypes.h:225
PGFRect::top
UINT32 top
Definition: PGFtypes.h:225
PGFRect::left
UINT32 left
Definition: PGFtypes.h:225
PGFRect::bottom
UINT32 bottom
Definition: PGFtypes.h:225

## ◆ PGFRect() [2/2]

PGFRect::PGFRect | ( | UINT32 | x,
|  | UINT32 | y,
|  | UINT32 | width,
|  | UINT32 | height
| ) |  |
| inline

Constructor

Parameters

  x | Left offset
  y | Top offset
  width | Rectangle width
  height | Rectangle height

Definition at line 235 of file PGFtypes.h.

235 : left(x), top(y), right(x + width), bottom(y + height) {}
PGFRect::right
UINT32 right
Definition: PGFtypes.h:225
PGFRect::top
UINT32 top
Definition: PGFtypes.h:225
PGFRect::left
UINT32 left
Definition: PGFtypes.h:225
PGFRect::bottom
UINT32 bottom
Definition: PGFtypes.h:225

## Member Function Documentation

## ◆ Height()

UINT32 PGFRect::Height | ( |  | ) | const
| inline

Returns
  Rectangle height

Definition at line 258 of file PGFtypes.h.

258 { return bottom - top; }
PGFRect::top
UINT32 top
Definition: PGFtypes.h:225
PGFRect::bottom
UINT32 bottom
Definition: PGFtypes.h:225

## ◆ IsInside()

bool PGFRect::IsInside | ( | UINT32 | x,
|  | UINT32 | y
| ) |  | const
| inline

Test if point (x,y) is inside this rectangle (inclusive top-left edges, exclusive bottom-right edges)

Parameters

  x | Point coordinate x
  y | Point coordinate y

Returns
  True if point (x,y) is inside this rectangle (inclusive top-left edges, exclusive bottom-right edges)

Definition at line 264 of file PGFtypes.h.

264 { return (x >= left && x < right && y >= top && y < bottom); }
PGFRect::top
UINT32 top
Definition: PGFtypes.h:225
PGFRect::left
UINT32 left
Definition: PGFtypes.h:225
PGFRect::bottom
UINT32 bottom
Definition: PGFtypes.h:225

## ◆ Width()

UINT32 PGFRect::Width | ( |  | ) | const
| inline

Returns
  Rectangle width

Definition at line 255 of file PGFtypes.h.

255 { return right - left; }
PGFRect::right
UINT32 right
Definition: PGFtypes.h:225
PGFRect::left
UINT32 left
Definition: PGFtypes.h:225

## Member Data Documentation

## ◆ bottom

UINT32 PGFRect::bottom

Definition at line 225 of file PGFtypes.h.

## ◆ left

UINT32 PGFRect::left

Definition at line 225 of file PGFtypes.h.

## ◆ right

UINT32 PGFRect::right

Definition at line 225 of file PGFtypes.h.

## ◆ top

UINT32 PGFRect::top

Definition at line 225 of file PGFtypes.h.

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

- PGFtypes.h