示例#1
0
    private PointCloud <PointXYZRGBA> ReadDataRGBA(byte[] byteArray)
    {
        PointCloud <PointXYZRGBA> cloud = new PointCloud <PointXYZRGBA> ();

        //int temp = byteArray.Length / (int)_point_step;
        for (int i = 0; i < _width * _height; i++)
        {
            float x    = System.BitConverter.ToSingle(_data, i * (int)_point_step + 0);
            float y    = System.BitConverter.ToSingle(_data, i * (int)_point_step + 4);
            float z    = System.BitConverter.ToSingle(_data, i * (int)_point_step + 8);
            uint  rgba = System.BitConverter.ToUInt32(_data, i * (int)_point_step + 12);
            if (!(float.IsNaN(x) || float.IsNaN(y) || float.IsNaN(z)))
            {
                PointXYZRGBA p = new PointXYZRGBA(x, y, z, rgba);
                //Debug.Log(x + ", " + y + ", " + z);
                cloud.Add(p);
            }
            //Debug.Log(i + "/" + _width * _height + ", " + temp);
        }
        //Debug.Log("Done1");
        return(cloud);
    }
 public static extern void segmentation_supervoxel_xyzrgba_setCentroid(IntPtr ptr, ref PointXYZRGBA value);
 public static extern void std_vector_xyzrgba_add(IntPtr ptr, PointXYZRGBA value);
 public static extern void std_vector_xyzrgba_insert(IntPtr ptr, IntPtr idx, PointXYZRGBA value);
 public static extern void std_vector_xyzrgba_at(IntPtr ptr, UIntPtr idx, ref PointXYZRGBA value);