MyScript Interactive Ink SDK  3.2.0
Point.h
1 // Copyright @ MyScript. All rights reserved.
2 
3 #pragma once
4 
5 #include <iostream>
6 
7 namespace myscript {
8 namespace iink {
9 namespace graphics {
10 
14 struct Point
15 {
16  float x = 0.f;
17  float y = 0.f;
22  Point() =default;
23 
30  Point(float x, float y) noexcept : x(x), y(y) {}
31 
39  bool operator==(const Point& other) const noexcept
40  {
41  return x == other.x && y == other.y;
42  }
43 
51  bool operator!=(const Point& other) const noexcept
52  {
53  return x != other.x || y != other.y;
54  }
55 };
56 
65 inline
66 std::ostream& operator<<(std::ostream& os, const Point& p)
67 {
68  os << "Point(" << p.x << ", " << p.y << ")";
69  return os;
70 }
71 
72 }
73 }
74 }
std::ostream & operator<<(std::ostream &os, const Color &c)
Definition: Color.h:134
Definition: Configuration.h:11
Definition: Point.h:15
float x
Definition: Point.h:16
bool operator!=(const Point &other) const noexcept
Definition: Point.h:51
Point(float x, float y) noexcept
Definition: Point.h:30
float y
Definition: Point.h:17
bool operator==(const Point &other) const noexcept
Definition: Point.h:39