Example #1
0
        public void CopyToFloatBuffer_ShouldReturnFloatArray_When_BufferSizeIsLargeEnough()
        {
            var imageFrame   = new ImageFrame(ImageFormat.Format.VEC32F1, 10, 10);
            var normalBuffer = imageFrame.CopyToFloatBuffer(100);
            var largeBuffer  = imageFrame.CopyToFloatBuffer(120);

            Assert.IsEmpty(normalBuffer.Where((x, i) => Math.Abs(x - largeBuffer[i]) > 1e-9));
        }
Example #2
0
        public void CopyToFloatBuffer_ShouldThrowException_When_BufferSizeIsTooSmall()
        {
            var imageFrame = new ImageFrame(ImageFormat.Format.VEC32F1, 10, 10);

            Assert.Throws <MediaPipeException>(() => { imageFrame.CopyToFloatBuffer(99); });
        }