DepthSpacePoint.cs 1.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546
  1. using RootSystem = System;
  2. using System.Linq;
  3. using System.Collections.Generic;
  4. namespace Windows.Kinect
  5. {
  6. //
  7. // Windows.Kinect.DepthSpacePoint
  8. //
  9. [RootSystem.Runtime.InteropServices.StructLayout(RootSystem.Runtime.InteropServices.LayoutKind.Sequential)]
  10. public struct DepthSpacePoint
  11. {
  12. public float X { get; set; }
  13. public float Y { get; set; }
  14. public override int GetHashCode()
  15. {
  16. return X.GetHashCode() ^ Y.GetHashCode();
  17. }
  18. public override bool Equals(object obj)
  19. {
  20. if (!(obj is DepthSpacePoint))
  21. {
  22. return false;
  23. }
  24. return this.Equals((DepthSpacePoint)obj);
  25. }
  26. public bool Equals(DepthSpacePoint obj)
  27. {
  28. return X.Equals(obj.X) && Y.Equals(obj.Y);
  29. }
  30. public static bool operator ==(DepthSpacePoint a, DepthSpacePoint b)
  31. {
  32. return a.Equals(b);
  33. }
  34. public static bool operator !=(DepthSpacePoint a, DepthSpacePoint b)
  35. {
  36. return !(a.Equals(b));
  37. }
  38. }
  39. }