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.
24 /// <since_tizen> 3 </since_tizen>
29 /// Initializes a new instance of the Point with the specified coordinates.
31 /// <param name="x">X-axis coordinate of the point in the 2D space.</param>
32 /// <param name="y">Y-axis coordinate of the point in the 2D space.</param>
33 /// <since_tizen> 3 </since_tizen>
34 public Point(int x, int y)
41 /// Gets or sets the X-axis coordinate of the point in the 2D space.
43 /// <since_tizen> 3 </since_tizen>
51 /// Gets or sets the Y-axis coordinate of the point in the 2D space.
53 /// <since_tizen> 3 </since_tizen>
61 /// Returns a string that represents the current object.
63 /// <returns>A string that represents the current object.</returns>
64 /// <since_tizen> 3 </since_tizen>
65 public override string ToString() => $"X={X.ToString()}, Y={Y.ToString()}";
68 /// Gets the hash code for this instance of <see cref="Point"/>.
70 /// <returns>The hash code for this instance of <see cref="Point"/>.</returns>
71 /// <since_tizen> 3 </since_tizen>
72 public override int GetHashCode()
74 return new { X, Y }.GetHashCode();
78 /// Compares an object to an instance of <see cref="Point"/> for equality.
80 /// <param name="obj">A <see cref="Object"/> to compare.</param>
81 /// <returns>true if the points are equal; otherwise, false.</returns>
82 /// <since_tizen> 3 </since_tizen>
83 public override bool Equals(object obj)
85 return obj is Point && this == (Point)obj;
89 /// Compares two instances of <see cref="Point"/> for equality.
91 /// <param name="point1">A <see cref="Point"/> to compare.</param>
92 /// <param name="point2">A <see cref="Point"/> to compare.</param>
93 /// <returns>true if the two instances of <see cref="Point"/> are equal; otherwise false.</returns>
94 /// <since_tizen> 3 </since_tizen>
95 public static bool operator ==(Point point1, Point point2)
97 return point1.X == point2.X && point1.Y == point2.Y;
101 /// Compares two instances of <see cref="Point"/> for inequality.
103 /// <param name="point1">A <see cref="Point"/> to compare.</param>
104 /// <param name="point2">A <see cref="Point"/> to compare.</param>
105 /// <returns>true if the two instances of <see cref="Point"/> are not equal; otherwise false.</returns>
106 /// <since_tizen> 3 </since_tizen>
107 public static bool operator !=(Point point1, Point point2)
109 return !(point1 == point2);