2 * Copyright (c) 2016 Samsung Electronics Co., Ltd All Rights Reserved
4 * Licensed under the Apache License, Version 2.0 (the License);
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
8 * http://www.apache.org/licenses/LICENSE-2.0
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an AS IS BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
19 namespace Tizen.Multimedia
22 /// Represents a point in the 2D space.
28 /// Initializes a new instance of the Point with the specified coordinates.
30 /// <param name="x">X-axis coordinate of the point in the 2D space.</param>
31 /// <param name="y">Y-axis coordinate of the point in the 2D space.</param>
32 public Point(int x, int y)
39 /// Gets or sets the X-axis coordinate of the point in the 2D space.
48 /// Gets or sets the Y-axis coordinate of the point in the 2D space.
57 /// Returns a string that represents the current object.
59 /// <returns>A string that represents the current object.</returns>
60 public override string ToString() => $"X={X.ToString()}, Y={Y.ToString()}";
63 /// Gets the hash code for this instance of <see cref="Point"/>.
65 /// <returns>The hash code for this instance of <see cref="Point"/>.</returns>
66 public override int GetHashCode()
68 return new { X, Y }.GetHashCode();
72 /// Compares an object to an instance of <see cref="Point"/> for equality.
74 /// <param name="obj">A <see cref="Object"/> to compare.</param>
75 /// <returns>true if the points are equal; otherwise, false.</returns>
76 public override bool Equals(object obj)
78 return obj is Point && this == (Point)obj;
82 /// Compares two instances of <see cref="Point"/> for equality.
84 /// <param name="point1">A <see cref="Point"/> to compare.</param>
85 /// <param name="point2">A <see cref="Point"/> to compare.</param>
86 /// <returns>true if the two instances of <see cref="Point"/> are equal; otherwise false.</returns>
87 public static bool operator ==(Point point1, Point point2)
89 return point1.X == point2.X && point1.Y == point2.Y;
93 /// Compares two instances of <see cref="Point"/> for inequality.
95 /// <param name="point1">A <see cref="Point"/> to compare.</param>
96 /// <param name="point2">A <see cref="Point"/> to compare.</param>
97 /// <returns>true if the two instances of <see cref="Point"/> are not equal; otherwise false.</returns>
98 public static bool operator !=(Point point1, Point point2)
100 return !(point1 == point2);