Beispiel #1
0
 public unsafe void CopyTo(MutableSpan <float> dest)
 {
     fixed(void *ptr = &this.V0L)
     {
         Marshal.Copy((IntPtr)ptr, dest.Data, dest.Offset, ScalarCount);
     }
 }
Beispiel #2
0
 public unsafe void LoadFrom(MutableSpan <float> source)
 {
     fixed(void *ptr = &this.V0L)
     {
         Marshal.Copy(source.Data, source.Offset, (IntPtr)ptr, ScalarCount);
     }
 }
Beispiel #3
0
 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;
 }
Beispiel #4
0
 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];
 }
Beispiel #5
0
        /// <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];
                }
            }
        }
Beispiel #6
0
        /// <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];
                }
            }
        }
Beispiel #7
0
        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;
            }
        }
Beispiel #8
0
 public static unsafe void CopyTo(Block8x8F *blockPtr, MutableSpan <float> dest)
 {
     Marshal.Copy((IntPtr)blockPtr, dest.Data, dest.Offset, ScalarCount);
 }
Beispiel #9
0
 public static unsafe void LoadFrom(Block8x8F *blockPtr, MutableSpan <float> source)
 {
     Marshal.Copy(source.Data, source.Offset, (IntPtr)blockPtr, ScalarCount);
 }