blob: 94d14664cb9e793a0f54e4b5becb571df0b3372e [file] [log] [blame]
Brian Silverman4e662aa2022-05-11 23:10:19 -07001// Copyright 2021 Google LLC
2//
3// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
4// https://www.apache.org/licenses/LICENSE-2.0> or the MIT license
5// <LICENSE-MIT or https://opensource.org/licenses/MIT>, at your
6// option. This file may not be copied, modified, or distributed
7// except according to those terms.
8
9#pragma once
10#include <iostream>
11
12struct Point {
13 int x;
14 int y;
15};
16
17class Rect {
18public:
19 Point top_left;
20 Point bottom_right;
21 int width() const { return bottom_right.x - top_left.x; }
22 int height() const { return bottom_right.y - top_left.y; }
23};
24
25inline void print_point(Point p) {
26 std::cout << "(" << p.x << ", " << p.y << ")\n";
27}