4 using System.Runtime.InteropServices;
6 namespace SiliconStudio.
Paradox.Graphics
11 [StructLayout(LayoutKind.Sequential)]
12 public struct DataBox : IEquatable<DataBox>
25 public DataBox(IntPtr datapointer,
int rowPitch,
int slicePitch)
29 SlicePitch = slicePitch;
55 return EqualsByRef(ref Empty);
61 return EqualsByRef(ref other);
64 public override bool Equals(
object obj)
66 if (ReferenceEquals(null, obj))
return false;
74 var hashCode = DataPointer.GetHashCode();
75 hashCode = (hashCode * 397) ^ RowPitch;
76 hashCode = (hashCode * 397) ^ SlicePitch;
89 return left.Equals(right);
100 return !left.Equals(right);
103 private bool EqualsByRef(ref
DataBox other)
105 return DataPointer.Equals(other.DataPointer) && RowPitch == other.RowPitch && SlicePitch == other.SlicePitch;
bool Equals(DataBox other)
int RowPitch
Gets the number of bytes per row.
IntPtr DataPointer
Pointer to the data.
override bool Equals(object obj)
override int GetHashCode()
Provides access to data organized in 3D.
int SlicePitch
Gets the number of bytes per slice (for a 3D texture, a slice is a 2D image)
DataBox(IntPtr datapointer, int rowPitch, int slicePitch)
Initializes a new instance of the DataBox struct.