CameraIntrinsics.cs
2.08 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
using RootSystem = System;
using System.Linq;
using System.Collections.Generic;
namespace Windows.Kinect
{
//
// Windows.Kinect.CameraIntrinsics
//
[RootSystem.Runtime.InteropServices.StructLayout(RootSystem.Runtime.InteropServices.LayoutKind.Sequential)]
public struct CameraIntrinsics
{
public float FocalLengthX { get; set; }
public float FocalLengthY { get; set; }
public float PrincipalPointX { get; set; }
public float PrincipalPointY { get; set; }
public float RadialDistortionSecondOrder { get; set; }
public float RadialDistortionFourthOrder { get; set; }
public float RadialDistortionSixthOrder { get; set; }
public override int GetHashCode()
{
return FocalLengthX.GetHashCode() ^ FocalLengthY.GetHashCode() ^
PrincipalPointX.GetHashCode() ^ PrincipalPointY.GetHashCode() ^
RadialDistortionSecondOrder.GetHashCode() ^ RadialDistortionFourthOrder.GetHashCode() ^
RadialDistortionSixthOrder.GetHashCode();
}
public override bool Equals(object obj)
{
if (!(obj is CameraIntrinsics))
{
return false;
}
return this.Equals((CameraIntrinsics)obj);
}
public bool Equals(CameraIntrinsics obj)
{
return FocalLengthX.Equals(obj.FocalLengthX) && FocalLengthY.Equals(obj.FocalLengthY) &&
PrincipalPointX.Equals(obj.PrincipalPointX) && PrincipalPointY.Equals(obj.PrincipalPointY) &&
RadialDistortionSecondOrder.Equals(obj.RadialDistortionSecondOrder) &&
RadialDistortionFourthOrder.Equals(obj.RadialDistortionFourthOrder) &&
RadialDistortionSixthOrder.Equals(obj.RadialDistortionSixthOrder);
}
public static bool operator ==(CameraIntrinsics a, CameraIntrinsics b)
{
return a.Equals(b);
}
public static bool operator !=(CameraIntrinsics a, CameraIntrinsics b)
{
return !(a.Equals(b));
}
}
}