|
|
|
@ -2,6 +2,7 @@ |
|
|
|
// Licensed under the Apache License, Version 2.0.
|
|
|
|
|
|
|
|
using System.Buffers; |
|
|
|
using System.Numerics; |
|
|
|
using SixLabors.ImageSharp.Formats.Tiff.Utils; |
|
|
|
using SixLabors.ImageSharp.Memory; |
|
|
|
using SixLabors.ImageSharp.PixelFormats; |
|
|
|
@ -25,14 +26,17 @@ namespace SixLabors.ImageSharp.Formats.Tiff.PhotometricInterpretation |
|
|
|
/// <inheritdoc/>
|
|
|
|
public override void Decode(IMemoryOwner<byte>[] data, Buffer2D<TPixel> pixels, int left, int top, int width, int height) |
|
|
|
{ |
|
|
|
// Note: due to an issue with netcore 2.1 and default values and unpredictable behavior with those,
|
|
|
|
// we define our own defaults as a workaround. See: https://github.com/dotnet/runtime/issues/55623
|
|
|
|
Rgba64 rgba = TiffUtils.Rgba64Default; |
|
|
|
var color = default(TPixel); |
|
|
|
color.FromVector4(TiffUtils.Vector4Default); |
|
|
|
|
|
|
|
System.Span<byte> redData = data[0].GetSpan(); |
|
|
|
System.Span<byte> greenData = data[1].GetSpan(); |
|
|
|
System.Span<byte> blueData = data[2].GetSpan(); |
|
|
|
|
|
|
|
int offset = 0; |
|
|
|
var rgba = default(Rgba64); |
|
|
|
for (int y = top; y < top + height; y++) |
|
|
|
{ |
|
|
|
System.Span<TPixel> pixelRow = pixels.GetRowSpan(y); |
|
|
|
|