public unsafe void CopyTo(MutableSpan <float> dest) { fixed(void *ptr = &this.V0L) { Marshal.Copy((IntPtr)ptr, dest.Data, dest.Offset, ScalarCount); } }
public unsafe void LoadFrom(MutableSpan <float> source) { fixed(void *ptr = &this.V0L) { Marshal.Copy(source.Data, source.Offset, (IntPtr)ptr, ScalarCount); } }
public static void LoadFrom(this MutableSpan <float> data, ref Vector4 v) { data[0] = v.X; data[1] = v.Y; data[2] = v.Z; data[3] = v.W; }
public static void SaveTo(this MutableSpan <int> data, ref Vector4 v) { v.X = data[0]; v.Y = data[1]; v.Z = data[2]; v.W = data[3]; }
/// <summary> /// Load raw 32bit floating point data from source /// </summary> internal unsafe void LoadFrom(MutableSpan <int> source) { fixed(Vector4 *ptr = &this.V0L) { float *fp = (float *)ptr; for (int i = 0; i < ScalarCount; i++) { fp[i] = source[i]; } } }
/// <summary> /// Copy raw 32bit floating point data to dest /// </summary> internal unsafe void CopyTo(MutableSpan <int> dest) { fixed(Vector4 *ptr = &this.V0L) { float *fp = (float *)ptr; for (int i = 0; i < ScalarCount; i++) { dest[i] = (int)fp[i]; } } }
internal unsafe void CopyColorsTo(MutableSpan <byte> buffer, int stride, Block8x8F *temp) { this.TransformByteConvetibleColorValuesInto(ref *temp); float *src = (float *)temp; for (int i = 0; i < 8; i++) { buffer[0] = (byte)src[0]; buffer[1] = (byte)src[1]; buffer[2] = (byte)src[2]; buffer[3] = (byte)src[3]; buffer[4] = (byte)src[4]; buffer[5] = (byte)src[5]; buffer[6] = (byte)src[6]; buffer[7] = (byte)src[7]; buffer.AddOffset(stride); src += 8; } }
public static unsafe void CopyTo(Block8x8F *blockPtr, MutableSpan <float> dest) { Marshal.Copy((IntPtr)blockPtr, dest.Data, dest.Offset, ScalarCount); }
public static unsafe void LoadFrom(Block8x8F *blockPtr, MutableSpan <float> source) { Marshal.Copy(source.Data, source.Offset, (IntPtr)blockPtr, ScalarCount); }