Exemplo n.º 1
0
        public void GetOrientation_ReturnsValue(ByteOrder byteOrder, TiffType type, int?data, TiffOrientation expectedResult)
        {
            var ifd = TiffIfdBuilder.GenerateIfd(TiffTags.Orientation, type, data, byteOrder).Ifd;

            var result = ifd.GetOrientation(byteOrder);

            Assert.Equal(expectedResult, result);
        }
 /// <summary>
 /// Initialize the middleware with the specified orientation.
 /// </summary>
 /// <param name="orientation">The orientation tag.</param>
 public TiffApplyOrientationMiddleware(TiffOrientation orientation)
 {
     _orientation = orientation;
 }
 /// <summary>
 /// Initialize the middleware with the specified orientation.
 /// </summary>
 /// <param name="orientation">The orientation tag.</param>
 public TiffReverseOrientationMiddleware(TiffOrientation orientation)
 {
     _orientation = orientation;
 }
Exemplo n.º 4
0
        public TiffOrientatedImageDecoderContext(TiffImageDecoderContext innerContext, TiffOrientation orientation) : base(innerContext)
        {
            if (orientation == 0)
            {
                _isFlipOrOrientation = false;
                _flipLeftRigt        = false;
                _flipTopBottom       = false;
                return;
            }
            switch (orientation)
            {
            case TiffOrientation.TopLeft:
                _isFlipOrOrientation = false;
                _flipLeftRigt        = false;
                _flipTopBottom       = false;
                break;

            case TiffOrientation.TopRight:
                _isFlipOrOrientation = false;
                _flipLeftRigt        = true;
                _flipTopBottom       = false;
                break;

            case TiffOrientation.BottomRight:
                _isFlipOrOrientation = false;
                _flipLeftRigt        = true;
                _flipTopBottom       = true;
                break;

            case TiffOrientation.BottomLeft:
                _isFlipOrOrientation = false;
                _flipLeftRigt        = false;
                _flipTopBottom       = true;
                break;

            case TiffOrientation.LeftTop:
                _isFlipOrOrientation = true;
                _flipLeftRigt        = false;
                _flipTopBottom       = false;
                break;

            case TiffOrientation.RightTop:
                _isFlipOrOrientation = true;
                _flipLeftRigt        = true;
                _flipTopBottom       = false;
                break;

            case TiffOrientation.RightBottom:
                _isFlipOrOrientation = true;
                _flipLeftRigt        = true;
                _flipTopBottom       = true;
                break;

            case TiffOrientation.LeftBottom:
                _isFlipOrOrientation = true;
                _flipLeftRigt        = false;
                _flipTopBottom       = true;
                break;

            default:
                throw new InvalidDataException("Unknown orientation tag.");
            }
        }