start packing
This commit is contained in:
parent
a2f07920c7
commit
8d91216f24
4 changed files with 62 additions and 1 deletions
18
src/bounding_box.cpp
Normal file
18
src/bounding_box.cpp
Normal 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;
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue