From d3e72142465c020df19954ab6ab1846e9df5d0cc Mon Sep 17 00:00:00 2001 From: Brian Popow Date: Fri, 24 Apr 2020 17:01:51 +0200 Subject: [PATCH] Move lossy and lossless related files into separate folders --- src/ImageSharp/Formats/WebP/AlphaDecoder.cs | 2 ++ .../Formats/WebP/{ => BitReader}/BitReaderBase.cs | 2 +- .../Formats/WebP/{ => BitReader}/Vp8BitReader.cs | 2 +- .../Formats/WebP/{ => BitReader}/Vp8LBitReader.cs | 2 +- src/ImageSharp/Formats/WebP/{ => Lossless}/ColorCache.cs | 2 +- src/ImageSharp/Formats/WebP/{ => Lossless}/HTreeGroup.cs | 2 +- src/ImageSharp/Formats/WebP/{ => Lossless}/HuffIndex.cs | 2 +- .../Formats/WebP/{ => Lossless}/HuffmanCode.cs | 2 +- .../Formats/WebP/{ => Lossless}/HuffmanUtils.cs | 2 +- .../Formats/WebP/{ => Lossless}/LosslessUtils.cs | 2 +- .../Formats/WebP/{ => Lossless}/Vp8LDecoder.cs | 2 +- .../Formats/WebP/{ => Lossless}/Vp8LMetadata.cs | 2 +- .../Formats/WebP/{ => Lossless}/Vp8LTransform.cs | 2 +- .../Formats/WebP/{ => Lossless}/Vp8LTransformType.cs | 2 +- .../Formats/WebP/{ => Lossless}/WebPLosslessDecoder.cs | 9 ++++++--- .../Formats/WebP/{ => Lossy}/IntraPredictionMode.cs | 2 +- src/ImageSharp/Formats/WebP/{ => Lossy}/LoopFilter.cs | 2 +- src/ImageSharp/Formats/WebP/{ => Lossy}/LossyUtils.cs | 2 +- src/ImageSharp/Formats/WebP/{ => Lossy}/VP8BandProbas.cs | 2 +- src/ImageSharp/Formats/WebP/{ => Lossy}/Vp8Decoder.cs | 3 ++- .../Formats/WebP/{ => Lossy}/Vp8FilterHeader.cs | 2 +- src/ImageSharp/Formats/WebP/{ => Lossy}/Vp8FilterInfo.cs | 2 +- .../Formats/WebP/{ => Lossy}/Vp8FrameHeader.cs | 2 +- src/ImageSharp/Formats/WebP/{ => Lossy}/Vp8Io.cs | 2 +- src/ImageSharp/Formats/WebP/{ => Lossy}/Vp8MacroBlock.cs | 2 +- .../Formats/WebP/{ => Lossy}/Vp8MacroBlockData.cs | 2 +- .../Formats/WebP/{ => Lossy}/Vp8PictureHeader.cs | 2 +- src/ImageSharp/Formats/WebP/{ => Lossy}/Vp8Proba.cs | 2 +- src/ImageSharp/Formats/WebP/{ => Lossy}/Vp8ProbaArray.cs | 2 +- .../Formats/WebP/{ => Lossy}/Vp8QuantMatrix.cs | 2 +- .../Formats/WebP/{ => Lossy}/Vp8SegmentHeader.cs | 2 +- src/ImageSharp/Formats/WebP/{ => Lossy}/Vp8TopSamples.cs | 2 +- .../Formats/WebP/{ => Lossy}/WebPLossyDecoder.cs | 3 ++- src/ImageSharp/Formats/WebP/WebPDecoderCore.cs | 3 +++ src/ImageSharp/Formats/WebP/WebPImageInfo.cs | 2 ++ 35 files changed, 46 insertions(+), 34 deletions(-) rename src/ImageSharp/Formats/WebP/{ => BitReader}/BitReaderBase.cs (97%) rename src/ImageSharp/Formats/WebP/{ => BitReader}/Vp8BitReader.cs (99%) rename src/ImageSharp/Formats/WebP/{ => BitReader}/Vp8LBitReader.cs (99%) rename src/ImageSharp/Formats/WebP/{ => Lossless}/ColorCache.cs (97%) rename src/ImageSharp/Formats/WebP/{ => Lossless}/HTreeGroup.cs (97%) rename src/ImageSharp/Formats/WebP/{ => Lossless}/HuffIndex.cs (93%) rename src/ImageSharp/Formats/WebP/{ => Lossless}/HuffmanCode.cs (92%) rename src/ImageSharp/Formats/WebP/{ => Lossless}/HuffmanUtils.cs (99%) rename src/ImageSharp/Formats/WebP/{ => Lossless}/LosslessUtils.cs (99%) rename src/ImageSharp/Formats/WebP/{ => Lossless}/Vp8LDecoder.cs (97%) rename src/ImageSharp/Formats/WebP/{ => Lossless}/Vp8LMetadata.cs (92%) rename src/ImageSharp/Formats/WebP/{ => Lossless}/Vp8LTransform.cs (96%) rename src/ImageSharp/Formats/WebP/{ => Lossless}/Vp8LTransformType.cs (96%) rename src/ImageSharp/Formats/WebP/{ => Lossless}/WebPLosslessDecoder.cs (99%) rename src/ImageSharp/Formats/WebP/{ => Lossy}/IntraPredictionMode.cs (92%) rename src/ImageSharp/Formats/WebP/{ => Lossy}/LoopFilter.cs (91%) rename src/ImageSharp/Formats/WebP/{ => Lossy}/LossyUtils.cs (99%) rename src/ImageSharp/Formats/WebP/{ => Lossy}/VP8BandProbas.cs (93%) rename src/ImageSharp/Formats/WebP/{ => Lossy}/Vp8Decoder.cs (99%) rename src/ImageSharp/Formats/WebP/{ => Lossy}/Vp8FilterHeader.cs (97%) rename src/ImageSharp/Formats/WebP/{ => Lossy}/Vp8FilterInfo.cs (98%) rename src/ImageSharp/Formats/WebP/{ => Lossy}/Vp8FrameHeader.cs (92%) rename src/ImageSharp/Formats/WebP/{ => Lossy}/Vp8Io.cs (97%) rename src/ImageSharp/Formats/WebP/{ => Lossy}/Vp8MacroBlock.cs (91%) rename src/ImageSharp/Formats/WebP/{ => Lossy}/Vp8MacroBlockData.cs (97%) rename src/ImageSharp/Formats/WebP/{ => Lossy}/Vp8PictureHeader.cs (96%) rename src/ImageSharp/Formats/WebP/{ => Lossy}/Vp8Proba.cs (96%) rename src/ImageSharp/Formats/WebP/{ => Lossy}/Vp8ProbaArray.cs (92%) rename src/ImageSharp/Formats/WebP/{ => Lossy}/Vp8QuantMatrix.cs (94%) rename src/ImageSharp/Formats/WebP/{ => Lossy}/Vp8SegmentHeader.cs (95%) rename src/ImageSharp/Formats/WebP/{ => Lossy}/Vp8TopSamples.cs (85%) rename src/ImageSharp/Formats/WebP/{ => Lossy}/WebPLossyDecoder.cs (99%) diff --git a/src/ImageSharp/Formats/WebP/AlphaDecoder.cs b/src/ImageSharp/Formats/WebP/AlphaDecoder.cs index 7a23ad6e5e..a78f76c4b7 100644 --- a/src/ImageSharp/Formats/WebP/AlphaDecoder.cs +++ b/src/ImageSharp/Formats/WebP/AlphaDecoder.cs @@ -6,6 +6,8 @@ using System.Buffers; using System.Collections.Generic; using System.Runtime.CompilerServices; using System.Runtime.InteropServices; +using SixLabors.ImageSharp.Formats.WebP.BitReader; +using SixLabors.ImageSharp.Formats.WebP.Lossless; using SixLabors.ImageSharp.Memory; namespace SixLabors.ImageSharp.Formats.WebP diff --git a/src/ImageSharp/Formats/WebP/BitReaderBase.cs b/src/ImageSharp/Formats/WebP/BitReader/BitReaderBase.cs similarity index 97% rename from src/ImageSharp/Formats/WebP/BitReaderBase.cs rename to src/ImageSharp/Formats/WebP/BitReader/BitReaderBase.cs index f35368c15a..24601c8aa9 100644 --- a/src/ImageSharp/Formats/WebP/BitReaderBase.cs +++ b/src/ImageSharp/Formats/WebP/BitReader/BitReaderBase.cs @@ -7,7 +7,7 @@ using System.IO; using SixLabors.ImageSharp.Memory; -namespace SixLabors.ImageSharp.Formats.WebP +namespace SixLabors.ImageSharp.Formats.WebP.BitReader { /// /// Base class for VP8 and VP8L bitreader. diff --git a/src/ImageSharp/Formats/WebP/Vp8BitReader.cs b/src/ImageSharp/Formats/WebP/BitReader/Vp8BitReader.cs similarity index 99% rename from src/ImageSharp/Formats/WebP/Vp8BitReader.cs rename to src/ImageSharp/Formats/WebP/BitReader/Vp8BitReader.cs index 1601c7339d..24ea1b6347 100644 --- a/src/ImageSharp/Formats/WebP/Vp8BitReader.cs +++ b/src/ImageSharp/Formats/WebP/BitReader/Vp8BitReader.cs @@ -7,7 +7,7 @@ using System.IO; using System.Runtime.CompilerServices; using SixLabors.ImageSharp.Memory; -namespace SixLabors.ImageSharp.Formats.WebP +namespace SixLabors.ImageSharp.Formats.WebP.BitReader { /// /// A bit reader for VP8 streams. diff --git a/src/ImageSharp/Formats/WebP/Vp8LBitReader.cs b/src/ImageSharp/Formats/WebP/BitReader/Vp8LBitReader.cs similarity index 99% rename from src/ImageSharp/Formats/WebP/Vp8LBitReader.cs rename to src/ImageSharp/Formats/WebP/BitReader/Vp8LBitReader.cs index 10b7307b31..b4bd48a144 100644 --- a/src/ImageSharp/Formats/WebP/Vp8LBitReader.cs +++ b/src/ImageSharp/Formats/WebP/BitReader/Vp8LBitReader.cs @@ -6,7 +6,7 @@ using System.IO; using System.Runtime.CompilerServices; using SixLabors.ImageSharp.Memory; -namespace SixLabors.ImageSharp.Formats.WebP +namespace SixLabors.ImageSharp.Formats.WebP.BitReader { /// /// A bit reader for reading lossless webp streams. diff --git a/src/ImageSharp/Formats/WebP/ColorCache.cs b/src/ImageSharp/Formats/WebP/Lossless/ColorCache.cs similarity index 97% rename from src/ImageSharp/Formats/WebP/ColorCache.cs rename to src/ImageSharp/Formats/WebP/Lossless/ColorCache.cs index d5834a4c80..6a1d0b3f50 100644 --- a/src/ImageSharp/Formats/WebP/ColorCache.cs +++ b/src/ImageSharp/Formats/WebP/Lossless/ColorCache.cs @@ -1,7 +1,7 @@ // Copyright (c) Six Labors and contributors. // Licensed under the Apache License, Version 2.0. -namespace SixLabors.ImageSharp.Formats.WebP +namespace SixLabors.ImageSharp.Formats.WebP.Lossless { /// /// A small hash-addressed array to store recently used colors, to be able to recall them with shorter codes. diff --git a/src/ImageSharp/Formats/WebP/HTreeGroup.cs b/src/ImageSharp/Formats/WebP/Lossless/HTreeGroup.cs similarity index 97% rename from src/ImageSharp/Formats/WebP/HTreeGroup.cs rename to src/ImageSharp/Formats/WebP/Lossless/HTreeGroup.cs index 42e0d9d936..f1b5a6e852 100644 --- a/src/ImageSharp/Formats/WebP/HTreeGroup.cs +++ b/src/ImageSharp/Formats/WebP/Lossless/HTreeGroup.cs @@ -3,7 +3,7 @@ using System.Collections.Generic; -namespace SixLabors.ImageSharp.Formats.WebP +namespace SixLabors.ImageSharp.Formats.WebP.Lossless { /// /// Huffman table group. diff --git a/src/ImageSharp/Formats/WebP/HuffIndex.cs b/src/ImageSharp/Formats/WebP/Lossless/HuffIndex.cs similarity index 93% rename from src/ImageSharp/Formats/WebP/HuffIndex.cs rename to src/ImageSharp/Formats/WebP/Lossless/HuffIndex.cs index 7e2b58a8e5..4d49801657 100644 --- a/src/ImageSharp/Formats/WebP/HuffIndex.cs +++ b/src/ImageSharp/Formats/WebP/Lossless/HuffIndex.cs @@ -1,7 +1,7 @@ // Copyright (c) Six Labors and contributors. // Licensed under the Apache License, Version 2.0. -namespace SixLabors.ImageSharp.Formats.WebP +namespace SixLabors.ImageSharp.Formats.WebP.Lossless { /// /// Five Huffman codes are used at each meta code. diff --git a/src/ImageSharp/Formats/WebP/HuffmanCode.cs b/src/ImageSharp/Formats/WebP/Lossless/HuffmanCode.cs similarity index 92% rename from src/ImageSharp/Formats/WebP/HuffmanCode.cs rename to src/ImageSharp/Formats/WebP/Lossless/HuffmanCode.cs index ac6c5bec46..52ece88ea5 100644 --- a/src/ImageSharp/Formats/WebP/HuffmanCode.cs +++ b/src/ImageSharp/Formats/WebP/Lossless/HuffmanCode.cs @@ -3,7 +3,7 @@ using System.Diagnostics; -namespace SixLabors.ImageSharp.Formats.WebP +namespace SixLabors.ImageSharp.Formats.WebP.Lossless { /// /// A classic way to do entropy coding where a smaller number of bits are used for more frequent codes. diff --git a/src/ImageSharp/Formats/WebP/HuffmanUtils.cs b/src/ImageSharp/Formats/WebP/Lossless/HuffmanUtils.cs similarity index 99% rename from src/ImageSharp/Formats/WebP/HuffmanUtils.cs rename to src/ImageSharp/Formats/WebP/Lossless/HuffmanUtils.cs index ee2e5ea6d4..222f929157 100644 --- a/src/ImageSharp/Formats/WebP/HuffmanUtils.cs +++ b/src/ImageSharp/Formats/WebP/Lossless/HuffmanUtils.cs @@ -3,7 +3,7 @@ using System; -namespace SixLabors.ImageSharp.Formats.WebP +namespace SixLabors.ImageSharp.Formats.WebP.Lossless { /// /// Utility functions related to creating the huffman tables. diff --git a/src/ImageSharp/Formats/WebP/LosslessUtils.cs b/src/ImageSharp/Formats/WebP/Lossless/LosslessUtils.cs similarity index 99% rename from src/ImageSharp/Formats/WebP/LosslessUtils.cs rename to src/ImageSharp/Formats/WebP/Lossless/LosslessUtils.cs index 6279a5d12b..f73dd37561 100644 --- a/src/ImageSharp/Formats/WebP/LosslessUtils.cs +++ b/src/ImageSharp/Formats/WebP/Lossless/LosslessUtils.cs @@ -7,7 +7,7 @@ using System.Runtime.InteropServices; using SixLabors.ImageSharp.Memory; -namespace SixLabors.ImageSharp.Formats.WebP +namespace SixLabors.ImageSharp.Formats.WebP.Lossless { /// /// Utility functions for the lossless decoder. diff --git a/src/ImageSharp/Formats/WebP/Vp8LDecoder.cs b/src/ImageSharp/Formats/WebP/Lossless/Vp8LDecoder.cs similarity index 97% rename from src/ImageSharp/Formats/WebP/Vp8LDecoder.cs rename to src/ImageSharp/Formats/WebP/Lossless/Vp8LDecoder.cs index 76010fdb22..2dd3f72def 100644 --- a/src/ImageSharp/Formats/WebP/Vp8LDecoder.cs +++ b/src/ImageSharp/Formats/WebP/Lossless/Vp8LDecoder.cs @@ -6,7 +6,7 @@ using System.Buffers; using System.Collections.Generic; using SixLabors.ImageSharp.Memory; -namespace SixLabors.ImageSharp.Formats.WebP +namespace SixLabors.ImageSharp.Formats.WebP.Lossless { /// /// Holds information for decoding a lossless webp image. diff --git a/src/ImageSharp/Formats/WebP/Vp8LMetadata.cs b/src/ImageSharp/Formats/WebP/Lossless/Vp8LMetadata.cs similarity index 92% rename from src/ImageSharp/Formats/WebP/Vp8LMetadata.cs rename to src/ImageSharp/Formats/WebP/Lossless/Vp8LMetadata.cs index 737def7f41..2959dbf15b 100644 --- a/src/ImageSharp/Formats/WebP/Vp8LMetadata.cs +++ b/src/ImageSharp/Formats/WebP/Lossless/Vp8LMetadata.cs @@ -3,7 +3,7 @@ using System.Buffers; -namespace SixLabors.ImageSharp.Formats.WebP +namespace SixLabors.ImageSharp.Formats.WebP.Lossless { internal class Vp8LMetadata { diff --git a/src/ImageSharp/Formats/WebP/Vp8LTransform.cs b/src/ImageSharp/Formats/WebP/Lossless/Vp8LTransform.cs similarity index 96% rename from src/ImageSharp/Formats/WebP/Vp8LTransform.cs rename to src/ImageSharp/Formats/WebP/Lossless/Vp8LTransform.cs index ae62123d31..3207bee617 100644 --- a/src/ImageSharp/Formats/WebP/Vp8LTransform.cs +++ b/src/ImageSharp/Formats/WebP/Lossless/Vp8LTransform.cs @@ -4,7 +4,7 @@ using System.Buffers; using System.Diagnostics; -namespace SixLabors.ImageSharp.Formats.WebP +namespace SixLabors.ImageSharp.Formats.WebP.Lossless { /// /// Data associated with a VP8L transformation to reduce the entropy. diff --git a/src/ImageSharp/Formats/WebP/Vp8LTransformType.cs b/src/ImageSharp/Formats/WebP/Lossless/Vp8LTransformType.cs similarity index 96% rename from src/ImageSharp/Formats/WebP/Vp8LTransformType.cs rename to src/ImageSharp/Formats/WebP/Lossless/Vp8LTransformType.cs index 7e1be4deb2..f9fe87b4ec 100644 --- a/src/ImageSharp/Formats/WebP/Vp8LTransformType.cs +++ b/src/ImageSharp/Formats/WebP/Lossless/Vp8LTransformType.cs @@ -1,7 +1,7 @@ // Copyright (c) Six Labors and contributors. // Licensed under the Apache License, Version 2.0. -namespace SixLabors.ImageSharp.Formats.WebP +namespace SixLabors.ImageSharp.Formats.WebP.Lossless { /// /// Enum for the different transform types. Transformations are reversible manipulations of the image data diff --git a/src/ImageSharp/Formats/WebP/WebPLosslessDecoder.cs b/src/ImageSharp/Formats/WebP/Lossless/WebPLosslessDecoder.cs similarity index 99% rename from src/ImageSharp/Formats/WebP/WebPLosslessDecoder.cs rename to src/ImageSharp/Formats/WebP/Lossless/WebPLosslessDecoder.cs index cbe2fec0f0..529b649b5c 100644 --- a/src/ImageSharp/Formats/WebP/WebPLosslessDecoder.cs +++ b/src/ImageSharp/Formats/WebP/Lossless/WebPLosslessDecoder.cs @@ -8,10 +8,11 @@ using System.Linq; using System.Runtime.CompilerServices; using System.Runtime.InteropServices; +using SixLabors.ImageSharp.Formats.WebP.BitReader; using SixLabors.ImageSharp.Memory; using SixLabors.ImageSharp.PixelFormats; -namespace SixLabors.ImageSharp.Formats.WebP +namespace SixLabors.ImageSharp.Formats.WebP.Lossless { /// /// Decoder for lossless webp images. This code is a port of libwebp, which can be found here: https://chromium.googlesource.com/webm/libwebp @@ -939,8 +940,9 @@ namespace SixLabors.ImageSharp.Formats.WebP /// The number of pixels to copy. private static void CopyBlock(Span pixelData, int decodedPixels, int dist, int length) { - if (dist >= length) // no overlap. + if (dist >= length) { + // no overlap. Span src = pixelData.Slice(decodedPixels - dist, length); Span dest = pixelData.Slice(decodedPixels); src.CopyTo(dest); @@ -967,8 +969,9 @@ namespace SixLabors.ImageSharp.Formats.WebP /// The number of pixels to copy. private static void CopyBlock8B(Span data, int pos, int dist, int length) { - if (dist >= length) // no overlap. + if (dist >= length) { + // no overlap. data.Slice(pos - dist, length).CopyTo(data.Slice(pos)); } else diff --git a/src/ImageSharp/Formats/WebP/IntraPredictionMode.cs b/src/ImageSharp/Formats/WebP/Lossy/IntraPredictionMode.cs similarity index 92% rename from src/ImageSharp/Formats/WebP/IntraPredictionMode.cs rename to src/ImageSharp/Formats/WebP/Lossy/IntraPredictionMode.cs index 29c64c7650..964a60dd2f 100644 --- a/src/ImageSharp/Formats/WebP/IntraPredictionMode.cs +++ b/src/ImageSharp/Formats/WebP/Lossy/IntraPredictionMode.cs @@ -1,7 +1,7 @@ // Copyright (c) Six Labors and contributors. // Licensed under the Apache License, Version 2.0. -namespace SixLabors.ImageSharp.Formats.WebP +namespace SixLabors.ImageSharp.Formats.WebP.Lossy { internal enum IntraPredictionMode { diff --git a/src/ImageSharp/Formats/WebP/LoopFilter.cs b/src/ImageSharp/Formats/WebP/Lossy/LoopFilter.cs similarity index 91% rename from src/ImageSharp/Formats/WebP/LoopFilter.cs rename to src/ImageSharp/Formats/WebP/Lossy/LoopFilter.cs index 8330ca593f..837ce10c07 100644 --- a/src/ImageSharp/Formats/WebP/LoopFilter.cs +++ b/src/ImageSharp/Formats/WebP/Lossy/LoopFilter.cs @@ -1,7 +1,7 @@ // Copyright (c) Six Labors and contributors. // Licensed under the Apache License, Version 2.0. -namespace SixLabors.ImageSharp.Formats.WebP +namespace SixLabors.ImageSharp.Formats.WebP.Lossy { /// /// Enum for the different loop filters used. VP8 supports two types of loop filters. diff --git a/src/ImageSharp/Formats/WebP/LossyUtils.cs b/src/ImageSharp/Formats/WebP/Lossy/LossyUtils.cs similarity index 99% rename from src/ImageSharp/Formats/WebP/LossyUtils.cs rename to src/ImageSharp/Formats/WebP/Lossy/LossyUtils.cs index 2d71938a1a..cfc892d608 100644 --- a/src/ImageSharp/Formats/WebP/LossyUtils.cs +++ b/src/ImageSharp/Formats/WebP/Lossy/LossyUtils.cs @@ -6,7 +6,7 @@ using System.Buffers.Binary; using System.Runtime.CompilerServices; // ReSharper disable InconsistentNaming -namespace SixLabors.ImageSharp.Formats.WebP +namespace SixLabors.ImageSharp.Formats.WebP.Lossy { internal static class LossyUtils { diff --git a/src/ImageSharp/Formats/WebP/VP8BandProbas.cs b/src/ImageSharp/Formats/WebP/Lossy/VP8BandProbas.cs similarity index 93% rename from src/ImageSharp/Formats/WebP/VP8BandProbas.cs rename to src/ImageSharp/Formats/WebP/Lossy/VP8BandProbas.cs index d96e9bd63e..e45a4c6ff9 100644 --- a/src/ImageSharp/Formats/WebP/VP8BandProbas.cs +++ b/src/ImageSharp/Formats/WebP/Lossy/VP8BandProbas.cs @@ -1,7 +1,7 @@ // Copyright (c) Six Labors and contributors. // Licensed under the Apache License, Version 2.0. -namespace SixLabors.ImageSharp.Formats.WebP +namespace SixLabors.ImageSharp.Formats.WebP.Lossy { /// /// All the probabilities associated to one band. diff --git a/src/ImageSharp/Formats/WebP/Vp8Decoder.cs b/src/ImageSharp/Formats/WebP/Lossy/Vp8Decoder.cs similarity index 99% rename from src/ImageSharp/Formats/WebP/Vp8Decoder.cs rename to src/ImageSharp/Formats/WebP/Lossy/Vp8Decoder.cs index 3c09821b78..e9ae39a9f4 100644 --- a/src/ImageSharp/Formats/WebP/Vp8Decoder.cs +++ b/src/ImageSharp/Formats/WebP/Lossy/Vp8Decoder.cs @@ -3,9 +3,10 @@ using System; using System.Buffers; +using SixLabors.ImageSharp.Formats.WebP.BitReader; using SixLabors.ImageSharp.Memory; -namespace SixLabors.ImageSharp.Formats.WebP +namespace SixLabors.ImageSharp.Formats.WebP.Lossy { /// /// Holds information for decoding a lossy webp image. diff --git a/src/ImageSharp/Formats/WebP/Vp8FilterHeader.cs b/src/ImageSharp/Formats/WebP/Lossy/Vp8FilterHeader.cs similarity index 97% rename from src/ImageSharp/Formats/WebP/Vp8FilterHeader.cs rename to src/ImageSharp/Formats/WebP/Lossy/Vp8FilterHeader.cs index 2d854664a1..3166624235 100644 --- a/src/ImageSharp/Formats/WebP/Vp8FilterHeader.cs +++ b/src/ImageSharp/Formats/WebP/Lossy/Vp8FilterHeader.cs @@ -1,7 +1,7 @@ // Copyright (c) Six Labors and contributors. // Licensed under the Apache License, Version 2.0. -namespace SixLabors.ImageSharp.Formats.WebP +namespace SixLabors.ImageSharp.Formats.WebP.Lossy { internal class Vp8FilterHeader { diff --git a/src/ImageSharp/Formats/WebP/Vp8FilterInfo.cs b/src/ImageSharp/Formats/WebP/Lossy/Vp8FilterInfo.cs similarity index 98% rename from src/ImageSharp/Formats/WebP/Vp8FilterInfo.cs rename to src/ImageSharp/Formats/WebP/Lossy/Vp8FilterInfo.cs index 42756e5e3a..cd7632f861 100644 --- a/src/ImageSharp/Formats/WebP/Vp8FilterInfo.cs +++ b/src/ImageSharp/Formats/WebP/Lossy/Vp8FilterInfo.cs @@ -1,7 +1,7 @@ // Copyright (c) Six Labors and contributors. // Licensed under the Apache License, Version 2.0. -namespace SixLabors.ImageSharp.Formats.WebP +namespace SixLabors.ImageSharp.Formats.WebP.Lossy { /// /// Filter information. diff --git a/src/ImageSharp/Formats/WebP/Vp8FrameHeader.cs b/src/ImageSharp/Formats/WebP/Lossy/Vp8FrameHeader.cs similarity index 92% rename from src/ImageSharp/Formats/WebP/Vp8FrameHeader.cs rename to src/ImageSharp/Formats/WebP/Lossy/Vp8FrameHeader.cs index c7bfa67f65..eb7d9c321e 100644 --- a/src/ImageSharp/Formats/WebP/Vp8FrameHeader.cs +++ b/src/ImageSharp/Formats/WebP/Lossy/Vp8FrameHeader.cs @@ -1,7 +1,7 @@ // Copyright (c) Six Labors and contributors. // Licensed under the Apache License, Version 2.0. -namespace SixLabors.ImageSharp.Formats.WebP +namespace SixLabors.ImageSharp.Formats.WebP.Lossy { /// /// Vp8 frame header information. diff --git a/src/ImageSharp/Formats/WebP/Vp8Io.cs b/src/ImageSharp/Formats/WebP/Lossy/Vp8Io.cs similarity index 97% rename from src/ImageSharp/Formats/WebP/Vp8Io.cs rename to src/ImageSharp/Formats/WebP/Lossy/Vp8Io.cs index 527ef02f05..0ae2312e11 100644 --- a/src/ImageSharp/Formats/WebP/Vp8Io.cs +++ b/src/ImageSharp/Formats/WebP/Lossy/Vp8Io.cs @@ -3,7 +3,7 @@ using System; -namespace SixLabors.ImageSharp.Formats.WebP +namespace SixLabors.ImageSharp.Formats.WebP.Lossy { internal ref struct Vp8Io { diff --git a/src/ImageSharp/Formats/WebP/Vp8MacroBlock.cs b/src/ImageSharp/Formats/WebP/Lossy/Vp8MacroBlock.cs similarity index 91% rename from src/ImageSharp/Formats/WebP/Vp8MacroBlock.cs rename to src/ImageSharp/Formats/WebP/Lossy/Vp8MacroBlock.cs index 8ecaa2c83c..86122e187e 100644 --- a/src/ImageSharp/Formats/WebP/Vp8MacroBlock.cs +++ b/src/ImageSharp/Formats/WebP/Lossy/Vp8MacroBlock.cs @@ -1,7 +1,7 @@ // Copyright (c) Six Labors and contributors. // Licensed under the Apache License, Version 2.0. -namespace SixLabors.ImageSharp.Formats.WebP +namespace SixLabors.ImageSharp.Formats.WebP.Lossy { /// /// Contextual macroblock information. diff --git a/src/ImageSharp/Formats/WebP/Vp8MacroBlockData.cs b/src/ImageSharp/Formats/WebP/Lossy/Vp8MacroBlockData.cs similarity index 97% rename from src/ImageSharp/Formats/WebP/Vp8MacroBlockData.cs rename to src/ImageSharp/Formats/WebP/Lossy/Vp8MacroBlockData.cs index 5e473e02ef..6ac5938cda 100644 --- a/src/ImageSharp/Formats/WebP/Vp8MacroBlockData.cs +++ b/src/ImageSharp/Formats/WebP/Lossy/Vp8MacroBlockData.cs @@ -1,7 +1,7 @@ // Copyright (c) Six Labors and contributors. // Licensed under the Apache License, Version 2.0. -namespace SixLabors.ImageSharp.Formats.WebP +namespace SixLabors.ImageSharp.Formats.WebP.Lossy { /// /// Data needed to reconstruct a macroblock. diff --git a/src/ImageSharp/Formats/WebP/Vp8PictureHeader.cs b/src/ImageSharp/Formats/WebP/Lossy/Vp8PictureHeader.cs similarity index 96% rename from src/ImageSharp/Formats/WebP/Vp8PictureHeader.cs rename to src/ImageSharp/Formats/WebP/Lossy/Vp8PictureHeader.cs index 3f80b13b29..97f741ada2 100644 --- a/src/ImageSharp/Formats/WebP/Vp8PictureHeader.cs +++ b/src/ImageSharp/Formats/WebP/Lossy/Vp8PictureHeader.cs @@ -1,7 +1,7 @@ // Copyright (c) Six Labors and contributors. // Licensed under the Apache License, Version 2.0. -namespace SixLabors.ImageSharp.Formats.WebP +namespace SixLabors.ImageSharp.Formats.WebP.Lossy { internal class Vp8PictureHeader { diff --git a/src/ImageSharp/Formats/WebP/Vp8Proba.cs b/src/ImageSharp/Formats/WebP/Lossy/Vp8Proba.cs similarity index 96% rename from src/ImageSharp/Formats/WebP/Vp8Proba.cs rename to src/ImageSharp/Formats/WebP/Lossy/Vp8Proba.cs index f6ff52eeb8..d8af86b46f 100644 --- a/src/ImageSharp/Formats/WebP/Vp8Proba.cs +++ b/src/ImageSharp/Formats/WebP/Lossy/Vp8Proba.cs @@ -1,7 +1,7 @@ // Copyright (c) Six Labors and contributors. // Licensed under the Apache License, Version 2.0. -namespace SixLabors.ImageSharp.Formats.WebP +namespace SixLabors.ImageSharp.Formats.WebP.Lossy { /// /// Data for all frame-persistent probabilities. diff --git a/src/ImageSharp/Formats/WebP/Vp8ProbaArray.cs b/src/ImageSharp/Formats/WebP/Lossy/Vp8ProbaArray.cs similarity index 92% rename from src/ImageSharp/Formats/WebP/Vp8ProbaArray.cs rename to src/ImageSharp/Formats/WebP/Lossy/Vp8ProbaArray.cs index 6cc87a8112..d320028f08 100644 --- a/src/ImageSharp/Formats/WebP/Vp8ProbaArray.cs +++ b/src/ImageSharp/Formats/WebP/Lossy/Vp8ProbaArray.cs @@ -1,7 +1,7 @@ // Copyright (c) Six Labors and contributors. // Licensed under the Apache License, Version 2.0. -namespace SixLabors.ImageSharp.Formats.WebP +namespace SixLabors.ImageSharp.Formats.WebP.Lossy { /// /// Probabilities associated to one of the contexts. diff --git a/src/ImageSharp/Formats/WebP/Vp8QuantMatrix.cs b/src/ImageSharp/Formats/WebP/Lossy/Vp8QuantMatrix.cs similarity index 94% rename from src/ImageSharp/Formats/WebP/Vp8QuantMatrix.cs rename to src/ImageSharp/Formats/WebP/Lossy/Vp8QuantMatrix.cs index 47bc965024..439c181b98 100644 --- a/src/ImageSharp/Formats/WebP/Vp8QuantMatrix.cs +++ b/src/ImageSharp/Formats/WebP/Lossy/Vp8QuantMatrix.cs @@ -1,7 +1,7 @@ // Copyright (c) Six Labors and contributors. // Licensed under the Apache License, Version 2.0. -namespace SixLabors.ImageSharp.Formats.WebP +namespace SixLabors.ImageSharp.Formats.WebP.Lossy { internal class Vp8QuantMatrix { diff --git a/src/ImageSharp/Formats/WebP/Vp8SegmentHeader.cs b/src/ImageSharp/Formats/WebP/Lossy/Vp8SegmentHeader.cs similarity index 95% rename from src/ImageSharp/Formats/WebP/Vp8SegmentHeader.cs rename to src/ImageSharp/Formats/WebP/Lossy/Vp8SegmentHeader.cs index c7c198bb22..d9e76bf2f9 100644 --- a/src/ImageSharp/Formats/WebP/Vp8SegmentHeader.cs +++ b/src/ImageSharp/Formats/WebP/Lossy/Vp8SegmentHeader.cs @@ -1,7 +1,7 @@ // Copyright (c) Six Labors and contributors. // Licensed under the Apache License, Version 2.0. -namespace SixLabors.ImageSharp.Formats.WebP +namespace SixLabors.ImageSharp.Formats.WebP.Lossy { /// /// Segment features. diff --git a/src/ImageSharp/Formats/WebP/Vp8TopSamples.cs b/src/ImageSharp/Formats/WebP/Lossy/Vp8TopSamples.cs similarity index 85% rename from src/ImageSharp/Formats/WebP/Vp8TopSamples.cs rename to src/ImageSharp/Formats/WebP/Lossy/Vp8TopSamples.cs index c6382b5c62..4235de734c 100644 --- a/src/ImageSharp/Formats/WebP/Vp8TopSamples.cs +++ b/src/ImageSharp/Formats/WebP/Lossy/Vp8TopSamples.cs @@ -1,7 +1,7 @@ // Copyright (c) Six Labors and contributors. // Licensed under the Apache License, Version 2.0. -namespace SixLabors.ImageSharp.Formats.WebP +namespace SixLabors.ImageSharp.Formats.WebP.Lossy { internal class Vp8TopSamples { diff --git a/src/ImageSharp/Formats/WebP/WebPLossyDecoder.cs b/src/ImageSharp/Formats/WebP/Lossy/WebPLossyDecoder.cs similarity index 99% rename from src/ImageSharp/Formats/WebP/WebPLossyDecoder.cs rename to src/ImageSharp/Formats/WebP/Lossy/WebPLossyDecoder.cs index 1c524b83b3..1571b05490 100644 --- a/src/ImageSharp/Formats/WebP/WebPLossyDecoder.cs +++ b/src/ImageSharp/Formats/WebP/Lossy/WebPLossyDecoder.cs @@ -6,10 +6,11 @@ using System.Buffers; using System.Runtime.CompilerServices; using System.Runtime.InteropServices; +using SixLabors.ImageSharp.Formats.WebP.BitReader; using SixLabors.ImageSharp.Memory; using SixLabors.ImageSharp.PixelFormats; -namespace SixLabors.ImageSharp.Formats.WebP +namespace SixLabors.ImageSharp.Formats.WebP.Lossy { /// /// Decoder for lossy webp images. This code is a port of libwebp, which can be found here: https://chromium.googlesource.com/webm/libwebp diff --git a/src/ImageSharp/Formats/WebP/WebPDecoderCore.cs b/src/ImageSharp/Formats/WebP/WebPDecoderCore.cs index b8d450c33a..90ad79c874 100644 --- a/src/ImageSharp/Formats/WebP/WebPDecoderCore.cs +++ b/src/ImageSharp/Formats/WebP/WebPDecoderCore.cs @@ -5,6 +5,9 @@ using System; using System.Buffers.Binary; using System.IO; +using SixLabors.ImageSharp.Formats.WebP.BitReader; +using SixLabors.ImageSharp.Formats.WebP.Lossless; +using SixLabors.ImageSharp.Formats.WebP.Lossy; using SixLabors.ImageSharp.Memory; using SixLabors.ImageSharp.Metadata; using SixLabors.ImageSharp.Metadata.Profiles.Exif; diff --git a/src/ImageSharp/Formats/WebP/WebPImageInfo.cs b/src/ImageSharp/Formats/WebP/WebPImageInfo.cs index cf4a6fef7a..6030e4d0e0 100644 --- a/src/ImageSharp/Formats/WebP/WebPImageInfo.cs +++ b/src/ImageSharp/Formats/WebP/WebPImageInfo.cs @@ -2,6 +2,8 @@ // Licensed under the Apache License, Version 2.0. using System; +using SixLabors.ImageSharp.Formats.WebP.BitReader; +using SixLabors.ImageSharp.Formats.WebP.Lossy; namespace SixLabors.ImageSharp.Formats.WebP {