コード例 #1
0
            public override void CopyTo(IntPtr ptr, uint[] array, int arrayIndex)
            {
                var size = this.GetSize(ptr);

                if (size == 0)
                {
                    return;
                }

                var elementPtr = this.GetElementPtr(ptr);

                InteropHelper.Copy(elementPtr, array, arrayIndex, (uint)size);
            }
コード例 #2
0
            public override Point <int>[] ToArray(IntPtr ptr)
            {
                var size = this.GetSize(ptr);

                if (size == 0)
                {
                    return(new Point <int> [0]);
                }

                var dst        = new OpenPose.Native.NativePointOfInt32[size];
                var elementPtr = this.GetElementPtr(ptr);

                InteropHelper.Copy(elementPtr, dst, dst.Length);
                return(dst.Select(p => new Point <int>(p.x, p.y)).ToArray());
            }
コード例 #3
0
            public override LogMode[] ToArray(IntPtr ptr)
            {
                var size = this.GetSize(ptr);

                if (size == 0)
                {
                    return(new LogMode[0]);
                }

                var dst        = new LogMode[size];
                var elementPtr = this.GetElementPtr(ptr);

                InteropHelper.Copy(elementPtr, dst, dst.Length);
                return(dst);
            }
コード例 #4
0
            public override Rectangle <float>[] ToArray(IntPtr ptr)
            {
                var size = this.GetSize(ptr);

                if (size == 0)
                {
                    return(new Rectangle <float> [0]);
                }

                var dst        = new NativeMethods.NativeRectangleOfFloat[size];
                var elementPtr = this.GetElementPtr(ptr);

                InteropHelper.Copy(elementPtr, dst, dst.Length);
                return(dst.Select(r => new Rectangle <float>(r.x, r.y, r.width, r.height)).ToArray());
            }