summaryrefslogtreecommitdiff
path: root/internal/dynamic_depth/dimension.h
blob: 3d792fb8fc593c6d7eb547810fc5b2ee54ed459c (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
#ifndef DYNAMIC_DEPTH_INTERNAL_DYNAMIC_DEPTH_DIMENSION_H_  // NOLINT
#define DYNAMIC_DEPTH_INTERNAL_DYNAMIC_DEPTH_DIMENSION_H_  // NOLINT

namespace dynamic_depth {

// A struct that contains the width and height of a size or the x and y
// coordinates of a point.
struct Dimension {
  Dimension(int w, int h) : width(w), height(h) {}
  int width;
  int height;

  inline bool operator==(const Dimension& other) const {
    return width == other.width && height == other.height;
  }

  inline bool operator!=(const Dimension& other) const {
    return !(*this == other);
  }
};

}  // namespace dynamic_depth

#endif  // DYNAMIC_DEPTH_INTERNAL_DYNAMIC_DEPTH_DIMENSION_H_  // NOLINT