8 #ifndef __LIBCAMERA_GEOMETRY_H__
9 #define __LIBCAMERA_GEOMETRY_H__
36 Size(
unsigned int w,
unsigned int h)
48 bool operator==(
const Size &lhs,
const Size &rhs);
49 bool operator<(
const Size &lhs,
const Size &rhs);
51 static inline bool operator!=(
const Size &lhs,
const Size &rhs)
56 static inline bool operator<=(
const Size &lhs,
const Size &rhs)
58 return lhs < rhs || lhs == rhs;
61 static inline bool operator>(
const Size &lhs,
const Size &rhs)
66 static inline bool operator>=(
const Size &lhs,
const Size &rhs)
90 unsigned int hstep,
unsigned int vstep)
108 return !(lhs == rhs);
Describe a range of sizes.
Definition: geometry.h:72
SizeRange(const Size &minSize, const Size &maxSize, unsigned int hstep, unsigned int vstep)
Construct a size range with specified min, max and step.
Definition: geometry.h:89
SizeRange(const Size &minSize, const Size &maxSize)
Construct a size range with specified min and max, and steps of 1.
Definition: geometry.h:84
unsigned int vStep
The vertical step.
Definition: geometry.h:102
SizeRange(const Size &size)
Construct a size range representing a single size.
Definition: geometry.h:79
Size max
The maximum size.
Definition: geometry.h:100
unsigned int hStep
The horizontal step.
Definition: geometry.h:101
SizeRange()
Construct a size range initialized to 0.
Definition: geometry.h:74
Size min
The minimum size.
Definition: geometry.h:99
bool contains(const Size &size) const
Test if a size is contained in the range.
Definition: geometry.cpp:273
std::string toString() const
Assemble and return a string describing the size range.
Definition: geometry.cpp:288
bool operator==(const Rectangle &lhs, const Rectangle &rhs)
Compare rectangles for equality.
Definition: geometry.cpp:69
Describe a rectangle's position and dimensions.
Definition: geometry.h:15
int y
The vertical coordinate of the rectangle's top-left corner.
Definition: geometry.h:17
unsigned int height
The distance between the top and bottom sides.
Definition: geometry.h:19
const std::string toString() const
Assemble and return a string describing the rectangle.
Definition: geometry.cpp:56
unsigned int width
The distance between the left and right sides.
Definition: geometry.h:18
int x
The horizontal coordinate of the rectangle's top-left corner.
Definition: geometry.h:16
Describe a two-dimensional size.
Definition: geometry.h:30
const std::string toString() const
Assemble and return a string describing the size.
Definition: geometry.cpp:120
Size()
Construct a Size with width and height set to 0.
Definition: geometry.h:31
unsigned int width
The Size width.
Definition: geometry.h:41
Size(unsigned int w, unsigned int h)
Construct a Size with given width and height.
Definition: geometry.h:36
bool isNull() const
Check if the size is null.
Definition: geometry.h:44
unsigned int height
The Size height.
Definition: geometry.h:42