start packing

This commit is contained in:
Fabien Freling 2022-02-14 00:13:09 +01:00
parent a2f07920c7
commit 8d91216f24
4 changed files with 62 additions and 1 deletions

18
src/bounding_box.cpp Normal file
View file

@ -0,0 +1,18 @@
#include "bounding_box.h"
int BoundingBox::width() const {
return right - left;
}
int BoundingBox::height() const {
return bottom - top;
}
int BoundingBox::area() const {
return width() * height();
}
bool BoundingBox::operator==(const BoundingBox& b) const {
return left == b.left and top == b.top and right == b.right and
bottom == b.bottom;
}