MyScript Interactive Ink SDK  4.1.2
Point.h
1 // Copyright @ MyScript. All rights reserved.
2 
3 #pragma once
4 
5 #include <iink/Engine.h>
6 
7 #include <cmath>
8 #include <iosfwd>
9 
10 namespace myscript {
11 namespace iink {
12 namespace graphics {
13 
17 struct Point
18 {
19  float x = 0.f;
20  float y = 0.f;
25  Point() =default;
26 
33  Point(float x, float y) noexcept : x(x), y(y) {}
34 
42  bool isFinite() const noexcept
43  {
44  return std::isfinite(y) && std::isfinite(x);
45  }
46 
54  bool operator==(const Point& other) const noexcept
55  {
56  return x == other.x && y == other.y;
57  }
58 
66  bool operator!=(const Point& other) const noexcept
67  {
68  return x != other.x || y != other.y;
69  }
70 
79  IINK_API friend std::ostream& operator<<(std::ostream& os, const Point& p);
80 };
81 
82 }
83 }
84 }
Definition: Configuration.h:10
Definition: Point.h:18
float x
Definition: Point.h:19
bool isFinite() const noexcept
Definition: Point.h:42
bool operator!=(const Point &other) const noexcept
Definition: Point.h:66
Point(float x, float y) noexcept
Definition: Point.h:33
friend std::ostream & operator<<(std::ostream &os, const Point &p)
float y
Definition: Point.h:20
bool operator==(const Point &other) const noexcept
Definition: Point.h:54