libCZI
Reading and Writing CZI documents made easy
libCZI::IntRect Struct Reference

A rectangle (with integer coordinates). More...

#include <libCZI_Pixels.h>

Public Member Functions

void Invalidate ()
 Invalidates this object.
 
bool IsValid () const
 Returns a boolean indicating whether this rectangle contains valid information.
 
bool IsNonEmpty () const
 Returns a boolean indicating whether this rectangle is valid and non-empty.
 
bool IntersectsWith (const IntRect &r) const
 
IntRect Intersect (const IntRect &r) const
 

Static Public Member Functions

static IntRect Intersect (const IntRect &a, const IntRect &b)
 

Public Attributes

int x
 The x-coordinate of the upper-left point of the rectangle.
 
int y
 The y-coordinate of the upper-left point of the rectangle.
 
int w
 The width of the rectangle.
 
int h
 The height of the rectangle.
 

Detailed Description

A rectangle (with integer coordinates).

Member Function Documentation

◆ Intersect() [1/2]

static IntRect libCZI::IntRect::Intersect ( const IntRect a,
const IntRect b 
)
inlinestatic

Calculate the intersection of the two specified rectangle.

Parameters
aThe first rectangle.
bThe second rectangle.
Returns
A rectangle which is the intersection of the two rectangles. If the two rectangles do not intersect, an empty rectangle is returned (width=height=0).

◆ Intersect() [2/2]

IntRect libCZI::IntRect::Intersect ( const IntRect r) const
inline

Calculate the intersection with the specified rectangle.

Parameters
rThe rectangle for which the intersection is to be calculated.
Returns
A rectangle which is the intersection of the two rectangles. If the two rectangles do not intersect, an empty rectangle is returned (width=height=0).

◆ IntersectsWith()

bool libCZI::IntRect::IntersectsWith ( const IntRect r) const
inline

Determine whether this rectangle intersects with the specified one.

Parameters
rThe other rectangle.
Returns
True if the two rectangles intersect, false otherwise.

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