Browse Source

move Block8x8F into ImageSharp.Formats.Jpeg.Common

pull/298/head
Anton Firszov 9 years ago
parent
commit
1c75403036
  1. 2
      src/ImageSharp/Formats/Jpeg/Common/Block8x8F.Generated.cs
  2. 2
      src/ImageSharp/Formats/Jpeg/Common/Block8x8F.Generated.tt
  3. 3
      src/ImageSharp/Formats/Jpeg/Common/Block8x8F.cs
  4. 8
      src/ImageSharp/Formats/Jpeg/GolangPort/Components/BlockQuad.cs
  5. 2
      src/ImageSharp/Formats/Jpeg/GolangPort/Components/DCT.cs
  6. 2
      src/ImageSharp/Formats/Jpeg/GolangPort/Components/Decoder/DecodedBlock.cs
  7. 4
      src/ImageSharp/Formats/Jpeg/GolangPort/Components/Decoder/JpegBlockProcessor.cs
  8. 3
      src/ImageSharp/Formats/Jpeg/GolangPort/Components/Decoder/JpegPixelArea.cs
  9. 3
      src/ImageSharp/Formats/Jpeg/GolangPort/Components/Decoder/JpegScanDecoder.ComputationData.cs
  10. 2
      src/ImageSharp/Formats/Jpeg/GolangPort/Components/Decoder/JpegScanDecoder.DataPointers.cs
  11. 4
      src/ImageSharp/Formats/Jpeg/GolangPort/Components/Decoder/JpegScanDecoder.cs
  12. 3
      src/ImageSharp/Formats/Jpeg/GolangPort/JpegDecoderCore.cs
  13. 3
      src/ImageSharp/Formats/Jpeg/GolangPort/JpegEncoderCore.cs
  14. 4
      tests/ImageSharp.Tests/Formats/Jpg/BadEofJpegTests.cs
  15. 2
      tests/ImageSharp.Tests/Formats/Jpg/Block8x8FTests.cs
  16. 1
      tests/ImageSharp.Tests/Formats/Jpg/JpegEncoderTests.cs
  17. 1
      tests/ImageSharp.Tests/Formats/Jpg/JpegUtilityTestFixture.cs
  18. 1
      tests/ImageSharp.Tests/Formats/Jpg/JpegUtilsTests.cs
  19. 2
      tests/ImageSharp.Tests/Formats/Jpg/ReferenceImplementations.cs
  20. 1
      tests/ImageSharp.Tests/Formats/Jpg/ReferenceImplementationsTests.cs
  21. 1
      tests/ImageSharp.Tests/Formats/Jpg/YCbCrImageTests.cs

2
src/ImageSharp/Formats/Jpeg/Common/Block8x8F.Generated.cs

@ -5,7 +5,7 @@
// ReSharper disable InconsistentNaming // ReSharper disable InconsistentNaming
// <auto-generated /> // <auto-generated />
#pragma warning disable #pragma warning disable
namespace ImageSharp.Formats.Jpg namespace ImageSharp.Formats.Jpeg.Common
{ {
using System.Numerics; using System.Numerics;
using System.Runtime.CompilerServices; using System.Runtime.CompilerServices;

2
src/ImageSharp/Formats/Jpeg/Common/Block8x8F.Generated.tt

@ -14,7 +14,7 @@
<# <#
char[] coordz = {'X', 'Y', 'Z', 'W'}; char[] coordz = {'X', 'Y', 'Z', 'W'};
#> #>
namespace ImageSharp.Formats.Jpg namespace ImageSharp.Formats.Jpeg.Common
{ {
using System.Numerics; using System.Numerics;
using System.Runtime.CompilerServices; using System.Runtime.CompilerServices;

3
src/ImageSharp/Formats/Jpeg/Common/Block8x8F.cs

@ -3,10 +3,9 @@
// Licensed under the Apache License, Version 2.0. // Licensed under the Apache License, Version 2.0.
// </copyright> // </copyright>
// ReSharper disable InconsistentNaming // ReSharper disable InconsistentNaming
namespace ImageSharp.Formats.Jpg namespace ImageSharp.Formats.Jpeg.Common
{ {
using System; using System;
using System.Buffers;
using System.Numerics; using System.Numerics;
using System.Runtime.CompilerServices; using System.Runtime.CompilerServices;
using System.Runtime.InteropServices; using System.Runtime.InteropServices;

8
src/ImageSharp/Formats/Jpeg/GolangPort/Components/BlockQuad.cs

@ -4,16 +4,18 @@
// </copyright> // </copyright>
namespace ImageSharp.Formats.Jpeg.GolangPort.Components namespace ImageSharp.Formats.Jpeg.GolangPort.Components
{ {
using ImageSharp.Formats.Jpg; using ImageSharp.Formats.Jpeg.Common;
using Block8x8F = ImageSharp.Formats.Jpeg.Common.Block8x8F;
/// <summary> /// <summary>
/// Poor man's stackalloc: Contains a value-type <see cref="float"/> buffer sized for 4 <see cref="Block8x8F"/> instances. /// Poor man's stackalloc: Contains a value-type <see cref="float"/> buffer sized for 4 <see cref="Common.Block8x8F"/> instances.
/// Useful for decoder/encoder operations allocating a block for each Jpeg component. /// Useful for decoder/encoder operations allocating a block for each Jpeg component.
/// </summary> /// </summary>
internal unsafe struct BlockQuad internal unsafe struct BlockQuad
{ {
/// <summary> /// <summary>
/// The value-type <see cref="float"/> buffer sized for 4 <see cref="Block8x8F"/> instances. /// The value-type <see cref="float"/> buffer sized for 4 <see cref="Common.Block8x8F"/> instances.
/// </summary> /// </summary>
public fixed float Data[4 * Block8x8F.ScalarCount]; public fixed float Data[4 * Block8x8F.ScalarCount];
} }

2
src/ImageSharp/Formats/Jpeg/GolangPort/Components/DCT.cs

@ -9,7 +9,7 @@ namespace ImageSharp.Formats.Jpeg.GolangPort.Components
using System.Numerics; using System.Numerics;
using System.Runtime.CompilerServices; using System.Runtime.CompilerServices;
using ImageSharp.Formats.Jpg; using Block8x8F = ImageSharp.Formats.Jpeg.Common.Block8x8F;
/// <summary> /// <summary>
/// Contains forward and inverse DCT implementations /// Contains forward and inverse DCT implementations

2
src/ImageSharp/Formats/Jpeg/GolangPort/Components/Decoder/DecodedBlock.cs

@ -5,7 +5,7 @@
namespace ImageSharp.Formats.Jpeg.GolangPort.Components.Decoder namespace ImageSharp.Formats.Jpeg.GolangPort.Components.Decoder
{ {
using ImageSharp.Formats.Jpg; using Block8x8F = ImageSharp.Formats.Jpeg.Common.Block8x8F;
/// <summary> /// <summary>
/// A structure to store unprocessed <see cref="Block8x8F"/> instances and their coordinates while scanning the image. /// A structure to store unprocessed <see cref="Block8x8F"/> instances and their coordinates while scanning the image.

4
src/ImageSharp/Formats/Jpeg/GolangPort/Components/Decoder/JpegBlockProcessor.cs

@ -6,10 +6,10 @@
namespace ImageSharp.Formats.Jpeg.GolangPort.Components.Decoder namespace ImageSharp.Formats.Jpeg.GolangPort.Components.Decoder
{ {
using System.Runtime.InteropServices; using System.Runtime.InteropServices;
using ImageSharp.Formats.Jpg;
using ImageSharp.Memory; using ImageSharp.Memory;
using Block8x8F = ImageSharp.Formats.Jpeg.Common.Block8x8F;
/// <summary> /// <summary>
/// Encapsulates the implementation of processing "raw" <see cref="Buffer{T}"/>-s into Jpeg image channels. /// Encapsulates the implementation of processing "raw" <see cref="Buffer{T}"/>-s into Jpeg image channels.
/// </summary> /// </summary>

3
src/ImageSharp/Formats/Jpeg/GolangPort/Components/Decoder/JpegPixelArea.cs

@ -7,9 +7,10 @@ namespace ImageSharp.Formats.Jpeg.GolangPort.Components.Decoder
using System.Runtime.CompilerServices; using System.Runtime.CompilerServices;
using ImageSharp.Formats.Jpeg.GolangPort.Utils; using ImageSharp.Formats.Jpeg.GolangPort.Utils;
using ImageSharp.Formats.Jpg;
using ImageSharp.Memory; using ImageSharp.Memory;
using Block8x8F = ImageSharp.Formats.Jpeg.Common.Block8x8F;
/// <summary> /// <summary>
/// Represents an area of a Jpeg subimage (channel) /// Represents an area of a Jpeg subimage (channel)
/// </summary> /// </summary>

3
src/ImageSharp/Formats/Jpeg/GolangPort/Components/Decoder/JpegScanDecoder.ComputationData.cs

@ -6,8 +6,7 @@
namespace ImageSharp.Formats.Jpeg.GolangPort.Components.Decoder namespace ImageSharp.Formats.Jpeg.GolangPort.Components.Decoder
{ {
using System.Runtime.InteropServices; using System.Runtime.InteropServices;
using Block8x8F = ImageSharp.Formats.Jpeg.Common.Block8x8F;
using ImageSharp.Formats.Jpg;
/// <content> /// <content>
/// Conains the definition of <see cref="ComputationData"/> /// Conains the definition of <see cref="ComputationData"/>

2
src/ImageSharp/Formats/Jpeg/GolangPort/Components/Decoder/JpegScanDecoder.DataPointers.cs

@ -5,7 +5,7 @@
namespace ImageSharp.Formats.Jpeg.GolangPort.Components.Decoder namespace ImageSharp.Formats.Jpeg.GolangPort.Components.Decoder
{ {
using ImageSharp.Formats.Jpg; using Block8x8F = ImageSharp.Formats.Jpeg.Common.Block8x8F;
/// <content> /// <content>
/// Conains the definition of <see cref="DataPointers"/> /// Conains the definition of <see cref="DataPointers"/>

4
src/ImageSharp/Formats/Jpeg/GolangPort/Components/Decoder/JpegScanDecoder.cs

@ -7,10 +7,10 @@ namespace ImageSharp.Formats.Jpeg.GolangPort.Components.Decoder
{ {
using System.Runtime.CompilerServices; using System.Runtime.CompilerServices;
using System.Runtime.InteropServices; using System.Runtime.InteropServices;
using ImageSharp.Formats.Jpg;
using ImageSharp.Memory; using ImageSharp.Memory;
using Block8x8F = ImageSharp.Formats.Jpeg.Common.Block8x8F;
/// <summary> /// <summary>
/// Encapsulates the impementation of Jpeg SOS Huffman decoding. See JpegScanDecoder.md! /// Encapsulates the impementation of Jpeg SOS Huffman decoding. See JpegScanDecoder.md!
/// ///

3
src/ImageSharp/Formats/Jpeg/GolangPort/JpegDecoderCore.cs

@ -11,10 +11,11 @@ namespace ImageSharp.Formats.Jpeg.GolangPort
using System.Threading.Tasks; using System.Threading.Tasks;
using ImageSharp.Formats.Jpeg.GolangPort.Components.Decoder; using ImageSharp.Formats.Jpeg.GolangPort.Components.Decoder;
using ImageSharp.Formats.Jpg;
using ImageSharp.Memory; using ImageSharp.Memory;
using ImageSharp.PixelFormats; using ImageSharp.PixelFormats;
using Block8x8F = ImageSharp.Formats.Jpeg.Common.Block8x8F;
/// <summary> /// <summary>
/// Performs the jpeg decoding operation. /// Performs the jpeg decoding operation.
/// </summary> /// </summary>

3
src/ImageSharp/Formats/Jpeg/GolangPort/JpegEncoderCore.cs

@ -12,9 +12,10 @@ namespace ImageSharp.Formats.Jpeg.GolangPort
using ImageSharp.Formats.Jpeg.GolangPort.Components; using ImageSharp.Formats.Jpeg.GolangPort.Components;
using ImageSharp.Formats.Jpeg.GolangPort.Components.Encoder; using ImageSharp.Formats.Jpeg.GolangPort.Components.Encoder;
using ImageSharp.Formats.Jpeg.GolangPort.Utils; using ImageSharp.Formats.Jpeg.GolangPort.Utils;
using ImageSharp.Formats.Jpg;
using ImageSharp.PixelFormats; using ImageSharp.PixelFormats;
using Block8x8F = ImageSharp.Formats.Jpeg.Common.Block8x8F;
/// <summary> /// <summary>
/// Image encoder for writing an image to a stream as a jpeg. /// Image encoder for writing an image to a stream as a jpeg.
/// </summary> /// </summary>

4
tests/ImageSharp.Tests/Formats/Jpg/BadEofJpegTests.cs

@ -14,11 +14,7 @@ using Xunit.Abstractions;
namespace ImageSharp.Tests namespace ImageSharp.Tests
{ {
using System.Numerics;
using ImageSharp.Formats.Jpg;
using ImageSharp.PixelFormats; using ImageSharp.PixelFormats;
using ImageSharp.Processing;
public class BadEOFJpegTests : MeasureFixture public class BadEOFJpegTests : MeasureFixture
{ {

2
tests/ImageSharp.Tests/Formats/Jpg/Block8x8FTests.cs

@ -14,9 +14,9 @@ namespace ImageSharp.Tests
using System.Numerics; using System.Numerics;
using ImageSharp.Formats; using ImageSharp.Formats;
using ImageSharp.Formats.Jpeg.Common;
using ImageSharp.Formats.Jpeg.GolangPort.Components; using ImageSharp.Formats.Jpeg.GolangPort.Components;
using ImageSharp.Formats.Jpeg.GolangPort.Utils; using ImageSharp.Formats.Jpeg.GolangPort.Utils;
using ImageSharp.Formats.Jpg;
using Xunit; using Xunit;
using Xunit.Abstractions; using Xunit.Abstractions;

1
tests/ImageSharp.Tests/Formats/Jpg/JpegEncoderTests.cs

@ -14,7 +14,6 @@ using Xunit.Abstractions;
namespace ImageSharp.Tests namespace ImageSharp.Tests
{ {
using ImageSharp.Formats.Jpg;
using ImageSharp.PixelFormats; using ImageSharp.PixelFormats;
using ImageSharp.Processing; using ImageSharp.Processing;
using SixLabors.Primitives; using SixLabors.Primitives;

1
tests/ImageSharp.Tests/Formats/Jpg/JpegUtilityTestFixture.cs

@ -14,7 +14,6 @@ namespace ImageSharp.Tests
using System.Diagnostics; using System.Diagnostics;
using ImageSharp.Formats.Jpeg.GolangPort.Utils; using ImageSharp.Formats.Jpeg.GolangPort.Utils;
using ImageSharp.Formats.Jpg;
public class JpegUtilityTestFixture : MeasureFixture public class JpegUtilityTestFixture : MeasureFixture
{ {

1
tests/ImageSharp.Tests/Formats/Jpg/JpegUtilsTests.cs

@ -10,7 +10,6 @@ namespace ImageSharp.Tests
using System.Numerics; using System.Numerics;
using ImageSharp.Formats.Jpeg.GolangPort.Utils; using ImageSharp.Formats.Jpeg.GolangPort.Utils;
using ImageSharp.Formats.Jpg;
using ImageSharp.PixelFormats; using ImageSharp.PixelFormats;
using Xunit; using Xunit;

2
tests/ImageSharp.Tests/Formats/Jpg/ReferenceImplementations.cs

@ -12,8 +12,8 @@ namespace ImageSharp.Tests
using System.Runtime.CompilerServices; using System.Runtime.CompilerServices;
using ImageSharp.Formats; using ImageSharp.Formats;
using ImageSharp.Formats.Jpeg.Common;
using ImageSharp.Formats.Jpeg.GolangPort.Utils; using ImageSharp.Formats.Jpeg.GolangPort.Utils;
using ImageSharp.Formats.Jpg;
/// <summary> /// <summary>
/// This class contains simplified (unefficient) reference implementations to produce verification data for unit tests /// This class contains simplified (unefficient) reference implementations to produce verification data for unit tests

1
tests/ImageSharp.Tests/Formats/Jpg/ReferenceImplementationsTests.cs

@ -7,7 +7,6 @@
namespace ImageSharp.Tests.Formats.Jpg namespace ImageSharp.Tests.Formats.Jpg
{ {
using ImageSharp.Formats.Jpeg.GolangPort.Utils; using ImageSharp.Formats.Jpeg.GolangPort.Utils;
using ImageSharp.Formats.Jpg;
using Xunit; using Xunit;
using Xunit.Abstractions; using Xunit.Abstractions;

1
tests/ImageSharp.Tests/Formats/Jpg/YCbCrImageTests.cs

@ -6,7 +6,6 @@
namespace ImageSharp.Tests namespace ImageSharp.Tests
{ {
using ImageSharp.Formats.Jpeg.GolangPort.Components.Decoder; using ImageSharp.Formats.Jpeg.GolangPort.Components.Decoder;
using ImageSharp.Formats.Jpg;
using SixLabors.Primitives; using SixLabors.Primitives;
using Xunit; using Xunit;
using Xunit.Abstractions; using Xunit.Abstractions;

Loading…
Cancel
Save