Browse Source

Add ShouldFlip methods, fix typo

pull/3153/head
winscripter 1 month ago
parent
commit
eead4a9361
  1. 2
      src/ImageSharp/Formats/Jxl/IO/Metadata/JxlExifOrientation.cs
  2. 21
      src/ImageSharp/Formats/Jxl/Processing/RenderPipeline/WriteToOutputStage.cs

2
src/ImageSharp/Formats/Jxl/IO/Metadata/JxlExifOrientation.cs

@ -9,7 +9,7 @@ internal enum JxlExifOrientation : byte
FlipHorizontal = 2, FlipHorizontal = 2,
Rotate180 = 3, Rotate180 = 3,
FlipVertical = 4, FlipVertical = 4,
Transponse = 5, Transpose = 5,
Rotate90 = 6, Rotate90 = 6,
AntiTranspose = 7, AntiTranspose = 7,
Rotate270 = 8 Rotate270 = 8

21
src/ImageSharp/Formats/Jxl/Processing/RenderPipeline/WriteToOutputStage.cs

@ -1,6 +1,9 @@
// Copyright (c) Six Labors. // Copyright (c) Six Labors.
// Licensed under the Six Labors Split License. // Licensed under the Six Labors Split License.
using SixLabors.ImageSharp.Formats.Jxl.IO.Metadata;
using SixLabors.ImageSharp.Formats.Jxl.Processing.Image;
namespace SixLabors.ImageSharp.Formats.Jxl.Processing.RenderPipeline; namespace SixLabors.ImageSharp.Formats.Jxl.Processing.RenderPipeline;
internal sealed class WriteToOutputStage internal sealed class WriteToOutputStage
@ -209,4 +212,22 @@ internal sealed class WriteToOutputStage
0.04825f, -0.07914f, -0.39954f, 0.12160f, 0.29145f, 0.00965f, -0.37638f, 0.32233f, 0.04825f, -0.07914f, -0.39954f, 0.12160f, 0.29145f, 0.00965f, -0.37638f, 0.32233f,
0.20267f, -0.17564f, 0.39182f, 0.12160f, 0.18336f, 0.32619f, 0.26057f, 0.49219f 0.20267f, -0.17564f, 0.39182f, 0.12160f, 0.18336f, 0.32619f, 0.26057f, 0.49219f
]; ];
private static bool ShouldFlipX(JxlExifOrientation orientation) =>
orientation is JxlExifOrientation.FlipHorizontal or
JxlExifOrientation.Rotate180 or
JxlExifOrientation.Rotate270 or
JxlExifOrientation.AntiTranspose;
private static bool ShouldFlipY(JxlExifOrientation orientation) =>
orientation is JxlExifOrientation.FlipVertical or
JxlExifOrientation.Rotate180 or
JxlExifOrientation.Rotate90 or
JxlExifOrientation.AntiTranspose;
private static bool ShouldTranspose(JxlExifOrientation orientation) =>
orientation is JxlExifOrientation.Transpose or
JxlExifOrientation.Rotate90 or
JxlExifOrientation.Rotate270 or
JxlExifOrientation.AntiTranspose;
} }

Loading…
Cancel
Save