summaryrefslogtreecommitdiff
path: root/internal/dynamic_depth/dimension.h
blob: 9f68f544f4a34e26f44b505223f18d74130acbb8 (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
25
26
#ifndef DYNAMIC_DEPTH_INTERNAL_DYNAMIC_DEPTH_DIMENSION_H_  // NOLINT
#define DYNAMIC_DEPTH_INTERNAL_DYNAMIC_DEPTH_DIMENSION_H_  // NOLINT

namespace photos_editing_formats {
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
}  // namespace photos_editing_formats

#endif // DYNAMIC_DEPTH_INTERNAL_DYNAMIC_DEPTH_DIMENSION_H_  // NOLINT