Ejemplo n.º 1
0
        public void ReadRotationInvalidSize()
        {
            // Well formed stream data
            byte[] streamData =
            {
                1,   0, 0, 0,
                232, 3, 0, 0,
                200, 0, 0, 0,
                200, 0, 0, 0,
                145, 0, 0, 0,
                145, 0, 0, 0,
                0,   0, 0, 0,
                0,   0, 0, 0,
                1,   0, 0, 0,
                0,   0, 0, 0,
                0,   0, 0, 0,
                0,   0, 0, 0,
                0,   0, 0, 0,
                0,   0, 0, 0
            };

            for (int dataSize = 0; dataSize < streamData.Length - 1; dataSize++)
            {
                WangStream   stream = new WangStream(streamData);
                WangRotation read   = WangAnnotationStructureReader.ReadRotation(stream, dataSize);
                Assert.IsTrue(read == null);
            }
        }
Ejemplo n.º 2
0
        public void ReadRotationStdExactDifferentResolution()
        {
            byte[] streamData =
            {
                1,   0, 0, 0,
                232, 3, 0, 0,
                200, 0, 0, 0,
                200, 0, 0, 0,
                200, 0, 0, 0,
                145, 0, 0, 0,
                0,   0, 0, 0,
                0,   0, 0, 0,
                1,   0, 0, 0,
                0,   0, 0, 0,
                0,   0, 0, 0,
                0,   0, 0, 0,
                0,   0, 0, 0,
                0,   0, 0, 0
            };

            WangStream   stream = new WangStream(streamData);
            WangRotation read   = WangAnnotationStructureReader.ReadRotation(stream, 56);

            Assert.IsTrue(read != null);

            Assert.AreEqual(200, read.OrigHRes);
            Assert.AreEqual(145, read.OrigVRes);
            Assert.AreEqual(1, read.Rotation);
            Assert.AreEqual(0, stream.AvailableBytes());
        }
Ejemplo n.º 3
0
 /// <summary>
 /// SetRotation sets the rotation.
 /// </summary>
 /// <param name="rotation">The rotation.</param>
 public void SetRotation(WangRotation rotation)
 {
     _rotation = rotation;
 }