public ValueTask ReadAsync(TiffPoint offset, TiffPixelBufferWriter <TPixel> destination, CancellationToken cancellationToken)
 {
     if (_flipLeftRight)
     {
         offset = new TiffPoint(Width - offset.X - destination.Width, offset.Y);
     }
     if (_flipTopBottom)
     {
         offset = new TiffPoint(offset.X, Height - offset.Y - destination.Height);
     }
     destination = new TiffFlippedPixelBufferWriter <TPixel>(destination, _flipLeftRight, _flipTopBottom).AsPixelBufferWriter();
     return(_reader.ReadAsync(offset, destination, cancellationToken));
 }
Exemplo n.º 2
0
            public override void Dispose()
            {
                if (_innerHandle is null)
                {
                    return;
                }

                Debug.Assert(_parent != null);
                _innerHandle.GetSpan().Reverse();
                _innerHandle.Dispose();
                TiffFlippedPixelBufferWriter <TPixel> parent = _parent !;

                _parent      = null;
                _innerHandle = null;
                Interlocked.CompareExchange(ref parent._cachedHandle, this, null);
            }
Exemplo n.º 3
0
 internal void SetHandle(TiffFlippedPixelBufferWriter <TPixel> parent, TiffPixelSpanHandle <TPixel> handle)
 {
     _parent      = parent;
     _innerHandle = handle;
     _length      = handle.Length;
 }